Skip to content

Commit 1ae0c1b

Browse files
Merge remote-tracking branch 'origin/master' into server-installation
2 parents 4dcde17 + a859665 commit 1ae0c1b

File tree

12 files changed

+450
-54
lines changed

12 files changed

+450
-54
lines changed

docs/.vuepress/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = {
2222
logo: '/logo.svg',
2323
nav: [
2424
{ text: 'Home', link: '/' },
25+
{ text: 'User Guide', link: 'https://docs.krayincrm.com/' },
2526
{ text: 'Community Forum', link: 'https://forums.krayincrm.com/' },
2627
],
2728

docs/.vuepress/theme/components/PageNav.vue

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959

6060
<script>
6161
import { resolvePage } from '../util'
62-
import isString from 'lodash/isString'
63-
import isNil from 'lodash/isNil'
6462
6563
export default {
6664
name: 'PageNav',
@@ -103,43 +101,44 @@ function resolvePageLink (
103101
linkType,
104102
{ $themeConfig, $page, $route, $site, sidebarItems }
105103
) {
106-
const { resolveLink, getThemeLinkConfig, getPageLinkConfig } = linkType
104+
const { resolveLink, getThemeLinkConfig, getPageLinkConfig } = linkType;
107105
108-
// Get link config from theme
109-
const themeLinkConfig = getThemeLinkConfig($themeConfig)
106+
const link = getPageLinkConfig($page) ?? getThemeLinkConfig($themeConfig);
110107
111-
// Get link config from current page
112-
const pageLinkConfig = getPageLinkConfig($page)
108+
if (link === false) return null;
109+
if (typeof link === "string") return resolvePage($site.pages, link, $route.path);
113110
114-
// Page link config will overwrite global theme link config if defined
115-
const link = isNil(pageLinkConfig) ? themeLinkConfig : pageLinkConfig
116-
117-
if (link === false) {
118-
return
119-
} else if (isString(link)) {
120-
return resolvePage($site.pages, link, $route.path)
121-
} else {
122-
return resolveLink($page, sidebarItems)
123-
}
111+
return resolveLink($page, sidebarItems);
124112
}
125113
126-
function find (page, items, offset) {
127-
const res = []
128-
flatten(items, res)
114+
function find(page, items, offset) {
115+
const res = [];
116+
flatten(items, res);
117+
129118
for (let i = 0; i < res.length; i++) {
130-
const cur = res[i]
131-
if (cur.type === 'page' && cur.path === decodeURIComponent(page.path)) {
132-
return res[i + offset]
119+
const cur = res[i];
120+
121+
const isPageMatch =
122+
cur.type === 'page' && cur.path === decodeURIComponent(page.path);
123+
124+
const isGroupMatch =
125+
cur.type === 'group' && cur.title === decodeURIComponent(page.title);
126+
127+
if (isPageMatch || isGroupMatch) {
128+
return res[i + offset] || null;
133129
}
134130
}
131+
132+
return null;
135133
}
136134
137135
function flatten (items, res) {
138-
for (let i = 0, l = items.length; i < l; i++) {
139-
if (items[i].type === 'group') {
140-
flatten(items[i].children || [], res)
141-
} else {
142-
res.push(items[i])
136+
for (let i = 0; i < items.length; i++) {
137+
const currentItem = items[i];
138+
res.push(currentItem);
139+
140+
if (currentItem.type === 'group') {
141+
flatten(currentItem.children || [], res);
143142
}
144143
}
145144
}

docs/.vuepress/theme/components/SidebarGroup.vue

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'active': isActive($route, item.path)
1818
}"
1919
:to="item.path"
20-
@click.native="$emit('toggle')"
20+
@click.native="$emit('toggle', index)"
2121
>
2222
<span>{{ item.title }}</span>
2323
<span
@@ -31,7 +31,7 @@
3131
v-else
3232
class="sidebar-heading"
3333
:class="{ open }"
34-
@click="$emit('toggle')"
34+
@click="$emit('toggle', index)"
3535
>
3636
<span>{{ item.title }}</span>
3737
<span
@@ -69,15 +69,35 @@ export default {
6969
'item',
7070
'open',
7171
'collapsable',
72-
'depth'
72+
'depth',
73+
'index'
7374
],
7475
75-
// ref: https://vuejs.org/v2/guide/components-edge-cases.html#Circular-References-Between-Components
76-
beforeCreate () {
76+
beforeCreate() {
7777
this.$options.components.SidebarLinks = require('@theme/components/SidebarLinks.vue').default
7878
},
7979
80-
methods: { isActive }
80+
mounted() {
81+
this.openSideBar();
82+
},
83+
84+
methods: {
85+
isActive(route, path) {
86+
if (!path) return false;
87+
88+
if (path === '/') {
89+
return route.path === path;
90+
}
91+
92+
return route.path.startsWith(path);
93+
},
94+
95+
openSideBar() {
96+
if (this.item.path === this.$route.matched[0].path) {
97+
this.$emit('toggle', this.index);
98+
}
99+
}
100+
}
81101
}
82102
</script>
83103

docs/.vuepress/theme/components/SidebarLinks.vue

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<SidebarGroup
1111
v-if="item.type === 'group'"
1212
:item="item"
13+
:index="i"
1314
:open="i === openGroupIndex"
1415
:collapsable="item.collapsable || item.collapsible"
1516
:depth="depth"
@@ -36,14 +37,14 @@ export default {
3637
3738
props: [
3839
'items',
39-
'depth', // depth of current sidebar links
40-
'sidebarDepth', // depth of headers to be extracted
40+
'depth',
41+
'sidebarDepth',
4142
'initialOpenGroupIndex'
4243
],
4344
4445
data () {
4546
return {
46-
openGroupIndex: this.initialOpenGroupIndex || 0
47+
openGroupIndex: this.initialOpenGroupIndex || 0,
4748
}
4849
},
4950
@@ -68,36 +69,36 @@ export default {
6869
}
6970
},
7071
71-
toggleGroup (index) {
72+
toggleGroup(index) {
7273
this.openGroupIndex = index === this.openGroupIndex ? -1 : index
7374
},
7475
7576
isActive (page) {
76-
return isActive(this.$route, page.regularPath)
77+
return isActive(this.$route, page.regularPath);
7778
}
7879
}
7980
}
8081
8182
function resolveOpenGroupIndex (route, items) {
8283
for (let i = 0; i < items.length; i++) {
83-
const item = items[i]
84+
const item = items[i];
8485
if (descendantIsActive(route, item)) {
85-
return i
86+
return i;
8687
}
8788
}
88-
return -1
89+
return -1;
8990
}
9091
9192
function descendantIsActive (route, item) {
9293
if (item.type === 'group') {
9394
return item.children.some(child => {
9495
if (child.type === 'group') {
95-
return descendantIsActive(route, child)
96+
return descendantIsActive(route, child);
9697
} else {
97-
return child.type === 'page' && isActive(route, child.path)
98+
return child.type === 'page' && isActive(route, child.path);
9899
}
99-
})
100+
});
100101
}
101-
return false
102+
return false;
102103
}
103104
</script>

docs/.vuepress/theme/layouts/Layout.vue

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ export default {
7171
},
7272
7373
computed: {
74+
headMeta() {
75+
const { frontmatter } = this.$page;
76+
77+
const { title: siteTitle = 'Krayin CRM Developer Portal' } = this.$site;
78+
79+
return {
80+
title: frontmatter.title || this.$title || siteTitle,
81+
82+
description: frontmatter.description || 'Krayin CRM is an open-source, customizable CRM solution designed to streamline customer management and improve business workflows.',
83+
84+
keywords: frontmatter.keywords || 'krayin crm extension, extension development',
85+
};
86+
},
87+
7488
shouldShowNavbar () {
7589
const { themeConfig } = this.$site
7690
const { frontmatter } = this.$page
@@ -121,17 +135,23 @@ export default {
121135
}
122136
},
123137
124-
mounted () {
125-
this.updateTopNavStyles();
138+
mounted() {
139+
this.updatePageAttributes();
126140
127141
this.$router.afterEach(() => {
128142
this.isSidebarOpen = false;
129143
130-
this.updateTopNavStyles();
144+
this.updatePageAttributes();
131145
});
132146
},
133147
134148
methods: {
149+
updatePageAttributes() {
150+
this.updateMetaTags();
151+
152+
this.updateTopNavStyles();
153+
},
154+
135155
updateTopNavStyles() {
136156
let currentPath = this.$route.path.split('/');
137157
@@ -144,6 +164,28 @@ export default {
144164
}
145165
},
146166
167+
updateMetaTags() {
168+
const { title, description, keywords } = this.headMeta;
169+
170+
document.title = title;
171+
172+
const updateMetaTag = (name, content) => {
173+
let metaTag = document.querySelector(`meta[name="${name}"]`);
174+
175+
if (! metaTag) {
176+
metaTag = document.createElement('meta');
177+
metaTag.name = name;
178+
document.head.appendChild(metaTag);
179+
}
180+
181+
metaTag.content = content;
182+
};
183+
184+
updateMetaTag('description', description);
185+
186+
updateMetaTag('keywords', keywords);
187+
},
188+
147189
applyTopNavCustomStyles() {
148190
setTimeout(() => {
149191
document.querySelectorAll('.navbar').forEach(element => element.classList.add('custom-navbar-top-height'));

docs/.vuepress/version-configs/2.0.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module.exports = [
3030
children: setVersionPrefix([
3131
['introduction/requirements', 'Requirements'],
3232
['introduction/installation', 'Installation'],
33+
['introduction/docker', 'Docker'],
3334
]),
3435
},
3536
{

docs/.vuepress/version-configs/master.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module.exports = [
3030
children: setVersionPrefix([
3131
['introduction/requirements', 'Requirements'],
3232
['introduction/installation', 'Installation'],
33+
['introduction/docker', 'Docker'],
3334
]),
3435
},
3536
{

docs/2.0/advanced/email-inbound-parse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Krayin CRM is capable of handling attachments that are sent via email. These att
6363
3. Krayin CRM processes the incoming email, stores the details, and displays the email in the **Mail > Inbox** section.
6464
6565
66-
### **IMAP Inbound Parse**
66+
<!-- ### **IMAP Inbound Parse**
6767
6868
Krayin CRM allows you to receive and manage your emails using the IMAP protocol. To integrate IMAP in Krayin CRM, we will use the **Webklex-IMAP** package as the email receiver driver.
6969
@@ -123,4 +123,4 @@ This tells Krayin CRM to use the Webklex IMAP package to handle incoming emails.
123123

124124
Once the IMAP settings are configured in the `.env` file, Krayin CRM will be able to use IMAP to fetch emails from the specified email account.
125125

126-
Make sure to check your email provider’s documentation for the correct IMAP settings.
126+
Make sure to check your email provider’s documentation for the correct IMAP settings. -->

0 commit comments

Comments
 (0)