Restyles invitation dialog and adds message on successfully sent
This commit is contained in:
parent
9c7bd9a59c
commit
dcc8f3823b
|
@ -16,6 +16,9 @@ import { Observable } from 'rxjs';
|
||||||
import { map, takeUntil } from 'rxjs/operators';
|
import { map, takeUntil } from 'rxjs/operators';
|
||||||
import { Role } from '@app/core/common/enum/role';
|
import { Role } from '@app/core/common/enum/role';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
|
import { UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
|
import { SnackBarNotificationLevel } from '@common/modules/notification/ui-notification-service';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-invitation-dialog-component',
|
selector: 'app-invitation-dialog-component',
|
||||||
|
@ -41,7 +44,9 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
|
||||||
public enumUtils: EnumUtils,
|
public enumUtils: EnumUtils,
|
||||||
public route: ActivatedRoute,
|
public route: ActivatedRoute,
|
||||||
public router: Router,
|
public router: Router,
|
||||||
|
private language: TranslateService,
|
||||||
public dialogRef: MatDialogRef<DmpInvitationDialogComponent>,
|
public dialogRef: MatDialogRef<DmpInvitationDialogComponent>,
|
||||||
|
private uiNotificationService: UiNotificationService,
|
||||||
@Inject(MAT_DIALOG_DATA) public data: any
|
@Inject(MAT_DIALOG_DATA) public data: any
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
@ -98,9 +103,13 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
|
||||||
|
|
||||||
this.invitationService.inviteDmpInvitationUsers(invitationObject)
|
this.invitationService.inviteDmpInvitationUsers(invitationObject)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(items => {
|
.subscribe(
|
||||||
|
complete => {
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
});
|
this.onCallbackSuccess();
|
||||||
|
},
|
||||||
|
error => this.onCallbackError(error)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
closeDialog(): void {
|
closeDialog(): void {
|
||||||
|
@ -130,4 +139,12 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
|
||||||
return this.formGroup.get('users') && this.formGroup.get('users').value && this.formGroup.get('users').value.length > 0;
|
return this.formGroup.get('users') && this.formGroup.get('users').value && this.formGroup.get('users').value.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onCallbackSuccess(): void {
|
||||||
|
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.INVITATION-DIALOG.SUCCESS' ), SnackBarNotificationLevel.Success);
|
||||||
|
}
|
||||||
|
|
||||||
|
onCallbackError(errorResponse: any) {
|
||||||
|
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.INVITATION-DIALOG.ERROR' ), SnackBarNotificationLevel.Error);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,9 @@
|
||||||
"UPLOAD-FILE": "Upload File"
|
"UPLOAD-FILE": "Upload File"
|
||||||
},
|
},
|
||||||
"INVITATION-DIALOG": {
|
"INVITATION-DIALOG": {
|
||||||
"HINT": "Press comma or enter between authors"
|
"HINT": "Press comma or enter between authors",
|
||||||
|
"SUCCESS": "Invitation successfully sent",
|
||||||
|
"ERROR": "Invitation sent failed"
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"VIEW-ALL": "View All",
|
"VIEW-ALL": "View All",
|
||||||
|
|
Loading…
Reference in New Issue