UX: Enforce bullet category style in sidebar (#17334)

The other category styles do not fit into how we want the sidebar to
look.
This commit is contained in:
Alan Guo Xiang Tan 2022-07-05 13:28:51 +08:00 committed by GitHub
parent 56c0d8cf92
commit 4d51f9cad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -49,7 +49,9 @@ export default class CategorySectionLink {
}
get text() {
return htmlSafe(categoryBadgeHTML(this.category, { link: false }));
return htmlSafe(
categoryBadgeHTML(this.category, { link: false, categoryStyle: "bullet" })
);
}
get badgeCount() {

View File

@ -141,6 +141,20 @@ acceptance("Sidebar - Categories Section", function (needs) {
);
});
test("category section links uses the bullet style even when category_style site setting has been configured", async function (assert) {
this.siteSettings.category_style = "box";
const { category1 } = setupUserSidebarCategories();
await visit("/");
assert.ok(
exists(
`.sidebar-section-categories .sidebar-section-link-${category1.slug} .badge-wrapper.bullet`
),
"category badge uses the bullet style"
);
});
test("category section links", async function (assert) {
const { category1, category2 } = setupUserSidebarCategories();