Refactor dossiers dialog service: recategorize image
This commit is contained in:
parent
d18359aa6c
commit
40a361a689
@ -45,7 +45,7 @@
|
|||||||
></iqser-circle-button>
|
></iqser-circle-button>
|
||||||
|
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="annotationActionsService.recategorizeImage($event, annotations, annotationsChanged)"
|
(action)="annotationActionsService.recategorizeImages($event, annotations, annotationsChanged)"
|
||||||
*ngIf="annotationPermissions.canRecategorizeImage"
|
*ngIf="annotationPermissions.canRecategorizeImage"
|
||||||
[tooltipPosition]="tooltipPosition"
|
[tooltipPosition]="tooltipPosition"
|
||||||
[tooltip]="'annotation-actions.recategorize-image' | translate"
|
[tooltip]="'annotation-actions.recategorize-image' | translate"
|
||||||
|
|||||||
@ -100,8 +100,8 @@ export class AnnotationActionsService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
recategorizeImage($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter<AnnotationWrapper>) {
|
recategorizeImages($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter<AnnotationWrapper>) {
|
||||||
this._dialogService.openRecategorizeImageDialog($event, annotations, (data: { type: string; comment: string }) => {
|
this._dialogService.openDialog('recategorizeImage', $event, annotations, (data: { type: string; comment: string }) => {
|
||||||
annotations.forEach(annotation => {
|
annotations.forEach(annotation => {
|
||||||
this._processObsAndEmit(
|
this._processObsAndEmit(
|
||||||
this._manualAnnotationService.recategorizeImage(annotation.annotationId, data.type, data.comment),
|
this._manualAnnotationService.recategorizeImage(annotation.annotationId, data.type, data.comment),
|
||||||
@ -147,7 +147,7 @@ export class AnnotationActionsService {
|
|||||||
title: this._translateService.instant('annotation-actions.recategorize-image'),
|
title: this._translateService.instant('annotation-actions.recategorize-image'),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this._ngZone.run(() => {
|
this._ngZone.run(() => {
|
||||||
this.recategorizeImage(null, annotations, annotationsChanged);
|
this.recategorizeImages(null, annotations, annotationsChanged);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -28,7 +28,7 @@ const dialogConfig = {
|
|||||||
|
|
||||||
// TODO: Continue refactor
|
// TODO: Continue refactor
|
||||||
|
|
||||||
type DialogType = 'confirm' | 'documentInfo' | 'editDossier' | 'addDossier' | 'assignFile';
|
type DialogType = 'confirm' | 'documentInfo' | 'editDossier' | 'addDossier' | 'assignFile' | 'recategorizeImage';
|
||||||
|
|
||||||
type DossiersDialogConfig = {
|
type DossiersDialogConfig = {
|
||||||
[key in DialogType]: {
|
[key in DialogType]: {
|
||||||
@ -61,6 +61,9 @@ export class DossiersDialogService extends DialogService<DialogType> {
|
|||||||
},
|
},
|
||||||
assignFile: {
|
assignFile: {
|
||||||
component: AssignReviewerApproverDialogComponent
|
component: AssignReviewerApproverDialogComponent
|
||||||
|
},
|
||||||
|
recategorizeImage: {
|
||||||
|
component: RecategorizeImageDialogComponent
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -120,24 +123,6 @@ export class DossiersDialogService extends DialogService<DialogType> {
|
|||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
openRecategorizeImageDialog(
|
|
||||||
$event: MouseEvent,
|
|
||||||
annotations: AnnotationWrapper[],
|
|
||||||
cb?: Function
|
|
||||||
): MatDialogRef<RecategorizeImageDialogComponent> {
|
|
||||||
$event?.stopPropagation();
|
|
||||||
const ref = this._dialog.open(RecategorizeImageDialogComponent, {
|
|
||||||
...dialogConfig,
|
|
||||||
data: annotations
|
|
||||||
});
|
|
||||||
ref.afterClosed().subscribe(async result => {
|
|
||||||
if (result && cb) {
|
|
||||||
cb(result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return ref;
|
|
||||||
}
|
|
||||||
|
|
||||||
openRemoveFromDictionaryDialog(
|
openRemoveFromDictionaryDialog(
|
||||||
$event: MouseEvent,
|
$event: MouseEvent,
|
||||||
annotations: AnnotationWrapper[],
|
annotations: AnnotationWrapper[],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user