Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
stream: Change button text to "Close" in copy email address modal.
Sahil Batra8db9093d0b19
diff --git a/web/src/dialog_widget.ts b/web/src/dialog_widget.tsindex 6915b7a273e..558f87b28d5 100644--- a/web/src/dialog_widget.ts+++ b/web/src/dialog_widget.ts@@ -48,6 +48,7 @@ export type DialogWidgetConfig = {html_body: string;on_click: (e: unknown) => void;html_submit_button?: string;+ html_exit_button?: string;close_on_submit?: boolean;focus_submit_on_open?: boolean;help_link?: string;@@ -112,6 +113,7 @@ export function launch(conf: DialogWidgetConfig): void {// Optional parameters:// * html_submit_button: Submit button text.+ // * html_exit_button: Exit button text.// * close_on_submit: Whether to close modal on clicking submit.// * focus_submit_on_open: Whether to focus submit button on open.// * help_link: A help link in the heading area.@@ -130,10 +132,12 @@ export function launch(conf: DialogWidgetConfig): void {// on valid input change in modal.const html_submit_button = conf.html_submit_button ?? $t_html({defaultMessage: "Save changes"});+ const html_exit_button = conf.html_exit_button ?? $t_html({defaultMessage: "Cancel"});const html = render_dialog_widget({heading_text: conf.html_heading,link: conf.help_link,html_submit_button,+ html_exit_button,html_body: conf.html_body,id: conf.id,single_footer_button: conf.single_footer_button,diff --git a/web/src/stream_edit.js b/web/src/stream_edit.jsindex a7e1f1eee30..328f57c65a4 100644--- a/web/src/stream_edit.js+++ b/web/src/stream_edit.js@@ -513,6 +513,7 @@ export function initialize() {html_body: copy_email_address,id: "copy_email_address_modal",html_submit_button: $t_html({defaultMessage: "Copy address"}),+ html_exit_button: $t_html({defaultMessage: "Close"}),help_link: "/help/message-a-stream-by-email#configuration-options",on_click() {},close_on_submit: false,diff --git a/web/templates/dialog_widget.hbs b/web/templates/dialog_widget.hbsindex e7c8268879b..be95c1ff072 100644--- a/web/templates/dialog_widget.hbs+++ b/web/templates/dialog_widget.hbs@@ -16,7 +16,7 @@</main><footer class="modal__footer">{{#unless single_footer_button}}- <button class="modal__btn dialog_cancel_button" aria-label="{{t 'Close this dialog window' }}" data-micromodal-close>{{t "Cancel" }}</button>+ <button class="modal__btn dialog_cancel_button" aria-label="{{t 'Close this dialog window' }}" data-micromodal-close>{{{ html_exit_button }}}</button>{{/unless}}<button class="modal__btn dialog_submit_button"{{#if single_footer_button}} aria-label="{{t 'Close this dialog window' }}" data-micromodal-close{{/if}}><span>{{{ html_submit_button }}}</span>