UX: Add confirmation when deleting a staff note
This commit is contained in:
parent
550d5c73f4
commit
228462b159
|
@ -37,11 +37,16 @@ export default Ember.Controller.extend({
|
|||
},
|
||||
|
||||
removeNote(note) {
|
||||
note.destroyRecord().then(() => {
|
||||
const notes = this.get('model');
|
||||
notes.removeObject(note);
|
||||
this._refreshCount();
|
||||
}).catch(popupAjaxError);
|
||||
|
||||
bootbox.confirm(I18n.t("staff_notes.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), result => {
|
||||
if (result) {
|
||||
note.destroyRecord().then(() => {
|
||||
const notes = this.get('model');
|
||||
notes.removeObject(note);
|
||||
this._refreshCount();
|
||||
}).catch(popupAjaxError);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -5,3 +5,4 @@ en:
|
|||
attach: "Attach Staff Note"
|
||||
remove: "Remove Note"
|
||||
show: "Staff Notes ({{count}})"
|
||||
delete_confirm: "Are you sure you want to delete that staff note?"
|
||||
|
|
Loading…
Reference in New Issue