mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-09 23:15:58 -06:00
Fixed an issue with the properties tab not getting updated if the user updates the selected node. #6158
This commit is contained in:
parent
39a0f46159
commit
625508e32a
@ -18,6 +18,7 @@ import { Search } from './quick_search/trigger_search';
|
||||
import { send_heartbeat, stop_heartbeat } from './heartbeat';
|
||||
import getApiInstance from '../../../static/js/api_instance';
|
||||
import { copyToClipboard } from '../../../static/js/clipboard';
|
||||
import { TAB_CHANGE } from './constants';
|
||||
|
||||
define('pgadmin.browser', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery',
|
||||
@ -64,7 +65,7 @@ define('pgadmin.browser', [
|
||||
if (d && obj.Nodes[d._type].callbacks['selected'] &&
|
||||
_.isFunction(obj.Nodes[d._type].callbacks['selected'])) {
|
||||
return obj.Nodes[d._type].callbacks['selected'].apply(
|
||||
obj.Nodes[d._type], [i, d, obj]);
|
||||
obj.Nodes[d._type], [i, d, obj, [], '', TAB_CHANGE]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
2
web/pgadmin/browser/static/js/constants.js
Normal file
2
web/pgadmin/browser/static/js/constants.js
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
export const TAB_CHANGE = 'TAB_CHANGE';
|
@ -11,6 +11,8 @@ import {getNodeView, removeNodeView} from './node_view';
|
||||
import Notify from '../../../static/js/helpers/Notifier';
|
||||
import _ from 'lodash';
|
||||
import getApiInstance from '../../../static/js/api_instance';
|
||||
import { removePanelView } from './panel_view';
|
||||
import { TAB_CHANGE } from './constants';
|
||||
|
||||
define('pgadmin.browser.node', [
|
||||
'sources/gettext', 'sources/pgadmin',
|
||||
@ -857,7 +859,7 @@ define('pgadmin.browser.node', [
|
||||
pgBrowser.Node.callbacks.change_server_background(item, data);
|
||||
},
|
||||
// Callback called - when a node is selected in browser tree.
|
||||
selected: function(item, data, browser) {
|
||||
selected: function(item, data, browser, _argsList, _event, actionSource) {
|
||||
// Show the information about the selected node in the below panels,
|
||||
// which are visible at this time:
|
||||
// + Properties
|
||||
@ -873,12 +875,24 @@ define('pgadmin.browser.node', [
|
||||
pgAdmin.Browser.enable_disable_menus.apply(b, [item]);
|
||||
|
||||
if (d && b) {
|
||||
|
||||
if ('properties' in b.panels &&
|
||||
b.panels['properties'] &&
|
||||
b.panels['properties'].panel &&
|
||||
b.panels['properties'].panel.isVisible()) {
|
||||
this.showProperties(item, d, b.panels['properties'].panel);
|
||||
b.panels['properties'].panel) {
|
||||
|
||||
if (actionSource != TAB_CHANGE) {
|
||||
const propertiesPanel = b.panels['properties'].panel.$container.find('.obj_properties').first();
|
||||
if (propertiesPanel) {
|
||||
removePanelView(propertiesPanel[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (b.panels['properties'].panel.isVisible()) {
|
||||
this.showProperties(item, d, b.panels['properties'].panel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pgBrowser.Events.trigger('pgadmin:browser:tree:update-tree-state',
|
||||
|
Loading…
Reference in New Issue
Block a user