diff --git a/app/javascript/dashboard/api/helpCenter/articles.js b/app/javascript/dashboard/api/helpCenter/articles.js index 3f3ab3a49..7430d65a4 100644 --- a/app/javascript/dashboard/api/helpCenter/articles.js +++ b/app/javascript/dashboard/api/helpCenter/articles.js @@ -7,10 +7,18 @@ class ArticlesAPI extends PortalsAPI { super('articles', { accountScoped: true }); } - getArticles({ pageNumber, portalSlug, locale, status, author_id }) { + getArticles({ + pageNumber, + portalSlug, + locale, + status, + author_id, + category_slug, + }) { let baseUrl = `${this.url}/${portalSlug}/articles?page=${pageNumber}&locale=${locale}`; if (status !== undefined) baseUrl += `&status=${status}`; if (author_id) baseUrl += `&author_id=${author_id}`; + if (category_slug) baseUrl += `&category_slug=${category_slug}`; return axios.get(baseUrl); } } diff --git a/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue b/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue index 6a7505cc2..861805589 100644 --- a/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue +++ b/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue @@ -5,8 +5,12 @@ {{ $t(`SIDEBAR.${menuItem.label}`) }}
+ {{ $t('SIDEBAR.HELP_CENTER.CATEGORY_EMPTY_MESSAGE') }} +
@@ -98,6 +105,10 @@ export default { type: Boolean, default: false, }, + isCategoryEmpty: { + type: Boolean, + default: false, + }, }, computed: { ...mapGetters({ activeInbox: 'getSelectedInbox' }), @@ -134,11 +145,8 @@ export default { this.menuItem.toStateName === 'settings_applications' ); }, - isAllArticles() { - return ( - this.$store.state.route.name === 'list_all_locale_articles' && - this.menuItem.toStateName === 'all_locale_articles' - ); + isArticlesView() { + return this.$store.state.route.name === this.menuItem.toStateName; }, computedClass() { @@ -158,7 +166,7 @@ export default { return ' '; } if (this.isHelpCenterSidebar) { - if (this.isAllArticles) { + if (this.isArticlesView) { return 'is-active'; } return ' '; @@ -195,6 +203,9 @@ export default { showItem(item) { return this.isAdmin && item.newLink !== undefined; }, + onClickOpen() { + this.$emit('open'); + }, }, }; @@ -324,4 +335,10 @@ export default { } } } + +.empty-text { + color: var(--s-600); + font-size: var(--font-size-small); + margin: var(--space-smaller) 0; +} diff --git a/app/javascript/dashboard/components/widgets/forms/Input.vue b/app/javascript/dashboard/components/widgets/forms/Input.vue index 49e1a0cec..057438895 100644 --- a/app/javascript/dashboard/components/widgets/forms/Input.vue +++ b/app/javascript/dashboard/components/widgets/forms/Input.vue @@ -70,4 +70,7 @@ export default { color: var(--s-600); font-style: normal; } +.message { + margin-top: 0 !important; +} diff --git a/app/javascript/dashboard/i18n/locale/en/helpCenter.json b/app/javascript/dashboard/i18n/locale/en/helpCenter.json index 4e70fc58d..c17bb8c49 100644 --- a/app/javascript/dashboard/i18n/locale/en/helpCenter.json +++ b/app/javascript/dashboard/i18n/locale/en/helpCenter.json @@ -174,6 +174,10 @@ "BUTTONS": { "CREATE": "Create category", "CANCEL": "Cancel" + }, + "API": { + "SUCCESS_MESSAGE": "Category created successfully", + "ERROR_MESSAGE": "Unable to create category" } } } diff --git a/app/javascript/dashboard/i18n/locale/en/settings.json b/app/javascript/dashboard/i18n/locale/en/settings.json index 0db8e393d..038af64a5 100644 --- a/app/javascript/dashboard/i18n/locale/en/settings.json +++ b/app/javascript/dashboard/i18n/locale/en/settings.json @@ -197,7 +197,8 @@ "MY_ARTICLES": "My Articles", "DRAFT": "Draft", "ARCHIVED": "Archived", - "CATEGORY": "Category" + "CATEGORY": "Category", + "CATEGORY_EMPTY_MESSAGE": "No categories found" }, "DOCS": "Read docs" }, diff --git a/app/javascript/dashboard/components/helpCenter/AddCategory.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/components/AddCategory.vue similarity index 77% rename from app/javascript/dashboard/components/helpCenter/AddCategory.vue rename to app/javascript/dashboard/routes/dashboard/helpcenter/components/AddCategory.vue index 370949cd1..fc56a684f 100644 --- a/app/javascript/dashboard/components/helpCenter/AddCategory.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/components/AddCategory.vue @@ -1,5 +1,5 @@ -