Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
filter: Add titles for messages with alerts and unread messages.
Lauryn Menardc1b430d60230
diff --git a/frontend_tests/node_tests/filter.js b/frontend_tests/node_tests/filter.jsindex eda55ed0b4a..7583acd9c53 100644--- a/frontend_tests/node_tests/filter.js+++ b/frontend_tests/node_tests/filter.js@@ -1478,6 +1478,9 @@ test("navbar_helpers", () => {const group_pm_including_missing_person = [];+ // not common narrows, but used for browser title updates+ const is_alerted = [{operator: "is", operand: "alerted"}];+ const is_unread = [{operator: "is", operand: "unread"}];const test_cases = [{@@ -1598,6 +1601,20 @@ test("navbar_helpers", () => {]),redirect_url_with_search: "/#narrow/pm-with/undefined",},+ {+ operator: is_alerted,+ is_common_narrow: false,+ icon: undefined,+ title: "translated: Alerted messages",+ redirect_url_with_search: "#",+ },+ {+ operator: is_unread,+ is_common_narrow: false,+ icon: undefined,+ title: "translated: Unread messages",+ redirect_url_with_search: "#",+ },];for (const test_case of test_cases) {diff --git a/static/js/filter.js b/static/js/filter.jsindex ccc83320f17..ffb7e5c500c 100644--- a/static/js/filter.js+++ b/static/js/filter.js@@ -706,6 +706,13 @@ export class Filter {}case "is-resolved":return $t({defaultMessage: "Topics marked as resolved"});+ // These cases return false for is_common_narrow, and therefore are not+ // formatted in the message view header. They are used in narrow.js to+ // update the browser title.+ case "is-alerted":+ return $t({defaultMessage: "Alerted messages"});+ case "is-unread":+ return $t({defaultMessage: "Unread messages"});}}/* istanbul ignore next */