feat: Add support to uncategorized articles (#6912)

This commit is contained in:
Tejaswini Chile
2023-05-02 15:35:26 +05:30
committed by GitHub
parent c8041392dc
commit 847d7ea082
18 changed files with 103 additions and 46 deletions

View File

@@ -8,8 +8,8 @@ export const buildPortalArticleURL = (
portalSlug,
categorySlug,
locale,
articleId
articleSlug
) => {
const portalURL = buildPortalURL(portalSlug);
return `${portalURL}/${locale}/${categorySlug}/${articleId}`;
return `${portalURL}/articles/${articleSlug}`;
};

View File

@@ -20,9 +20,9 @@ describe('PortalHelper', () => {
hostURL: 'https://app.chatwoot.com',
helpCenterURL: 'https://help.chatwoot.com',
};
expect(buildPortalArticleURL('handbook', 'culture', 'fr', 1)).toEqual(
'https://help.chatwoot.com/hc/handbook/fr/culture/1'
);
expect(
buildPortalArticleURL('handbook', 'culture', 'fr', 'article-slug')
).toEqual('https://help.chatwoot.com/hc/handbook/articles/article-slug');
window.chatwootConfig = {};
});
});

View File

@@ -93,7 +93,7 @@ export default {
slug,
this.article.category.slug,
this.article.category.locale,
this.article.id
this.article.slug
);
},
},

View File

@@ -86,7 +86,7 @@ export default {
methods: {
generateArticleUrl(article) {
return `/hc/${article.portal.slug}/${article.category.locale}/${article.category.slug}/${article.id}`;
return `/hc/${article.portal.slug}/articles/${article.slug}`;
},
handleKeyboardEvent(e) {
this.processKeyDownEvent(e);