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:
David Taylor 2023-03-24 14:34:32 +00:00 committed by GitHub
parent 9b41700f87
commit fc3c737a7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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",

View File

@ -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"));
});