mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-29 18:03:45 +08:00
fix(core-navigation-tree, plugin-navigation-tree): CB-2360 Do not duplicate confirmation when deleting tables
This commit is contained in:
+1
-21
@@ -62,32 +62,12 @@ export class ObjectPropertyTableFooterService {
|
||||
onClick: async context => {
|
||||
const nodes = this.getSelectedNodes(context.data.tableState.selectedList)
|
||||
.filter(node => node.features?.includes(ENodeFeature.canDelete));
|
||||
const nodeNames = nodes.map(getNodeDisplayName);
|
||||
|
||||
const result = await this.commonDialogService.open(ConfirmationDialogDelete, {
|
||||
title: 'ui_data_delete_confirmation',
|
||||
message: `You're going to delete following items: "${nodeNames.join(', ')}". Are you sure?`,
|
||||
confirmActionText: 'ui_delete',
|
||||
});
|
||||
|
||||
if (result === DialogueStateResult.Rejected) {
|
||||
return;
|
||||
}
|
||||
|
||||
const deleted: string[] = [];
|
||||
|
||||
try {
|
||||
for (const node of nodes) {
|
||||
await this.navTreeResource.deleteNode(node.id);
|
||||
deleted.push(node.id);
|
||||
}
|
||||
await this.navTreeResource.deleteNode(resourceKeyList(nodes.map(node => node.id)));
|
||||
} catch (exception: any) {
|
||||
this.notificationService.logException(exception, 'Failed to delete item');
|
||||
}
|
||||
|
||||
if (deleted.length) {
|
||||
context.data.tableState.unselect(deleted);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
+3
@@ -28,6 +28,9 @@ const menuStyles = css`
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
}
|
||||
menu-container:not([|menuEmpty]) value {
|
||||
padding-right: 8px;
|
||||
}
|
||||
menu-box {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
|
||||
Reference in New Issue
Block a user