diff --git a/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts index 316bde88a..3d381b8ee 100644 --- a/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts @@ -59,7 +59,7 @@ export class AnnotationActionsService { } changeLegalBasis($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { - this._dialogService.openChangeLegalBasisDialog($event, annotations, (data: { comment: string; legalBasis: string }) => { + this._dialogService.openDialog('changeLegalBasis', $event, annotations, (data: { comment: string; legalBasis: string }) => { annotations.forEach(annotation => { this._processObsAndEmit( this._manualAnnotationService.changeLegalBasis(annotation.annotationId, data.legalBasis, data.comment), diff --git a/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts b/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts index f583df392..f7ffb1d87 100644 --- a/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts @@ -28,7 +28,7 @@ const dialogConfig = { // TODO: Continue refactor -type DialogType = 'confirm' | 'documentInfo' | 'editDossier' | 'addDossier' | 'assignFile' | 'recategorizeImage'; +type DialogType = 'confirm' | 'documentInfo' | 'editDossier' | 'addDossier' | 'assignFile' | 'recategorizeImage' | 'changeLegalBasis'; type DossiersDialogConfig = { [key in DialogType]: { @@ -64,6 +64,9 @@ export class DossiersDialogService extends DialogService { }, recategorizeImage: { component: RecategorizeImageDialogComponent + }, + changeLegalBasis: { + component: ChangeLegalBasisDialogComponent } }; @@ -105,24 +108,6 @@ export class DossiersDialogService extends DialogService { return ref; } - openChangeLegalBasisDialog( - $event: MouseEvent, - annotations: AnnotationWrapper[], - cb?: Function - ): MatDialogRef { - $event?.stopPropagation(); - const ref = this._dialog.open(ChangeLegalBasisDialogComponent, { - ...dialogConfig, - data: annotations - }); - ref.afterClosed().subscribe(async result => { - if (result && cb) { - cb(result); - } - }); - return ref; - } - openRemoveFromDictionaryDialog( $event: MouseEvent, annotations: AnnotationWrapper[],