diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.ts index 4a18b6705..dd439a765 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.ts @@ -19,7 +19,6 @@ export class AddEditUserDialogComponent { private readonly _formBuilder: FormBuilder, private readonly _userControllerService: UserControllerService, private readonly _userService: UserService, - private readonly _dialogService: AdminDialogService, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public user: User ) { @@ -96,8 +95,7 @@ export class AddEditUserDialogComponent { } public async delete() { - this._dialogService.openConfirmDeleteUserDialog(this.user); - // this.dialogRef.close(); + this.dialogRef.close('DELETE'); } public changeRoleValue(role: string, { checked }: MatCheckboxChange) { diff --git a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-user-dialog/confirm-delete-user-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-user-dialog/confirm-delete-user-dialog.component.html index bd83c23e7..0d4366f84 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-user-dialog/confirm-delete-user-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-user-dialog/confirm-delete-user-dialog.component.html @@ -1,6 +1,13 @@
+
+
+ + + +
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html index a5d86d764..13a13a447 100644 --- a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html @@ -64,7 +64,7 @@ > { - await this._loadData(); + this._adminDialogService.openAddEditUserDialog(user, async (action) => { + if (action === 'DELETE') { + this.openDeleteUserDialog(user); + } else { + await this._loadData(); + } }); } - public openDeleteUserDialog($event: MouseEvent, user: User) { - $event.stopPropagation(); + public openDeleteUserDialog(user: User, $event?: MouseEvent) { + $event?.stopPropagation(); + this._adminDialogService.openConfirmDeleteUserDialog(user, async () => { + await this._loadData(); + }); } private async _loadData() { diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index dc6e08925..4a312b587 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -755,7 +755,8 @@ "delete": "Delete Attribute", "cancel": "Keep Attribute", "checkbox-1": "All documents it is used on will be impacted", - "checkbox-2": "All inputted details on the documents will be lost" + "checkbox-2": "All inputted details on the documents will be lost", + "toast-error": "Please confirm that you understand the ramifications of your action!" }, "confirm-delete-user": { "title": "Delete User from Workspace", @@ -763,7 +764,8 @@ "checkbox-1": "{{count}} projects will be impacted", "checkbox-2": "{{count}} documents waiting review will be impacted", "delete": "Delete User", - "cancel": "Keep User" + "cancel": "Keep User", + "toast-error": "Please confirm that you understand the ramifications of your action!" }, "document-info": { "title": "Introduce File Attributes", diff --git a/apps/red-ui/src/assets/styles/red-toasts.scss b/apps/red-ui/src/assets/styles/red-toasts.scss index a98a82c49..12276c23c 100644 --- a/apps/red-ui/src/assets/styles/red-toasts.scss +++ b/apps/red-ui/src/assets/styles/red-toasts.scss @@ -2,7 +2,8 @@ $toast-width: 400px; -.toast-container .ngx-toastr { +.toast-container .ngx-toastr, +.inline-dialog-toast { padding: 11px 16px; border-radius: 8px; background-image: none; @@ -90,6 +91,7 @@ $toast-width: 400px; .toast-error { background-color: $red-1; + color: $white; } .toast-warning { @@ -99,3 +101,9 @@ $toast-width: 400px; .toast-info { background-color: $grey-1; } + +.inline-dialog-toast { + width: calc(100% - 96px); + margin-left: 32px; + margin-top: 14px; +}