mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Replace dialog messages with alerts
This commit is contained in:
parent
ef75838ab8
commit
c9924470ad
@ -347,10 +347,12 @@ function constructForm(url, options) {
|
||||
constructCreateForm(OPTIONS.actions.POST, options);
|
||||
} else {
|
||||
// User does not have permission to POST to the endpoint
|
||||
showAlertDialog(
|
||||
'{% trans "Action Prohibited" %}',
|
||||
'{% trans "Create operation not allowed" %}'
|
||||
);
|
||||
showMessage('{% trans "Action Prohibited" %}', {
|
||||
style: 'danger',
|
||||
details: '{% trans "Create operation not allowed" %}',
|
||||
icon: 'fas fa-user-times',
|
||||
});
|
||||
|
||||
console.log(`'POST action unavailable at ${url}`);
|
||||
}
|
||||
break;
|
||||
@ -360,10 +362,12 @@ function constructForm(url, options) {
|
||||
constructChangeForm(OPTIONS.actions.PUT, options);
|
||||
} else {
|
||||
// User does not have permission to PUT/PATCH to the endpoint
|
||||
showAlertDialog(
|
||||
'{% trans "Action Prohibited" %}',
|
||||
'{% trans "Update operation not allowed" %}'
|
||||
);
|
||||
showMessage('{% trans "Action Prohibited" %}', {
|
||||
style: 'danger',
|
||||
details: '{% trans "Update operation not allowed" %}',
|
||||
icon: 'fas fa-user-times',
|
||||
});
|
||||
|
||||
console.log(`${options.method} action unavailable at ${url}`);
|
||||
}
|
||||
break;
|
||||
@ -372,10 +376,12 @@ function constructForm(url, options) {
|
||||
constructDeleteForm(OPTIONS.actions.DELETE, options);
|
||||
} else {
|
||||
// User does not have permission to DELETE to the endpoint
|
||||
showAlertDialog(
|
||||
'{% trans "Action Prohibited" %}',
|
||||
'{% trans "Delete operation not allowed" %}'
|
||||
);
|
||||
showMessage('{% trans "Action Prohibited" %}', {
|
||||
style: 'danger',
|
||||
details: '{% trans "Delete operation not allowed" %}',
|
||||
icon: 'fas fa-user-times',
|
||||
});
|
||||
|
||||
console.log(`DELETE action unavailable at ${url}`);
|
||||
}
|
||||
break;
|
||||
@ -384,10 +390,12 @@ function constructForm(url, options) {
|
||||
// TODO?
|
||||
} else {
|
||||
// User does not have permission to GET to the endpoint
|
||||
showAlertDialog(
|
||||
'{% trans "Action Prohibited" %}',
|
||||
'{% trans "View operation not allowed" %}'
|
||||
);
|
||||
showMessage('{% trans "Action Prohibited" %}', {
|
||||
style: 'danger',
|
||||
details: '{% trans "View operation not allowed" %}',
|
||||
icon: 'fas fa-user-times',
|
||||
});
|
||||
|
||||
console.log(`GET action unavailable at ${url}`);
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user