Skip to content

Commit d26b63f

Browse files
authored
Use 'Drop' instead of 'Delete' for object commands to make destructive actions more deliberate. pgadmin-org#8958
1 parent 770a0f2 commit d26b63f

8 files changed

Lines changed: 38 additions & 35 deletions

File tree

docs/en_US/menu_bar.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ following options (in alphabetical order):
6363
| *Create* | Click *Create* to access a context menu that provides context-sensitive selections. |
6464
| | Your selection opens a *Create* dialog for creating a new object. |
6565
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
66-
| *Delete* | Click to delete the currently selected object from the server. |
66+
| *Drop* | Click to drop the currently selected object from the server. |
6767
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
68-
| *Delete (Cascade)* | Click to delete the currently selected object and all dependent objects from the server. |
68+
| *Drop (Cascade)* | Click to drop the currently selected object and all dependent objects from the server. |
6969
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
70-
| *Delete (Force)* | Click to delete the currently selected database with force option. |
70+
| *Drop (Force)* | Click to drop the currently selected database with force option. |
7171
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+
7272
| *Disconnect from server* | Click to disconnect from the currently selected server. |
7373
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------+

docs/en_US/release_notes_9_6.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Bundled PostgreSQL Utilities
2020
New features
2121
************
2222

23+
| `Issue #1923 <https://github.com/pgadmin-org/pgadmin4/issues/1923>`_ - Ensure that keyboard shortcuts are displayed in tooltips, context menus, and the main menu.
2324
| `Issue #5797 <https://github.com/pgadmin-org/pgadmin4/issues/5797>`_ - Implemented a server-side cursor to enhance performance when retrieving large datasets.
2425
| `Issue #7979 <https://github.com/pgadmin-org/pgadmin4/issues/7979>`_ - Added support for setting a custom SESSION_DIGEST_METHOD in pgAdmin 4 to facilitate FIPS compliance.
2526
| `Issue #8941 <https://github.com/pgadmin-org/pgadmin4/issues/8941>`_ - Enable the PKCE workflow for OAuth 2 authentication.
@@ -28,11 +29,13 @@ Housekeeping
2829
************
2930

3031
| `Issue #8828 <https://github.com/pgadmin-org/pgadmin4/issues/8828>`_ - Ensure that pgAdmin 4 is compatible with PG/EPAS v18.
32+
| `Issue #8958 <https://github.com/pgadmin-org/pgadmin4/issues/8958>`_ - Use 'Drop' instead of 'Delete' for object commands to make destructive actions more deliberate.
3133
3234
Bug fixes
3335
*********
3436

3537
| `Issue #8420 <https://github.com/pgadmin-org/pgadmin4/issues/8420>`_ - Fixed an issue where windows installer is not signing tmp files generated by InnoSetup.
3638
| `Issue #8675 <https://github.com/pgadmin-org/pgadmin4/issues/8675>`_ - Fixed an issue in the Search Objects tool where selecting a node occasionally selected an incorrect node.
3739
| `Issue #8901 <https://github.com/pgadmin-org/pgadmin4/issues/8901>`_ - Improved the application state restoration by leveraging rc-dock layout and ensure the order and layout of tabs is maintained on restore.
40+
| `Issue #8907 <https://github.com/pgadmin-org/pgadmin4/issues/8907>`_ - Fixed an issue where json editor in result grid was crashing if null value is set in the json editor.
3841
| `Issue #8914 <https://github.com/pgadmin-org/pgadmin4/issues/8914>`_ - Update zstd library link to 1.5.7 in Dockerfile.

docs/en_US/tree_control.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ following selections (options appear in alphabetical order):
4949
+---------------------------+---------------------------------------------------------------------------------------------------------------------------+
5050
| *Debugging* | Click through to open the :ref:`Debug <debugger>` tool or to select *Set breakpoint* to stop or pause a script execution. |
5151
+---------------------------+---------------------------------------------------------------------------------------------------------------------------+
52-
| *Delete* | Click to delete the currently selected object from the server. |
52+
| *Drop* | Click to drop the currently selected object from the server. |
5353
+---------------------------+---------------------------------------------------------------------------------------------------------------------------+
54-
| *Delete (Cascade)* | Click to delete the currently selected object and all dependent objects from the server. |
54+
| *Drop (Cascade)* | Click to drop the currently selected object and all dependent objects from the server. |
5555
+---------------------------+---------------------------------------------------------------------------------------------------------------------------+
56-
| *Delete (Force)* | Click to delete the currently selected database with force option. |
56+
| *Drop (Force)* | Click to drop the currently selected database with force option. |
5757
+---------------------------+---------------------------------------------------------------------------------------------------------------------------+
5858
| *Disconnect Database...* | Click to terminate a database connection. |
5959
+---------------------------+---------------------------------------------------------------------------------------------------------------------------+

web/pgadmin/browser/register_browser_preferences.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def register_browser_preferences(self):
325325
self.preference.register(
326326
'keyboard_shortcuts',
327327
'sub_menu_delete',
328-
gettext('Delete object'),
328+
gettext('Drop object'),
329329
'keyboardshortcut',
330330
{
331331
'alt': True,

web/pgadmin/browser/server_groups/servers/databases/static/js/database.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ define('pgadmin.node.database', [
103103
},{
104104
name: 'delete_database_force', node: 'database', module: this,
105105
applies: ['object', 'context'], callback: 'delete_database_force',
106-
category: 'delete', priority: 2, label: gettext('Delete (Force)'),
106+
category: 'delete', priority: 2, label: gettext('Drop (Force)'),
107107
enable : canDeleteWithForce,
108108
}, {
109109
name: 'disconnect_database', node: 'database', module: this,

web/pgadmin/browser/static/js/node.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ define('pgadmin.browser.node', [
155155
applies: ['object', 'context'],
156156
callback: 'delete_obj',
157157
priority: self.dropPriority,
158-
label: (self.dropAsRemove) ? gettext('Remove %s', self.label) : gettext('Delete'),
158+
label: (self.dropAsRemove) ? gettext('Remove %s', self.label) : gettext('Drop'),
159159
data: {
160160
'url': 'drop',
161161
data_disabled: gettext('The selected tree node does not support this option.'),
@@ -176,7 +176,7 @@ define('pgadmin.browser.node', [
176176
applies: ['object', 'context'],
177177
callback: 'delete_obj',
178178
priority: 2,
179-
label: gettext('Delete (Cascade)'),
179+
label: gettext('Drop (Cascade)'),
180180
data: {
181181
'url': 'delete',
182182
},
@@ -532,13 +532,13 @@ define('pgadmin.browser.node', [
532532
let msg, title;
533533

534534
if (input.url == 'delete' && d._type === 'database') {
535-
msg = gettext('Delete database with the force option will attempt to terminate all existing connections to the <b>"%s"</b> database. Are you sure you want to proceed?', d.label);
536-
title = gettext('Delete FORCE %s?', obj.label);
535+
msg = gettext('Drop database with the force option will attempt to terminate all existing connections to the <b>"%s"</b> database. Are you sure you want to proceed?', d.label);
536+
title = gettext('Drop FORCE %s?', obj.label);
537537

538538
} else if (input.url == 'delete') {
539-
msg = gettext('Are you sure you want to delete the %s <b>"%s"</b> and all the objects that depend on it?',
539+
msg = gettext('Are you sure you want to drop the %s <b>"%s"</b> and all the objects that depend on it?',
540540
obj.label.toLowerCase(), d.label);
541-
title = gettext('Delete CASCADE %s?', obj.label);
541+
title = gettext('Drop CASCADE %s?', obj.label);
542542

543543
if (!(_.isFunction(obj.canDropCascade) ?
544544
obj.canDropCascade(d, i) : obj.canDropCascade)) {
@@ -553,8 +553,8 @@ define('pgadmin.browser.node', [
553553
msg = gettext('Are you sure you want to remove the %s <b>"%s"</b>?', obj.label.toLowerCase(), d.label);
554554
title = gettext('Remove %s?', obj.label);
555555
} else {
556-
msg = gettext('Are you sure you want to delete the %s <b>"%s"</b>?', obj.label.toLowerCase(), d.label);
557-
title = gettext('Delete %s?', obj.label);
556+
msg = gettext('Are you sure you want to drop the %s <b>"%s"</b>?', obj.label.toLowerCase(), d.label);
557+
title = gettext('Drop %s?', obj.label);
558558
}
559559

560560
if (!(_.isFunction(obj.canDrop) ?
@@ -605,7 +605,7 @@ define('pgadmin.browser.node', [
605605
});
606606
},
607607
() => {},
608-
gettext('Delete'),
608+
obj.dropAsRemove ? gettext('Remove') : gettext('Drop'),
609609
gettext('Cancel'),
610610
);
611611
},
@@ -735,7 +735,7 @@ define('pgadmin.browser.node', [
735735
}, 0);
736736
}
737737
pgBrowser.Node.callbacks.change_server_background(item, data);
738-
// Suppress added tree event being called during object search operations
738+
// Suppress added tree event being called during object search operations
739739
// where tree.select clashes due to previous tree state restore
740740
const suppressPath = pgBrowser.tree.suppressEventsForPath;
741741
if (suppressPath) {
@@ -745,7 +745,7 @@ define('pgadmin.browser.node', [
745745
return;
746746
}
747747
}
748-
748+
749749
pgBrowser.Events.trigger('pgadmin:browser:tree:expand-from-previous-tree-state', item);
750750
},
751751
// Callback called - when a node is selected in browser tree.
@@ -792,7 +792,7 @@ define('pgadmin.browser.node', [
792792
opened: function(item) {
793793
let tree = pgBrowser.tree,
794794
auto_expand = usePreferences.getState().getPreferences('browser', 'auto_expand_sole_children');
795-
// Suppress opened tree event being called during object search operations
795+
// Suppress opened tree event being called during object search operations
796796
// where tree.select clashes due to only child of parent opens automatically.
797797
const suppressPath = pgBrowser.tree.suppressEventsForPath;
798798
if (suppressPath) {

web/pgadmin/misc/properties/CollectionNodeProperties.jsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function CustomHeader({node, nodeData, nodeItem, treeNodeInfo, selectedObject, o
4747
<PgIconButton
4848
icon={<DeleteIcon style={{height: '1.35rem'}}/>}
4949
aria-label="Delete"
50-
title={gettext('Delete')}
50+
title={gettext('Drop')}
5151
onClick={() => {
5252
onDrop('drop');
5353
}}
@@ -59,8 +59,8 @@ function CustomHeader({node, nodeData, nodeItem, treeNodeInfo, selectedObject, o
5959
></PgIconButton>
6060
{node.type !== 'coll-database' ? <PgIconButton
6161
icon={<DeleteSweepIcon style={{height: '1.5rem'}} />}
62-
aria-label="Delete Cascade"
63-
title={gettext('Delete (Cascade)')}
62+
aria-label="Drop Cascade"
63+
title={gettext('Drop (Cascade)')}
6464
onClick={() => {
6565
onDrop('dropCascade');
6666
}}
@@ -72,8 +72,8 @@ function CustomHeader({node, nodeData, nodeItem, treeNodeInfo, selectedObject, o
7272
></PgIconButton> :
7373
<PgIconButton
7474
icon={<DeleteForeverIcon style={{height: '1.4rem'}} />}
75-
aria-label="Delete Force"
76-
title={gettext('Delete (Force)')}
75+
aria-label="Drop Force"
76+
title={gettext('Drop (Force)')}
7777
onClick={() => {
7878
onDrop('dropForce');
7979
}}
@@ -144,8 +144,8 @@ export default function CollectionNodeProperties({
144144

145145
if (selRows.length === 0) {
146146
pgAdmin.Browser.notifier.alert(
147-
gettext('Delete Multiple'),
148-
gettext('Please select at least one object to delete.')
147+
gettext('Drop Multiple'),
148+
gettext('Please select at least one object to drop.')
149149
);
150150
return;
151151
}
@@ -155,19 +155,19 @@ export default function CollectionNodeProperties({
155155
if (type === 'dropCascade') {
156156
url = selNode.generate_url(selItem, 'delete');
157157
msg = gettext(
158-
'Are you sure you want to delete all the selected objects and all the objects that depend on them?'
158+
'Are you sure you want to drop all the selected objects and all the objects that depend on them?'
159159
);
160-
title = gettext('Delete CASCADE multiple objects?');
160+
title = gettext('Drop CASCADE multiple objects?');
161161
} else if (type === 'dropForce') {
162162
url = selNode.generate_url(selItem, 'delete');
163163
msg = gettext(
164-
'Delete databases with the force option will attempt to terminate all the existing connections to the selected databases. Are you sure you want to proceed?'
164+
'Drop databases with the force option will attempt to terminate all the existing connections to the selected databases. Are you sure you want to proceed?'
165165
);
166-
title = gettext('Delete FORCE multiple objects?');
166+
title = gettext('Drop FORCE multiple objects?');
167167
} else {
168168
url = selNode.generate_url(selItem, 'drop');
169-
msg = gettext('Are you sure you want to delete all the selected objects?');
170-
title = gettext('Delete multiple objects?');
169+
msg = gettext('Are you sure you want to drop all the selected objects?');
170+
title = gettext('Drop multiple objects?');
171171
}
172172

173173
const api = getApiInstance();
@@ -198,7 +198,7 @@ export default function CollectionNodeProperties({
198198
};
199199

200200
if (confirm) {
201-
pgAdmin.Browser.notifier.confirmDelete(title, msg, dropNodeProperties, () => {}, gettext('Delete'), gettext('Cancel'));
201+
pgAdmin.Browser.notifier.confirmDelete(title, msg, dropNodeProperties, () => {}, gettext('Drop'), gettext('Cancel'));
202202
} else {
203203
dropNodeProperties();
204204
}

web/regression/feature_utils/pgadmin_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def remove_server(self, server_config):
366366
self.click_element(self.find_by_css_selector(
367367
"li[data-label='Remove Server']"))
368368
self.driver.switch_to.default_content()
369-
self.click_modal('Delete')
369+
self.click_modal('Remove')
370370
time.sleep(1)
371371
else:
372372
print(server_config['name'] + " server is not removed",

0 commit comments

Comments
 (0)