mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
WebAdmin: improve the error message when trying to delete referenced resources
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -251,11 +251,11 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
fixedColumnsLeft: 1
|
||||
},
|
||||
stateLoadParams: function (settings, data) {
|
||||
if (data.search.search){
|
||||
const filterSearch = document.querySelector('[data-table-filter="search"]');
|
||||
filterSearch.value = data.search.search;
|
||||
}
|
||||
},
|
||||
if (data.search.search){
|
||||
const filterSearch = document.querySelector('[data-table-filter="search"]');
|
||||
filterSearch.value = data.search.search;
|
||||
}
|
||||
},
|
||||
language: {
|
||||
info: $.t('datatable.info'),
|
||||
infoEmpty: $.t('datatable.info_empty'),
|
||||
@@ -326,7 +326,19 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
el.on("click", function(e){
|
||||
e.preventDefault();
|
||||
const parent = e.target.closest('tr');
|
||||
deleteAction(dt.row(parent).data()['name']);
|
||||
let row = dt.row(parent).data();
|
||||
if (row.users && row.users.length > 0){
|
||||
ModalAlert.fire({
|
||||
text: $.t('group.err_delete_referenced'),
|
||||
icon: "warning",
|
||||
confirmButtonText: $.t('general.ok'),
|
||||
customClass: {
|
||||
confirmButton: "btn btn-primary"
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
deleteAction(row['name']);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user