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.

delete_topic_modal: Show realm_empty_topic_display_name for topic="".

Prakhar Pratyush3f1e53f3fb14
diff --git a/web/src/topic_popover.ts b/web/src/topic_popover.ts
index 34e2d8f3ee0..3cbdf1fabc2 100644
--- a/web/src/topic_popover.ts
+++ b/web/src/topic_popover.ts
@@ -64,11 +64,14 @@ export function initialize(): void {
onMount(instance) {
const $popper = $(instance.popper);
const {stream_id, topic_name, url} = get_conversation(instance);
- const is_topic_empty = popover_menus_data.get_topic_popover_content_context({
+ const context = popover_menus_data.get_topic_popover_content_context({
stream_id,
topic_name,
url,
- }).is_topic_empty;
+ });
+ const is_topic_empty = context.is_topic_empty;
+ const topic_display_name = context.topic_display_name;
+ const is_empty_string_topic = context.is_empty_string_topic;
if (!stream_id) {
popover_menus.hide_current_popover_if_visible(instance);
@@ -139,7 +142,10 @@ export function initialize(): void {
});
$popper.one("click", ".sidebar-popover-delete-topic-messages", () => {
- const html_body = render_delete_topic_modal({topic_name});
+ const html_body = render_delete_topic_modal({
+ topic_display_name,
+ is_empty_string_topic,
+ });
confirm_dialog.launch({
html_heading: $t_html({defaultMessage: "Delete topic"}),
diff --git a/web/templates/confirm_dialog/confirm_delete_topic.hbs b/web/templates/confirm_dialog/confirm_delete_topic.hbs
index 07263a28c9f..c13c7da0df0 100644
--- a/web/templates/confirm_dialog/confirm_delete_topic.hbs
+++ b/web/templates/confirm_dialog/confirm_delete_topic.hbs
@@ -1,4 +1,9 @@
<p>
{{t "Deleting a topic will immediately remove it and its messages for everyone. Other users may find this confusing, especially if they had received an email or push notification related to the deleted messages." }}
</p>
-<p class="white-space-preserve-wrap">{{#tr}}Are you sure you want to permanently delete <b>{topic_name}</b>?{{/tr}}</p>
+<p class="white-space-preserve-wrap">
+ {{#tr}}
+ Are you sure you want to permanently delete <z-topic-display-name></z-topic-display-name>?
+ {{#*inline "z-topic-display-name"}}<span {{#if is_empty_string_topic}}class="empty-topic-display"{{/if}}><b>{{topic_display_name}}</b></span>{{/inline}}
+ {{/tr}}
+</p>