feat: Category store integration (#5218)

* Add more actions

* Complete sidebar store integration

* Complete portal list store integration

* Fixed the specs

* Added missing specs

* Add comment

* Code cleanup

* Fixed all the spec issues

* Add portal and article API specs

* Add category name in article list

* Add more locales

* Code beautification

* Exclude locale from codeclimate ci

* feat: Category store integration

* chore: Minor fixes

* chore: API call fixes

* chore: Minor fixes

* chore: Minor fixes

* chore: Adds the ability for get articles based on categories

* chore: minor fixes

* chore: Minor fixes

* chore: fixes specs and minor improvements

* chore: Review fixes

* chore: Minor fixes

* chore: Review fixes

* chore: Review fixes

* chore: Spacing fixes

* Code cleanup

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Sivin Varghese 2022-08-10 10:48:41 +05:30 committed by GitHub
parent 16ad263a3a
commit 9bc75225fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 196 additions and 80 deletions

View file

@ -5,8 +5,12 @@
{{ $t(`SIDEBAR.${menuItem.label}`) }}
</span>
<div v-if="isHelpCenterSidebar" class="submenu-icons">
<fluent-icon icon="search" class="submenu-icon" size="16" />
<fluent-icon icon="add" class="submenu-icon" size="16" />
<div class="submenu-icon">
<fluent-icon icon="search" size="16" />
</div>
<div class="submenu-icon" @click="onClickOpen">
<fluent-icon icon="add" size="16" />
</div>
</div>
</div>
<router-link
@ -71,6 +75,9 @@
</a>
</li>
</router-link>
<p v-if="isHelpCenterSidebar && isCategoryEmpty" class="empty-text">
{{ $t('SIDEBAR.HELP_CENTER.CATEGORY_EMPTY_MESSAGE') }}
</p>
</ul>
</li>
</template>
@ -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');
},
},
};
</script>
@ -324,4 +335,10 @@ export default {
}
}
}
.empty-text {
color: var(--s-600);
font-size: var(--font-size-small);
margin: var(--space-smaller) 0;
}
</style>