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 661024ca0..f2b1822f0 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
@@ -32,7 +32,7 @@
>
();
annotationPermissions: AnnotationPermissions;
constructor(
readonly annotationActionsService: AnnotationActionsService,
private readonly _permissionsService: PermissionsService,
+ private readonly _dossiersService: DossiersService,
private readonly _userService: UserService,
) {}
@@ -67,23 +69,21 @@ export class AnnotationActionsComponent implements OnChanges {
return this.annotations?.length === 1 && this.annotations?.[0].resizing;
}
+ private get _dossier(): Dossier {
+ return this._dossiersService.find(this.file.dossierId);
+ }
+
ngOnChanges(): void {
this._setPermissions();
}
suggestRemoveAnnotations($event, removeFromDict: boolean) {
$event.stopPropagation();
- this.annotationActionsService.suggestRemoveAnnotation(
- $event,
- this.annotations,
- this.dossier,
- removeFromDict,
- this.annotationsChanged,
- );
+ this.annotationActionsService.suggestRemoveAnnotation($event, this.annotations, this.file, removeFromDict, this.annotationsChanged);
}
markAsFalsePositive($event) {
- this.annotationActionsService.markAsFalsePositive($event, this.annotations, this.dossier, this.annotationsChanged);
+ this.annotationActionsService.markAsFalsePositive($event, this.annotations, this.file, this.annotationsChanged);
}
hideAnnotation($event: MouseEvent) {
@@ -105,7 +105,7 @@ export class AnnotationActionsComponent implements OnChanges {
}
acceptResize($event: MouseEvent) {
- this.annotationActionsService.acceptResize($event, this.viewer, this.dossier, this.annotations[0], this.annotationsChanged);
+ this.annotationActionsService.acceptResize($event, this.viewer, this.file, this.annotations[0], this.annotationsChanged);
}
cancelResize($event: MouseEvent) {
@@ -114,7 +114,7 @@ export class AnnotationActionsComponent implements OnChanges {
private _setPermissions() {
this.annotationPermissions = AnnotationPermissions.forUser(
- this._permissionsService.isApprover(this.dossier),
+ this._permissionsService.isApprover(this._dossier),
this._userService.currentUser,
this.annotations,
);
diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html
index c6463bd9e..6fdbcb1ad 100644
--- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html
+++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html
@@ -56,7 +56,7 @@
[alwaysVisible]="true"
[annotations]="selectedAnnotations"
[canPerformAnnotationActions]="!isReadOnly"
- [dossier]="dossier"
+ [file]="file"
[viewer]="viewer"
buttonType="primary"
tooltipPosition="above"
diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts
index 1741d5210..23ca8210f 100644
--- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts
+++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts
@@ -19,7 +19,7 @@ import { PermissionsService } from '@services/permissions.service';
import { WebViewerInstance } from '@pdftron/webviewer';
import { BehaviorSubject, combineLatest, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
-import { Dossier, File, IViewedPage } from '@red/domain';
+import { File, IViewedPage } from '@red/domain';
const COMMAND_KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Escape'];
const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
@@ -41,7 +41,6 @@ export class FileWorkloadComponent {
@Input() dialogRef: MatDialogRef;
@Input() viewedPages: IViewedPage[];
@Input() @Required() file!: File;
- @Input() @Required() dossier!: Dossier;
@Input() hideSkipped: boolean;
@Input() showExcludedPages: boolean;
@Input() annotationActionsTemplate: TemplateRef;
diff --git a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts
index 2b98ab406..d835e71af 100644
--- a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts
+++ b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts
@@ -466,12 +466,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
}
this.instance.UI.annotationPopup.add(
- this._annotationActionsService.getViewerAvailableActions(
- this.instance,
- this._dossier,
- annotationWrappers,
- this.annotationsChanged,
- ),
+ this._annotationActionsService.getViewerAvailableActions(this.instance, this.file, annotationWrappers, this.annotationsChanged),
);
}
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts
index bafec82ce..55ce35c2b 100644
--- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts
+++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts
@@ -7,7 +7,8 @@ import { ManualAnnotationService } from '../../services/manual-annotation.servic
import { ManualAnnotationResponse } from '@models/file/manual-annotation-response';
import { PermissionsService } from '@services/permissions.service';
import { JustificationsService } from '@services/entity-services/justifications.service';
-import { Dictionary, Dossier, IAddRedactionRequest } from '@red/domain';
+import { Dictionary, Dossier, File, IAddRedactionRequest } from '@red/domain';
+import { DossiersService } from '@services/entity-services/dossiers.service';
export interface LegalBasisOption {
label?: string;
@@ -30,16 +31,20 @@ export class ManualAnnotationDialogComponent implements OnInit {
redactionDictionaries: Dictionary[] = [];
legalOptions: LegalBasisOption[] = [];
+ private readonly _dossier: Dossier;
+
constructor(
private readonly _appStateService: AppStateService,
private readonly _formBuilder: FormBuilder,
private readonly _justificationsService: JustificationsService,
private readonly _manualAnnotationService: ManualAnnotationService,
private readonly _permissionsService: PermissionsService,
+ private readonly _dossiersService: DossiersService,
public dialogRef: MatDialogRef,
- @Inject(MAT_DIALOG_DATA) public data: { manualRedactionEntryWrapper: ManualRedactionEntryWrapper; dossier: Dossier },
+ @Inject(MAT_DIALOG_DATA) public data: { manualRedactionEntryWrapper: ManualRedactionEntryWrapper; file: File },
) {
- this.isDocumentAdmin = this._permissionsService.isApprover(this.data.dossier);
+ this._dossier = this._dossiersService.find(this.data.file.dossierId);
+ this.isDocumentAdmin = this._permissionsService.isApprover(this._dossier);
this.isFalsePositiveRequest = this.data.manualRedactionEntryWrapper.type === 'FALSE_POSITIVE';
this.isDictionaryRequest = this.data.manualRedactionEntryWrapper.type === 'DICTIONARY' || this.isFalsePositiveRequest;
@@ -49,32 +54,8 @@ export class ManualAnnotationDialogComponent implements OnInit {
this.redactionDictionaries = this._redactionDictionaries;
}
- private _getForm(): FormGroup {
- return this._formBuilder.group({
- reason: this.isDictionaryRequest ? [null] : [null, Validators.required],
- dictionary: this.isDictionaryRequest
- ? [this.isFalsePositiveRequest ? 'false_positive' : null, Validators.required]
- : ['manual', Validators.required],
- comment: this.isDocumentAdmin ? [null] : [null, Validators.required],
- });
- }
-
- private get _redactionDictionaries(): Dictionary[] {
- const redactionDictionaries: Dictionary[] = [];
-
- for (const key of Object.keys(this._appStateService.dictionaryData[this.data.dossier.dossierTemplateId])) {
- const dictionaryData = this._appStateService.getDictionary(key, this.data.dossier.dossierTemplateId);
- if (!dictionaryData.virtual && dictionaryData.addToDictionaryAction) {
- redactionDictionaries.push(dictionaryData);
- }
- }
- redactionDictionaries.sort((a, b) => a.label.localeCompare(b.label));
-
- return redactionDictionaries;
- }
-
get title() {
- return this._manualAnnotationService.getTitle(this.data.manualRedactionEntryWrapper.type, this.data.dossier);
+ return this._manualAnnotationService.getTitle(this.data.manualRedactionEntryWrapper.type, this._dossier);
}
get displayedDictionaryLabel() {
@@ -85,8 +66,23 @@ export class ManualAnnotationDialogComponent implements OnInit {
return null;
}
+ private get _redactionDictionaries(): Dictionary[] {
+ const redactionDictionaries: Dictionary[] = [];
+ const dossier = this._dossier;
+
+ for (const key of Object.keys(this._appStateService.dictionaryData[dossier.dossierTemplateId])) {
+ const dictionaryData = this._appStateService.getDictionary(key, dossier.dossierTemplateId);
+ if (!dictionaryData.virtual && dictionaryData.addToDictionaryAction) {
+ redactionDictionaries.push(dictionaryData);
+ }
+ }
+ redactionDictionaries.sort((a, b) => a.label.localeCompare(b.label));
+
+ return redactionDictionaries;
+ }
+
async ngOnInit() {
- const data = await this._justificationsService.getForDossierTemplate(this.data.dossier.dossierTemplateId).toPromise();
+ const data = await this._justificationsService.getForDossierTemplate(this._dossier.dossierTemplateId).toPromise();
this.legalOptions = data.map(lbm => ({
legalBasis: lbm.reason,
@@ -99,12 +95,10 @@ export class ManualAnnotationDialogComponent implements OnInit {
handleAddRedaction() {
this._enhanceManualRedaction(this.data.manualRedactionEntryWrapper.manualRedactionEntry);
- this._manualAnnotationService
- .addAnnotation(this.data.manualRedactionEntryWrapper.manualRedactionEntry, this.data.dossier)
- .subscribe(
- response => this.dialogRef.close(new ManualAnnotationResponse(this.data.manualRedactionEntryWrapper, response)),
- () => this.dialogRef.close(),
- );
+ this._manualAnnotationService.addAnnotation(this.data.manualRedactionEntryWrapper.manualRedactionEntry, this.data.file).subscribe(
+ response => this.dialogRef.close(new ManualAnnotationResponse(this.data.manualRedactionEntryWrapper, response)),
+ () => this.dialogRef.close(),
+ );
}
format(value: string) {
@@ -115,6 +109,16 @@ export class ManualAnnotationDialogComponent implements OnInit {
);
}
+ private _getForm(): FormGroup {
+ return this._formBuilder.group({
+ reason: this.isDictionaryRequest ? [null] : [null, Validators.required],
+ dictionary: this.isDictionaryRequest
+ ? [this.isFalsePositiveRequest ? 'false_positive' : null, Validators.required]
+ : ['manual', Validators.required],
+ comment: this.isDocumentAdmin ? [null] : [null, Validators.required],
+ });
+ }
+
private _enhanceManualRedaction(addRedactionRequest: IAddRedactionRequest) {
const legalOption: LegalBasisOption = this.redactionForm.get('reason').value;
addRedactionRequest.type = this.redactionForm.get('dictionary').value;
diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html
index 99bb129ec..fbeef0359 100644
--- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html
+++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html
@@ -1,222 +1,223 @@
-