Ensure that the 'Remove Server' option should be visible in the context menu. Fixes #5861

pull/35/head
Pradip Parkale 2020-09-24 10:58:30 +05:30 committed by Akshay Joshi
parent f8611416ec
commit c1d04747a1
2 changed files with 12 additions and 3 deletions

View File

@ -26,4 +26,5 @@ Bug fixes
| `Issue #5839 <https://redmine.postgresql.org/issues/5839>`_ - Ensure that multiple extensions can be dropped from the properties tab. | `Issue #5839 <https://redmine.postgresql.org/issues/5839>`_ - Ensure that multiple extensions can be dropped from the properties tab.
| `Issue #5841 <https://redmine.postgresql.org/issues/5841>`_ - Fixed an issue where the server is not able to connect using the service. | `Issue #5841 <https://redmine.postgresql.org/issues/5841>`_ - Fixed an issue where the server is not able to connect using the service.
| `Issue #5843 <https://redmine.postgresql.org/issues/5843>`_ - Fixed an issue where the 'PARALLEL UNSAFE' option is missing from reverse engineering SQL of function/procedure. | `Issue #5843 <https://redmine.postgresql.org/issues/5843>`_ - Fixed an issue where the 'PARALLEL UNSAFE' option is missing from reverse engineering SQL of function/procedure.
| `Issue #5845 <https://redmine.postgresql.org/issues/5845>`_ - Fixed an issue where the query tool is not fetching more than 1000 rows for the table does not have any primary key. | `Issue #5845 <https://redmine.postgresql.org/issues/5845>`_ - Fixed an issue where the query tool is not fetching more than 1000 rows for the table does not have any primary key.
| `Issue #5861 <https://redmine.postgresql.org/issues/5861>`_ - Ensure that the 'Remove Server' option should be visible in the context menu.

View File

@ -58,7 +58,7 @@ define('pgadmin.node.server', [
label: gettext('Server'), label: gettext('Server'),
canDrop: function(node){ canDrop: function(node){
var serverOwner = node.user_id; var serverOwner = node.user_id;
if (serverOwner != current_user.id) if (serverOwner != current_user.id && !_.isUndefined(serverOwner))
return false; return false;
return true; return true;
}, },
@ -763,6 +763,14 @@ define('pgadmin.node.server', [
}, },
{ {
id: 'server_owner', label: gettext('Shared Server Owner'), type: 'text', mode: ['properties'], id: 'server_owner', label: gettext('Shared Server Owner'), type: 'text', mode: ['properties'],
visible:function(model){
var serverOwner = model.attributes.user_id;
if (model.attributes.shared && serverOwner != current_user.id && pgAdmin.server_mode == 'True'){
return true;
}
return false;
},
}, },
{ {
id: 'server_type', label: gettext('Server type'), type: 'options', id: 'server_type', label: gettext('Server type'), type: 'options',
@ -1239,7 +1247,7 @@ define('pgadmin.node.server', [
// Let's not change the status of the tree node now. // Let's not change the status of the tree node now.
if (!_wasConnected) { if (!_wasConnected) {
tree.setInode(_item); tree.setInode(_item);
if (data.shared && pgAdmin.server_mode == 'True'){ if (_data.shared && pgAdmin.server_mode == 'True'){
tree.addIcon(_item, {icon: 'icon-shared-server-not-connected'}); tree.addIcon(_item, {icon: 'icon-shared-server-not-connected'});
}else{ }else{
tree.addIcon(_item, {icon: 'icon-server-not-connected'}); tree.addIcon(_item, {icon: 'icon-server-not-connected'});