diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/components/HelpCenterLayout.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/components/HelpCenterLayout.vue index 0467c62fb..162e9343e 100644 --- a/app/javascript/dashboard/routes/dashboard/helpcenter/components/HelpCenterLayout.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/components/HelpCenterLayout.vue @@ -10,7 +10,7 @@ v-if="portals.length" :class="sidebarClassName" :header-title="headerTitle" - :sub-title="localeName(selectedPortalLocale)" + :sub-title="localeName(selectedLocaleInPortal)" :accessible-menu-items="accessibleMenuItems" :additional-secondary-menu-items="additionalSecondaryMenuItems" @open-popover="openPortalPopover" @@ -32,13 +32,14 @@ v-if="showPortalPopover" :portals="portals" :active-portal-slug="selectedPortalSlug" + :active-locale="selectedLocaleInPortal" @close-popover="closePortalPopover" /> @@ -96,6 +97,9 @@ export default { return this.$store.getters['portals/allPortals'][0]; }, + selectedLocaleInPortal() { + return this.$route.params.locale || this.defaultPortalLocale; + }, sidebarClassName() { if (this.isOnDesktop) { return ''; @@ -120,7 +124,7 @@ export default { selectedPortalSlug() { return this.selectedPortal ? this.selectedPortal?.slug : ''; }, - selectedPortalLocale() { + defaultPortalLocale() { return this.selectedPortal ? this.selectedPortal?.meta?.default_locale : ''; @@ -142,7 +146,7 @@ export default { key: 'list_all_locale_articles', count: allArticlesCount, toState: frontendURL( - `accounts/${this.accountId}/portals/${this.selectedPortalSlug}/${this.selectedPortalLocale}/articles` + `accounts/${this.accountId}/portals/${this.selectedPortalSlug}/${this.selectedLocaleInPortal}/articles` ), toolTip: 'All Articles', toStateName: 'list_all_locale_articles', @@ -153,7 +157,7 @@ export default { key: 'list_mine_articles', count: mineArticlesCount, toState: frontendURL( - `accounts/${this.accountId}/portals/${this.selectedPortalSlug}/${this.selectedPortalLocale}/articles/mine` + `accounts/${this.accountId}/portals/${this.selectedPortalSlug}/${this.selectedLocaleInPortal}/articles/mine` ), toolTip: 'My articles', toStateName: 'list_mine_articles', @@ -164,7 +168,7 @@ export default { key: 'list_draft_articles', count: draftArticlesCount, toState: frontendURL( - `accounts/${this.accountId}/portals/${this.selectedPortalSlug}/${this.selectedPortalLocale}/articles/draft` + `accounts/${this.accountId}/portals/${this.selectedPortalSlug}/${this.selectedLocaleInPortal}/articles/draft` ), toolTip: 'Draft', toStateName: 'list_draft_articles', @@ -175,7 +179,7 @@ export default { key: 'list_archived_articles', count: archivedArticlesCount, toState: frontendURL( - `accounts/${this.accountId}/portals/${this.selectedPortalSlug}/${this.selectedPortalLocale}/articles/archived` + `accounts/${this.accountId}/portals/${this.selectedPortalSlug}/${this.selectedLocaleInPortal}/articles/archived` ), toolTip: 'Archived', toStateName: 'list_archived_articles', diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalPopover.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalPopover.vue index 94d9a0778..1f5eebe0e 100644 --- a/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalPopover.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalPopover.vue @@ -34,18 +34,11 @@ :key="portal.id" :portal="portal" :active-portal-slug="activePortalSlug" + :active-locale="activeLocale" :active="portal.slug === activePortalSlug" @open-portal-page="onPortalSelect" /> - @@ -66,6 +59,10 @@ export default { type: String, default: '', }, + activeLocale: { + type: String, + default: '', + }, }, methods: { @@ -125,12 +122,5 @@ export default { } } } - - footer { - display: flex; - justify-content: end; - align-items: center; - gap: var(--space-small); - } } diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSwitch.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSwitch.vue index b93a82025..91b8a0467 100644 --- a/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSwitch.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSwitch.vue @@ -19,13 +19,13 @@ />
-
+
{{ $t('HELP_CENTER.PORTAL.CHOOSE_LOCALE_LABEL') }}