typeahead: Show stream privacy icons in typeahead options.

We now show the stream privacy icons along with their names
in the typeahead options.
This commit is contained in:
Sahil Batra 2023-04-17 15:02:39 +05:30 committed by Tim Abbott
parent 0676629008
commit 2700ad7903
3 changed files with 8 additions and 4 deletions

View File

@ -123,8 +123,8 @@ export function render_stream(stream) {
}
return render_typeahead_item({
primary: stream.name,
secondary: desc,
stream,
is_unsubscribed: !stream.subscribed,
});
}

View File

@ -18,7 +18,11 @@
<i class="typeahead-image icon fa fa-group no-presence-circle" aria-hidden="true"></i>
{{/if}}
<strong>
{{~ primary ~}}
{{~#if stream}}
{{> inline_decorated_stream_name stream=stream }}
{{else}}
{{~ primary ~}}
{{/if}}
</strong>
{{~#if has_status}}
{{> status_emoji status_emoji_info}}

View File

@ -722,7 +722,7 @@ test("render_stream", ({mock_template}) => {
};
mock_template("typeahead_list_item.hbs", false, (args) => {
assert.equal(args.primary, stream.name);
assert.equal(args.stream, stream);
assert.equal(args.secondary, stream.description);
rendered = true;
return "typeahead-item-stub";
@ -741,7 +741,7 @@ test("render_stream w/long description", ({mock_template}) => {
};
mock_template("typeahead_list_item.hbs", false, (args) => {
assert.equal(args.primary, stream.name);
assert.equal(args.stream, stream);
const short_desc = stream.description.slice(0, 35);
assert.equal(args.secondary, short_desc + "...");
rendered = true;