Delete user

This commit is contained in:
Adina Țeudan 2021-04-06 01:39:16 +03:00
parent a4d0d15f65
commit fe57bba05e
6 changed files with 33 additions and 11 deletions

View File

@ -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<AddEditUserDialogComponent>,
@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) {

View File

@ -1,6 +1,13 @@
<section class="dialog">
<div class="dialog-header heading-l" translate="confirm-delete-user.title"></div>
<div class="inline-dialog-toast toast-error" *ngIf="showToast">
<div translate="confirm-delete-user.toast-error"></div>
<a (click)="showToast = false" class="toast-close-button">
<mat-icon svgIcon="red:close"></mat-icon>
</a>
</div>
<div class="dialog-content">
<div class="heading" translate="confirm-delete-user.warning"></div>

View File

@ -64,7 +64,7 @@
>
</redaction-circle-button>
<redaction-circle-button
(action)="openDeleteUserDialog($event, user)"
(action)="openDeleteUserDialog(user, $event)"
tooltip="user-listing.action.delete"
type="dark-bg"
icon="red:trash"

View File

@ -46,13 +46,20 @@ export class UserListingScreenComponent implements OnInit {
public openAddEditUserDialog($event: MouseEvent, user?: User) {
$event.stopPropagation();
this._adminDialogService.openAddEditUserDialog(user, async () => {
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() {

View File

@ -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",

View File

@ -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;
}