confirm_dialog: Rename html_yes_button to html_submit_button.

This commit renames the html_yes_button parameter of confirm
dialog widget to html_submit_button and also all the related
variables in confirm_dialog.js.
This will help in keeping a general name when deduplicating
the code for confirm_dialog and edit_fields_modal.
This commit is contained in:
sahil839
2021-07-05 18:41:23 +05:30
committed by Tim Abbott
parent eaf69bbf16
commit 055d7113f2
15 changed files with 23 additions and 23 deletions

View File

@@ -103,7 +103,7 @@ export function build_user_avatar_widget(upload_function) {
parent: modal_parent,
html_heading: $t_html({defaultMessage: "Delete profile picture"}),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: delete_user_avatar,
fade: true,
});

View File

@@ -62,7 +62,7 @@ export function launch(conf) {
// templates.
"html_heading",
"html_body",
"html_yes_button",
"html_submit_button",
"on_click",
"parent",
];
@@ -89,13 +89,13 @@ export function launch(conf) {
);
confirm_dialog.find(".confirm_dialog_body").append(conf.html_body);
const yes_button_span = confirm_dialog.find(".confirm_dialog_yes_button span");
const submit_button_span = confirm_dialog.find(".confirm_dialog_yes_button span");
yes_button_span.html(conf.html_yes_button);
submit_button_span.html(conf.html_submit_button);
const yes_button = confirm_dialog.find(".confirm_dialog_yes_button");
const submit_button = confirm_dialog.find(".confirm_dialog_yes_button");
// Set up handlers.
yes_button.on("click", () => {
submit_button.on("click", () => {
if (conf.loading_spinner) {
show_confirm_dialog_spinner();
} else {
@@ -112,6 +112,6 @@ export function launch(conf) {
overlays.open_modal("#confirm_dialog_modal");
conf.parent.on("shown.bs.modal", () => {
yes_button.trigger("focus");
submit_button.trigger("focus");
});
}

View File

@@ -983,7 +983,7 @@ export function delete_message(msg_id) {
parent: modal_parent,
html_heading: $t_html({defaultMessage: "Delete message"}),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
help_link: "/help/edit-or-delete-a-message#delete-a-message",
on_click: do_delete_message,
loading_spinner: true,

View File

@@ -146,7 +146,7 @@ export function confirm_mute_user(user_id) {
html_heading: $t({defaultMessage: "Mute user"}),
help_link: "/help/mute-a-user",
html_body,
html_yes_button: $t({defaultMessage: "Confirm"}),
html_submit_button: $t({defaultMessage: "Confirm"}),
on_click,
});
}

View File

@@ -602,7 +602,7 @@ export function set_up() {
parent: modal_parent,
html_heading: $t_html({defaultMessage: "Deactivate your account"}),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: handle_confirm,
help_link: "/help/deactivate-your-account",
fade: true,

View File

@@ -269,7 +269,7 @@ export function set_up() {
parent: modal_parent,
html_heading: $t_html({defaultMessage: "Override built-in emoji?"}),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: submit_custom_emoji_request,
fade: true,
});

View File

@@ -206,7 +206,7 @@ export function on_load_success(invites_data, initialize_event_handlers) {
? $t_html({defaultMessage: "Revoke invitation link"})
: $t_html({defaultMessage: "Revoke invitation to {email}"}, {email}),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: do_revoke_invite,
fade: true,
});
@@ -232,7 +232,7 @@ export function on_load_success(invites_data, initialize_event_handlers) {
parent: modal_parent,
html_heading: $t_html({defaultMessage: "Resend invitation"}),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: do_resend_invite,
fade: true,
});

View File

@@ -1174,7 +1174,7 @@ export function build_page() {
html_heading: $t_html({defaultMessage: "Deactivate organization"}),
help_link: "/help/deactivate-your-organization",
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: do_deactivate_realm,
fade: true,
});

View File

@@ -366,7 +366,7 @@ export function set_up() {
parent: modal_parent,
html_heading: $t_html({defaultMessage: "Delete user group"}),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: delete_user_group,
fade: true,
});

View File

@@ -447,7 +447,7 @@ function confirm_deactivation(row, user_id, status_field) {
parent: modal_parent,
html_heading: $t_html({defaultMessage: "Deactivate {email}"}, {email: user.email}),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: handle_confirm,
fade: true,
});

View File

@@ -16,7 +16,7 @@ export function confirm_unstar_all_messages() {
parent: modal_parent,
html_heading: $t_html({defaultMessage: "Unstar all messages"}),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: message_flags.unstar_all_messages,
});
}
@@ -41,7 +41,7 @@ export function confirm_unstar_all_messages_in_topic(stream_id, topic) {
parent: modal_parent,
html_heading: $t_html({defaultMessage: "Unstar messages in topic"}),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click,
});
}

View File

@@ -441,7 +441,7 @@ export function set_up_handlers() {
parent: modal_parent,
html_heading: $t_html({defaultMessage: "Large number of subscribers"}),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: () => {
create_stream();
},

View File

@@ -883,7 +883,7 @@ export function initialize() {
{stream_name: sub.name},
),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: remove_user_from_private_stream,
fade: true,
});
@@ -952,7 +952,7 @@ export function initialize() {
),
help_link: "/help/archive-a-stream",
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: do_archive_stream,
fade: true,
});

View File

@@ -671,7 +671,7 @@ export function register_topic_handlers() {
html_heading: $t_html({defaultMessage: "Delete topic"}),
help_link: "/help/delete-a-topic",
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: () => {
message_edit.delete_topic(stream_id, topic);
},

View File

@@ -963,7 +963,7 @@ export function unsubscribe_from_private_stream(sub, from_stream_popover) {
{stream_name: sub.name},
),
html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}),
html_submit_button: $t_html({defaultMessage: "Confirm"}),
on_click: unsubscribe_from_stream,
fade: true,
});