mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-28 21:18:46 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user