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.

empty_feed_notice: Add support for empty string topic.

Prakhar Pratyush22efac5a778f
diff --git a/web/src/narrow_banner.ts b/web/src/narrow_banner.ts
index 8774e3d8e73..3a6ebcac462 100644
--- a/web/src/narrow_banner.ts
+++ b/web/src/narrow_banner.ts
@@ -82,8 +82,9 @@ function retrieve_search_query_data(): SearchData {
const stream_name = stream_data.get_valid_sub_by_id_string(stream_id).name;
search_string_result.stream_query = stream_name;
}
- if (topic) {
- search_string_result.topic_query = topic;
+ if (topic !== undefined) {
+ search_string_result.topic_query = util.get_final_topic_display_name(topic);
+ search_string_result.is_empty_string_topic = topic === "";
}
}
diff --git a/web/src/narrow_error.ts b/web/src/narrow_error.ts
index 9aa4f0be05c..dd159577699 100644
--- a/web/src/narrow_error.ts
+++ b/web/src/narrow_error.ts
@@ -10,6 +10,7 @@ export type SearchData = {
has_stop_word: boolean;
stream_query?: string;
topic_query?: string;
+ is_empty_string_topic?: boolean;
};
export type NarrowBannerData = {
diff --git a/web/templates/empty_feed_notice.hbs b/web/templates/empty_feed_notice.hbs
index ad2f6699be4..bed147a4500 100644
--- a/web/templates/empty_feed_notice.hbs
+++ b/web/templates/empty_feed_notice.hbs
@@ -7,8 +7,12 @@
<span>channel: {{search_data.stream_query}}</span>
{{/if}}
{{#if search_data.topic_query}}
+ {{#if search_data.is_empty_string_topic}}
+ <span>topic: <span class="empty-topic-display">{{search_data.topic_query}}</span></span>
+ {{else}}
<span>topic: {{search_data.topic_query}}</span>
{{/if}}
+ {{/if}}
{{#each search_data.query_words}}
{{#if is_stop_word}}
<del>{{query_word}}</del>