chore: Helpcenter routing and UI fixes (#5460)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Nithin David Thomas 2022-09-20 08:10:32 +05:30 committed by GitHub
parent 3b7cae19e6
commit 54d0055e86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 6 deletions

View file

@ -110,13 +110,19 @@ export default {
primaryMenuItems() {
const menuItems = this.sideMenuConfig.primaryMenu;
return menuItems.filter(menuItem => {
const isAvailableForTheUser = menuItem.roles.includes(this.currentRole);
if (!isAvailableForTheUser) {
return false;
}
if (menuItem.featureFlag) {
return this.isFeatureEnabledonAccount(
this.accountId,
menuItem.featureFlag
);
}
return menuItem.roles.includes(this.currentRole);
return true;
});
},
activeSecondaryMenu() {

View file

@ -10,6 +10,8 @@
v-if="portals.length"
:class="sidebarClassName"
:header-title="headerTitle"
:portal-slug="selectedPortalSlug"
:locale-slug="selectedLocaleInPortal"
:sub-title="localeName(selectedLocaleInPortal)"
:accessible-menu-items="accessibleMenuItems"
:additional-secondary-menu-items="additionalSecondaryMenuItems"

View file

@ -48,6 +48,14 @@ export default {
type: String,
default: '',
},
portalSlug: {
type: String,
default: '',
},
localeSlug: {
type: String,
default: '',
},
accessibleMenuItems: {
type: Array,
default: () => [],
@ -68,8 +76,7 @@ export default {
);
},
portalLink() {
const slug = this.$route.params.portalSlug;
return `/hc/${slug}`;
return `/hc/${this.portalSlug}/${this.localeSlug}`;
},
},
methods: {

View file

@ -65,7 +65,7 @@ export default {
return {
isUpdating: false,
isSaved: false,
showArticleSettings: false,
showArticleSettings: true,
alertMessage: '',
showDeleteConfirmationPopup: false,
};
@ -86,7 +86,7 @@ export default {
},
portalLink() {
const slug = this.$route.params.portalSlug;
return `/hc/${slug}`;
return `/hc/${slug}/${this.article.category.slug}/${this.article.id}`;
},
},
mounted() {

View file

@ -40,7 +40,7 @@ export default {
articleTitle: '',
articleContent: '',
showOpenSidebarButton: false,
showArticleSettings: false,
showArticleSettings: true,
article: {},
};
},