user_profile: Display `Saved` feedback.

Visually confirms successful profile changes with a clear
`Saved` message.

Fixes part of #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
This commit is contained in:
sanchi-t 2024-03-07 16:16:02 +05:30 committed by Tim Abbott
parent 5a0abeed92
commit ca74c95c60
3 changed files with 25 additions and 0 deletions

View File

@ -592,6 +592,11 @@ export function show_edit_bot_info_modal(user_id, $container) {
hide_button_spinner($submit_btn);
original_values = get_current_values($("#bot-edit-form"));
toggle_submit_button($("#edit-user-form"));
ui_report.success(
$t_html({defaultMessage: "Saved"}),
$("#user-profile-modal .save-success"),
1200,
);
$cancel_btn.prop("disabled", false);
},
error(xhr) {
@ -868,6 +873,11 @@ export function show_edit_user_info_modal(user_id, $container) {
hide_button_spinner($submit_btn);
original_values = get_current_values($("#edit-user-form"));
toggle_submit_button($("#edit-user-form"));
ui_report.success(
$t_html({defaultMessage: "Saved"}),
$("#user-profile-modal .save-success"),
1200,
);
$cancel_btn.prop("disabled", false);
},
error(xhr) {

View File

@ -157,6 +157,20 @@
color: hsl(0deg 0% 100%) !important;
}
#user-profile-modal .save-success {
vertical-align: top;
background-color: transparent;
border-radius: 4px;
margin-right: 10px;
color: hsl(156deg 30% 50%);
padding: 0.5rem 1rem;
line-height: 1.15;
&:not(:empty) {
border: 1px solid hsl(156deg 30% 50%);
}
}
#read_receipts_error,
#dialog_error {
margin-bottom: 10px;

View File

@ -135,6 +135,7 @@
</main>
<div class="manage-profile-tab-footer">
<footer class="modal__footer">
<div class="save-success"></div>
<button type="button" class="modal__btn dialog_exit_button" aria-label="{{t 'Close this dialog window' }}" data-micromodal-close>{{t "Cancel" }}</button>
<button type="button" class="modal__btn dialog_submit_button">
<span>{{t "Save changes"}}</span>