chore: Helpcenter routing and UI fixes (#5460)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
committed by
GitHub
parent
3b7cae19e6
commit
54d0055e86
@@ -110,13 +110,19 @@ export default {
|
|||||||
primaryMenuItems() {
|
primaryMenuItems() {
|
||||||
const menuItems = this.sideMenuConfig.primaryMenu;
|
const menuItems = this.sideMenuConfig.primaryMenu;
|
||||||
return menuItems.filter(menuItem => {
|
return menuItems.filter(menuItem => {
|
||||||
|
const isAvailableForTheUser = menuItem.roles.includes(this.currentRole);
|
||||||
|
|
||||||
|
if (!isAvailableForTheUser) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (menuItem.featureFlag) {
|
if (menuItem.featureFlag) {
|
||||||
return this.isFeatureEnabledonAccount(
|
return this.isFeatureEnabledonAccount(
|
||||||
this.accountId,
|
this.accountId,
|
||||||
menuItem.featureFlag
|
menuItem.featureFlag
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return menuItem.roles.includes(this.currentRole);
|
return true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
activeSecondaryMenu() {
|
activeSecondaryMenu() {
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
v-if="portals.length"
|
v-if="portals.length"
|
||||||
:class="sidebarClassName"
|
:class="sidebarClassName"
|
||||||
:header-title="headerTitle"
|
:header-title="headerTitle"
|
||||||
|
:portal-slug="selectedPortalSlug"
|
||||||
|
:locale-slug="selectedLocaleInPortal"
|
||||||
:sub-title="localeName(selectedLocaleInPortal)"
|
:sub-title="localeName(selectedLocaleInPortal)"
|
||||||
:accessible-menu-items="accessibleMenuItems"
|
:accessible-menu-items="accessibleMenuItems"
|
||||||
:additional-secondary-menu-items="additionalSecondaryMenuItems"
|
:additional-secondary-menu-items="additionalSecondaryMenuItems"
|
||||||
|
|||||||
@@ -48,6 +48,14 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
portalSlug: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
localeSlug: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
accessibleMenuItems: {
|
accessibleMenuItems: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
@@ -68,8 +76,7 @@ export default {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
portalLink() {
|
portalLink() {
|
||||||
const slug = this.$route.params.portalSlug;
|
return `/hc/${this.portalSlug}/${this.localeSlug}`;
|
||||||
return `/hc/${slug}`;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
isUpdating: false,
|
isUpdating: false,
|
||||||
isSaved: false,
|
isSaved: false,
|
||||||
showArticleSettings: false,
|
showArticleSettings: true,
|
||||||
alertMessage: '',
|
alertMessage: '',
|
||||||
showDeleteConfirmationPopup: false,
|
showDeleteConfirmationPopup: false,
|
||||||
};
|
};
|
||||||
@@ -86,7 +86,7 @@ export default {
|
|||||||
},
|
},
|
||||||
portalLink() {
|
portalLink() {
|
||||||
const slug = this.$route.params.portalSlug;
|
const slug = this.$route.params.portalSlug;
|
||||||
return `/hc/${slug}`;
|
return `/hc/${slug}/${this.article.category.slug}/${this.article.id}`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default {
|
|||||||
articleTitle: '',
|
articleTitle: '',
|
||||||
articleContent: '',
|
articleContent: '',
|
||||||
showOpenSidebarButton: false,
|
showOpenSidebarButton: false,
|
||||||
showArticleSettings: false,
|
showArticleSettings: true,
|
||||||
article: {},
|
article: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user