2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

Replace dialog messages with alerts

This commit is contained in:
Oliver 2021-11-08 09:44:45 +11:00
parent ef75838ab8
commit c9924470ad

View File

@ -347,10 +347,12 @@ function constructForm(url, options) {
constructCreateForm(OPTIONS.actions.POST, options); constructCreateForm(OPTIONS.actions.POST, options);
} else { } else {
// User does not have permission to POST to the endpoint // User does not have permission to POST to the endpoint
showAlertDialog( showMessage('{% trans "Action Prohibited" %}', {
'{% trans "Action Prohibited" %}', style: 'danger',
'{% trans "Create operation not allowed" %}' details: '{% trans "Create operation not allowed" %}',
); icon: 'fas fa-user-times',
});
console.log(`'POST action unavailable at ${url}`); console.log(`'POST action unavailable at ${url}`);
} }
break; break;
@ -360,10 +362,12 @@ function constructForm(url, options) {
constructChangeForm(OPTIONS.actions.PUT, options); constructChangeForm(OPTIONS.actions.PUT, options);
} else { } else {
// User does not have permission to PUT/PATCH to the endpoint // User does not have permission to PUT/PATCH to the endpoint
showAlertDialog( showMessage('{% trans "Action Prohibited" %}', {
'{% trans "Action Prohibited" %}', style: 'danger',
'{% trans "Update operation not allowed" %}' details: '{% trans "Update operation not allowed" %}',
); icon: 'fas fa-user-times',
});
console.log(`${options.method} action unavailable at ${url}`); console.log(`${options.method} action unavailable at ${url}`);
} }
break; break;
@ -372,10 +376,12 @@ function constructForm(url, options) {
constructDeleteForm(OPTIONS.actions.DELETE, options); constructDeleteForm(OPTIONS.actions.DELETE, options);
} else { } else {
// User does not have permission to DELETE to the endpoint // User does not have permission to DELETE to the endpoint
showAlertDialog( showMessage('{% trans "Action Prohibited" %}', {
'{% trans "Action Prohibited" %}', style: 'danger',
'{% trans "Delete operation not allowed" %}' details: '{% trans "Delete operation not allowed" %}',
); icon: 'fas fa-user-times',
});
console.log(`DELETE action unavailable at ${url}`); console.log(`DELETE action unavailable at ${url}`);
} }
break; break;
@ -384,10 +390,12 @@ function constructForm(url, options) {
// TODO? // TODO?
} else { } else {
// User does not have permission to GET to the endpoint // User does not have permission to GET to the endpoint
showAlertDialog( showMessage('{% trans "Action Prohibited" %}', {
'{% trans "Action Prohibited" %}', style: 'danger',
'{% trans "View operation not allowed" %}' details: '{% trans "View operation not allowed" %}',
); icon: 'fas fa-user-times',
});
console.log(`GET action unavailable at ${url}`); console.log(`GET action unavailable at ${url}`);
} }
break; break;