From e7eb80548d2da66bf52c299dc7a5eb9ecd50940d Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 13 Dec 2022 15:24:23 +0200 Subject: [PATCH] RED-3800 rss editing --- .../annotation-card.component.html | 2 +- .../annotation-card.component.ts | 5 ++- .../manual-annotation-dialog.component.html | 6 ++-- .../manual-annotation-dialog.component.ts | 5 +-- .../rss-dialog/rss-dialog.component.html | 31 ++++++++++--------- .../rss-dialog/rss-dialog.component.scss | 11 +++++++ apps/red-ui/src/assets/i18n/scm/en.json | 3 +- 7 files changed, 40 insertions(+), 23 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html b/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html index a9c7db561..5fbccad00 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html @@ -21,7 +21,7 @@ {{ annotation.entity.label }} -
+
: {{ annotation.shortContent }}
diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.ts index 24bc532c4..b085567d5 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.ts @@ -2,6 +2,8 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { MultiSelectService } from '../../services/multi-select.service'; import { annotationTypesTranslations } from '@translations/annotation-types-translations'; +import { ROLES } from '@users/roles'; +import { IqserPermissionsService } from '@iqser/common-ui'; @Component({ selector: 'redaction-annotation-card', @@ -10,9 +12,10 @@ import { annotationTypesTranslations } from '@translations/annotation-types-tran changeDetection: ChangeDetectionStrategy.OnPush, }) export class AnnotationCardComponent { + readonly roles = ROLES; annotationTypesTranslations = annotationTypesTranslations; @Input() annotation: AnnotationWrapper; @Input() isSelected = false; - constructor(readonly multiSelectService: MultiSelectService) {} + constructor(readonly iqserPermissionsService: IqserPermissionsService, readonly multiSelectService: MultiSelectService) {} } diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html index 241444383..c5a49d8a1 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html @@ -46,12 +46,12 @@ [value]="dictionary.type" matTooltipPosition="after" > - {{ dictionary.label }} {{ dictionary.hasDictionary }} + {{ dictionary.label }}
-
+
-
+
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 3f21c6c0e..6f158fd0c 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -23,6 +23,7 @@ export interface LegalBasisOption { styleUrls: ['./manual-annotation-dialog.component.scss'], }) export class ManualAnnotationDialogComponent extends BaseDialogComponent implements OnInit { + readonly roles = ROLES; readonly circleButtonTypes = CircleButtonTypes; isDictionaryRequest: boolean; isFalsePositiveRequest: boolean; @@ -36,7 +37,7 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme private readonly _dossier: Dossier; constructor( - private readonly _iqserPermissionsService: IqserPermissionsService, + readonly iqserPermissionsService: IqserPermissionsService, private readonly _justificationsService: JustificationsService, private readonly _manualRedactionService: ManualRedactionService, activeDossiersService: ActiveDossiersService, @@ -171,7 +172,7 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme addRedactionRequest.legalBasis = legalOption.legalBasis; } - if (this._iqserPermissionsService.has(ROLES.getRss)) { + if (this.iqserPermissionsService.has(ROLES.getRss)) { const selectedType = this.possibleDictionaries.find(d => d.type === addRedactionRequest.type); console.log(selectedType.hasDictionary); addRedactionRequest.addToDictionary = selectedType.hasDictionary; diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.html index 78dfef15f..88ec0641b 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.html @@ -7,16 +7,7 @@
Component
Value
Transformation
-
- Annotations -
-
-
Type
-
Rule
-
Pages
-
Reason
-
-
+
Annotations
{{ entry.key }}
@@ -34,7 +25,7 @@ (action)="undo(entry)" *ngIf="entry.value.value" [showDot]="true" - [tooltip]="'rss-dialog.actions.undo' | translate" + [tooltip]="'rss-dialog.actions.undo' | translate: { value: entry.value.originalValue }" [type]="iconButtonTypes.dark" class="ml-2" icon="red:undo" @@ -46,10 +37,20 @@
    -
  • - Type: {{ annotation.type }}, Rule: {{ annotation.ruleNumber }}, - Pages: {{ annotation.pages.join(',') }}, Reason: {{ annotation.reason }} -
  • +
- diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.scss b/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.scss index 60782ce67..cf04f8aa6 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.scss +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.scss @@ -52,3 +52,14 @@ display: grid; grid-template-columns: 3fr 1fr 1fr 5fr; } + +ul { + margin: 0; +} + +.output-data > div:nth-child(8n + 9), +.output-data > div:nth-child(8n + 10), +.output-data > div:nth-child(8n + 11), +.output-data > div:nth-child(8n + 12) { + background: var(--iqser-grey-8); +} diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index e4c0f2681..634c5d846 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -1959,8 +1959,9 @@ "export-json": "Export JSON", "export-xml": "Export XML", "save": "Save", - "undo": "Undo" + "undo": "Undo to: {value}" }, + "annotations": "{type} found on {pageCount, plural, one{page} other{pages}} {pages} by rule #{ruleNumber}", "title": "Structured Component Management" }, "rules-screen": {