diff --git a/webapp/packages/core-connections/src/Administration/Connections/ConnectionsAdministrationController.ts b/webapp/packages/core-connections/src/Administration/Connections/ConnectionsAdministrationController.ts index a5431d9633..ba0227fd7c 100644 --- a/webapp/packages/core-connections/src/Administration/Connections/ConnectionsAdministrationController.ts +++ b/webapp/packages/core-connections/src/Administration/Connections/ConnectionsAdministrationController.ts @@ -117,39 +117,37 @@ export class ConnectionsAdministrationController { return; } + const deletionList = Array + .from(this.selectedItems) + .filter(([_, value]) => value) + .map(([connectionId]) => connectionId); + + if (deletionList.length === 0) { + return; + } + + const connectionNames = deletionList + .map(id => this.connectionsResource.get(id)?.name) + .filter(Boolean); + + const confirmed = await this.commonDialogService.open(ConfirmationDialog, { + title: 'authentication_administration_confirm_user_deletion', + message: `Would you like to delete connections: ${connectionNames.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 connectionNames = deletionList - .map(id => this.connectionsResource.get(id)?.name) - .filter(Boolean); - - const confirmed = await this.commonDialogService.open(ConfirmationDialog, { - title: 'authentication_administration_confirm_user_deletion', - message: `Would you like to delete connections: ${connectionNames.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'); diff --git a/webapp/packages/plugin-authentication/src/Administration/Users/UsersAdministrationController.ts b/webapp/packages/plugin-authentication/src/Administration/Users/UsersAdministrationController.ts index 27baf39fd2..0865681ffb 100644 --- a/webapp/packages/plugin-authentication/src/Administration/Users/UsersAdministrationController.ts +++ b/webapp/packages/plugin-authentication/src/Administration/Users/UsersAdministrationController.ts @@ -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();