From 32d6a894fc002b0e83c17376a61213876e4bbe31 Mon Sep 17 00:00:00 2001 From: Edi Cziszter Date: Sun, 16 Jan 2022 13:43:01 +0200 Subject: [PATCH] removed useless stuff & show button if annotation has references --- .../annotation-actions.component.html | 2 +- ...nnotation-references-dialog.component.html | 12 ++++------ ...nnotation-references-dialog.component.scss | 8 +++++++ .../annotation-references-dialog.component.ts | 1 + .../file-preview-screen.component.ts | 1 - .../services/annotation-references.service.ts | 4 ++++ .../services/dossiers-dialog.service.ts | 1 - apps/red-ui/src/assets/i18n/de.json | 22 ++++++++++++++++--- apps/red-ui/src/assets/i18n/en.json | 4 ++++ .../src/assets/icons/general/reference.svg | 3 +-- 10 files changed, 42 insertions(+), 16 deletions(-) diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.html index 548fe9710..ebdcd32f0 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-actions/annotation-actions.component.html @@ -89,7 +89,7 @@
- {{ annotationReferences.length }} {{ annotationReferences.length === 1 ? 'REFERENCE' : 'REFERENCES' }} + {{ annotationReferences.length }} + {{ (annotationReferences.length === 1 ? 'references.singular' : 'references.plural') | translate }}
-
+
-
+
{ + console.log(this.annotation); await this.setReferences(); } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 77c0624eb..8246c2072 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -89,7 +89,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni ready = false; private _instance: WebViewerInstance; private _lastPage: string; - private _reloadFileOnReanalysis = false; @ViewChild('fileWorkloadComponent') private readonly _workloadComponent: FileWorkloadComponent; @ViewChild('annotationFilterTemplate', { diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/annotation-references.service.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/annotation-references.service.ts index 03651811d..26cc1f09e 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/annotation-references.service.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/annotation-references.service.ts @@ -12,6 +12,10 @@ export class AnnotationReferencesService { this.annotation$ = this._annotation$.asObservable().pipe(shareDistinctLast()); } + hasReferences(annotations: AnnotationWrapper[]): boolean { + return !!annotations[0].reference && annotations[0].reference.length !== 0; + } + show(annotations: AnnotationWrapper[]) { this._annotation$.next(annotations[0]); } diff --git a/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts b/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts index ae70049f4..ca5aef32e 100644 --- a/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts @@ -11,7 +11,6 @@ import { ChangeLegalBasisDialogComponent } from '../dialogs/change-legal-basis-d import { RecategorizeImageDialogComponent } from '../dialogs/recategorize-image-dialog/recategorize-image-dialog.component'; import { ConfirmationDialogComponent, DialogConfig, DialogService, largeDialogConfig } from '@iqser/common-ui'; import { ResizeAnnotationDialogComponent } from '../dialogs/resize-annotation-dialog/resize-annotation-dialog.component'; -import { AnnotationReferencesDialogComponent } from '../screens/file-preview-screen/components/annotation-references-dialog/annotation-references-dialog.component'; type DialogType = | 'confirm' diff --git a/apps/red-ui/src/assets/i18n/de.json b/apps/red-ui/src/assets/i18n/de.json index 0d8eb9e41..5ab3ee049 100644 --- a/apps/red-ui/src/assets/i18n/de.json +++ b/apps/red-ui/src/assets/i18n/de.json @@ -141,7 +141,20 @@ "settings": "Einstellungen" }, "annotation": "Anmerkung", + "references": { + "singular": "", + "plural": "" + }, "annotation-actions": { + "resize": { + "label": "Größe ändern" + }, + "resize-accept": { + "label": "Größe speichern" + }, + "resize-cancel": { + "label": "Größenänderung abbrechen" + }, "accept-recommendation": { "label": "Empfehlung annehmen" }, @@ -151,12 +164,15 @@ "edit-reason": { "label": "Begründung bearbeiten" }, - "force-hint": { - "label": "Hinweis erzwingen" - }, "force-redaction": { "label": "Schwärzung erzwingen" }, + "see-references": { + "label": "" + }, + "force-hint": { + "label": "Hinweis erzwingen" + }, "hide": "Ausblenden", "message": { "dictionary": { diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index f64b1d60d..b17b42042 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -141,6 +141,10 @@ "settings": "Settings" }, "annotation": "Annotation", + "references": { + "singular": "REFERENCE", + "plural": "REFERENCES" + }, "annotation-actions": { "accept-recommendation": { "label": "Accept Recommendation" diff --git a/apps/red-ui/src/assets/icons/general/reference.svg b/apps/red-ui/src/assets/icons/general/reference.svg index ccbd1c2ea..77e985170 100644 --- a/apps/red-ui/src/assets/icons/general/reference.svg +++ b/apps/red-ui/src/assets/icons/general/reference.svg @@ -1,6 +1,5 @@ - status @@ -10,4 +9,4 @@ - \ No newline at end of file +