mirror of
https://github.com/zulip/zulip.git
synced 2025-10-27 18:13:58 +00:00
move_topic_modal: Show realm_empty_topic_display_name for topic="".
This commit adds support to display `realm_empty_topic_display_name` value in the 'move topic modal' heading for topics having the actual value of empty string. Also, in the new_topic_name input box we show a placeholder of `realm_empty_topic_display_name` value when the actual topic value is empty string.
This commit is contained in:
committed by
Tim Abbott
parent
6a44364a69
commit
083861fed9
@@ -319,8 +319,12 @@ export async function build_move_topic_to_stream_popover(
|
|||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const current_stream_name = sub_store.get(current_stream_id)!.name;
|
const current_stream_name = sub_store.get(current_stream_id)!.name;
|
||||||
const stream = sub_store.get(current_stream_id);
|
const stream = sub_store.get(current_stream_id);
|
||||||
|
const topic_display_name = util.get_final_topic_display_name(topic_name);
|
||||||
|
const is_empty_string_topic = topic_name === "";
|
||||||
const args: {
|
const args: {
|
||||||
topic_name: string;
|
topic_name: string;
|
||||||
|
topic_display_name: string;
|
||||||
|
is_empty_string_topic: boolean;
|
||||||
current_stream_id: number;
|
current_stream_id: number;
|
||||||
notify_new_thread: boolean;
|
notify_new_thread: boolean;
|
||||||
notify_old_thread: boolean;
|
notify_old_thread: boolean;
|
||||||
@@ -331,6 +335,8 @@ export async function build_move_topic_to_stream_popover(
|
|||||||
stream: sub_store.StreamSubscription | undefined;
|
stream: sub_store.StreamSubscription | undefined;
|
||||||
} = {
|
} = {
|
||||||
topic_name,
|
topic_name,
|
||||||
|
topic_display_name,
|
||||||
|
is_empty_string_topic,
|
||||||
current_stream_id,
|
current_stream_id,
|
||||||
stream,
|
stream,
|
||||||
notify_new_thread: message_edit.notify_new_thread_default,
|
notify_new_thread: message_edit.notify_new_thread_default,
|
||||||
@@ -355,7 +361,8 @@ export async function build_move_topic_to_stream_popover(
|
|||||||
{
|
{
|
||||||
"z-stream-or-topic": () =>
|
"z-stream-or-topic": () =>
|
||||||
render_inline_stream_or_topic_reference({
|
render_inline_stream_or_topic_reference({
|
||||||
topic_name,
|
topic_display_name,
|
||||||
|
is_empty_string_topic,
|
||||||
stream,
|
stream,
|
||||||
show_colored_icon: true,
|
show_colored_icon: true,
|
||||||
}),
|
}),
|
||||||
@@ -367,7 +374,8 @@ export async function build_move_topic_to_stream_popover(
|
|||||||
{
|
{
|
||||||
"z-stream-or-topic": () =>
|
"z-stream-or-topic": () =>
|
||||||
render_inline_stream_or_topic_reference({
|
render_inline_stream_or_topic_reference({
|
||||||
topic_name,
|
topic_display_name,
|
||||||
|
is_empty_string_topic,
|
||||||
stream,
|
stream,
|
||||||
show_colored_icon: true,
|
show_colored_icon: true,
|
||||||
}),
|
}),
|
||||||
@@ -382,7 +390,8 @@ export async function build_move_topic_to_stream_popover(
|
|||||||
"z-stream-or-topic": () =>
|
"z-stream-or-topic": () =>
|
||||||
render_inline_stream_or_topic_reference({
|
render_inline_stream_or_topic_reference({
|
||||||
stream,
|
stream,
|
||||||
topic_name,
|
topic_display_name,
|
||||||
|
is_empty_string_topic,
|
||||||
show_colored_icon: true,
|
show_colored_icon: true,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<span class="stream-or-topic-reference">
|
<span class="stream-or-topic-reference">
|
||||||
{{~#if stream~}}
|
{{~#if stream~}}
|
||||||
{{> inline_decorated_stream_name stream=stream show_colored_icon=show_colored_icon}}
|
{{> inline_decorated_stream_name stream=stream show_colored_icon=show_colored_icon}}
|
||||||
{{#if topic_name~}} > {{/if}}
|
{{#if topic_display_name~}} > {{/if}}
|
||||||
{{~/if~}}
|
{{~/if~}}
|
||||||
{{~ topic_name ~}}
|
<span {{#if is_empty_string_topic}}class="empty-topic-display"{{/if}}>{{~ topic_display_name ~}}</span>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
{{/unless}}
|
{{/unless}}
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<label for="move-topic-new-topic-name" class="modal-field-label">New topic</label>
|
<label for="move-topic-new-topic-name" class="modal-field-label">New topic</label>
|
||||||
<input id="move-topic-new-topic-name" name="new_topic_name" type="text" class="move_messages_edit_topic modal_text_input" autocomplete="off" value="{{topic_name}}" {{#if disable_topic_input}}disabled{{/if}} />
|
<input id="move-topic-new-topic-name" name="new_topic_name" type="text" class="move_messages_edit_topic modal_text_input" autocomplete="off" {{#if is_empty_string_topic}}placeholder="{{topic_display_name}}"{{/if}} value="{{topic_name}}" {{#if disable_topic_input}}disabled{{/if}} />
|
||||||
</div>
|
</div>
|
||||||
<input name="old_topic_name" type="hidden" value="{{topic_name}}" />
|
<input name="old_topic_name" type="hidden" value="{{topic_name}}" />
|
||||||
<input name="current_stream_id" type="hidden" value="{{current_stream_id}}" />
|
<input name="current_stream_id" type="hidden" value="{{current_stream_id}}" />
|
||||||
|
|||||||
Reference in New Issue
Block a user