mirror of https://github.com/zulip/zulip.git
filter: Add titles for messages with alerts and unread messages.
In `filter.get_title`, add cases for the two missing "is" operators, "alerted" and "unread". Prep commit for rewriting `update_narrow_title` to use `filter.get_title` as a helper for setting browser title text.
This commit is contained in:
parent
abec99fe0c
commit
c1b430d602
|
@ -1478,6 +1478,9 @@ test("navbar_helpers", () => {
|
|||
const group_pm_including_missing_person = [
|
||||
{operator: "pm-with", operand: "joe@example.com,STEVE@foo.com,sally@doesnotexist.com"},
|
||||
];
|
||||
// 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) {
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue