fix: Draft, Articles, Archived are counted wrong in help-center (#7761)

This commit is contained in:
Sivin Varghese
2023-08-21 12:42:10 +05:30
committed by GitHub
parent 55972cc17a
commit 18235d3fb5
3 changed files with 19 additions and 0 deletions

View File

@@ -189,6 +189,7 @@ export default {
articleId: this.articleSlug, articleId: this.articleSlug,
status: status, status: status,
}); });
this.$emit('update-meta');
this.statusUpdateSuccessMessage(status); this.statusUpdateSuccessMessage(status);
this.closeActionsDropdown(); this.closeActionsDropdown();
if (status === this.ARTICLE_STATUS_TYPES.ARCHIVE) { if (status === this.ARTICLE_STATUS_TYPES.ARCHIVE) {

View File

@@ -209,15 +209,21 @@ export default {
}, },
onClickAssignAuthor({ id }) { onClickAssignAuthor({ id }) {
this.$emit('save-article', { author_id: id }); this.$emit('save-article', { author_id: id });
this.updateMeta();
}, },
onChangeMetaInput() { onChangeMetaInput() {
this.saveArticle(); this.saveArticle();
}, },
onClickArchiveArticle() { onClickArchiveArticle() {
this.$emit('archive-article'); this.$emit('archive-article');
this.updateMeta();
}, },
onClickDeleteArticle() { onClickDeleteArticle() {
this.$emit('delete-article'); this.$emit('delete-article');
this.updateMeta();
},
updateMeta() {
this.$emit('update-meta');
}, },
}, },
}; };

View File

@@ -13,6 +13,7 @@
@open="openArticleSettings" @open="openArticleSettings"
@close="closeArticleSettings" @close="closeArticleSettings"
@show="showArticleInPortal" @show="showArticleInPortal"
@update-meta="updateMeta"
/> />
<div v-if="isFetching" class="text-center p-normal fs-default h-full"> <div v-if="isFetching" class="text-center p-normal fs-default h-full">
<spinner size="" /> <spinner size="" />
@@ -31,6 +32,7 @@
@save-article="saveArticle" @save-article="saveArticle"
@delete-article="openDeletePopup" @delete-article="openDeletePopup"
@archive-article="archiveArticle" @archive-article="archiveArticle"
@update-meta="updateMeta"
/> />
<woot-delete-modal <woot-delete-modal
:show.sync="showDeleteConfirmationPopup" :show.sync="showDeleteConfirmationPopup"
@@ -87,6 +89,9 @@ export default {
selectedPortalSlug() { selectedPortalSlug() {
return this.$route.params.portalSlug; return this.$route.params.portalSlug;
}, },
selectedLocale() {
return this.$route.params.locale;
},
portalLink() { portalLink() {
const slug = this.$route.params.portalSlug; const slug = this.$route.params.portalSlug;
return buildPortalArticleURL( return buildPortalArticleURL(
@@ -183,6 +188,13 @@ export default {
this.showAlert(this.alertMessage); this.showAlert(this.alertMessage);
} }
}, },
updateMeta() {
const selectedPortalParam = {
portalSlug: this.selectedPortalSlug,
locale: this.selectedLocale,
};
return this.$store.dispatch('portals/show', selectedPortalParam);
},
openArticleSettings() { openArticleSettings() {
this.showArticleSettings = true; this.showArticleSettings = true;
}, },