mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Improved alertify notification logic. Remove AlertifyWrapper class and extend notification methods in alertify itself.
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
define('pgadmin.node.pga_job', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify',
|
||||
'sources/alerts/alertify_wrapper',
|
||||
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
|
||||
'pgadmin.node.pga_jobstep', 'pgadmin.node.pga_schedule'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, AlertifyWrapper) {
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-pga_job']) {
|
||||
var pga_jobs = pgBrowser.Nodes['coll-pga_job'] =
|
||||
@@ -181,18 +179,17 @@ define('pgadmin.node.pga_job', [
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
var error_msg = "Unable to run pgagent job.";
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
if (xhr.readyState == 0) {
|
||||
alertifyWrapper.error(gettext('Not connected to the server or the connection to the server has been closed.'));
|
||||
alertify.error(gettext('Not connected to the server or the connection to the server has been closed.'));
|
||||
}
|
||||
else {
|
||||
if (_.isUndefined(xhr.responseText)) {
|
||||
alertifyWrapper.error(error_msg);
|
||||
alertify.error(error_msg);
|
||||
}
|
||||
else {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user