narrow: Improve window titles of is:<type> narrows.

We capitalize the type name, and add a " messages" suffix.
This commit is contained in:
Puneeth Chaganti 2019-06-18 10:09:49 +05:30 committed by Tim Abbott
parent 066c168448
commit 0409db3c9d
2 changed files with 4 additions and 2 deletions

View File

@ -300,7 +300,7 @@ casper.thenClick('.top_left_private_messages a');
expect_all_pm(); expect_all_pm();
casper.then(check_narrow_title('private - Zulip Dev - Zulip')); casper.then(check_narrow_title('Private messages - Zulip Dev - Zulip'));
un_narrow(); un_narrow();

View File

@ -88,7 +88,9 @@ exports.activate = function (raw_operators, opts) {
exports.narrow_title = filter.operands("stream")[0]; exports.narrow_title = filter.operands("stream")[0];
} }
} else if (filter.has_operator("is")) { } else if (filter.has_operator("is")) {
exports.narrow_title = filter.operands("is")[0]; var title = filter.operands("is")[0];
title = title.charAt(0).toUpperCase() + title.slice(1) + " messages";
exports.narrow_title = title;
} else if (filter.has_operator("pm-with") || filter.has_operator("group-pm-with")) { } else if (filter.has_operator("pm-with") || filter.has_operator("group-pm-with")) {
var emails = filter.public_operators()[0].operand; var emails = filter.public_operators()[0].operand;
var names = people.get_recipients(people.emails_strings_to_user_ids_string(emails)); var names = people.get_recipients(people.emails_strings_to_user_ids_string(emails));