chore: Helpcenter improvements (#6098)
This commit is contained in:
parent
6a78254701
commit
8c88344170
5 changed files with 30 additions and 3 deletions
|
@ -227,6 +227,26 @@ export default {
|
|||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
'$route.name'() {
|
||||
const routeName = this.$route?.name;
|
||||
const routeParams = this.$route?.params;
|
||||
const updateMetaInAllPortals = routeName === 'list_all_portals';
|
||||
const updateMetaInEditArticle =
|
||||
routeName === 'edit_article' && routeParams?.recentlyCreated;
|
||||
const updateMetaInLocaleArticles =
|
||||
routeName === 'list_all_locale_articles' &&
|
||||
routeParams?.recentlyDeleted;
|
||||
if (
|
||||
updateMetaInAllPortals ||
|
||||
updateMetaInEditArticle ||
|
||||
updateMetaInLocaleArticles
|
||||
) {
|
||||
this.fetchPortalAndItsCategories();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
window.addEventListener('resize', this.handleResize);
|
||||
this.handleResize();
|
||||
|
|
|
@ -236,8 +236,10 @@ export default {
|
|||
});
|
||||
},
|
||||
articleCount() {
|
||||
const { all_articles_count: count } = this.portal.meta;
|
||||
return count;
|
||||
const { allowed_locales: allowedLocales } = this.portal.config;
|
||||
return allowedLocales.reduce((acc, locale) => {
|
||||
return acc + locale.articles_count;
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -105,7 +105,10 @@ export default {
|
|||
return this.portal?.config?.allowed_locales;
|
||||
},
|
||||
articlesCount() {
|
||||
return this.portal?.meta?.all_articles_count;
|
||||
const { allowed_locales: allowedLocales } = this.portal.config;
|
||||
return allowedLocales.reduce((acc, locale) => {
|
||||
return acc + locale.articles_count;
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
@ -151,6 +151,7 @@ export default {
|
|||
params: {
|
||||
portalSlug: this.selectedPortalSlug,
|
||||
locale: this.locale,
|
||||
recentlyDeleted: true,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
|
|
|
@ -87,6 +87,7 @@ export default {
|
|||
articleSlug: articleId,
|
||||
portalSlug: this.selectedPortalSlug,
|
||||
locale: this.locale,
|
||||
recentlyCreated: true,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
|
|
Loading…
Reference in a new issue