Commit f08ba9fd authored by Florent POITTEVIN's avatar Florent POITTEVIN
Browse files

refactor: add sample using dialog util

parent 30b581e2
......@@ -40,7 +40,7 @@ import {
AbstractAppComponent,
AppStatusService,
BreakpointService,
ChemicalMoleculeVisualizationEnum,
DialogUtil,
isNotNullNorUndefined,
LoggingService,
MARK_AS_TRANSLATABLE,
......@@ -135,8 +135,7 @@ export class AppComponent extends AbstractAppComponent {
filter(user => isNotNullNorUndefined(user)),
take(1),
tap((user: User) => {
this._dialog.open(UserDialog, {
data: user,
DialogUtil.open(this._dialog, UserDialog, user, {
width: "90%",
});
this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.orcid.associated"), {orcid: user?.person?.orcid});
......
......@@ -18,7 +18,7 @@ import {
User,
} from "@models";
import {Store} from "@ngxs/store";
import {SharedAbstractContainer} from "@shared/components/containers/shared-abstract/shared-abstract.container";
import {SharedAbstractDialog} from "@shared/components/dialogs/shared-abstract/shared-abstract.dialog";
import {SharedPersonFormPresentational} from "@shared/components/presentationals/shared-person-form/shared-person-form.presentational";
import {ResourceLogoNameSpace} from "@shared/stores/resource-logo/resource-logo-namespace.model";
import {Observable} from "rxjs";
......@@ -34,7 +34,7 @@ import {
styleUrls: ["./user.dialog.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class UserDialog extends SharedAbstractContainer implements OnInit {
export class UserDialog extends SharedAbstractDialog<User, void> implements OnInit {
currentPersonObs: Observable<Person> = MemoizedUtil.current(this._store, AppPersonState);
isLoadingPersonObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, AppPersonState);
......@@ -49,7 +49,7 @@ export class UserDialog extends SharedAbstractContainer implements OnInit {
constructor(protected readonly _store: Store,
protected readonly _dialogRef: MatDialogRef<UserDialog>,
@Inject(MAT_DIALOG_DATA) public user: User) {
super();
super(_dialogRef, user);
}
ngOnInit(): void {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment