feat: Adds the ability to publish an article (#5365)
* feat: Adds the ability to publish an article * chore: Disabled publish button and dropdown when there is no article id * chore: Review fixes * chore: Review fixes * Update app/javascript/dashboard/routes/dashboard/helpcenter/components/Header/EditArticleHeader.vue * chore: Review fixes Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -20,6 +20,12 @@ export const getters = {
|
||||
.filter(article => article !== undefined);
|
||||
return articles;
|
||||
},
|
||||
articleStatus: (...getterArguments) => articleId => {
|
||||
const [state] = getterArguments;
|
||||
const article = state.articles.byId[articleId];
|
||||
if (!article) return undefined;
|
||||
return article.status;
|
||||
},
|
||||
getMeta: state => {
|
||||
return state.meta;
|
||||
},
|
||||
|
||||
@@ -34,6 +34,10 @@ describe('#getters', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('articleStatus', () => {
|
||||
expect(getters.articleStatus(state)(1)).toEqual('draft');
|
||||
});
|
||||
|
||||
it('isFetchingArticles', () => {
|
||||
expect(getters.isFetching(state)).toEqual(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user