mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1) Fixed issue where Drop and Disconnect connection menu points are too close to each other. Fixes #3279
2) Rename the context menu from 'Drop Server' to 'Remove Server'. Fixes #3859
This commit is contained in:
parent
091d2cd0d2
commit
62d55cabd9
Binary file not shown.
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 88 KiB |
@ -57,7 +57,7 @@ following options (in alphabetical order):
|
|||||||
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||||
| *Delete/Drop* | Click to delete the currently selected object from the server. |
|
| *Delete/Drop* | Click to delete the currently selected object from the server. |
|
||||||
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||||
| *Disconnect Server...* | Click to refresh the currently selected object. |
|
| *Disconnect Server...* | Click to disconnect the currently selected server. |
|
||||||
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||||
| *Drop Cascade* | Click to delete the currently selected object and all dependent objects from the server. |
|
| *Drop Cascade* | Click to delete the currently selected object and all dependent objects from the server. |
|
||||||
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||||
@ -65,6 +65,8 @@ following options (in alphabetical order):
|
|||||||
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||||
| *Refresh...* | Click to refresh the currently selected object. |
|
| *Refresh...* | Click to refresh the currently selected object. |
|
||||||
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||||
|
| *Remove Server* | Click to remove the currently selected server. |
|
||||||
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||||
| *Scripts* | Click to open the :ref:`Query tool <query_tool>` to edit or view the selected script from the flyout menu. |
|
| *Scripts* | Click to open the :ref:`Query tool <query_tool>` to edit or view the selected script from the flyout menu. |
|
||||||
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||||
| *Trigger(s)* | Click to *Disable* or *Enable* trigger(s) for the currently selected table. Options are displayed on the flyout menu. |
|
| *Trigger(s)* | Click to *Disable* or *Enable* trigger(s) for the currently selected table. Options are displayed on the flyout menu. |
|
||||||
|
@ -21,7 +21,9 @@ Bug fixes
|
|||||||
*********
|
*********
|
||||||
|
|
||||||
| `Issue #3130 <https://redmine.postgresql.org/issues/3130>`_ - Ensure create new object dialog should be opened when alt+shift+n key is pressed on the collection node.
|
| `Issue #3130 <https://redmine.postgresql.org/issues/3130>`_ - Ensure create new object dialog should be opened when alt+shift+n key is pressed on the collection node.
|
||||||
|
| `Issue #3279 <https://redmine.postgresql.org/issues/3279>`_ - Fixed issue where Drop and Disconnect connection menu points are too close to each other.
|
||||||
| `Issue #3789 <https://redmine.postgresql.org/issues/3789>`_ - Ensure context menus never get hidden below the menu bar.
|
| `Issue #3789 <https://redmine.postgresql.org/issues/3789>`_ - Ensure context menus never get hidden below the menu bar.
|
||||||
|
| `Issue #3859 <https://redmine.postgresql.org/issues/3859>`_ - Rename the context menu from 'Drop Server' to 'Remove Server'.
|
||||||
| `Issue #3913 <https://redmine.postgresql.org/issues/3913>`_ - Ensure the correct "running at" agent is shown when a pgAgent job is executing.
|
| `Issue #3913 <https://redmine.postgresql.org/issues/3913>`_ - Ensure the correct "running at" agent is shown when a pgAgent job is executing.
|
||||||
| `Issue #3915 <https://redmine.postgresql.org/issues/3915>`_ - Fix an issue in the Query Tool where shortcut keys could be ignored following a query error.
|
| `Issue #3915 <https://redmine.postgresql.org/issues/3915>`_ - Fix an issue in the Query Tool where shortcut keys could be ignored following a query error.
|
||||||
| `Issue #3999 <https://redmine.postgresql.org/issues/3999>`_ - Fix the toggle case shortcut key combination.
|
| `Issue #3999 <https://redmine.postgresql.org/issues/3999>`_ - Fix the toggle case shortcut key combination.
|
||||||
|
@ -28,6 +28,10 @@ define('pgadmin.browser.node', [
|
|||||||
F1: 112,
|
F1: 112,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const REMOVE_SERVER_PRIORITY = 5;
|
||||||
|
const REMOVE_SERVER_LABEL = 'Remove Server';
|
||||||
|
const SERVER = 'server';
|
||||||
|
|
||||||
// It has already been defined.
|
// It has already been defined.
|
||||||
// Avoid running this script again.
|
// Avoid running this script again.
|
||||||
if (pgBrowser.Node)
|
if (pgBrowser.Node)
|
||||||
@ -142,8 +146,8 @@ define('pgadmin.browser.node', [
|
|||||||
module: self,
|
module: self,
|
||||||
applies: ['object', 'context'],
|
applies: ['object', 'context'],
|
||||||
callback: 'delete_obj',
|
callback: 'delete_obj',
|
||||||
priority: 2,
|
priority: self.get_menu_item_priority(self.type, 2),
|
||||||
label: gettext('Delete/Drop'),
|
label: self.change_menu_label(self.type, gettext('Delete/Drop')),
|
||||||
data: {
|
data: {
|
||||||
'url': 'drop',
|
'url': 'drop',
|
||||||
},
|
},
|
||||||
@ -755,15 +759,31 @@ define('pgadmin.browser.node', [
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msg = gettext('Are you sure you want to drop %s "%s"?', obj.label.toLowerCase(), d.label);
|
var remove_drop_text;
|
||||||
title = gettext('DROP %s?', obj.label);
|
if(obj.type === SERVER) {
|
||||||
|
remove_drop_text = 'Remove';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
remove_drop_text = 'DROP';
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = gettext('Are you sure you want to %s %s "%s"?', remove_drop_text.toLowerCase(), obj.label.toLowerCase(), d.label);
|
||||||
|
title = gettext('%s %s?', remove_drop_text, obj.label);
|
||||||
|
|
||||||
if (!(_.isFunction(obj.canDrop) ?
|
if (!(_.isFunction(obj.canDrop) ?
|
||||||
obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) {
|
obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) {
|
||||||
|
if(obj.type === SERVER) {
|
||||||
|
Alertify.error(
|
||||||
|
gettext('The %s "%s" cannot be removed.', obj.label, d.label),
|
||||||
|
10
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
Alertify.error(
|
Alertify.error(
|
||||||
gettext('The %s "%s" cannot be dropped.', obj.label, d.label),
|
gettext('The %s "%s" cannot be dropped.', obj.label, d.label),
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -792,8 +812,14 @@ define('pgadmin.browser.node', [
|
|||||||
console.warn(e.stack || e);
|
console.warn(e.stack || e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(obj.type === SERVER) {
|
||||||
|
pgBrowser.report_error(
|
||||||
|
gettext('Error removing %s: "%s"', obj.label, objName), msg);
|
||||||
|
}
|
||||||
|
else {
|
||||||
pgBrowser.report_error(
|
pgBrowser.report_error(
|
||||||
gettext('Error dropping %s: "%s"', obj.label, objName), msg);
|
gettext('Error dropping %s: "%s"', obj.label, objName), msg);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
null).show();
|
null).show();
|
||||||
@ -1757,6 +1783,18 @@ define('pgadmin.browser.node', [
|
|||||||
return this.parent_type;
|
return this.parent_type;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
get_menu_item_priority: function(type, default_priority) { //downgrade Remove Server priority in menus only for Servers
|
||||||
|
if(type && type === SERVER) {
|
||||||
|
return REMOVE_SERVER_PRIORITY;
|
||||||
|
}
|
||||||
|
return default_priority;
|
||||||
|
},
|
||||||
|
change_menu_label: function(type, default_label) { //change Delete/Drop menu option to Remove Server
|
||||||
|
if(type && type === SERVER) {
|
||||||
|
return gettext(REMOVE_SERVER_LABEL);
|
||||||
|
}
|
||||||
|
return default_label;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return pgAdmin.Browser.Node;
|
return pgAdmin.Browser.Node;
|
||||||
|
Loading…
Reference in New Issue
Block a user