diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.html b/apps/red-ui/src/app/components/base-screen/base-screen.component.html index 20eb64e45..d26b35bc0 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.html +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.html @@ -1,4 +1,4 @@ - +
@@ -21,11 +21,11 @@ - + + @@ -21,20 +21,18 @@
- +
@@ -44,7 +42,7 @@ [config]="translateChartService.translateDossierStates(dossierTemplate.dossiersChartConfig, dossierTemplate.id)" [radius]="63" [strokeWidth]="15" - [subtitles]="['dossier-template-stats.active-dossiers' | translate : { count: dossierTemplate.numberOfActiveDossiers }]" + [subtitles]="['dossier-template-stats.active-dossiers' | translate: { count: dossierTemplate.numberOfActiveDossiers }]" direction="row" totalType="sum" > @@ -76,7 +74,7 @@ *ngIf="permissionsService.canCreateDossier(dossierTemplate)" [label]="'dashboard.empty-template.new-dossier' | translate" [type]="iconButtonTypes.primary" - [attr.help-mode-key]="'new_dossier_button'" + [attr.help-mode-key]="'new_dossier'" icon="iqser:plus" > diff --git a/apps/red-ui/src/app/modules/dossier-overview/components/screen-header/dossier-overview-screen-header.component.html b/apps/red-ui/src/app/modules/dossier-overview/components/screen-header/dossier-overview-screen-header.component.html index 9db020284..1a46d08ff 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/components/screen-header/dossier-overview-screen-header.component.html +++ b/apps/red-ui/src/app/modules/dossier-overview/components/screen-header/dossier-overview-screen-header.component.html @@ -7,7 +7,7 @@ > this.#openEditDossierDialog(dossierId), icon: 'iqser:edit', hide: !this.#currentUser.isManager && !this._iqserPermissionsService.has(Roles.dossiers.edit), - helpModeKey: 'edit_dossier_in_dossier', + helpModeKey: 'edit_dossier', disabled$, }, ]; @@ -446,28 +446,28 @@ export class ConfigService { required: true, checker: this._recentlyModifiedChecker, disabled: entities.filter(this._recentlyModifiedChecker).length === 0, - helpModeKey: 'filter_document_list', + helpModeKey: 'quick_filters_documents', }, { id: 'assigned-to-me', label: this._translateService.instant('dossier-overview.quick-filters.assigned-to-me'), checker: this._assignedToMeChecker, disabled: entities.filter(this._assignedToMeChecker).length === 0, - helpModeKey: 'filter_document_list', + helpModeKey: 'quick_filters_documents', }, { id: 'unassigned', label: this._translateService.instant('dossier-overview.quick-filters.unassigned'), checker: this._unassignedChecker, disabled: entities.filter(this._unassignedChecker).length === 0, - helpModeKey: 'filter_document_list', + helpModeKey: 'quick_filters_documents', }, { id: 'assigned-to-others', label: this._translateService.instant('dossier-overview.quick-filters.assigned-to-others'), checker: this._assignedToOthersChecker, disabled: entities.filter(this._assignedToOthersChecker).length === 0, - helpModeKey: 'filter_document_list', + helpModeKey: 'quick_filters_documents', }, ].map(filter => new NestedFilter(filter)); } diff --git a/apps/red-ui/src/app/modules/dossier-overview/screen/dossier-overview-screen.component.html b/apps/red-ui/src/app/modules/dossier-overview/screen/dossier-overview-screen.component.html index 5f60630ae..774daaa1e 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/screen/dossier-overview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier-overview/screen/dossier-overview-screen.component.html @@ -41,6 +41,7 @@ [noDataIcon]="'iqser:document'" [noDataText]="'dossier-overview.no-data.title' | translate" [showNoDataButton]="true" + [id]="'workflow-view'" addElementColumn="NEW" > diff --git a/apps/red-ui/src/app/modules/dossiers-listing/config.service.ts b/apps/red-ui/src/app/modules/dossiers-listing/config.service.ts index 5245afec3..5f6490ad0 100644 --- a/apps/red-ui/src/app/modules/dossiers-listing/config.service.ts +++ b/apps/red-ui/src/app/modules/dossiers-listing/config.service.ts @@ -69,7 +69,7 @@ export class ConfigService { hide: !this._permissionsService.canCreateDossier(dossierTemplate), icon: 'iqser:plus', type: 'primary', - helpModeKey: 'new_dossier_button', + helpModeKey: 'new_dossier', }, ]; } @@ -226,14 +226,14 @@ export class ConfigService { label: this._translateService.instant('dossier-listing.quick-filters.owner'), checker: dossierOwnerQuickChecker(userId), disabled: entities.filter(dossierOwnerQuickChecker(userId)).length === 0, - helpModeKey: 'filter_dossier_list', + helpModeKey: 'quick_filter_dossiers', }, { id: 'member', label: this._translateService.instant('dossier-listing.quick-filters.member'), checker: dossierMemberQuickChecker(userId), disabled: entities.filter(dossierMemberQuickChecker(userId)).length === 0, - helpModeKey: 'filter_dossier_list', + helpModeKey: 'quick_filter_dossiers', }, ].map(filter => new NestedFilter(filter)); } 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 eae5e9d7d..23d3978c5 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 @@ -30,20 +30,17 @@ [tooltipPosition]="tooltipPosition" [tooltip]="'annotation-actions.resize.label' | translate" [type]="buttonType" + [attr.help-mode-key]="helpModeKey('resize')" icon="red:resize" > @@ -139,10 +136,11 @@ 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 b368cea86..b9a28495d 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 @@ -1,5 +1,5 @@ import { Component, computed, Input, OnChanges } from '@angular/core'; -import { HelpModeService, IqserPermissionsService } from '@iqser/common-ui'; +import { getConfig, HelpModeService, IqserPermissionsService } from '@iqser/common-ui'; import { AnnotationPermissions } from '@models/file/annotation.permissions'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { PermissionsService } from '@services/permissions.service'; @@ -24,8 +24,6 @@ export type AnnotationButtonType = keyof typeof AnnotationButtonTypes; styleUrls: ['./annotation-actions.component.scss'], }) export class AnnotationActionsComponent implements OnChanges { - #annotations: AnnotationWrapper[] = []; - protected _annotationId = ''; @Input() buttonType: AnnotationButtonType = AnnotationButtonTypes.default; @Input() tooltipPosition: 'before' | 'above' = 'before'; @Input() canPerformAnnotationActions: boolean; @@ -33,10 +31,45 @@ export class AnnotationActionsComponent implements OnChanges { readonly roles = Roles; annotationPermissions: AnnotationPermissions; isImage = true; + protected _annotationId = ''; + #annotations: AnnotationWrapper[] = []; readonly isVisible = computed(() => { const hidden = this._annotationManager.hidden(); return this.#annotations.reduce((acc, annotation) => !hidden.has(annotation.id) && acc, true); }); + readonly #isDocumine = getConfig().IS_DOCUMINE; + + get annotations(): AnnotationWrapper[] { + return this.#annotations; + } + + @Input() + set annotations(annotations: AnnotationWrapper[]) { + this.#annotations = annotations.filter(a => a !== undefined); + this.isImage = this.#annotations?.reduce((accumulator, annotation) => annotation.isImage && accumulator, true); + this._annotationId = this.#annotations[0]?.id; + } + + get canEdit(): boolean { + const documineCanEditRedactions = + this.annotationPermissions.canChangeLegalBasis || + this.annotationPermissions.canRecategorizeAnnotation || + this.annotationPermissions.canForceHint || + this.annotationPermissions.canForceRedaction; + return this.#isDocumine && this.annotations.length > 1 ? this.annotationPermissions.canEditAnnotations : documineCanEditRedactions; + } + + get canRemoveRedaction(): boolean { + return (this.#isDocumine || this.annotations.length === 1) && this.annotationPermissions.canRemoveRedaction; + } + + get viewerAnnotations() { + return this._annotationManager.get(this.#annotations); + } + + get resizing() { + return this.#annotations?.length === 1 && this.#annotations?.[0].id === this._annotationManager.resizingAnnotationId; + } constructor( readonly viewModeService: ViewModeService, @@ -50,31 +83,12 @@ export class AnnotationActionsComponent implements OnChanges { readonly annotationReferencesService: AnnotationReferencesService, ) {} - get annotations(): AnnotationWrapper[] { - return this.#annotations; - } - - @Input() - set annotations(annotations: AnnotationWrapper[]) { - this.#annotations = annotations.filter(a => a !== undefined); - this.isImage = this.#annotations?.reduce((accumulator, annotation) => annotation.isImage && accumulator, true); - this._annotationId = this.#annotations[0]?.id; - } - - get viewerAnnotations() { - return this._annotationManager.get(this.#annotations); - } - - get resizing() { - return this.#annotations?.length === 1 && this.#annotations?.[0].id === this._annotationManager.resizingAnnotationId; - } - ngOnChanges(): void { this.#setPermissions(); } removeOrSuggestRemoveRedaction() { - this.annotationActionsService.removeRedaction(this.annotations[0], this.annotationPermissions); + this.annotationActionsService.removeRedaction(this.annotations, this.annotationPermissions); } acceptRecommendation() { @@ -113,4 +127,8 @@ export class AnnotationActionsComponent implements OnChanges { this._iqserPermissionsService, ); } + + helpModeKey(action: string) { + return this.#isDocumine ? `${action}_annotation` : ''; + } } 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 a8046088a..5ec1cb170 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 @@ -4,6 +4,7 @@ import { PdfProxyService } from '../../services/pdf-proxy.service'; import { ActionsHelpModeKeys } from '../../utils/constants'; import { ListItem } from '@models/file/list-item'; import { MultiSelectService } from '../../services/multi-select.service'; +import { getConfig } from '@iqser/common-ui'; @Component({ selector: 'redaction-annotation-wrapper', @@ -16,6 +17,7 @@ export class AnnotationWrapperComponent implements OnChanges { @HostBinding('attr.annotation-id') annotationId: string; @HostBinding('class.active') active = false; actionsHelpModeKey?: string; + readonly #isDocumine = getConfig().IS_DOCUMINE; protected readonly _pdfProxyService = inject(PdfProxyService); protected readonly _multiSelectService = inject(MultiSelectService); @@ -26,11 +28,14 @@ export class AnnotationWrapperComponent implements OnChanges { } #getActionsHelpModeKey(): string { - const type = this.annotation.item.typeLabel?.split('.')[1]; - const typeValue = this.annotation.item.typeValue; - if (type === 'hint' && (typeValue === 'ocr' || typeValue === 'formula' || typeValue === 'image')) { - return ActionsHelpModeKeys[`${type}-${typeValue}`]; + if (!this.#isDocumine) { + const type = this.annotation.item.typeLabel?.split('.')[1]; + const typeValue = this.annotation.item.typeValue; + if (type === 'hint' && (typeValue === 'ocr' || typeValue === 'formula' || typeValue === 'image')) { + return ActionsHelpModeKeys[`${type}-${typeValue}`]; + } + return ActionsHelpModeKeys[type]; } - return ActionsHelpModeKeys[type]; + return ''; } } diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.html index 4b6a9beba..ab5ab8c6b 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.html @@ -20,7 +20,7 @@
@@ -28,7 +28,7 @@ +
-
- - {{ redactedText }} +
+ + +
    +
  • {{ text }}
  • +
+
- - + {{ displayedDictionaryLabel }}