mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(core): administration items deletion behavior
This commit is contained in:
+18
-20
@@ -117,35 +117,33 @@ export class ConnectionsAdministrationController {
|
||||
return;
|
||||
}
|
||||
|
||||
const deletionList = Array
|
||||
.from(this.selectedItems)
|
||||
.filter(([_, value]) => value)
|
||||
.map(([connectionId]) => connectionId);
|
||||
|
||||
if (deletionList.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const confirmed = await this.commonDialogService.open(ConfirmationDialog, {
|
||||
title: 'authentication_administration_confirm_user_deletion',
|
||||
message: `Would you like to delete connections: ${deletionList.join(', ')}`,
|
||||
});
|
||||
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isProcessing = true;
|
||||
|
||||
try {
|
||||
const deletionList = Array
|
||||
.from(this.selectedItems)
|
||||
.filter(([_, value]) => value)
|
||||
.map(([connectionId]) => connectionId);
|
||||
|
||||
if (deletionList.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const confirmed = await this.commonDialogService.open(ConfirmationDialog, {
|
||||
title: 'authentication_administration_confirm_user_deletion',
|
||||
message: `Would you like to delete connections: ${deletionList.join(', ')}`,
|
||||
});
|
||||
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.connectionsResource.delete(resourceKeyList(deletionList));
|
||||
this.selectedItems.clear();
|
||||
|
||||
for (const id of deletionList) {
|
||||
this.expandedItems.delete(id);
|
||||
}
|
||||
|
||||
await this.connectionsResource.refresh('all');
|
||||
} catch (exception) {
|
||||
if (!this.error.catch(exception)) {
|
||||
this.notificationService.logException(exception, 'Connections delete failed');
|
||||
|
||||
+18
-17
@@ -35,7 +35,7 @@ export class UsersAdministrationController {
|
||||
}
|
||||
|
||||
get isLoading() {
|
||||
return this.usersResource.isLoading();
|
||||
return this.usersResource.isLoading() || this.isDeleting;
|
||||
}
|
||||
|
||||
constructor(
|
||||
@@ -64,25 +64,26 @@ export class UsersAdministrationController {
|
||||
return;
|
||||
}
|
||||
|
||||
const deletionList = Array
|
||||
.from(this.selectedItems)
|
||||
.filter(([_, value]) => value)
|
||||
.map(([userId]) => userId);
|
||||
if (deletionList.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const confirmed = await this.commonDialogService.open(ConfirmationDialog, {
|
||||
title: 'authentication_administration_confirm_user_deletion',
|
||||
message: `Would you like to delete users: ${deletionList.join(', ')}`,
|
||||
});
|
||||
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isDeleting = true;
|
||||
|
||||
try {
|
||||
const deletionList = Array
|
||||
.from(this.selectedItems)
|
||||
.filter(([_, value]) => value)
|
||||
.map(([userId]) => userId);
|
||||
if (deletionList.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const confirmed = await this.commonDialogService.open(ConfirmationDialog, {
|
||||
title: 'authentication_administration_confirm_user_deletion',
|
||||
message: `Would you like to delete users: ${deletionList.join(', ')}`,
|
||||
});
|
||||
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.usersResource.delete(resourceKeyList(deletionList));
|
||||
this.selectedItems.clear();
|
||||
|
||||
Reference in New Issue
Block a user