Fixed issues introduce by SonarQube fixes.

This commit is contained in:
Akshay Joshi 2022-02-01 14:11:18 +05:30
parent 21359c6c74
commit aa5b1d50b9
6 changed files with 27 additions and 36 deletions

View File

@ -556,8 +556,6 @@ define('pgadmin.browser', [
'the original/corrupt file using a tool such as DB Browser for SQLite if desired.'+
'<br><br>Original file: ' + res.data + '<br>Replacement file: ' +
res.data.substring(0, res.data.length - 14),
function() { /*This is intentional (SonarQube)*/
}
);
}
}).fail(function(xhr, status, error) {

View File

@ -48,15 +48,13 @@ define(
text += '</div>';
Notify.alert(
_.unescape(title),
text
)
.set({'closable': true,
'onok': function() {
text,
function() {
if(callback) {
callback();
}
},
});
}
);
},
});

View File

@ -453,10 +453,7 @@ define([
);
}
} else {
Notify.alert(gettext('Edit object'), gettext('This object is not user editable.'),
function() {
return true;
});
Notify.alert(gettext('Edit object'), gettext('This object is not user editable.'));
}
},
render: function() {
@ -548,11 +545,7 @@ define([
}
);
} else {
Notify.alert(gettext('Delete object'), gettext('This object cannot be deleted.'),
function() {
return true;
}
);
Notify.alert(gettext('Delete object'), gettext('This object cannot be deleted.'));
}
},
exitEditMode: function() {

View File

@ -449,7 +449,7 @@ define([
);
}
})
.fail(self.raisePollingError());
.fail(self.raisePollingError);
}, poll_timeout);
},
@ -623,7 +623,7 @@ define([
pgTools.DirectDebug.is_polling_required = false;
}
})
.fail(self.raisePollingError());
.fail(self.raisePollingError);
}, poll_end_timeout);
},
@ -682,7 +682,7 @@ define([
self.poll_end_execution_result(trans_id);
}
})
.fail(self.raisePollingError());
.fail(self.raisePollingError);
}
})
.fail(function(xhr) {

View File

@ -116,10 +116,14 @@ export default class SchemaDiffUI {
raise_error_on_fail(alert_title, xhr) {
try {
if (_.isUndefined(xhr.responseText)) {
Notify.alert(alert_title, gettext('Unable to get the response text.'));
} else {
var err = JSON.parse(xhr.responseText);
Notify.alert(alert_title, err.errormsg);
}
} catch (e) {
Notify.alert(alert_title, e.statusText);
Notify.alert(alert_title, gettext(e.message));
}
}

View File

@ -2372,16 +2372,14 @@ define('tools.querytool', [
pgWindow.default.pgAdmin && pgWindow.default.pgAdmin.Browser
&& pgWindow.default.pgAdmin.Browser.preference_version() <= 0) {
Notify.alert()
.setting({
'title': gettext('Connection lost'),
'label':gettext('Close'),
'message': gettext('The pgAdmin browser window has been closed and the connection to the server is lost. Please close this window and open a new pgAdmin session.'),
'onok': function(){
Notify.alert(gettext('Connection lost'),
gettext('The pgAdmin browser window has been closed and the connection to the server is lost. Please close this window and open a new pgAdmin session.'),
function(){
//Close the window after connection is lost
window.close();
},
}).show();
gettext('Close')
);
}
};