mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 17:12:45 +08:00
UX: Restore reviewable counts on hamburger for legacy navigation (#20807)
Previously we disabled the hamburger reviewable count badge when the redesigned user menu was enabled. This commit updates the logic so that the hamburger reviewable count is tied the legacy navigation mode instead. This ensures that there is always a persistent reviewable count visible. (in the non-legacy navigation modes, the total reviewable count is shown in the sidebar)
This commit is contained in:
parent
9b41700f87
commit
fc3c737a7f
|
@ -324,7 +324,7 @@ createWidget("header-icons", {
|
|||
let { currentUser } = this;
|
||||
if (
|
||||
currentUser?.reviewable_count &&
|
||||
!this.currentUser.redesigned_user_menu_enabled
|
||||
this.siteSettings.navigation_menu === "legacy"
|
||||
) {
|
||||
return h(
|
||||
"div.badge-notification.reviewables",
|
||||
|
|
|
@ -39,6 +39,7 @@ module("Integration | Component | site-header", function (hooks) {
|
|||
});
|
||||
|
||||
test("hamburger menu icon shows pending reviewables count", async function (assert) {
|
||||
this.siteSettings.navigation_menu = "legacy";
|
||||
this.currentUser.set("reviewable_count", 1);
|
||||
await render(hbs`<SiteHeader />`);
|
||||
let pendingReviewablesBadge = query(
|
||||
|
@ -47,9 +48,9 @@ module("Integration | Component | site-header", function (hooks) {
|
|||
assert.strictEqual(pendingReviewablesBadge.textContent, "1");
|
||||
});
|
||||
|
||||
test("hamburger menu icon doesn't show pending reviewables count when revamped user menu is enabled", async function (assert) {
|
||||
test("hamburger menu icon doesn't show pending reviewables count for non-legacy navigation menu", async function (assert) {
|
||||
this.currentUser.set("reviewable_count", 1);
|
||||
this.currentUser.set("redesigned_user_menu_enabled", true);
|
||||
this.siteSettings.navigation_menu = "sidebar";
|
||||
await render(hbs`<SiteHeader />`);
|
||||
assert.ok(!exists(".hamburger-dropdown .badge-notification"));
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user