RED-5872 - Correct help mode links

This commit is contained in:
Valentin Mihai 2023-01-26 14:54:44 +02:00
parent 2fd84d5fce
commit 9bf9787566
8 changed files with 47 additions and 40 deletions

View File

@ -31,7 +31,7 @@
<div class="dialog-actions">
<iqser-icon-button
[disabled]="form.invalid || !changed"
[iqserHelpMode]="'sytem_configurations'"
[iqserHelpMode]="'system_configurations'"
[label]="'general-config-screen.actions.save' | translate"
[submit]="true"
[type]="iconButtonTypes.primary"

View File

@ -14,7 +14,7 @@
<div class="vertical-line"></div>
<div class="all-caps-label mr-16 ml-8 label">
{{ 'file-preview.last-assignee' | translate: { status: file.workflowStatus } }}
{{ 'file-preview.last-assignee' | translate : { status: file.workflowStatus } }}
</div>
<iqser-initials-avatar
@ -38,7 +38,7 @@
[dossier]="dossier"
[file]="file"
[minWidth]="width"
fileActionsHelpModeKey="document_features_in_editor"
[fileActionsHelpModeKey]="'editor_document_features'"
type="file-preview"
></redaction-file-actions>

View File

@ -8,7 +8,7 @@ export const ActionsHelpModeKeys = {
hint: 'hint_text',
'hint-ocr': 'hint_picture',
'hint-formula': 'picture',
'hint-image': 'picture',
'hint-image': 'hint_images',
} as const;
export const ALL_HOTKEYS: List = ['Escape', 'F', 'f', 'ArrowUp', 'ArrowDown', 'H', 'h'] as const;

View File

@ -11,11 +11,15 @@
</ng-container>
<ng-template #actions (longPress)="forceReanalysisAction($event)" redactionLongPress>
<div class="file-actions">
<div
class="file-actions"
[iqserHelpMode]="fileActionsHelpModeKey"
[scrollableParentView]="scrollableParentView"
[overlappingElements]="overlappingElements"
>
<redaction-expandable-file-actions
[actions]="buttons"
[buttonType]="buttonType"
[helpModeKey]="fileActionsHelpModeKey"
[maxWidth]="maxWidth"
[minWidth]="minWidth"
[tooltipPosition]="tooltipPosition"

View File

@ -7,6 +7,7 @@ import {
Input,
OnChanges,
Optional,
SimpleChanges,
ViewChild,
} from '@angular/core';
import { PermissionsService } from '@services/permissions.service';
@ -19,6 +20,9 @@ import {
IqserPermissionsService,
IqserTooltipPosition,
LoadingService,
OverlappingElements,
ScrollableParentView,
ScrollableParentViews,
Toaster,
} from '@iqser/common-ui';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
@ -55,7 +59,7 @@ export class FileActionsComponent implements OnChanges {
@Input() type: 'file-preview' | 'dossier-overview-list' | 'dossier-overview-workflow';
@Input() maxWidth: number;
@Input() minWidth: number;
@Input() fileActionsHelpModeKey: 'document_features_in_dossier' | 'document_features_in_editor' = 'document_features_in_dossier';
@Input() fileActionsHelpModeKey: 'dossier_features_in_dossier' | 'editor_document_features' = 'dossier_features_in_dossier';
toggleTooltip?: string;
assignTooltip?: string;
buttonType?: CircleButtonType;
@ -86,6 +90,8 @@ export class FileActionsComponent implements OnChanges {
tooltipPosition: IqserTooltipPosition;
buttons: Action[];
scrollableParentView: ScrollableParentView;
@ViewChild(ExpandableFileActionsComponent)
private readonly _expandableActionsComponent: ExpandableFileActionsComponent;
@ -269,8 +275,12 @@ export class FileActionsComponent implements OnChanges {
].filter(btn => btn.show);
}
ngOnChanges() {
ngOnChanges(changes: SimpleChanges) {
this._setup();
if (changes.fileActionsHelpModeKey) {
this.scrollableParentView =
this.fileActionsHelpModeKey === 'dossier_features_in_dossier' ? ScrollableParentViews.VIRTUAL_SCROLL : undefined;
}
}
async setFileApproved($event: MouseEvent) {
@ -463,4 +473,8 @@ export class FileActionsComponent implements OnChanges {
await firstValueFrom(this._filesService.setToNewFor([this.file], this.file.dossierId));
this._loadingService.stop();
}
get overlappingElements() {
return this.fileActionsHelpModeKey === 'editor_document_features' ? [OverlappingElements.USER_MENU] : [];
}
}

View File

@ -11,9 +11,6 @@
[tooltipPosition]="tooltipPosition"
[tooltip]="btn.tooltip | translate"
[type]="btn.buttonType || buttonType"
[iqserHelpMode]="helpModeKey"
[scrollableParentView]="scrollableParentView"
[overlappingElements]="overlappingElements"
></iqser-circle-button>
<!-- download redacted file-->
@ -24,9 +21,6 @@
[tooltipClass]="btn.tooltipClass"
[tooltipPosition]="tooltipPosition"
[type]="buttonType"
[iqserHelpMode]="helpModeKey"
[scrollableParentView]="scrollableParentView"
[overlappingElements]="overlappingElements"
></redaction-file-download-btn>
<!-- exclude from redaction -->
@ -39,9 +33,6 @@
[matTooltipPosition]="tooltipPosition"
[matTooltip]="btn.tooltip | translate"
[ngClass]="btn.class"
[iqserHelpMode]="helpModeKey"
[scrollableParentView]="scrollableParentView"
[overlappingElements]="overlappingElements"
color="primary"
></mat-slide-toggle>
</div>

View File

@ -1,14 +1,6 @@
import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core';
import { Action, ActionTypes, Dossier, File } from '@red/domain';
import {
CircleButtonType,
defaultDialogConfig,
IqserTooltipPosition,
OverlappingElements,
ScrollableParentView,
ScrollableParentViews,
Toaster,
} from '@iqser/common-ui';
import { CircleButtonType, defaultDialogConfig, IqserTooltipPosition, Toaster } from '@iqser/common-ui';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { FileDownloadService } from '@upload-download/services/file-download.service';
import { PermissionsService } from '@services/permissions.service';
@ -33,12 +25,10 @@ export class ExpandableFileActionsComponent implements OnChanges {
@Input() actions: Action[];
@Input() buttonType: CircleButtonType;
@Input() tooltipPosition: IqserTooltipPosition;
@Input() helpModeKey: 'document_features_in_dossier' | 'document_features_in_editor';
displayedButtons: Action[];
hiddenButtons: Action[];
expanded = false;
scrollableParentView: ScrollableParentView;
@ViewChild(MatMenuTrigger) matMenu: MatMenuTrigger;
@ -48,11 +38,6 @@ export class ExpandableFileActionsComponent implements OnChanges {
private readonly _permissionsService: PermissionsService,
private readonly _dialog: MatDialog,
) {}
get overlappingElements() {
return this.helpModeKey === 'document_features_in_editor' ? [OverlappingElements.USER_MENU] : [];
}
ngOnChanges(changes: SimpleChanges) {
if (changes.actions || changes.maxWidth || changes.minWidth) {
let count = 0;
@ -88,11 +73,6 @@ export class ExpandableFileActionsComponent implements OnChanges {
downloadBtn.disabled = !this._permissionsService.canDownloadFiles(downloadBtn.files, downloadBtn.dossier);
}
}
if (changes.helpModeKey) {
this.scrollableParentView =
this.helpModeKey === 'document_features_in_dossier' ? ScrollableParentViews.VIRTUAL_SCROLL : undefined;
}
}
onButtonClick(button: Action, $event: MouseEvent) {

View File

@ -209,6 +209,12 @@
"it": "",
"fr": ""
},
"hint_images": {
"en": "/en/index-en.html?contextId=hint_images",
"de": "",
"it": "",
"fr": ""
},
"workload_in_editor": {
"en": "/en/index-en.html?contextId=workload_in_editor",
"de": "",
@ -479,8 +485,8 @@
"it": "",
"fr": ""
},
"sytem_configurations": {
"en": "/en/index-en.html?contextId=sytem_configurations",
"system_configurations": {
"en": "/en/index-en.html?contextId=system_configurations",
"de": "",
"it": "",
"fr": ""
@ -508,5 +514,17 @@
"de": "",
"it": "",
"fr": ""
},
"dossier_features_in_dossier": {
"en": "/en/index-en.html?contextId=dossier_features_in_dossier",
"de": "",
"it": "",
"fr": ""
},
"editor_document_features": {
"en": "/en/index-en.html?contextId=editor_document_features",
"de": "",
"it": "",
"fr": ""
}
}