Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
popovers: Restructure the Move Messages and Move Topic Modals.
Saubhagya Patel14a8fd124a06
diff --git a/web/src/stream_popover.ts b/web/src/stream_popover.tsindex 8c381634411..75147fe065b 100644--- a/web/src/stream_popover.ts+++ b/web/src/stream_popover.ts@@ -346,6 +346,7 @@ export async function build_move_topic_to_stream_popover(message?: Message,): Promise<void> {const current_stream_name = sub_store.get(current_stream_id)!.name;+ const stream = sub_store.get(current_stream_id);const args: {topic_name: string;current_stream_id: number;@@ -355,9 +356,11 @@ export async function build_move_topic_to_stream_popover(only_topic_edit: boolean;disable_topic_input?: boolean;message_placement?: "first" | "intermediate" | "last";+ stream: sub_store.StreamSubscription | undefined;} = {topic_name,current_stream_id,+ stream,notify_new_thread: message_edit.notify_new_thread_default,notify_old_thread: message_edit.notify_old_thread_default,from_message_actions_popover: message !== undefined,@@ -375,13 +378,34 @@ export async function build_move_topic_to_stream_popover(let modal_heading;if (only_topic_edit) {- modal_heading = $t_html({defaultMessage: "Rename topic"});+ modal_heading = $t_html(+ {defaultMessage: "Rename topic <z-stream></z-stream> > {topic_name}"},+ {+ topic_name,+ "z-stream": () =>+ render_inline_decorated_stream_name({stream, show_colored_icon: true}),+ },+ );} else {- modal_heading = $t_html({defaultMessage: "Move topic"});+ modal_heading = $t_html(+ {defaultMessage: "Move topic from <z-stream></z-stream> > {topic_name}"},+ {+ topic_name,+ "z-stream": () =>+ render_inline_decorated_stream_name({stream, show_colored_icon: true}),+ },+ );}if (message !== undefined) {- modal_heading = $t_html({defaultMessage: "Move messages"});+ modal_heading = $t_html(+ {defaultMessage: "Move messages from <z-stream></z-stream> > {topic_name}"},+ {+ topic_name,+ "z-stream": () =>+ render_inline_decorated_stream_name({stream, show_colored_icon: true}),+ },+ );// We disable topic input only for modal is opened from the message actions// popover and not when moving the whole topic from left sidebar. This is// because topic editing permission depend on message and we do not havediff --git a/web/styles/popovers.css b/web/styles/popovers.cssindex 3f1357d5ccd..2cc80ac7a63 100644--- a/web/styles/popovers.css+++ b/web/styles/popovers.css@@ -906,16 +906,24 @@ ul.popover-group-menu-member-list {max-width: 100%;}+ .modal__title {+ white-space: nowrap;+ text-overflow: ellipsis;++ .stream-privacy-type-icon {+ padding-left: 3px;+ padding-right: 5px;+ }+ }+#move_topic_to_stream_widget_wrapper {display: flex;- margin-bottom: 10px;.dropdown-widget-button {outline: none;/* 24px at 16px/1em */line-height: 1.5em;- width: auto;- max-width: 206px;+ width: 50%;}.dropdown_widget_value {@@ -943,12 +951,23 @@ ul.popover-group-menu-member-list {}.move_messages_edit_topic {- margin-bottom: 10px;+ margin-bottom: unset;+ box-sizing: border-box;+ width: 100%;+ height: auto;+ }++ #message_move_select_options {+ width: 100%;+ }++ #move_messages_count {+ margin-top: -20px;}.topic_stream_edit_header {display: flex;- flex-wrap: wrap;+ flex-flow: column wrap;justify-content: flex-start;#select_stream_id {diff --git a/web/templates/move_topic_to_stream.hbs b/web/templates/move_topic_to_stream.hbsindex 55629840c9d..ed2d18a7a18 100644--- a/web/templates/move_topic_to_stream.hbs+++ b/web/templates/move_topic_to_stream.hbs@@ -1,26 +1,26 @@-{{#unless (or from_message_actions_popover only_topic_edit)}}-<p class="white-space-preserve-wrap">{{#tr}}Move all messages in <strong>{topic_name}</strong>{{/tr}} to:</p>-{{/unless}}<form id="move_topic_form">- {{#if only_topic_edit }}- <p>{{t "Rename topic to:" }}</p>- {{else if from_message_actions_popover}}- <p>{{t "Move messages to:" }}</p>- {{/if}}<div class="topic_stream_edit_header">{{#unless only_topic_edit}}- {{> dropdown_widget_wrapper widget_name="move_topic_to_stream"}}- <i class="fa fa-angle-right" aria-hidden="true"></i>+ <div class="input-group">+ <label class="modal-field-label">New channel</label>+ {{> dropdown_widget_wrapper widget_name="move_topic_to_stream"}}+ </div>{{/unless}}- <input 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}} />+ <div class="input-group">+ <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}} />+ </div><input name="old_topic_name" type="hidden" value="{{topic_name}}" /><input name="current_stream_id" type="hidden" value="{{current_stream_id}}" />{{#if from_message_actions_popover}}- <select id="message_move_select_options" class="message_edit_topic_propagate modal_select bootstrap-focus-style">- <option value="change_one" {{#if (eq message_placement "last")}}selected{{/if}}> {{t "Move only this message" }}</option>- <option value="change_later" {{#if (eq message_placement "intermediate")}}selected{{/if}}> {{t "Move this and all following messages in this topic" }}</option>- <option value="change_all" {{#if (eq message_placement "first")}}selected{{/if}}> {{t "Move all messages in this topic" }}</option>- </select>+ <div class="input-group">+ <label for="message_move_select_options">{{t "Which messages should be moved?"}}</label>+ <select name="propagate_mode" id="message_move_select_options" class="message_edit_topic_propagate modal_select bootstrap-focus-style">+ <option value="change_one" {{#if (eq message_placement "last")}}selected{{/if}}> {{t "Move only this message" }}</option>+ <option value="change_later" {{#if (eq message_placement "intermediate")}}selected{{/if}}> {{t "Move this and all following messages in this topic" }}</option>+ <option value="change_all" {{#if (eq message_placement "first")}}selected{{/if}}> {{t "Move all messages in this topic" }}</option>+ </select>+ </div>{{/if}}<p id="move_messages_count"></p><div class="topic_move_breadcrumb_messages">