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:
parent
a7f58e2b92
commit
e506fa1dbe
@ -1,10 +1,7 @@
|
||||
define('pgadmin.node.cast', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin',
|
||||
'pgadmin.browser', 'alertify',
|
||||
'sources/alerts/alertify_wrapper',
|
||||
|
||||
'pgadmin.browser.collection'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, AlertifyWrapper) {
|
||||
'pgadmin.browser', 'pgadmin.alertifyjs', 'pgadmin.browser.collection'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
// Extend the collection class for cast
|
||||
if (!pgBrowser.Nodes['coll-cast']) {
|
||||
var casts = pgAdmin.Browser.Nodes['coll-cast'] =
|
||||
@ -215,8 +212,7 @@ define('pgadmin.node.cast', [
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
@ -1,10 +1,8 @@
|
||||
define('pgadmin.node.synonym', [
|
||||
'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.browser.collection'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, AlertifyWrapper) {
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-synonym']) {
|
||||
var databases = pgAdmin.Browser.Nodes['coll-synonym'] =
|
||||
@ -169,8 +167,7 @@ define('pgadmin.node.synonym', [
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
@ -1,11 +1,9 @@
|
||||
// Check Constraint Module: Node
|
||||
define('pgadmin.node.check_constraint', [
|
||||
'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.browser.collection'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, AlertifyWrapper) {
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
// Check Constraint Node
|
||||
if (!pgBrowser.Nodes['check_constraints']) {
|
||||
@ -66,8 +64,7 @@ define('pgadmin.node.check_constraint', [
|
||||
type:'GET',
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.removeIcon(i);
|
||||
data.valid = true;
|
||||
data.icon = 'icon-check_constraints';
|
||||
@ -80,8 +77,7 @@ define('pgadmin.node.check_constraint', [
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
|
@ -1,10 +1,8 @@
|
||||
define('pgadmin.node.foreign_key', [
|
||||
'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.browser.collection'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, AlertifyWrapper) {
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
var formatNode = function(opt) {
|
||||
if (!opt.id) {
|
||||
@ -655,8 +653,7 @@ define('pgadmin.node.foreign_key', [
|
||||
type:'GET',
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.removeIcon(i);
|
||||
data.valid = true;
|
||||
data.icon = 'icon-foreign_key';
|
||||
@ -669,8 +666,7 @@ define('pgadmin.node.foreign_key', [
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
|
@ -1,10 +1,9 @@
|
||||
define([
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser', 'backform', 'alertify',
|
||||
'sources/alerts/alertify_wrapper',
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser', 'backform', 'pgadmin.alertifyjs',
|
||||
'pgadmin.browser.collection', 'pgadmin.browser.table.partition.utils'
|
||||
],
|
||||
function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, AlertifyWrapper) {
|
||||
function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-partition']) {
|
||||
var databases = pgAdmin.Browser.Nodes['coll-partition'] =
|
||||
@ -164,8 +163,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, Aler
|
||||
dataType: "json",
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.unload(i);
|
||||
t.setInode(i);
|
||||
t.deselect(i);
|
||||
@ -178,8 +176,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, Aler
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -219,8 +216,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, Aler
|
||||
dataType: "json",
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.removeIcon(i);
|
||||
data.icon = 'icon-partition';
|
||||
t.addIcon(i, {icon: data.icon});
|
||||
@ -237,8 +233,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, Aler
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -269,8 +264,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, Aler
|
||||
type:'DELETE',
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.removeIcon(i);
|
||||
data.icon = 'icon-partition';
|
||||
t.addIcon(i, {icon: data.icon});
|
||||
@ -287,8 +281,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, Aler
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -320,8 +313,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, Aler
|
||||
type:'PUT',
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
var n = t.next(i);
|
||||
if (!n || !n.length) {
|
||||
n = t.prev(i);
|
||||
@ -340,8 +332,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, Aler
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
@ -1,12 +1,10 @@
|
||||
define('pgadmin.node.table', [
|
||||
'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.browser.collection', 'pgadmin.node.column',
|
||||
'pgadmin.node.constraints', 'pgadmin.browser.table.partition.utils'
|
||||
], function(
|
||||
gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, AlertifyWrapper
|
||||
) {
|
||||
gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-table']) {
|
||||
var databases = pgBrowser.Nodes['coll-table'] =
|
||||
@ -129,8 +127,7 @@ define('pgadmin.node.table', [
|
||||
dataType: "json",
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.unload(i);
|
||||
t.setInode(i);
|
||||
t.deselect(i);
|
||||
@ -143,8 +140,7 @@ define('pgadmin.node.table', [
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -184,8 +180,7 @@ define('pgadmin.node.table', [
|
||||
dataType: "json",
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.removeIcon(i);
|
||||
data.icon = data.is_partitioned ? 'icon-partition': 'icon-table';
|
||||
t.addIcon(i, {icon: data.icon});
|
||||
@ -202,8 +197,7 @@ define('pgadmin.node.table', [
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -234,8 +228,7 @@ define('pgadmin.node.table', [
|
||||
type:'DELETE',
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.removeIcon(i);
|
||||
data.icon = data.is_partitioned ? 'icon-partition': 'icon-table';
|
||||
t.addIcon(i, {icon: data.icon});
|
||||
@ -252,8 +245,7 @@ define('pgadmin.node.table', [
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
|
@ -1,9 +1,8 @@
|
||||
define('pgadmin.node.trigger', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser', 'backform', 'alertify',
|
||||
'sources/alerts/alertify_wrapper',
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser', 'backform', 'pgadmin.alertifyjs',
|
||||
'pgadmin.browser.collection'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, AlertifyWrapper) {
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
|
||||
|
||||
var CustomSwitchControl = Backform.CustomSwitchControl = Backform.SwitchControl.extend({
|
||||
template: _.template([
|
||||
@ -118,8 +117,7 @@ define('pgadmin.node.trigger', [
|
||||
dataType: "json",
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.removeIcon(i);
|
||||
data.icon = 'icon-trigger';
|
||||
t.addIcon(i, {icon: data.icon});
|
||||
@ -136,8 +134,7 @@ define('pgadmin.node.trigger', [
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -163,8 +160,7 @@ define('pgadmin.node.trigger', [
|
||||
dataType: "json",
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.removeIcon(i);
|
||||
data.icon = 'icon-trigger-bad';
|
||||
t.addIcon(i, {icon: data.icon});
|
||||
@ -181,8 +177,7 @@ define('pgadmin.node.trigger', [
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
|
@ -1,10 +1,8 @@
|
||||
define('pgadmin.node.mview', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'pgadmin', 'alertify', 'pgadmin.browser', 'codemirror',
|
||||
'sources/alerts/alertify_wrapper',
|
||||
|
||||
'underscore.string', 'pgadmin', 'pgadmin.alertifyjs', 'pgadmin.browser', 'codemirror',
|
||||
'pgadmin.browser.server.privilege'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, alertify, pgBrowser, CodeMirror, AlertifyWrapper) {
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, alertify, pgBrowser, CodeMirror) {
|
||||
|
||||
/**
|
||||
Create and add a view collection into nodes
|
||||
@ -294,8 +292,7 @@ define('pgadmin.node.mview', [
|
||||
dataType: "json",
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success('View refreshed successfully');
|
||||
alertify.success('View refreshed successfully');
|
||||
}
|
||||
else {
|
||||
alertify.alert(
|
||||
|
@ -1,11 +1,9 @@
|
||||
define('pgadmin.node.database', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser.utils', 'alertify',
|
||||
'sources/alerts/alertify_wrapper',
|
||||
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser.utils', 'pgadmin.alertifyjs',
|
||||
'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
|
||||
'pgadmin.browser.server.variable',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, AlertifyWrapper) {
|
||||
'pgadmin.browser.server.variable'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-database']) {
|
||||
var databases = pgBrowser.Nodes['coll-database'] =
|
||||
@ -192,9 +190,8 @@ define('pgadmin.node.database', [
|
||||
type:'DELETE',
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var prv_i = t.parent(i),
|
||||
alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
var prv_i = t.parent(i);
|
||||
Alertify.success(res.info);
|
||||
t.removeIcon(i);
|
||||
data.connected = false;
|
||||
data.icon = 'icon-database-not-connected';
|
||||
@ -208,8 +205,7 @@ define('pgadmin.node.database', [
|
||||
}
|
||||
else {
|
||||
try {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(res.errormsg);
|
||||
Alertify.error(res.errormsg);
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
}
|
||||
@ -218,8 +214,7 @@ define('pgadmin.node.database', [
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
Alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -516,8 +511,7 @@ define('pgadmin.node.database', [
|
||||
tree.addIcon(item, {icon: data.icon});
|
||||
}
|
||||
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
Alertify.success(res.info);
|
||||
obj.trigger('connected', obj, item, data);
|
||||
pgBrowser.Events.trigger(
|
||||
'pgadmin:database:connected', item, data
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
define('pgadmin.node.server', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify',
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.server.supported_servers',
|
||||
'pgadmin.user_management.current_user',
|
||||
'sources/alerts/alertify_wrapper', 'pgadmin.browser.server.privilege'
|
||||
'pgadmin.alertifyjs', 'pgadmin.browser.server.privilege'
|
||||
], function(
|
||||
gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify,
|
||||
supported_servers, current_user, AlertifyWrapper
|
||||
gettext, url_for, $, _, S, pgAdmin, pgBrowser,
|
||||
supported_servers, current_user, alertify
|
||||
) {
|
||||
|
||||
if (!pgBrowser.Nodes['server']) {
|
||||
@ -189,8 +189,7 @@ define('pgadmin.node.server', [
|
||||
type:'DELETE',
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
d = t.itemData(i);
|
||||
t.removeIcon(i);
|
||||
d.connected = false;
|
||||
@ -209,8 +208,7 @@ define('pgadmin.node.server', [
|
||||
}
|
||||
else {
|
||||
try {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(res.errormsg);
|
||||
alertify.error(res.errormsg);
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
}
|
||||
@ -219,8 +217,7 @@ define('pgadmin.node.server', [
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -288,20 +285,17 @@ define('pgadmin.node.server', [
|
||||
method:'GET',
|
||||
success: function(res) {
|
||||
if (res.data.status) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.data.result);
|
||||
alertify.success(res.data.result);
|
||||
}
|
||||
else {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(res.data.result);
|
||||
alertify.error(res.data.result);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -336,15 +330,13 @@ define('pgadmin.node.server', [
|
||||
method:'POST',
|
||||
data:{ 'value': JSON.stringify(value) },
|
||||
success: function(res) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.data.result, 10);
|
||||
alertify.success(res.data.result, 10);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg, 10);
|
||||
alertify.error(err.errormsg, 10);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -352,8 +344,7 @@ define('pgadmin.node.server', [
|
||||
});
|
||||
} else {
|
||||
evt.cancel = true;
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error( gettext('Please enter a valid name.'), 10);
|
||||
alertify.error( gettext('Please enter a valid name.'), 10);
|
||||
}
|
||||
},
|
||||
// We will execute this function when user clicks on the Cancel button
|
||||
@ -494,20 +485,18 @@ define('pgadmin.node.server', [
|
||||
method:'POST',
|
||||
data:{'data': JSON.stringify(args) },
|
||||
success: function(res) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
if (res.success) {
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
self.close();
|
||||
} else {
|
||||
alertifyWrapper.error(res.errormsg);
|
||||
alertify.error(res.errormsg);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
@ -540,8 +529,7 @@ define('pgadmin.node.server', [
|
||||
dataType: "json",
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.itemData(i).wal_pause=res.data.wal_pause;
|
||||
t.unload(i);
|
||||
t.setInode(i);
|
||||
@ -557,8 +545,7 @@ define('pgadmin.node.server', [
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
msg = S(err.errormsg).value();
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -584,8 +571,7 @@ define('pgadmin.node.server', [
|
||||
dataType: "json",
|
||||
success: function(res) {
|
||||
if (res.success == 1) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
t.itemData(i).wal_pause=res.data.wal_pause;
|
||||
t.unload(i);
|
||||
t.setInode(i);
|
||||
@ -601,8 +587,7 @@ define('pgadmin.node.server', [
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
msg = S(err.errormsg).value();
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
t.unload(i);
|
||||
@ -908,8 +893,7 @@ define('pgadmin.node.server', [
|
||||
pgBrowser.serverInfo || {};
|
||||
serverInfo[data._id] = _.extend({}, data);
|
||||
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
obj.trigger('connected', obj, item, data);
|
||||
|
||||
// Generate the event that server is connected
|
||||
|
@ -1,11 +1,9 @@
|
||||
define('pgadmin.node.tablespace', [
|
||||
'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.browser.collection', 'pgadmin.browser.node.ui',
|
||||
'pgadmin.browser.server.privilege'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, AlertifyWrapper) {
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-tablespace']) {
|
||||
var databases = pgBrowser.Nodes['coll-tablespace'] =
|
||||
@ -280,20 +278,17 @@ define('pgadmin.node.tablespace', [
|
||||
data:{'data': JSON.stringify(args) },
|
||||
success: function(res) {
|
||||
if (res.success) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info);
|
||||
alertify.success(res.info);
|
||||
self.close();
|
||||
} else {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(res.errormsg);
|
||||
alertify.error(res.errormsg);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
define(
|
||||
'pgadmin.browser', [
|
||||
'sources/gettext', 'sources/url_for', 'require', 'jquery', 'underscore', 'underscore.string',
|
||||
'bootstrap', 'pgadmin', 'alertify', 'bundled_codemirror',
|
||||
'bootstrap', 'pgadmin', 'pgadmin.alertifyjs', 'bundled_codemirror',
|
||||
'sources/check_node_visibility', 'pgadmin.browser.utils', 'wcdocker',
|
||||
'jquery.contextmenu', 'jquery.aciplugin', 'jquery.acitree',
|
||||
'pgadmin.alertifyjs', 'pgadmin.browser.messages',
|
||||
'pgadmin.browser.messages',
|
||||
'pgadmin.browser.menu', 'pgadmin.browser.panel',
|
||||
'pgadmin.browser.error', 'pgadmin.browser.frame',
|
||||
'pgadmin.browser.node', 'pgadmin.browser.collection'
|
||||
@ -1846,8 +1846,7 @@ define(
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
Alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
fetchNodeInfo(_callback);
|
||||
|
@ -1,8 +1,8 @@
|
||||
define(
|
||||
'pgadmin.browser.node', [
|
||||
'sources/gettext', 'jquery', 'underscore', 'underscore.string', 'pgadmin',
|
||||
'pgadmin.browser.menu', 'backbone', 'alertify', 'pgadmin.browser.datamodel',
|
||||
'backform', 'pgadmin.browser.utils', 'pgadmin.backform', 'pgadmin.alertifyjs'
|
||||
'pgadmin.browser.menu', 'backbone', 'pgadmin.alertifyjs', 'pgadmin.browser.datamodel',
|
||||
'backform', 'pgadmin.browser.utils', 'pgadmin.backform'
|
||||
], function(gettext, $, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
|
||||
|
||||
var wcDocker = window.wcDocker,
|
||||
@ -626,8 +626,7 @@ define(
|
||||
|
||||
if (!(_.isFunction(obj.canDropCascade) ?
|
||||
obj.canDropCascade.apply(obj, [d, i]) : obj.canDropCascade)) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(
|
||||
Alertify.error(
|
||||
S('The %s "%s" cannot be dropped!')
|
||||
.sprintf(obj.label, d.label).value(),
|
||||
10
|
||||
@ -641,8 +640,7 @@ define(
|
||||
|
||||
if (!(_.isFunction(obj.canDrop) ?
|
||||
obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(
|
||||
Alertify.error(
|
||||
S('The %s "%s" cannot be dropped!')
|
||||
.sprintf(obj.label, d.label).value(),
|
||||
10
|
||||
|
@ -1,11 +1,11 @@
|
||||
define('pgadmin.dashboard', [
|
||||
'sources/url_for', 'sources/gettext', 'require', 'jquery', 'underscore',
|
||||
'pgadmin', 'backbone', 'backgrid', 'flotr2', 'alertify',
|
||||
'sources/alerts/alertify_wrapper', 'backgrid.filter',
|
||||
'pgadmin', 'backbone', 'backgrid', 'flotr2',
|
||||
'pgadmin.alertifyjs', 'backgrid.filter',
|
||||
'pgadmin.browser', 'bootstrap', 'wcdocker'
|
||||
],
|
||||
function(url_for, gettext, r, $, _, pgAdmin, Backbone, Backgrid, Flotr,
|
||||
alertify, AlertifyWrapper) {
|
||||
alertify) {
|
||||
|
||||
var wcDocker = window.wcDocker,
|
||||
pgBrowser = pgAdmin.Browser;
|
||||
@ -64,20 +64,18 @@ function(url_for, gettext, r, $, _, pgAdmin, Backbone, Backgrid, Flotr,
|
||||
url: cancel_query_url + self.model.get('pid'),
|
||||
type:'DELETE',
|
||||
success: function(res) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
if (res == gettext('Success')) {
|
||||
alertifyWrapper.success(gettext('Active query cancelled successfully.'));
|
||||
alertify.success(gettext('Active query cancelled successfully.'));
|
||||
refresh_grid();
|
||||
} else {
|
||||
alertifyWrapper.error(gettext('An error occurred whilst cancelling the active query.'));
|
||||
alertify.error(gettext('An error occurred whilst cancelling the active query.'));
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
if (err.success == 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err.errormsg);
|
||||
alertify.error(err.errormsg);
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
@ -1073,7 +1071,6 @@ function(url_for, gettext, r, $, _, pgAdmin, Backbone, Backgrid, Flotr,
|
||||
// If there is only one active session means it probably our main
|
||||
// connection session
|
||||
var active_sessions = m.collection.where({'state': 'active'}),
|
||||
alertifyWrapper = new AlertifyWrapper(),
|
||||
pg_version = this.get('postgres_version') || null;
|
||||
|
||||
// With PG10, We have background process showing on dashboard
|
||||
@ -1082,20 +1079,20 @@ function(url_for, gettext, r, $, _, pgAdmin, Backbone, Backgrid, Flotr,
|
||||
|
||||
// Background processes do not have database field populated
|
||||
if (pg_version && pg_version >= 100000 && !m.get('datname')) {
|
||||
alertifyWrapper.info(
|
||||
alertify.info(
|
||||
gettext('You cannot cancel background worker processes.')
|
||||
);
|
||||
return false;
|
||||
// If it is the last active connection on maintenance db then error out
|
||||
} else if (maintenance_database == m.get('datname') &&
|
||||
m.get('state') == 'active' && active_sessions.length == 1) {
|
||||
alertifyWrapper.error(
|
||||
alertify.error(
|
||||
gettext('You are not allowed to cancel the main active session.')
|
||||
);
|
||||
return false;
|
||||
} else if(m.get('state') == 'idle') {
|
||||
// If this session is already idle then do nothing
|
||||
alertifyWrapper.info(
|
||||
alertify.info(
|
||||
gettext('The session is already in idle state.')
|
||||
);
|
||||
return false;
|
||||
@ -1107,8 +1104,7 @@ function(url_for, gettext, r, $, _, pgAdmin, Backbone, Backgrid, Flotr,
|
||||
return true;
|
||||
} else {
|
||||
// Do not allow to cancel someone else session to non-super user
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(
|
||||
alertify.error(
|
||||
gettext('Superuser privileges are required to cancel another users query.')
|
||||
);
|
||||
return false;
|
||||
|
@ -1,7 +1,7 @@
|
||||
define('misc.file_manager', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'alertify',
|
||||
'sources/alerts/alertify_wrapper'
|
||||
], function(gettext, url_for, $, _, alertify, AlertifyWrapper) {
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'pgadmin.alertifyjs'
|
||||
], function(gettext, url_for, $, _, alertify) {
|
||||
pgAdmin = pgAdmin || window.pgAdmin || {};
|
||||
|
||||
/*
|
||||
@ -595,14 +595,12 @@ define('misc.file_manager', [
|
||||
permission = true;
|
||||
} else {
|
||||
$('.file_manager_ok').addClass('disabled');
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(data.Error);
|
||||
alertify.error(data.Error);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
$('.file_manager_ok').addClass('disabled');
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error( gettext('Error occurred while checking access permission.'));
|
||||
alertify.error( gettext('Error occurred while checking access permission.'));
|
||||
}
|
||||
});
|
||||
return permission;
|
||||
|
@ -11,10 +11,10 @@
|
||||
import loading_icon from 'acitree/image/load-root.gif';
|
||||
|
||||
define(['jquery', 'underscore', 'underscore.string',
|
||||
'sources/alerts/alertify_wrapper', 'sources/gettext',
|
||||
'pgadmin.alertifyjs', 'sources/gettext',
|
||||
'sources/url_for', 'dropzone'
|
||||
],
|
||||
function($, _, S, AlertifyWrapper, gettext, url_for, Dropzone) {
|
||||
function($, _, S, alertify, gettext, url_for, Dropzone) {
|
||||
|
||||
/*---------------------------------------------------------
|
||||
Define functions used for various operations
|
||||
@ -311,11 +311,9 @@ var renameItem = function(data) {
|
||||
// UnBind toolbar functions.
|
||||
$('.fileinfo').find('button.rename, button.delete, button.download').unbind();
|
||||
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(lg.successful_rename);
|
||||
alertify.success(lg.successful_rename);
|
||||
} else {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(result.Error);
|
||||
alertify.error(result.Error);
|
||||
}
|
||||
|
||||
finalName = result['New Name'];
|
||||
@ -356,16 +354,14 @@ var deleteItem = function(data) {
|
||||
if (result.Code === 1) {
|
||||
isDeleted = true;
|
||||
if (isDeleted) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(lg.successful_delete);
|
||||
alertify.success(lg.successful_delete);
|
||||
var rootpath = result.Path.substring(0, result.Path.length-1); // removing the last slash
|
||||
rootpath = rootpath.substr(0, rootpath.lastIndexOf('/') + 1);
|
||||
getFolderInfo(rootpath);
|
||||
}
|
||||
} else {
|
||||
isDeleted = false;
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(result.Error);
|
||||
alertify.error(result.Error);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -438,8 +434,7 @@ var getFileInfo = function(file) {
|
||||
}
|
||||
} else {
|
||||
$('.file_manager_ok').addClass('disabled');
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(data.Error);
|
||||
alertify.error(data.Error);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -466,14 +461,12 @@ var checkPermission = function(path) {
|
||||
permission = true;
|
||||
} else {
|
||||
$('.file_manager_ok').addClass('disabled');
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(data.Error);
|
||||
alertify.error(data.Error);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
$('.file_manager_ok').addClass('disabled');
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error( gettext('Error occurred while checking access permission.'));
|
||||
alertify.error( gettext('Error occurred while checking access permission.'));
|
||||
}
|
||||
});
|
||||
return permission;
|
||||
@ -549,8 +542,7 @@ var getFolderInfo = function(path, file_type) {
|
||||
// hide activity indicator
|
||||
$('.fileinfo').find('span.activity').hide();
|
||||
if (data.Code === 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(data.Error);
|
||||
alertify.error(data.Error);
|
||||
return;
|
||||
}
|
||||
// generate HTML for files/folder and render into container
|
||||
@ -1452,21 +1444,18 @@ pgAdmin.FileUtils = {
|
||||
$this.find(".dz-upload").addClass("success");
|
||||
}, 1000);
|
||||
$this.find(".dz-upload").css('width', "100%").html("100%");
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(lg.upload_success);
|
||||
alertify.success(lg.upload_success);
|
||||
} else {
|
||||
$this.find(".dz-upload").addClass("error");
|
||||
$this.find(".dz-upload").css('width', "0%").html("0%");
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(data.Error);
|
||||
alertify.error(data.Error);
|
||||
}
|
||||
getFolderInfo(path);
|
||||
},
|
||||
totaluploadprogress: function(progress) {},
|
||||
complete: function(file) {
|
||||
if (file.status == "error") {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(lg.upload_error);
|
||||
alertify.error(lg.upload_error);
|
||||
}
|
||||
$('.upload_file .dz_cross_btn').removeAttr('disabled');
|
||||
getFolderInfo(path);
|
||||
|
@ -1,11 +1,10 @@
|
||||
require(
|
||||
define(
|
||||
['sources/gettext', 'alertify', 'underscore.string'],
|
||||
function(gettext, alertify, S) {
|
||||
alertify.defaults.transition = "zoom";
|
||||
alertify.defaults.theme.ok = "btn btn-primary";
|
||||
alertify.defaults.theme.cancel = "btn btn-danger";
|
||||
alertify.defaults.theme.input = "form-control";
|
||||
|
||||
alertify.pgIframeDialog || alertify.dialog('pgIframeDialog', function() {
|
||||
var iframe;
|
||||
return {
|
||||
@ -84,7 +83,6 @@ function(gettext, alertify, S) {
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
alertify.pgNotifier = function(type, xhr, promptmsg, onJSONResult) {
|
||||
var msg = xhr.responseText,
|
||||
contentType = xhr.getResponseHeader('Content-Type');
|
||||
@ -309,4 +307,56 @@ function(gettext, alertify, S) {
|
||||
return false;
|
||||
};
|
||||
|
||||
var alertifySuccess = alertify.success,
|
||||
alertifyError = alertify.error;
|
||||
|
||||
/*
|
||||
For adding the jasmine test cases, we needed to refer the original success,
|
||||
and error functions, as orig_success and orig_error respectively.
|
||||
*/
|
||||
_.extend(alertify, {
|
||||
orig_success: alertifySuccess, orig_error: alertifyError
|
||||
});
|
||||
|
||||
_.extend(alertify, {
|
||||
success: function (message, timeout, callback) {
|
||||
var alertMessage = '\
|
||||
<div class="media font-green-3 text-14">\
|
||||
<div class="media-body media-middle">\
|
||||
<div class="alert-icon success-icon">\
|
||||
<i class="fa fa-check" aria-hidden="true"></i>\
|
||||
</div>\
|
||||
<div class="alert-text">' + message + '</div>\
|
||||
</div>\
|
||||
</div>';
|
||||
return alertify.orig_success(alertMessage, timeout, callback);
|
||||
},
|
||||
error: function(message, timeout, callback) {
|
||||
var alertMessage = '\
|
||||
<div class="media font-red-3 text-14">\
|
||||
<div class="media-body media-middle">\
|
||||
<div class="alert-icon error-icon">\
|
||||
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>\
|
||||
</div>\
|
||||
<div class="alert-text">' + message + '</div>\
|
||||
</div>\
|
||||
</div>';
|
||||
return alertify.orig_error(alertMessage, timeout, callback);
|
||||
},
|
||||
info: function(message, timeout) {
|
||||
var alertMessage = '\
|
||||
<div class="media alert-info font-blue text-14">\
|
||||
<div class="media-body media-middle">\
|
||||
<div class="alert-icon info-icon">\
|
||||
<i class="fa fa-info" aria-hidden="true"></i>\
|
||||
</div>\
|
||||
<div class="alert-text">' + message + '</div>\
|
||||
</div>\
|
||||
</div>';
|
||||
var alert = alertify.notify(alertMessage, timeout);
|
||||
return alert;
|
||||
}
|
||||
});
|
||||
|
||||
return alertify;
|
||||
});
|
||||
|
@ -1,55 +0,0 @@
|
||||
define([
|
||||
'jquery',
|
||||
'alertify',
|
||||
], function ($, alertify) {
|
||||
var AlertifyWrapper = function () {
|
||||
var success = function (message, timeout) {
|
||||
var alertMessage = '\
|
||||
<div class="media font-green-3 text-14">\
|
||||
<div class="media-body media-middle">\
|
||||
<div class="alert-icon success-icon">\
|
||||
<i class="fa fa-check" aria-hidden="true"></i>\
|
||||
</div>\
|
||||
<div class="alert-text">' + message + '</div>\
|
||||
</div>\
|
||||
</div>';
|
||||
var alert = alertify.success(alertMessage, timeout);
|
||||
return alert;
|
||||
};
|
||||
|
||||
var error = function(message, timeout) {
|
||||
var alertMessage = '\
|
||||
<div class="media font-red-3 text-14">\
|
||||
<div class="media-body media-middle">\
|
||||
<div class="alert-icon error-icon">\
|
||||
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>\
|
||||
</div>\
|
||||
<div class="alert-text">' + message + '</div>\
|
||||
</div>\
|
||||
</div>';
|
||||
var alert = alertify.error(alertMessage, timeout);
|
||||
return alert;
|
||||
};
|
||||
|
||||
var info = function(message, timeout) {
|
||||
var alertMessage = '\
|
||||
<div class="media alert-info font-blue text-14">\
|
||||
<div class="media-body media-middle">\
|
||||
<div class="alert-icon info-icon">\
|
||||
<i class="fa fa-info" aria-hidden="true"></i>\
|
||||
</div>\
|
||||
<div class="alert-text">' + message + '</div>\
|
||||
</div>\
|
||||
</div>';
|
||||
var alert = alertify.notify(alertMessage, timeout);
|
||||
return alert;
|
||||
};
|
||||
|
||||
$.extend(this, {
|
||||
'success': success,
|
||||
'error': error,
|
||||
'info': info,
|
||||
});
|
||||
};
|
||||
return AlertifyWrapper;
|
||||
});
|
@ -1,9 +1,8 @@
|
||||
// Backup dialog
|
||||
define([
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'alertify',
|
||||
'pgadmin.browser', 'backbone', 'backgrid', 'backform', 'pgadmin.browser.node',
|
||||
'sources/alerts/alertify_wrapper'
|
||||
], function(gettext, url_for, $, _, S, alertify, pgBrowser, Backbone, Backgrid, Backform, pgNode, AlertifyWrapper) {
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin.alertifyjs',
|
||||
'pgadmin.browser', 'backbone', 'backgrid', 'backform', 'pgadmin.browser.node'
|
||||
], function(gettext, url_for, $, _, S, alertify, pgBrowser, Backbone, Backgrid, Backform, pgNode) {
|
||||
|
||||
// if module is already initialized, refer to that.
|
||||
if (pgBrowser.Backup) {
|
||||
@ -556,8 +555,7 @@ TODO LIST FOR BACKUP:
|
||||
data:{ 'data': JSON.stringify(args) },
|
||||
success: function(res) {
|
||||
if (res.success) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(gettext('Backup job created.'), 5);
|
||||
alertify.success(gettext('Backup job created.'), 5);
|
||||
pgBrowser.Events.trigger('pgadmin-bgprocess:created', self);
|
||||
} else {
|
||||
console.log(res);
|
||||
@ -785,8 +783,7 @@ TODO LIST FOR BACKUP:
|
||||
data:{ 'data': JSON.stringify(args) },
|
||||
success: function(res) {
|
||||
if (res.success) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(gettext('Backup job created.'), 5);
|
||||
alertify.success(gettext('Backup job created.'), 5);
|
||||
pgBrowser.Events.trigger('pgadmin-bgprocess:created', self);
|
||||
}
|
||||
},
|
||||
|
@ -1,15 +1,12 @@
|
||||
define([
|
||||
'sources/gettext', 'sources/url_for' ,'jquery', 'underscore', 'underscore.string', 'alertify',
|
||||
'sources/gettext', 'sources/url_for' ,'jquery', 'underscore', 'underscore.string', 'pgadmin.alertifyjs',
|
||||
'pgadmin','pgadmin.browser', 'backbone', 'backgrid', 'sources/../bundle/codemirror', 'backform',
|
||||
'pgadmin.tools.debugger.ui',
|
||||
'sources/alerts/alertify_wrapper',
|
||||
|
||||
'wcdocker', 'pgadmin.backform',
|
||||
'pgadmin.backgrid'
|
||||
|
||||
], function(
|
||||
gettext, url_for, $, _, S, Alertify, pgAdmin, pgBrowser, Backbone, Backgrid,
|
||||
codemirror, Backform, debug_function_again, AlertifyWrapper
|
||||
codemirror, Backform, debug_function_again
|
||||
) {
|
||||
|
||||
var CodeMirror = codemirror.default;
|
||||
@ -481,8 +478,7 @@ define([
|
||||
pgTools.DirectDebug.polling_timeout_idle = true;
|
||||
|
||||
//Set the alertify message to inform the user that execution is completed.
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info, 3);
|
||||
Alertify.success(res.info, 3);
|
||||
|
||||
// Update the message tab of the debugger
|
||||
if (res.data.status_message) {
|
||||
@ -513,8 +509,7 @@ define([
|
||||
pgTools.DirectDebug.polling_timeout_idle = true;
|
||||
|
||||
//Set the alertify message to inform the user that execution is completed.
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info, 3);
|
||||
Alertify.success(res.info, 3);
|
||||
|
||||
// Update the message tab of the debugger
|
||||
if (res.data.status_message) {
|
||||
@ -556,11 +551,9 @@ define([
|
||||
pgTools.DirectDebug.direct_execution_completed = true;
|
||||
pgTools.DirectDebug.editor.removeLineClass(self.active_line_no, 'wrap', 'CodeMirror-activeline-background');
|
||||
|
||||
//Set the alertify message to inform the user that execution is completed with error.
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
|
||||
//Set the Alertify message to inform the user that execution is completed with error.
|
||||
if(!pgTools.DirectDebug.is_user_aborted_debugging) {
|
||||
alertifyWrapper.error(res.info, 3);
|
||||
Alertify.error(res.info, 3);
|
||||
}
|
||||
|
||||
// Update the message tab of the debugger
|
||||
@ -825,10 +818,9 @@ define([
|
||||
// We will give same behaviour as pgAdmin3 and disable all buttons
|
||||
self.enable('continue', false);
|
||||
|
||||
// Set the alertify message to inform the user that execution
|
||||
// Set the Alertify message to inform the user that execution
|
||||
// is completed.
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.info, 3);
|
||||
Alertify.success(res.info, 3);
|
||||
}
|
||||
else if (res.data.status === 'NotConnected') {
|
||||
Alertify.alert(
|
||||
@ -1221,11 +1213,10 @@ define([
|
||||
// Get the updated variables value
|
||||
self.GetLocalVariables(pgTools.DirectDebug.trans_id);
|
||||
// Show the message to the user that deposit value is success or failure
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
if (res.data.result) {
|
||||
alertifyWrapper.success(res.data.info, 3);
|
||||
Alertify.success(res.data.info, 3);
|
||||
} else {
|
||||
alertifyWrapper.error(res.data.info, 3);
|
||||
Alertify.error(res.data.info, 3);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1,11 +1,9 @@
|
||||
define([
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'alertify',
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin.alertifyjs',
|
||||
'pgadmin', 'pgadmin.browser', 'backbone', 'backgrid', 'backform',
|
||||
'sources/alerts/alertify_wrapper',
|
||||
|
||||
'pgadmin.backform', 'pgadmin.backgrid', 'pgadmin.browser.node.ui'
|
||||
], function(
|
||||
gettext, url_for, $, _, S, Alertify, pgAdmin, pgBrowser, Backbone, Backgrid, Backform, AlertifyWrapper
|
||||
gettext, url_for, $, _, S, Alertify, pgAdmin, pgBrowser, Backbone, Backgrid, Backform
|
||||
) {
|
||||
|
||||
pgAdmin = pgAdmin || window.pgAdmin || {};
|
||||
@ -420,8 +418,7 @@ define([
|
||||
data:{ 'data': JSON.stringify(this.view.model.toJSON()) },
|
||||
success: function(res) {
|
||||
if (res.success) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(gettext('Import/export job created.'), 5);
|
||||
Alertify.success(gettext('Import/export job created.'), 5);
|
||||
pgBrowser.Events.trigger('pgadmin-bgprocess:created', self);
|
||||
}
|
||||
},
|
||||
|
@ -1,14 +1,12 @@
|
||||
define([
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'alertify', 'pgadmin', 'pgadmin.browser', 'backbone',
|
||||
'underscore.string', 'pgadmin.alertifyjs', 'pgadmin', 'pgadmin.browser', 'backbone',
|
||||
'backgrid', 'backform',
|
||||
'sources/alerts/alertify_wrapper',
|
||||
|
||||
'pgadmin.backform', 'pgadmin.backgrid',
|
||||
'pgadmin.browser.node.ui'
|
||||
], function(
|
||||
gettext, url_for, $, _, S, Alertify, pgAdmin, pgBrowser, Backbone, Backgrid,
|
||||
Backform, AlertifyWrapper
|
||||
Backform
|
||||
) {
|
||||
|
||||
pgAdmin = pgAdmin || window.pgAdmin || {};
|
||||
@ -353,13 +351,11 @@ define([
|
||||
success: function(res) {
|
||||
if (res.data && res.data.status) {
|
||||
//Do nothing as we are creating the job and exiting from the main dialog
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(res.data.info);
|
||||
Alertify.success(res.data.info);
|
||||
pgBrowser.Events.trigger('pgadmin-bgprocess:created', self);
|
||||
}
|
||||
else {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(res.data.errmsg);
|
||||
Alertify.error(res.data.errmsg);
|
||||
}
|
||||
},
|
||||
error: function(e) {
|
||||
|
@ -1,12 +1,11 @@
|
||||
// Restore dialog
|
||||
define('tools.restore', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'alertify', 'pgadmin.browser', 'backbone', 'backgrid',
|
||||
'backform', 'pgadmin.browser.node',
|
||||
'sources/alerts/alertify_wrapper',
|
||||
'underscore.string', 'pgadmin.alertifyjs', 'pgadmin.browser', 'backbone', 'backgrid',
|
||||
'backform', 'pgadmin.browser.node'
|
||||
], function(
|
||||
gettext, url_for, $, _, S, alertify, pgBrowser, Backbone, Backgrid, Backform,
|
||||
pgNode, AlertifyWrapper
|
||||
pgNode
|
||||
) {
|
||||
|
||||
// if module is already initialized, refer to that.
|
||||
@ -531,8 +530,7 @@ define('tools.restore', [
|
||||
data:{ 'data': JSON.stringify(args) },
|
||||
success: function(res) {
|
||||
if (res.success) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(
|
||||
alertify.success(
|
||||
gettext('Restore job created.'), 5
|
||||
);
|
||||
pgBrowser.Events.trigger('pgadmin-bgprocess:created', self);
|
||||
|
@ -1,6 +1,6 @@
|
||||
define('tools.querytool', [
|
||||
'babel-polyfill', 'sources/gettext','sources/url_for', 'jquery',
|
||||
'underscore', 'underscore.string', 'alertify',
|
||||
'underscore', 'underscore.string', 'pgadmin.alertifyjs',
|
||||
'pgadmin', 'backbone', 'sources/../bundle/codemirror',
|
||||
'pgadmin.misc.explain',
|
||||
'sources/selection/grid_selector',
|
||||
@ -15,7 +15,6 @@ define('tools.querytool', [
|
||||
'sources/history/index.js',
|
||||
'sources/../jsx/history/query_history',
|
||||
'react', 'react-dom',
|
||||
'sources/alerts/alertify_wrapper',
|
||||
'sources/sqleditor/keyboard_shortcuts',
|
||||
'sources/../bundle/slickgrid',
|
||||
'pgadmin.file_manager',
|
||||
@ -26,7 +25,7 @@ define('tools.querytool', [
|
||||
], function(
|
||||
babelPollyfill, gettext, url_for, $, _, S, alertify, pgAdmin, Backbone, codemirror,
|
||||
pgExplain, GridSelector, ActiveCellCapture, clipboard, copyData, RangeSelectionHelper, handleQueryOutputKeyboardEvent,
|
||||
XCellSelectionModel, setStagedRows, SqlEditorUtils, HistoryBundle, queryHistory, React, ReactDOM, AlertifyWrapper,
|
||||
XCellSelectionModel, setStagedRows, SqlEditorUtils, HistoryBundle, queryHistory, React, ReactDOM,
|
||||
keyboardShortcuts
|
||||
) {
|
||||
/* Return back, this has been called more than once */
|
||||
@ -1734,8 +1733,7 @@ define('tools.querytool', [
|
||||
self.update_msg_history(true, res.result, false);
|
||||
// Display the notifier if the timeout is set to >= 0
|
||||
if (self.info_notifier_timeout >= 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(msg, self.info_notifier_timeout);
|
||||
alertify.success(msg, self.info_notifier_timeout);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1886,8 +1884,7 @@ define('tools.querytool', [
|
||||
|
||||
// Display the notifier if the timeout is set to >= 0
|
||||
if (self.info_notifier_timeout >= 0) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(msg1 + ' ' + msg2, self.info_notifier_timeout);
|
||||
alertify.success(msg1 + ' ' + msg2, self.info_notifier_timeout);
|
||||
}
|
||||
|
||||
var _msg = msg1 + '\n' + msg2;
|
||||
@ -2205,8 +2202,7 @@ define('tools.querytool', [
|
||||
} else {
|
||||
$("#btn-save").prop('disabled', true);
|
||||
}
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(gettext("Row(s) deleted"));
|
||||
alertify.success(gettext("Row(s) deleted"));
|
||||
} else {
|
||||
// There are other data to needs to be updated on server
|
||||
if(is_updated) {
|
||||
@ -2357,8 +2353,7 @@ define('tools.querytool', [
|
||||
$("#btn-flash").prop('disabled', false);
|
||||
$('.sql-editor-message').text(res.data.result);
|
||||
var err_msg = S(gettext("%s.")).sprintf(res.data.result).value();
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(err_msg, 20);
|
||||
alertify.error(err_msg, 20);
|
||||
grid.setSelectedRows([]);
|
||||
// To highlight the row at fault
|
||||
if(_.has(res.data, '_rowid') &&
|
||||
@ -2393,8 +2388,7 @@ define('tools.querytool', [
|
||||
self.trigger('pgadmin-sqleditor:loading-icon:hide');
|
||||
|
||||
grid.invalidate();
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(gettext("Data saved successfully."));
|
||||
alertify.success(gettext("Data saved successfully."));
|
||||
if (self.close_on_save) {
|
||||
self.close();
|
||||
}
|
||||
@ -2549,8 +2543,7 @@ define('tools.querytool', [
|
||||
},
|
||||
error: function(e) {
|
||||
var errmsg = $.parseJSON(e.responseText).errormsg;
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(errmsg);
|
||||
alertify.error(errmsg);
|
||||
self.trigger('pgadmin-sqleditor:loading-icon:hide');
|
||||
// hide cursor
|
||||
$busy_icon_div.removeClass('show_progress');
|
||||
@ -2578,8 +2571,7 @@ define('tools.querytool', [
|
||||
data: JSON.stringify(data),
|
||||
success: function(res) {
|
||||
if (res.data.status) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(gettext("File saved successfully."));
|
||||
alertify.success(gettext("File saved successfully."));
|
||||
self.gridView.current_file = e;
|
||||
self.setTitle(self.gridView.current_file.replace(/^.*[\\\/]/g, ''));
|
||||
// disable save button on file save
|
||||
@ -2600,8 +2592,7 @@ define('tools.querytool', [
|
||||
var errmsg = $.parseJSON(e.responseText).errormsg;
|
||||
setTimeout(
|
||||
function() {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(errmsg);
|
||||
alertify.error(errmsg);
|
||||
}, 10
|
||||
);
|
||||
},
|
||||
|
@ -1,11 +1,11 @@
|
||||
define([
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'alertify',
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin.alertifyjs',
|
||||
'pgadmin.browser', 'backbone', 'backgrid', 'backform', 'pgadmin.browser.node',
|
||||
'sources/alerts/alertify_wrapper', 'pgadmin.user_management.current_user',
|
||||
'pgadmin.user_management.current_user',
|
||||
'backgrid.select.all', 'backgrid.filter'
|
||||
], function(
|
||||
gettext, url_for, $, _, S, alertify, pgBrowser, Backbone, Backgrid, Backform,
|
||||
pgNode, AlertifyWrapper, userInfo
|
||||
pgNode, userInfo
|
||||
) {
|
||||
|
||||
// if module is already initialized, refer to that.
|
||||
@ -310,12 +310,10 @@ define([
|
||||
self.model.destroy({
|
||||
wait: true,
|
||||
success: function(res) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(gettext('User deleted.'));
|
||||
alertify.success(gettext('User deleted.'));
|
||||
},
|
||||
error: function(m, jqxhr) {
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(gettext('Error during deleting user.'));
|
||||
alertify.error(gettext('Error during deleting user.'));
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -492,15 +490,13 @@ define([
|
||||
'confirmPassword':undefined});
|
||||
|
||||
m.startNewSession();
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.success(S(gettext("User '%s' saved.")).sprintf(
|
||||
alertify.success(S(gettext("User '%s' saved.")).sprintf(
|
||||
m.get('email')
|
||||
).value());
|
||||
},
|
||||
error: function(res, jqxhr) {
|
||||
m.startNewSession();
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
alertifyWrapper.error(
|
||||
alertify.error(
|
||||
S(gettext("Error saving user: '%s'")).sprintf(
|
||||
jqxhr.responseJSON.errormsg
|
||||
).value()
|
||||
|
@ -6,19 +6,16 @@
|
||||
// This software is released under the PostgreSQL Licence
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
import alertify from 'alertify';
|
||||
import AlertifyWrapper from 'sources/alerts/alertify_wrapper';
|
||||
import alertify from 'pgadmin.alertifyjs';
|
||||
|
||||
describe('alertify_wrapper', function () {
|
||||
describe('success', function () {
|
||||
it('calls the success function from alertify and adds the checkmark to the element', function () {
|
||||
spyOn(alertify, 'success');
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
spyOn(alertify, 'orig_success');
|
||||
|
||||
alertifyWrapper.success('Yay, congrats!', 1);
|
||||
alertify.success('Yay, congrats!', 1);
|
||||
|
||||
var calledWithMessage = alertify.success.calls.mostRecent().args[0];
|
||||
var calledWithMessage = alertify.orig_success.calls.mostRecent().args[0];
|
||||
|
||||
expect(calledWithMessage).toContain('Yay, congrats!');
|
||||
expect(calledWithMessage).toContain('class="fa fa-check"');
|
||||
@ -27,12 +24,11 @@ describe('alertify_wrapper', function () {
|
||||
|
||||
describe('error', function () {
|
||||
it('calls the error function from alertify and adds the warning symbol to the element', function () {
|
||||
spyOn(alertify, 'error');
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
spyOn(alertify, 'orig_error');
|
||||
|
||||
alertifyWrapper.error('bad, very bad', 1);
|
||||
alertify.error('bad, very bad', 1);
|
||||
|
||||
var calledWithMessage = alertify.error.calls.mostRecent().args[0];
|
||||
var calledWithMessage = alertify.orig_error.calls.mostRecent().args[0];
|
||||
|
||||
expect(calledWithMessage).toContain('bad, very bad');
|
||||
expect(calledWithMessage).toContain('class="fa fa-exclamation-triangle"');
|
||||
|
@ -271,7 +271,7 @@ var webpackShimConfig = {
|
||||
'pgadmin.browser.datamodel', 'pgadmin.browser.menu', 'pgadmin.browser.panel', 'pgadmin',
|
||||
'pgadmin.browser.frame', 'slick.pgadmin.editors', 'slick.pgadmin.formatters',
|
||||
'pgadmin.backform', 'pgadmin.backgrid', 'pgadmin.browser', 'pgadmin.file_manager',
|
||||
'pgadmin.file_utility', 'sources/alerts/alertify_wrapper', 'pgadmin.browser.node',
|
||||
'pgadmin.file_utility', 'pgadmin.browser.node',
|
||||
'pgadmin.alertifyjs', 'pgadmin.settings', 'pgadmin.preferences', 'pgadmin.sqlfoldcode',
|
||||
],
|
||||
// Checks whether JS module is npm module or not
|
||||
|
@ -69,6 +69,7 @@ module.exports = {
|
||||
'browser': path.resolve(__dirname, 'pgadmin/browser/static/js'),
|
||||
'pgadmin': sourcesDir + '/js/pgadmin',
|
||||
'pgadmin.sqlfoldcode': sourcesDir + '/js/codemirror/addon/fold/pgadmin-sqlfoldcode',
|
||||
'pgadmin.alertifyjs': sourcesDir + '/js/alertify.pgadmin.defaults',
|
||||
},
|
||||
},
|
||||
externals: {
|
||||
|
Loading…
Reference in New Issue
Block a user