N°3795 - Replace JS alert native calls with centralized informative modals (#456)

* N°3795 - Replace JS alert native calls with centralized informative modals

* N°3795 - Add constants for severity

* N°3795 - Fix success severity value wrongfully set to 'error'

* N°3795 - Add constants for severity

* N°3795 - Simplify API consumption

* N°3795 - Allows to pass more options when consuming API
This commit is contained in:
Stephen Abello
2023-03-31 10:24:49 +02:00
committed by GitHub
parent 383b5623b1
commit a80506b8e8
12 changed files with 68 additions and 27 deletions

View File

@@ -953,13 +953,11 @@ $(function()
'json'
)
.fail(function (oXHR, sStatus, sErrorThrown) {
// TODO 3.0.0: Maybe we could have a centralized dialog to display error messages?
alert(sErrorThrown);
CombodoModal.OpenErrorModal(sErrorThrown);
})
.done(function (oData) {
if (false === oData.data.success) {
// TODO 3.0.0: Same comment as the fail() callback
alert(oData.data.error_message);
CombodoModal.OpenErrorModal(oData.data.error_message);
return false;
}
@@ -1142,8 +1140,7 @@ $(function()
sNewLockStatus = me.enums.lock_status.locked_by_someone_else;
} else if ('expired' === oData.operation) {
sNewLockStatus = me.enums.lock_status.unknown;
// TODO 3.0.0: Maybe we could use a centralized dialog to display error message?
alert(oData.popup_message);
CombodoModal.OpenErrorModal(oData.popup_message);
}
} else {
sNewLockStatus = me.enums.lock_status.locked_by_myself;
@@ -1392,13 +1389,11 @@ $(function()
'json'
)
.fail(function (oXHR, sStatus, sErroThrown) {
// TODO 3.0.0: Maybe we could have a centralized dialog to display error messages?
alert(sErrorThrown);
CombodoModal.OpenErrorModal(sErrorThrown);
})
.done(function (oData) {
if (false === oData.data.success) {
// TODO 3.0.0: Same comment as the fail() callback
alert(oData.data.error_message);
CombodoModal.OpenErrorModal(oData.data.error_message);
return false;
}