DEV: Include quote notifications in the replies tab in the user menu (#18401)
The rationale behind this change is that quote notifications are almost always as important as replies notifications so it makes sense for them to be included in the replies tab instead of the "other" tab. Internal topic: t/74748.
This commit is contained in:
parent
ea3bc7d7dc
commit
70b96ac4e7
|
@ -45,11 +45,14 @@ const CORE_TOP_TABS = [
|
||||||
}
|
}
|
||||||
|
|
||||||
get count() {
|
get count() {
|
||||||
return this.getUnreadCountForType("replied");
|
return (
|
||||||
|
this.getUnreadCountForType("replied") +
|
||||||
|
this.getUnreadCountForType("quoted")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get notificationTypes() {
|
get notificationTypes() {
|
||||||
return ["replied"];
|
return ["replied", "quoted"];
|
||||||
}
|
}
|
||||||
|
|
||||||
get linkWhenActive() {
|
get linkWhenActive() {
|
||||||
|
|
|
@ -239,6 +239,8 @@ module("Integration | Component | user-menu", function (hooks) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
} else if (queryParams.filter_by_types === "replied,quoted") {
|
||||||
|
data = [];
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`unexpected notification type ${queryParams.filter_by_types}`
|
`unexpected notification type ${queryParams.filter_by_types}`
|
||||||
|
@ -286,6 +288,22 @@ module("Integration | Component | user-menu", function (hooks) {
|
||||||
);
|
);
|
||||||
assert.strictEqual(queryAll("#quick-access-likes ul li").length, 3);
|
assert.strictEqual(queryAll("#quick-access-likes ul li").length, 3);
|
||||||
|
|
||||||
|
await click("#user-menu-button-replies");
|
||||||
|
assert.ok(exists("#quick-access-replies.quick-access-panel"));
|
||||||
|
assert.strictEqual(
|
||||||
|
queryParams.filter_by_types,
|
||||||
|
"replied,quoted",
|
||||||
|
"request params has filter_by_types set to `replied` and `quoted`"
|
||||||
|
);
|
||||||
|
assert.strictEqual(queryParams.silent, "true");
|
||||||
|
activeTabs = queryAll(".top-tabs .btn.active");
|
||||||
|
assert.strictEqual(activeTabs.length, 1);
|
||||||
|
assert.strictEqual(
|
||||||
|
activeTabs[0].id,
|
||||||
|
"user-menu-button-replies",
|
||||||
|
"active tab is now the replies tab"
|
||||||
|
);
|
||||||
|
|
||||||
await click("#user-menu-button-review-queue");
|
await click("#user-menu-button-review-queue");
|
||||||
assert.ok(exists("#quick-access-review-queue.quick-access-panel"));
|
assert.ok(exists("#quick-access-review-queue.quick-access-panel"));
|
||||||
activeTabs = queryAll(".top-tabs .btn.active");
|
activeTabs = queryAll(".top-tabs .btn.active");
|
||||||
|
|
Loading…
Reference in New Issue