Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

search_pill: Use hbs to render combined channel topic.

apoorvapendsee1b249c1d9ec
diff --git a/web/src/search_pill.ts b/web/src/search_pill.ts
index 578fb348160..35470f355ed 100644
--- a/web/src/search_pill.ts
+++ b/web/src/search_pill.ts
@@ -47,6 +47,8 @@ type PillRenderData =
sign?: string;
topic_display_name?: string;
description_html?: string;
+ is_combined_channel_topic?: boolean;
+ combined_channel_name?: string;
})
| SearchUserPill;
@@ -166,7 +168,11 @@ function maybe_generate_combined_channel_topic_pill(
const channel_name = stream_data.get_valid_sub_by_id_string(channel_operand).name;
return {
...search_pill,
- display_value: `${sign}#${channel_name} > ${util.get_final_topic_display_name(search_pill.operand)}`,
+ sign,
+ combined_channel_name: channel_name,
+ is_combined_channel_topic: true,
+ topic_display_name: util.get_final_topic_display_name(search_pill.operand),
+ is_empty_string_topic: search_pill.operand === "",
};
}
diff --git a/web/templates/input_pill.hbs b/web/templates/input_pill.hbs
index 4fa32794629..0d862c5c1cb 100644
--- a/web/templates/input_pill.hbs
+++ b/web/templates/input_pill.hbs
@@ -21,11 +21,15 @@
<i class="zulip-icon zulip-icon-hashtag channel-privacy-type-icon" aria-hidden="true"></i>
{{~/if~}}
{{/if}}
+ {{#if is_combined_channel_topic}}
+ {{sign}}#{{combined_channel_name}} &gt;<span {{#if is_empty_string_topic}}class="empty-topic-display"{{/if}}> {{topic_display_name}}</span>
+ {{else}}
{{#if is_empty_string_topic}}
{{sign}}topic:{{#if topic_display_name}}<span class="empty-topic-display"> {{topic_display_name}}</span>{{/if}}
{{else}}
{{ display_value }}
{{/if}}
+ {{/if}}
</span>
{{~#if should_add_guest_user_indicator}}&nbsp;<i>({{t 'guest'}})</i>{{~/if~}}
{{~#if has_status~}}