Refactor dossiers dialog service: change legal basis
This commit is contained in:
parent
40a361a689
commit
dc810ae491
@ -59,7 +59,7 @@ export class AnnotationActionsService {
|
||||
}
|
||||
|
||||
changeLegalBasis($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter<AnnotationWrapper>) {
|
||||
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),
|
||||
|
||||
@ -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<DialogType> {
|
||||
},
|
||||
recategorizeImage: {
|
||||
component: RecategorizeImageDialogComponent
|
||||
},
|
||||
changeLegalBasis: {
|
||||
component: ChangeLegalBasisDialogComponent
|
||||
}
|
||||
};
|
||||
|
||||
@ -105,24 +108,6 @@ export class DossiersDialogService extends DialogService<DialogType> {
|
||||
return ref;
|
||||
}
|
||||
|
||||
openChangeLegalBasisDialog(
|
||||
$event: MouseEvent,
|
||||
annotations: AnnotationWrapper[],
|
||||
cb?: Function
|
||||
): MatDialogRef<ChangeLegalBasisDialogComponent> {
|
||||
$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[],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user