updated base dialog to not verify the changes on closing the window when it's on edit mode
This commit is contained in:
parent
cbeb63e121
commit
fecec0e32e
@ -75,7 +75,6 @@ const routes: Routes = [
|
||||
path: 'rules',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard],
|
||||
},
|
||||
|
||||
@ -41,7 +41,7 @@ export class AddEditDictionaryDialogComponent extends BaseDialogComponent {
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
private readonly _data: { readonly dictionary: Dictionary; readonly dossierTemplateId: string },
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
super(_injector, _dialogRef, !!_data.dictionary);
|
||||
this.form = this._getForm(this.dictionary);
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
this.hasColor$ = this._colorEmpty$;
|
||||
|
||||
@ -27,7 +27,7 @@ export class AddEditDossierAttributeDialogComponent extends BaseDialogComponent
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
readonly data: { readonly dossierAttribute: IDossierAttributeConfig; dossierTemplateId: string },
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
super(_injector, _dialogRef, !!data.dossierAttribute);
|
||||
this.form = this._getForm(this.dossierAttribute);
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ export class AddEditDossierStateDialogComponent extends BaseDialogComponent {
|
||||
protected readonly _dialogRef: MatDialogRef<AddEditDossierStateDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) readonly data: DialogData,
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
super(_injector, _dialogRef, !!data.dossierState);
|
||||
this.form = this.#getForm();
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ export class AddEditDossierTemplateDialogComponent extends BaseDialogComponent {
|
||||
private readonly _loadingService: LoadingService,
|
||||
@Inject(MAT_DIALOG_DATA) readonly dossierTemplateId: string,
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
super(_injector, _dialogRef, !!dossierTemplateId);
|
||||
this.dossierTemplate = this._dossierTemplatesService.find(this.dossierTemplateId);
|
||||
this.form = this._getForm();
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
|
||||
@ -34,7 +34,7 @@ export class AddEditFileAttributeDialogComponent extends BaseDialogComponent {
|
||||
numberOfFilterableAttrs: number;
|
||||
},
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
super(_injector, _dialogRef, !!data.fileAttribute);
|
||||
this.canSetDisplayed = data.numberOfDisplayedAttrs < this.DISPLAYED_FILTERABLE_LIMIT || data.fileAttribute?.displayedInFileList;
|
||||
this.canSetFilterable = data.numberOfFilterableAttrs < this.DISPLAYED_FILTERABLE_LIMIT || data.fileAttribute?.filterable;
|
||||
this.form = this._getForm(this.fileAttribute);
|
||||
|
||||
@ -19,9 +19,9 @@ export class AddEditUserDialogComponent extends BaseDialogComponent {
|
||||
protected readonly _dialogRef: MatDialogRef<AddEditUserDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) readonly user: User,
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
super(_injector, _dialogRef, !!user);
|
||||
}
|
||||
|
||||
X;
|
||||
toggleResetPassword() {
|
||||
this.resettingPassword = !this.resettingPassword;
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ export class EditColorDialogComponent extends BaseDialogComponent {
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
readonly data: IEditColorData,
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
super(_injector, _dialogRef, true);
|
||||
this._dossierTemplateId = data.dossierTemplateId;
|
||||
|
||||
this.form = this._getForm();
|
||||
|
||||
@ -28,7 +28,7 @@ export class FileAttributesConfigurationsDialogComponent extends BaseDialogCompo
|
||||
protected readonly _dialogRef: MatDialogRef<FileAttributesConfigurationsDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) private _data: { config: IFileAttributesConfig; dossierTemplateId: string },
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
super(_injector, _dialogRef, true);
|
||||
this.form = this._getForm();
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ export class AddEditJustificationDialogComponent extends BaseDialogComponent {
|
||||
protected readonly _dialogRef: MatDialogRef<AddEditJustificationDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: { justification?: Justification; dossierTemplateId: string },
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
super(_injector, _dialogRef, !!data.justification);
|
||||
|
||||
this.form = this._getForm();
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
|
||||
@ -4,8 +4,9 @@ import { RouterModule } from '@angular/router';
|
||||
import { SharedModule } from '../../../shared/shared.module';
|
||||
import { RulesScreenComponent } from './rules-screen/rules-screen.component';
|
||||
import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor';
|
||||
import { PendingChangesGuard } from '../../../../guards/can-deactivate.guard';
|
||||
|
||||
const routes = [{ path: '', component: RulesScreenComponent }];
|
||||
const routes = [{ path: '', component: RulesScreenComponent, canDeactivate: [PendingChangesGuard] }];
|
||||
|
||||
@NgModule({
|
||||
declarations: [RulesScreenComponent],
|
||||
|
||||
@ -31,7 +31,7 @@ export class ChangeLegalBasisDialogComponent extends BaseDialogComponent impleme
|
||||
protected readonly _dialogRef: MatDialogRef<ChangeLegalBasisDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) private readonly _data: { annotations: AnnotationWrapper[]; dossier: Dossier },
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
super(_injector, _dialogRef, true);
|
||||
this.form = this._getForm();
|
||||
}
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ export class EditDossierDialogComponent extends BaseDialogComponent implements A
|
||||
section?: Section;
|
||||
},
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
super(_injector, _dialogRef, true);
|
||||
this.navItems = [
|
||||
{
|
||||
key: 'dossierInfo',
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 8f8ce778bd78a42076db33c886b4e623a17d4f15
|
||||
Subproject commit 6c82fe505b7495d06bec21acbc2a20b653a791ed
|
||||
Loading…
x
Reference in New Issue
Block a user