Fixed an issue where the error is thrown while creating a new server using

Add New Server from the dashboard while tree item is not selected.

Fixes #7015
This commit is contained in:
Yogesh Mahajan 2021-11-28 13:32:30 +05:30 committed by Akshay Joshi
parent bef692d431
commit abe5303448
2 changed files with 5 additions and 4 deletions

View File

@ -28,3 +28,4 @@ Bug fixes
| `Issue #7005 <https://redmine.postgresql.org/issues/7005>`_ - Fixed an issue where On-demand rows throw an error when any row cell is edited and saved it then scroll to get more rows.
| `Issue #7006 <https://redmine.postgresql.org/issues/7006>`_ - Ensure that Python 3.10 and the latest eventlet dependency should not break the application.
| `Issue #7013 <https://redmine.postgresql.org/issues/7013>`_ - Fix an RPM build issue that could lead to a conflict with python3 at installation.
| `Issue #7015 <https://redmine.postgresql.org/issues/7015>`_ - Fixed an issue where the error is thrown while creating a new server using Add New Server from the dashboard while tree item is not selected.

View File

@ -394,9 +394,9 @@ define('pgadmin.dashboard', [
// Handler function to support the "Add Server" link
add_new_server: function() {
if (pgBrowser && pgBrowser.tree) {
var i = pgBrowser.tree.selected().length != 0 ?
pgBrowser.tree.selected() :
pgBrowser.tree.first(null, false),
var i = _.isUndefined(pgBrowser.tree.selected()) ?
pgBrowser.tree.first(null, false):
pgBrowser.tree.selected(),
serverModule = require('pgadmin.node.server'),
itemData = pgBrowser.tree.itemData(i);
@ -1141,7 +1141,7 @@ define('pgadmin.dashboard', [
this.chartsDomObj && this.chartsDomObj.unmount();
} else {
var t = pgBrowser.tree,
i = t.selected(),
i = t ? t.selected() : 0,
d = i && t.itemData(i);
this.chartsDomObj && this.chartsDomObj.setPageVisible(dashboardVisible);