diff --git a/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.html b/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.html index 34385181d..1be35c2eb 100644 --- a/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.html @@ -45,7 +45,7 @@ > ) { - this._dialogService.openRecategorizeImageDialog($event, annotations, (data: { type: string; comment: string }) => { + recategorizeImages($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { + this._dialogService.openDialog('recategorizeImage', $event, annotations, (data: { type: string; comment: string }) => { annotations.forEach(annotation => { this._processObsAndEmit( this._manualAnnotationService.recategorizeImage(annotation.annotationId, data.type, data.comment), @@ -147,7 +147,7 @@ export class AnnotationActionsService { title: this._translateService.instant('annotation-actions.recategorize-image'), onClick: () => { this._ngZone.run(() => { - this.recategorizeImage(null, annotations, annotationsChanged); + this.recategorizeImages(null, annotations, annotationsChanged); }); } }); 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 0a52aaf22..f583df392 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'; +type DialogType = 'confirm' | 'documentInfo' | 'editDossier' | 'addDossier' | 'assignFile' | 'recategorizeImage'; type DossiersDialogConfig = { [key in DialogType]: { @@ -61,6 +61,9 @@ export class DossiersDialogService extends DialogService { }, assignFile: { component: AssignReviewerApproverDialogComponent + }, + recategorizeImage: { + component: RecategorizeImageDialogComponent } }; @@ -120,24 +123,6 @@ export class DossiersDialogService extends DialogService { return ref; } - openRecategorizeImageDialog( - $event: MouseEvent, - annotations: AnnotationWrapper[], - cb?: Function - ): MatDialogRef { - $event?.stopPropagation(); - const ref = this._dialog.open(RecategorizeImageDialogComponent, { - ...dialogConfig, - data: annotations - }); - ref.afterClosed().subscribe(async result => { - if (result && cb) { - cb(result); - } - }); - return ref; - } - openRemoveFromDictionaryDialog( $event: MouseEvent, annotations: AnnotationWrapper[],