From 5dcfea12dbcac07028dadf625dd5cec55249abe7 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Fri, 2 Feb 2024 16:55:33 +0200 Subject: [PATCH] RED-8252 - Separate help mode links --- .../annotation-actions.component.html | 18 +++++++++++++++--- .../annotation-actions.component.ts | 3 ++- .../annotation-wrapper.component.html | 2 +- .../annotation-wrapper.component.ts | 2 +- .../modules/file-preview/utils/constants.ts | 4 ++-- .../dictionary-manager.component.html | 5 +++-- .../src/assets/help-mode/help-mode-keys.json | 12 ------------ 7 files changed, 24 insertions(+), 22 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.html b/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.html index f483491fb..cd883f28c 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.html @@ -11,6 +11,7 @@ [tooltipPosition]="tooltipPosition" [tooltip]="resized ? ('annotation-actions.resize-accept.label' | translate) : ''" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="iqser:check" > @@ -19,6 +20,7 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.resize-cancel.label' | translate" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="iqser:close" > @@ -28,20 +30,20 @@ @@ -51,6 +53,7 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.accept-recommendation.label' | translate" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="iqser:check" > @@ -60,6 +63,7 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.convert-highlights.label' | translate" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="red:convert" > @@ -69,6 +73,7 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.remove-highlights.label' | translate" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="iqser:trash" > @@ -78,6 +83,7 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.undo' | translate" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="red:undo" > @@ -87,6 +93,7 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.undo' | translate" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="red:undo" > @@ -96,6 +103,7 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.see-references.label' | translate" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="red:reference" > @@ -105,6 +113,7 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.force-redaction.label' | translate" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="red:thumb-up" > @@ -114,6 +123,7 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.force-hint.label' | translate" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="red:thumb-up" > @@ -123,6 +133,7 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.hide' | translate" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="red:visibility-off" > @@ -132,16 +143,17 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.show' | translate" [type]="buttonType" + [attr.help-mode-key]="actionsHelpModeKey" icon="red:visibility" > diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts index 219ad821b..bb4f0ebb2 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts @@ -31,6 +31,7 @@ export class AnnotationActionsComponent implements OnChanges { @Input() tooltipPosition: 'before' | 'above' = 'before'; @Input() canPerformAnnotationActions: boolean; @Input() alwaysVisible: boolean; + @Input() actionsHelpModeKey: string; readonly roles = Roles; annotationPermissions: AnnotationPermissions; isImage = true; @@ -156,7 +157,7 @@ export class AnnotationActionsComponent implements OnChanges { } helpModeKey(action: string) { - return this.#isDocumine ? `${action}_annotation` : ''; + return this.#isDocumine ? `${action}_annotation` : this.actionsHelpModeKey; } #setPermissions() { diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.html b/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.html index b86f9db37..962c48416 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.html @@ -23,7 +23,7 @@
diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.ts index 3b2c9775c..33f94a0ec 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.ts @@ -18,7 +18,7 @@ export class AnnotationWrapperComponent implements OnChanges { @Input({ required: true }) annotation!: ListItem; @HostBinding('attr.annotation-id') annotationId: string; @HostBinding('class.active') active = false; - actionsHelpModeKey?: string; + actionsHelpModeKey: string; showComments = false; ngOnChanges() { diff --git a/apps/red-ui/src/app/modules/file-preview/utils/constants.ts b/apps/red-ui/src/app/modules/file-preview/utils/constants.ts index 3abcf54fc..066da5374 100644 --- a/apps/red-ui/src/app/modules/file-preview/utils/constants.ts +++ b/apps/red-ui/src/app/modules/file-preview/utils/constants.ts @@ -15,8 +15,8 @@ export const ActionsHelpModeKeys = { skipped: 'skipped', hint: 'hint_text', 'hint-ocr': 'hint_picture', - 'hint-formula': 'picture', - 'hint-image': 'hint_images', + 'hint-formula': 'hint_picture', + 'hint-image': 'hint_picture', } as const; export const ALL_HOTKEYS: List = ['Escape', 'F', 'f', 'ArrowUp', 'ArrowDown', 'H', 'h'] as const; diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html index 4ff625fef..14f119496 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.html @@ -54,7 +54,8 @@ {{ dossierTemplate.id ? dossierTemplate.name : (dossierTemplate.name | translate) }} @@ -71,7 +72,7 @@ [placeholder]="selectedDossier.dossierId ? selectedDossier.dossierName : (selectDictionary.label | translate)" > - + {{ dossier.dossierName }}