feat: Add support to uncategorized articles (#6912)
This commit is contained in:
@@ -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}`;
|
||||
};
|
||||
|
||||
@@ -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 = {};
|
||||
});
|
||||
});
|
||||
|
||||
@@ -93,7 +93,7 @@ export default {
|
||||
slug,
|
||||
this.article.category.slug,
|
||||
this.article.category.locale,
|
||||
this.article.id
|
||||
this.article.slug
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user