From 2a16675bdfe385a767bdeffce4e62a25b593f8bc Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Mon, 28 Jun 2021 17:22:59 +0300 Subject: [PATCH] add filter for redactions with reason changes --- .../src/app/models/file/annotation.wrapper.ts | 2 + .../file/redaction-log-entry.wrapper.ts | 1 + .../file-workload/file-workload.component.ts | 12 +++++ .../services/annotation-processing.service.ts | 5 +- .../src/app/modules/icons/icons.module.ts | 1 + .../popup-filter/popup-filter.component.html | 48 ++++++++----------- .../src/assets/icons/general/reason.svg | 1 + 7 files changed, 39 insertions(+), 31 deletions(-) create mode 100644 apps/red-ui/src/assets/icons/general/reason.svg diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index 232a238d8..ebed53aca 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -39,6 +39,7 @@ export class AnnotationWrapper { positions: Rectangle[]; recommendationType: string; legalBasis: string; + legalBasisChangeValue?: string; image?: boolean; force?: boolean; @@ -234,6 +235,7 @@ export class AnnotationWrapper { annotationWrapper.dictionaryOperation = redactionLogEntry.dictionaryEntry; annotationWrapper.userId = redactionLogEntry.userId; annotationWrapper.image = redactionLogEntry.image; + annotationWrapper.legalBasisChangeValue = redactionLogEntry.legalBasisChangeValue; annotationWrapper.comments = redactionLogEntry.comments || []; annotationWrapper.legalBasis = redactionLogEntry.legalBasis; AnnotationWrapper._createContent(annotationWrapper, redactionLogEntry); diff --git a/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts b/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts index ea61f36ff..c407b4cbe 100644 --- a/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts +++ b/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts @@ -28,6 +28,7 @@ export interface RedactionLogEntryWrapper { actionPendingReanalysis?: boolean; hidden?: boolean; + legalBasisChangeValue?: string; userId?: string; comments?: Comment[]; 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 9b72900e1..698f66f9b 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 @@ -74,6 +74,18 @@ export class FileWorkloadComponent { private _multiSelectActive = false; + get isProcessing(): boolean { + return this.fileData?.fileStatus?.isProcessing; + } + + get activeAnnotationsLength(): number | undefined { + return this.displayedAnnotations[this.activeViewerPage]?.annotations?.length; + } + + get isReadOnly(): boolean { + return !this._permissionsService.canPerformAnnotationActions(); + } + get multiSelectActive(): boolean { return this._multiSelectActive; } diff --git a/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts b/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts index bcb1319b3..d189d56fc 100644 --- a/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts @@ -19,12 +19,13 @@ export class AnnotationProcessingService { }, { key: 'with-reason-changes', - icon: 'red:comment', + icon: 'red:reason', label: 'filter-menu.with-reason-changes', checked: false, topLevelFilter: true, filters: [], - checker: (annotation: AnnotationWrapper) => annotation?.comments?.length > 0 + checker: (annotation: AnnotationWrapper) => + annotation?.legalBasisChangeValue?.length > 0 } ]; } diff --git a/apps/red-ui/src/app/modules/icons/icons.module.ts b/apps/red-ui/src/app/modules/icons/icons.module.ts index 0fed86bb4..0fdd3947e 100644 --- a/apps/red-ui/src/app/modules/icons/icons.module.ts +++ b/apps/red-ui/src/app/modules/icons/icons.module.ts @@ -66,6 +66,7 @@ export class IconsModule { 'radio-selected', 'read-only', 'ready-for-approval', + 'reason', 'refresh', 'remove-from-dict', 'report', diff --git a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html index 924a1d038..330c9184c 100644 --- a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html +++ b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html @@ -37,13 +37,11 @@
@@ -52,13 +50,11 @@
@@ -93,17 +89,13 @@ class="filter-menu-checkbox" >
@@ -117,17 +109,15 @@ [checked]="subFilter.checked" >
diff --git a/apps/red-ui/src/assets/icons/general/reason.svg b/apps/red-ui/src/assets/icons/general/reason.svg new file mode 100644 index 000000000..2c3bfed3f --- /dev/null +++ b/apps/red-ui/src/assets/icons/general/reason.svg @@ -0,0 +1 @@ + \ No newline at end of file