From bfb418fdfdde308b80b1ee3092229fac24824771 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Thu, 28 Nov 2024 16:23:01 +0200 Subject: [PATCH 01/17] RED-10563: fixed pdf search input. --- .../pdf-viewer/services/pdf-viewer.service.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts index 5be425c50..87ce5cff8 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts @@ -115,6 +115,11 @@ export class PdfViewer { return page$.pipe(map(page => this.#adjustPage(page))); } + get #searchInput() { + const iframeWindow = this.#instance.UI.iframeWindow; + return iframeWindow.document.getElementById('SearchPanel__input') as HTMLInputElement; + } + activateSearch() { this.#instance.UI.searchTextFull('', this.searchOptions); } @@ -292,13 +297,13 @@ export class PdfViewer { #listenForShift() { this.#instance.UI.iframeWindow.addEventListener('keydown', e => { - e.preventDefault(); + if (e.target === this.#searchInput) return; if (e.key === 'Shift') { this.#setSelectionMode(SelectionModes.RECTANGULAR); } }); this.#instance.UI.iframeWindow.addEventListener('keyup', e => { - e.preventDefault(); + if (e.target === this.#searchInput) return; if (e.key === 'Shift') { this.#setSelectionMode(SelectionModes.STRUCTURAL); } @@ -395,13 +400,11 @@ export class PdfViewer { if (this.#isElementActive('textPopup')) { this.#instance.UI.closeElements(['textPopup']); } - const iframeWindow = this.#instance.UI.iframeWindow; - const input = iframeWindow.document.getElementById('SearchPanel__input') as HTMLInputElement; - if (input) { - input.focus(); + if (this.#searchInput) { + this.#searchInput.focus(); } - if (input?.value?.length > 0) { - input.select(); + if (this.#searchInput?.value?.length > 0) { + this.#searchInput.select(); } } From 29c870631bb0d4b049077f3d955c87a44cdd54b7 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Thu, 28 Nov 2024 18:32:17 +0200 Subject: [PATCH 02/17] RED-10314: added missing help mode toggles and keys in dialogs. --- .../annotation-actions.component.ts | 2 +- .../edit-redaction-dialog.component.html | 12 ++-- .../edit-redaction-dialog.component.ts | 8 +++ .../force-annotation-dialog.component.html | 7 ++- .../force-annotation-dialog.component.ts | 7 +-- ...edact-recommendation-dialog.component.html | 5 +- .../redact-recommendation-dialog.component.ts | 17 +++++- .../redact-text-dialog.component.html | 5 +- .../redact-text-dialog.component.ts | 14 ++++- .../remove-redaction-dialog.component.html | 12 ++-- .../remove-redaction-dialog.component.ts | 1 + .../resize-redaction-dialog.component.html | 8 ++- .../resize-redaction-dialog.component.ts | 23 +++++++- .../services/annotation-actions.service.ts | 9 +-- .../pdf-annotation-actions.service.ts | 2 +- .../file-preview/utils/dialog-types.ts | 1 + .../add-dossier-dialog.component.html | 4 +- .../src/assets/help-mode/help-mode-keys.json | 57 +++++++++++++++++++ 18 files changed, 165 insertions(+), 29 deletions(-) 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 2ec1353b6..82fcc69aa 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 @@ -126,7 +126,7 @@ export class AnnotationActionsComponent { async acceptRecommendation(): Promise { const annotations = untracked(this.annotations); - await this.annotationActionsService.convertRecommendationToAnnotation(annotations); + await this.annotationActionsService.convertRecommendationToAnnotation(annotations, 'accept'); } hideAnnotation() { diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html index a060ab00a..a2e9fbb92 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html @@ -1,10 +1,12 @@
-
+
+ +
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts index c87d46f0f..d8393392c 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts @@ -39,6 +39,7 @@ import { DetailsRadioComponent } from '@common-ui/inputs/details-radio/details-r import { DetailsRadioOption } from '@common-ui/inputs/details-radio/details-radio-option'; import { validatePageRange } from '../../utils/form-validators'; import { parseRectanglePosition, parseSelectedPageNumbers, prefillPageRange } from '../../utils/enhance-manual-redaction-request.utils'; +import { ActionsHelpModeKeys } from '../../utils/constants'; interface TypeSelectOptions { type: string; @@ -83,12 +84,19 @@ export class EditRedactionDialogComponent readonly isHint = this.annotations.every(annotation => annotation.HINT || annotation.IMAGE_HINT); readonly isRedacted = this.annotations.every(annotation => annotation.isRedacted); readonly isImported: boolean = this.annotations.every(annotation => annotation.imported || annotation.type === 'imported_redaction'); + readonly isSkipped: boolean = this.annotations.every(annotation => annotation.isSkipped); readonly allRectangles = this.annotations.reduce((acc, a) => acc && a.AREA, true); readonly tableColumns: ValueColumn[] = [{ label: 'Value' }, { label: 'Type' }]; readonly tableData: ValueColumn[][] = this.data.annotations.map(redaction => [ { label: redaction.value, bold: true }, { label: redaction.typeLabel }, ]); + readonly annotationsType = this.isHint + ? ActionsHelpModeKeys.hint + : this.isSkipped + ? ActionsHelpModeKeys.skipped + : ActionsHelpModeKeys.redaction; + readonly helpModeKeyByType = `${this.annotationsType}_edit_DIALOG`; options = this.allRectangles ? getRectangleRedactOptions('edit', this.data.annotations) : getEditRedactionOptions(this.isHint); legalOptions: LegalBasisOption[] = []; dictionaries: Dictionary[] = []; diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.html index cdf6b9936..a5adc3148 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.html @@ -1,6 +1,11 @@
-
+
+ +
@if (!isImageHint) { diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts index c27546dd0..d17ad99e7 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts @@ -10,9 +10,8 @@ import { IqserDialogComponent, } from '@iqser/common-ui'; import { JustificationsService } from '@services/entity-services/justifications.service'; -import { Dossier, ILegalBasisChangeRequest } from '@red/domain'; +import { ILegalBasisChangeRequest } from '@red/domain'; import { firstValueFrom } from 'rxjs'; -import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { Roles } from '@users/roles'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { @@ -38,10 +37,8 @@ const DOCUMINE_LEGAL_BASIS = 'n-a.'; standalone: true, imports: [ ReactiveFormsModule, - NgIf, SelectedAnnotationsTableComponent, MatFormField, - MatSelectTrigger, MatSelect, MatOption, MatTooltip, @@ -50,7 +47,6 @@ const DOCUMINE_LEGAL_BASIS = 'n-a.'; IconButtonComponent, IqserDenyDirective, CircleButtonComponent, - NgForOf, HelpButtonComponent, DetailsRadioComponent, ], @@ -68,6 +64,7 @@ export class ForceAnnotationDialogComponent { label: redaction.value, bold: true }, { label: redaction.typeLabel }, ]); + readonly isSkipped = this.data.annotations.every(annotation => annotation.isSkipped); legalOptions: LegalBasisOption[] = []; protected readonly roles = Roles; diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.html index 5c7d34dd2..dd12ee39a 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.html @@ -1,6 +1,8 @@
-
+
+ +
@@ -59,6 +61,7 @@
+
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.ts index c98b44dad..a89d59024 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.ts @@ -8,7 +8,15 @@ import { MatOption, MatSelect, MatSelectTrigger } from '@angular/material/select import { MatTooltip } from '@angular/material/tooltip'; import { DetailsRadioOption } from '@common-ui/inputs/details-radio/details-radio-option'; import { DetailsRadioComponent } from '@common-ui/inputs/details-radio/details-radio.component'; -import { CircleButtonComponent, HasScrollbarDirective, IconButtonComponent, IconButtonTypes, IqserDialogComponent } from '@iqser/common-ui'; +import { + CircleButtonComponent, + HasScrollbarDirective, + HelpButtonComponent, + IconButtonComponent, + IconButtonTypes, + IqserDenyDirective, + IqserDialogComponent, +} from '@iqser/common-ui'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { TranslateModule } from '@ngx-translate/core'; import { Dictionary, IAddRedactionRequest, SuperTypes } from '@red/domain'; @@ -30,6 +38,7 @@ import { RedactRecommendationResult, ResizeOptions, } from '../../utils/dialog-types'; +import { Roles } from '@users/roles'; @Component({ templateUrl: './redact-recommendation-dialog.component.html', @@ -51,6 +60,8 @@ import { MatDialogClose, MatSelectTrigger, MatSelect, + HelpButtonComponent, + IqserDenyDirective, ], }) export class RedactRecommendationDialogComponent @@ -75,6 +86,8 @@ export class RedactRecommendationDialogComponent reason: [null], }); + readonly helpModeKey = `recommendation_${this.data.action}_DIALOG`; + readonly tableColumns: ValueColumn[] = [{ label: 'Value' }, { label: 'Type' }]; readonly tableData: ValueColumn[][] = this.data.annotations.map(redaction => [ { label: redaction.value, bold: true }, @@ -204,4 +217,6 @@ export class RedactRecommendationDialogComponent } this.form.controls.dictionary.setValue(this.#manualRedactionTypeExists ? SuperTypes.ManualRedaction : null); } + + protected readonly roles = Roles; } diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html index ddc240a4c..796e45c90 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html @@ -1,6 +1,8 @@
-
+
+ +
@@ -134,6 +136,7 @@ />
+
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts index e65ef165f..b0911e59b 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts @@ -8,7 +8,15 @@ import { MatOption, MatSelect, MatSelectTrigger } from '@angular/material/select import { MatTooltip } from '@angular/material/tooltip'; import { DetailsRadioOption } from '@common-ui/inputs/details-radio/details-radio-option'; import { DetailsRadioComponent } from '@common-ui/inputs/details-radio/details-radio.component'; -import { CircleButtonComponent, HasScrollbarDirective, IconButtonComponent, IconButtonTypes, IqserDialogComponent } from '@iqser/common-ui'; +import { + CircleButtonComponent, + HasScrollbarDirective, + HelpButtonComponent, + IconButtonComponent, + IconButtonTypes, + IqserDenyDirective, + IqserDialogComponent, +} from '@iqser/common-ui'; import { TranslateModule } from '@ngx-translate/core'; import { Dictionary, SuperTypes } from '@red/domain'; import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service'; @@ -55,6 +63,8 @@ const MAXIMUM_TEXT_AREA_WIDTH = 421; AsyncPipe, IconButtonComponent, MatDialogClose, + HelpButtonComponent, + IqserDenyDirective, ], }) export class RedactTextDialogComponent @@ -138,7 +148,7 @@ export class RedactTextDialogComponent get applyToAll() { return this.isSystemDefault || this._userPreferences.getAddRedactionDefaultExtraOption() === 'undefined' - ? this.data.applyToAllDossiers ?? true + ? (this.data.applyToAllDossiers ?? true) : stringToBoolean(this._userPreferences.getAddRedactionDefaultExtraOption()); } diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.html index cea51e224..43055cbb2 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.html @@ -1,9 +1,13 @@
-
+
+ +
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts index 76da3737f..69b336f1c 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts @@ -76,6 +76,7 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent< : this.recommendation ? ANNOTATION_TYPES.RECOMMENDATION : ANNOTATION_TYPES.REDACTION; + readonly helpModeKeyByType = `${this.annotationsType}_remove_DIALOG`; readonly optionByType = { recommendation: { main: this._userPreferences.getRemoveRecommendationDefaultOption(), diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/resize-redaction-dialog/resize-redaction-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/resize-redaction-dialog/resize-redaction-dialog.component.html index 5f33edd9e..c9bf306e3 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/resize-redaction-dialog/resize-redaction-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/resize-redaction-dialog/resize-redaction-dialog.component.html @@ -1,6 +1,11 @@
-
+
+ +
@@ -48,6 +53,7 @@ >
+
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/resize-redaction-dialog/resize-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/resize-redaction-dialog/resize-redaction-dialog.component.ts index 1d8c4308e..0f3d75992 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/resize-redaction-dialog/resize-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/resize-redaction-dialog/resize-redaction-dialog.component.ts @@ -6,12 +6,21 @@ import { MatFormField } from '@angular/material/form-field'; import { MatOption, MatSelect, MatSelectTrigger } from '@angular/material/select'; import { DetailsRadioOption } from '@common-ui/inputs/details-radio/details-radio-option'; import { DetailsRadioComponent } from '@common-ui/inputs/details-radio/details-radio.component'; -import { CircleButtonComponent, HasScrollbarDirective, IconButtonComponent, IconButtonTypes, IqserDialogComponent } from '@iqser/common-ui'; +import { + CircleButtonComponent, + HasScrollbarDirective, + HelpButtonComponent, + IconButtonComponent, + IconButtonTypes, + IqserDenyDirective, + IqserDialogComponent, +} from '@iqser/common-ui'; import { TranslateModule } from '@ngx-translate/core'; import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service'; import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service'; import { getResizeRedactionOptions } from '../../utils/dialog-options'; import { ResizeOptions, ResizeRedactionData, ResizeRedactionOption, ResizeRedactionResult } from '../../utils/dialog-types'; +import { Roles } from '@users/roles'; @Component({ templateUrl: './resize-redaction-dialog.component.html', @@ -30,6 +39,8 @@ import { ResizeOptions, ResizeRedactionData, ResizeRedactionOption, ResizeRedact HasScrollbarDirective, MatDialogClose, NgIf, + HelpButtonComponent, + IqserDenyDirective, ], }) export class ResizeRedactionDialogComponent extends IqserDialogComponent< @@ -67,6 +78,14 @@ export class ResizeRedactionDialogComponent extends IqserDialogComponent< return this.data.redaction.HINT ? 'hint' : this.data.redaction.isSkippedImageHint ? 'image' : 'redaction'; } + get dialogTitleHelpKey() { + return this.data.redaction.isRecommendation + ? 'recommendation_resize_DIALOG' + : this.data.redaction.isHint + ? 'hint_resize_DIALOG' + : 'redaction_resize_DIALOG'; + } + get displayedDictionaryLabel() { const dictType = this.form.get('dictionary').value; if (dictType) { @@ -93,4 +112,6 @@ export class ResizeRedactionDialogComponent extends IqserDialogComponent< option: this.options[0], }); } + + protected readonly roles = Roles; } diff --git a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts index e94a33190..651fb0949 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts @@ -225,9 +225,9 @@ export class AnnotationActionsService { this.#processObsAndEmit(request$).then(); } - async convertRecommendationToAnnotation(recommendations: AnnotationWrapper[]) { + async convertRecommendationToAnnotation(recommendations: AnnotationWrapper[], action: 'accept' | 'resize') { const { dossierId, fileId } = this._state; - const data = this.#getRedactRecommendationDialogData(recommendations) as RedactRecommendationData; + const data = this.#getRedactRecommendationDialogData(recommendations, action) as RedactRecommendationData; const dialog = this._iqserDialog.openDefault(RedactRecommendationDialogComponent, { data }); const result = await dialog.result(); if (!result) { @@ -277,7 +277,7 @@ export class AnnotationActionsService { recommendation.isRemoved = true; await this._annotationDrawService.draw([recommendation], this._skippedService.hideSkipped(), this._state.dossierTemplateId); - return this.convertRecommendationToAnnotation([recommendation]); + return this.convertRecommendationToAnnotation([recommendation], 'resize'); } const dossier = this._state.dossier(); @@ -550,7 +550,7 @@ export class AnnotationActionsService { return this._iqserDialog.openDefault(EditRedactionDialogComponent, { data }); } - #getRedactRecommendationDialogData(annotations: AnnotationWrapper[]) { + #getRedactRecommendationDialogData(annotations: AnnotationWrapper[], action: 'accept' | 'resize') { const dossierTemplate = this._dossierTemplatesService.find(this._state.dossierTemplateId); const isApprover = this._permissionsService.isApprover(this._state.dossier()); const applyDictionaryUpdatesToAllDossiersByDefault = dossierTemplate.applyDictionaryUpdatesToAllDossiersByDefault; @@ -560,6 +560,7 @@ export class AnnotationActionsService { dossierId: this._state.dossierId, applyToAllDossiers: isApprover ? applyDictionaryUpdatesToAllDossiersByDefault : false, isApprover, + action, }; } diff --git a/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts b/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts index 45b8ec5d8..0fa78c9eb 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts @@ -75,7 +75,7 @@ export class PdfAnnotationActionsService { if (permissions.canAcceptRecommendation && annotationChangesAllowed) { const acceptRecommendationButton = this.#getButton('check', _('annotation-actions.accept-recommendation.label'), () => - this.#annotationActionsService.convertRecommendationToAnnotation(annotations), + this.#annotationActionsService.convertRecommendationToAnnotation(annotations, 'accept'), ); availableActions.push(acceptRecommendationButton); } diff --git a/apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts b/apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts index 05b705e84..0a697fd0a 100644 --- a/apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts +++ b/apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts @@ -97,6 +97,7 @@ export interface RedactTextResult { export type RedactRecommendationData = EditRedactionData & { applyToAllDossiers: boolean; + action?: 'resize' | 'accept'; }; export interface RedactRecommendationResult { diff --git a/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html b/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html index 1e5f43d09..43c1d9467 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html +++ b/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html @@ -1,6 +1,8 @@
-
+
+ +
diff --git a/apps/red-ui/src/assets/help-mode/help-mode-keys.json b/apps/red-ui/src/assets/help-mode/help-mode-keys.json index 06209d4b4..d066783ff 100644 --- a/apps/red-ui/src/assets/help-mode/help-mode-keys.json +++ b/apps/red-ui/src/assets/help-mode/help-mode-keys.json @@ -36,6 +36,11 @@ "documentKey": "new_dossier", "overlappingElements": ["USER_MENU"] }, + { + "elementKey": "new_dossier_DIALOG", + "documentKey": "new_dossier", + "overlappingElements": ["USER_MENU"] + }, { "elementKey": "open_notifications", "documentKey": "open_notifications" @@ -114,48 +119,84 @@ "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "redaction_resize_DIALOG", + "documentKey": "redaction_resize" + }, { "elementKey": "redaction_edit", "documentKey": "redaction_edit", "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "redaction_edit_DIALOG", + "documentKey": "redaction_edit" + }, + { + "elementKey": "add_redaction_DIALOG", + "documentKey": "add_redaction" + }, { "elementKey": "redaction_remove", "documentKey": "redaction_remove", "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "redaction_remove_DIALOG", + "documentKey": "redaction_remove" + }, { "elementKey": "recommendation_resize", "documentKey": "recommendation_resize", "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "recommendation_resize_DIALOG", + "documentKey": "recommendation_resize" + }, { "elementKey": "recommendation_accept", "documentKey": "recommendation_accept", "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "recommendation_accept_DIALOG", + "documentKey": "recommendation_accept" + }, { "elementKey": "recommendation_remove", "documentKey": "recommendation_remove", "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "recommendation_remove_DIALOG", + "documentKey": "recommendation_remove" + }, { "elementKey": "skipped_edit", "documentKey": "skipped_edit", "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "skipped_edit_DIALOG", + "documentKey": "skipped_edit" + }, { "elementKey": "skipped_force", "documentKey": "skipped_force", "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "skipped_force_DIALOG", + "documentKey": "skipped_force" + }, { "elementKey": "skipped_remove", "documentKey": "skipped_remove", @@ -174,18 +215,30 @@ "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "hint_resize_DIALOG", + "documentKey": "hint_resize" + }, { "elementKey": "hint_edit", "documentKey": "hint_edit", "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "hint_edit_DIALOG", + "documentKey": "hint_edit" + }, { "elementKey": "hint_remove", "documentKey": "hint_remove", "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "hint_remove_DIALOG", + "documentKey": "hint_remove" + }, { "elementKey": "hint_hide", "documentKey": "hint_hide", @@ -198,6 +251,10 @@ "scrollableParentView": "ANNOTATIONS_LIST", "overlappingElements": ["USER_MENU", "WORKLOAD_FILTER", "DOCUMENT_INFO"] }, + { + "elementKey": "hint_redact_DIALOG", + "documentKey": "hint_redact" + }, { "elementKey": "workload_in_editor", "documentKey": "workload_in_editor", From ddc163f286ef9ec07dfdb3d8e722cc75ed7cadcd Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Fri, 29 Nov 2024 11:09:53 +0200 Subject: [PATCH 03/17] RED-3800: localazy manual sync for redact. --- apps/red-ui/src/assets/i18n/redact/de.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index c6802073e..c966525a6 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -1,7 +1,7 @@ { "accept-recommendation-dialog": { "header": { - "add-to-dictionary": "Zum Wörterbuch hinzufügen", + "add-to-dictionary": "Fügen Sie die Schwärzung auf mehreren Seiten hinzu.", "request-add-to-dictionary": "Wörterbucheintrag vorschlagen" } }, @@ -529,7 +529,7 @@ }, "edit-title": "Edit {displayName} definition", "form": { - "autogenerated-label": "Autogenerated based on the initial display name", + "autogenerated-label": "Wurde ausgehend vom initialen Anzeigenamen automatisch generiert", "description": "Beschreibung", "description-placeholder": "Beschreibung", "display-name": "Display Name", @@ -640,7 +640,7 @@ }, "confirmation-dialog": { "approve-file": { - "confirmationText": "Trotzdem genehmigen", + "confirmationText": "Dennoch freigeben", "denyText": "Nein, abbrechen", "question": "Dieses Dokument enthält ungesehene Änderungen, die sich durch die Reanalyse ergeben haben.

Möchten Sie es trotzdem freigeben?", "title": "Warnung!", @@ -1616,7 +1616,7 @@ }, "file-status": { "analyse": "Analyse läuft", - "approved": "Genehmigt", + "approved": "Freigegeben", "error": "Reanalyse erforderlich", "figure-detection-analyzing": "", "full-processing": "Verarbeitung läuft", @@ -2383,7 +2383,7 @@ "red-manager": "{count, plural, one{Manager} other{Manager}}", "red-user": "Benutzer", "red-user-admin": "{count, plural, one{Benutzeradmin} other{Benutzeradmins}}", - "regular": "{count, plural, one{{regulärer Benutzer}} other{reguläre Benutzer}}" + "regular": "{count, plural, one{regulärer Benutzer} other{reguläre Benutzer}}" }, "search": { "active-dossiers": "Dokumente in aktiven Dossiers", From 5515a5b4d64ff986dc14db50874d0dc4031a2034 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Fri, 29 Nov 2024 12:27:59 +0200 Subject: [PATCH 04/17] RED-10563: fixed key actions not prevented when input is focused. --- .../annotations-list/annotations-list.component.ts | 3 ++- .../components/file-header/file-header.component.ts | 6 +++--- .../file-workload/file-workload.component.ts | 10 +++------- .../pdf-viewer/services/document-viewer.service.ts | 5 +++-- apps/red-ui/src/app/utils/functions.ts | 10 +++++++++- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotations-list/annotations-list.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotations-list/annotations-list.component.ts index 1b5deaff9..5bd7b034c 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotations-list/annotations-list.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/annotations-list/annotations-list.component.ts @@ -16,6 +16,7 @@ import { HighlightsSeparatorComponent } from '../highlights-separator/highlights import { AnnotationWrapperComponent } from '../annotation-wrapper/annotation-wrapper.component'; import { AnnotationReferencesListComponent } from '../annotation-references-list/annotation-references-list.component'; import { Clipboard } from '@angular/cdk/clipboard'; +import { isTargetInput } from '@utils/functions'; @Component({ selector: 'redaction-annotations-list', @@ -68,7 +69,7 @@ export class AnnotationsListComponent extends HasScrollbarDirective { console.log('Selected Annotation:', annotation); } - if (($event?.target as IqserEventTarget)?.localName === 'input') { + if (isTargetInput($event)) { return; } diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.ts b/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.ts index d1b164b70..d401ac67f 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.ts @@ -50,6 +50,7 @@ import { ALL_HOTKEYS } from '../../utils/constants'; import { AnnotationDrawService } from '../../../pdf-viewer/services/annotation-draw.service'; import { FileManagementService } from '@services/files/file-management.service'; import { MatDialog } from '@angular/material/dialog'; +import { isTargetInput, isTargetTextArea } from '@utils/functions'; @Component({ selector: 'redaction-file-header', @@ -178,7 +179,6 @@ export class FileHeaderComponent implements OnInit, AfterViewInit, OnDetach, OnD this.fullScreen = false; } } - @Bind() handleKeyEvent($event: KeyboardEvent) { if (this._router.url.indexOf('/file/') < 0) { @@ -212,7 +212,7 @@ export class FileHeaderComponent implements OnInit, AfterViewInit, OnDetach, OnD if (!$event.ctrlKey && !$event.metaKey && ['f', 'F'].includes($event.key)) { // if you type in an input, don't toggle full-screen - if ($event.target instanceof HTMLInputElement || $event.target instanceof HTMLTextAreaElement) { + if (isTargetInput($event) || isTargetTextArea($event)) { return; } this.toggleFullScreen(); @@ -220,7 +220,7 @@ export class FileHeaderComponent implements OnInit, AfterViewInit, OnDetach, OnD } if (['h', 'H'].includes($event.key)) { - if ($event.target instanceof HTMLInputElement || $event.target instanceof HTMLTextAreaElement) { + if (isTargetInput($event) || isTargetTextArea($event)) { return; } this._ngZone.run(() => { diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts index e7e0199c0..850108023 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts @@ -59,7 +59,7 @@ import { PageExclusionComponent } from '../page-exclusion/page-exclusion.compone import { PagesComponent } from '../pages/pages.component'; import { ReadonlyBannerComponent } from '../readonly-banner/readonly-banner.component'; import { DocumentInfoComponent } from '../document-info/document-info.component'; -import { getLast } from '@utils/functions'; +import { getLast, isTargetInput } from '@utils/functions'; import { ALL_ANNOTATIONS_PAGE } from '../../utils/constants'; const COMMAND_KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Escape']; @@ -251,11 +251,7 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, On handleKeyEvent($event: KeyboardEvent): void { const multiSelectServiceInactive = untracked(this.multiSelectService.inactive); - if ( - !ALL_HOTKEY_ARRAY.includes($event.key) || - this._dialog.openDialogs.length || - ($event.target as IqserEventTarget).localName === 'input' - ) { + if (!ALL_HOTKEY_ARRAY.includes($event.key) || this._dialog.openDialogs.length || isTargetInput($event)) { return; } @@ -342,7 +338,7 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, On } preventKeyDefault($event: KeyboardEvent): void { - if (COMMAND_KEY_ARRAY.includes($event.key) && !(($event.target as any).localName === 'input')) { + if (COMMAND_KEY_ARRAY.includes($event.key) && !isTargetInput($event)) { $event.preventDefault(); } } diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts index 88fbff253..a7b6be744 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts @@ -14,6 +14,7 @@ import { PdfViewer } from './pdf-viewer.service'; import Color = Core.Annotations.Color; import DocumentViewer = Core.DocumentViewer; import Quad = Core.Math.Quad; +import { isTargetInput } from '@utils/functions'; @Injectable() export class REDDocumentViewer { @@ -71,12 +72,12 @@ export class REDDocumentViewer { return fromEvent(this.#document, 'keyUp').pipe( tap(stopAndPreventIfNotAllowed), filter($event => { - if (($event.target as HTMLElement)?.tagName?.toLowerCase() === 'input') { + if (isTargetInput($event)) { if ($event.key === 'Escape') { return true; } } - return ($event.target as HTMLElement)?.tagName?.toLowerCase() !== 'input'; + return isTargetInput($event); }), filter($event => $event.key.startsWith('Arrow') || ['f', 'h', 'H', 'Escape', 'Shift'].includes($event.key)), tap(stopAndPrevent), diff --git a/apps/red-ui/src/app/utils/functions.ts b/apps/red-ui/src/app/utils/functions.ts index ea763c79a..405a3e629 100644 --- a/apps/red-ui/src/app/utils/functions.ts +++ b/apps/red-ui/src/app/utils/functions.ts @@ -1,5 +1,5 @@ import { ITrackable } from '@iqser/common-ui'; -import type { List } from '@iqser/common-ui/lib/utils'; +import type { IqserEventTarget, List } from '@iqser/common-ui/lib/utils'; import type { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { Dayjs } from 'dayjs'; import { AbstractControl } from '@angular/forms'; @@ -149,3 +149,11 @@ export function urlFileId() { export function formControlToSignal(control: AbstractControl) { return toSignal(control.valueChanges, { initialValue: control.value }); } + +export function isTargetInput(event: Event) { + return (event?.target as IqserEventTarget)?.localName === 'input'; +} + +export function isTargetTextArea(event: Event) { + return (event?.target as IqserEventTarget)?.localName === 'textarea'; +} From 8c47a8b75855b9091425237e9b07fbc65141b753 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Fri, 29 Nov 2024 12:38:17 +0200 Subject: [PATCH 05/17] RED-10563: grouped key events and extracted the target check. --- .../file-header/file-header.component.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.ts b/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.ts index d401ac67f..bf616ec5f 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.ts @@ -210,29 +210,26 @@ export class FileHeaderComponent implements OnInit, AfterViewInit, OnDetach, OnD this._changeRef.markForCheck(); } + if ($event.key === 'F5') { + window.location.reload(); + } + + if (isTargetInput($event) || isTargetTextArea($event)) { + return; + } + if (!$event.ctrlKey && !$event.metaKey && ['f', 'F'].includes($event.key)) { - // if you type in an input, don't toggle full-screen - if (isTargetInput($event) || isTargetTextArea($event)) { - return; - } this.toggleFullScreen(); return; } if (['h', 'H'].includes($event.key)) { - if (isTargetInput($event) || isTargetTextArea($event)) { - return; - } this._ngZone.run(() => { window.focus(); this._helpModeService.activateHelpMode(false); }); return; } - - if ($event.key === 'F5') { - window.location.reload(); - } } #openFullScreen() { From 315fa5a440d9a55ac728e8ef4c3644ef4327f04c Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Fri, 29 Nov 2024 14:12:14 +0200 Subject: [PATCH 06/17] RED-10531: disabled more buttons for file with error state. --- ...dossier-overview-bulk-actions.component.ts | 37 ++++++++++++++----- .../file-actions/file-actions.component.ts | 35 +++++++++++++----- 2 files changed, 53 insertions(+), 19 deletions(-) diff --git a/apps/red-ui/src/app/modules/dossier-overview/components/bulk-actions/dossier-overview-bulk-actions.component.ts b/apps/red-ui/src/app/modules/dossier-overview/components/bulk-actions/dossier-overview-bulk-actions.component.ts index a8faf210e..0de86597d 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/components/bulk-actions/dossier-overview-bulk-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier-overview/components/bulk-actions/dossier-overview-bulk-actions.component.ts @@ -26,6 +26,7 @@ export class DossierOverviewBulkActionsComponent { readonly maxWidth = input(); readonly buttons = computed(() => this.#buttons); readonly IqserTooltipPositions = IqserTooltipPositions; + readonly #areFilesInErrorState = computed(() => this.selectedFiles().some(file => file.isError)); readonly #areRulesLocked = computed(() => this._rulesService.currentTemplateRules().timeoutDetected); readonly #allFilesAreUnderReviewOrUnassigned = computed(() => this.selectedFiles().reduce((acc, file) => acc && (file.isUnderReview || file.isNew), true), @@ -47,18 +48,34 @@ export class DossierOverviewBulkActionsComponent { ); readonly #canDelete = computed(() => this._permissionsService.canSoftDeleteFile(this.selectedFiles(), this.dossier())); readonly #canReanalyse = computed(() => this._permissionsService.canReanalyseFile(this.selectedFiles(), this.dossier())); - readonly #canDisableAutoAnalysis = computed(() => - this._permissionsService.canDisableAutoAnalysis(this.selectedFiles(), this.dossier()), + readonly #canDisableAutoAnalysis = computed( + () => this._permissionsService.canDisableAutoAnalysis(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(), + ); + readonly #canEnableAutoAnalysis = computed( + () => this._permissionsService.canEnableAutoAnalysis(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(), ); - readonly #canEnableAutoAnalysis = computed(() => this._permissionsService.canEnableAutoAnalysis(this.selectedFiles(), this.dossier())); readonly #canToggleAnalysis = computed(() => this._permissionsService.canToggleAnalysis(this.selectedFiles(), this.dossier())); - readonly #canOcr = computed(() => this._permissionsService.canOcrFile(this.selectedFiles(), this.dossier())); - readonly #canSetToNew = computed(() => this._permissionsService.canSetToNew(this.selectedFiles(), this.dossier())); - readonly #canSetToUnderReview = computed(() => this._permissionsService.canSetUnderReview(this.selectedFiles(), this.dossier())); - readonly #canSetToUnderApproval = computed(() => this._permissionsService.canSetUnderApproval(this.selectedFiles(), this.dossier())); - readonly #isReadyForApproval = computed(() => this._permissionsService.isReadyForApproval(this.selectedFiles(), this.dossier())); - readonly #canApprove = computed(() => this._permissionsService.canBeApproved(this.selectedFiles(), this.dossier())); - readonly #canUndoApproval = computed(() => this._permissionsService.canUndoApproval(this.selectedFiles(), this.dossier())); + readonly #canOcr = computed( + () => this._permissionsService.canOcrFile(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(), + ); + readonly #canSetToNew = computed( + () => this._permissionsService.canSetToNew(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(), + ); + readonly #canSetToUnderReview = computed( + () => this._permissionsService.canSetUnderReview(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(), + ); + readonly #canSetToUnderApproval = computed( + () => this._permissionsService.canSetUnderApproval(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(), + ); + readonly #isReadyForApproval = computed( + () => this._permissionsService.isReadyForApproval(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(), + ); + readonly #canApprove = computed( + () => this._permissionsService.canBeApproved(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(), + ); + readonly #canUndoApproval = computed( + () => this._permissionsService.canUndoApproval(this.selectedFiles(), this.dossier()) && !this.#areFilesInErrorState(), + ); readonly #assignTooltip = computed(() => this.#allFilesAreUnderApproval() ? _('dossier-overview.assign-approver') : _('dossier-overview.assign-reviewer'), ); diff --git a/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts index 560e7bee2..77c0b221c 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts @@ -13,7 +13,7 @@ import { } from '@iqser/common-ui'; import { getCurrentUser } from '@iqser/common-ui/lib/users'; import { IqserTooltipPositions } from '@iqser/common-ui/lib/utils'; -import { Action, ActionTypes, ApproveResponse, Dossier, File, ProcessingFileStatuses, User } from '@red/domain'; +import { Action, ActionTypes, ApproveResponse, Dossier, File, User } from '@red/domain'; import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service'; import { FileAttributesService } from '@services/entity-services/file-attributes.service'; import { FileManagementService } from '@services/files/file-management.service'; @@ -69,15 +69,21 @@ export class FileActionsComponent { this.file().isUnderApproval ? _('dossier-overview.assign-approver') : _('dossier-overview.assign-reviewer'), ); readonly #showSetToNew = computed( - () => this._permissionsService.canSetToNew(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow(), + () => + this._permissionsService.canSetToNew(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow() && !this.file().isError, ); readonly #showUndoApproval = computed( - () => this._permissionsService.canUndoApproval(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow(), + () => + this._permissionsService.canUndoApproval(this.file(), this.dossier()) && + !this.isDossierOverviewWorkflow() && + !this.file().isError, ); readonly #showAssignToSelf = computed( () => this._permissionsService.canAssignToSelf(this.file(), this.dossier()) && this.isDossierOverview(), ); - readonly #showImportRedactions = computed(() => this._permissionsService.canImportRedactions(this.file(), this.dossier())); + readonly #showImportRedactions = computed( + () => this._permissionsService.canImportRedactions(this.file(), this.dossier()) && !this.file().isError, + ); readonly #showAssign = computed( () => (this._permissionsService.canAssignUser(this.file(), this.dossier()) || @@ -87,15 +93,26 @@ export class FileActionsComponent { readonly #showDelete = computed(() => this._permissionsService.canSoftDeleteFile(this.file(), this.dossier())); readonly #showOCR = computed(() => this._permissionsService.canOcrFile(this.file(), this.dossier()) && !this.file().isError); readonly #canReanalyse = computed(() => this._permissionsService.canReanalyseFile(this.file(), this.dossier())); - readonly #canEnableAutoAnalysis = computed(() => this._permissionsService.canEnableAutoAnalysis([this.file()], this.dossier())); + readonly #canEnableAutoAnalysis = computed( + () => this._permissionsService.canEnableAutoAnalysis([this.file()], this.dossier()) && !this.file().isError, + ); readonly #showUnderReview = computed( - () => this._permissionsService.canSetUnderReview(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow(), + () => + this._permissionsService.canSetUnderReview(this.file(), this.dossier()) && + !this.isDossierOverviewWorkflow() && + !this.file().isError, ); readonly #showUnderApproval = computed( - () => this._permissionsService.canSetUnderApproval(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow(), + () => + this._permissionsService.canSetUnderApproval(this.file(), this.dossier()) && + !this.isDossierOverviewWorkflow() && + !this.file().isError, ); readonly #showApprove = computed( - () => this._permissionsService.isReadyForApproval(this.file(), this.dossier()) && !this.isDossierOverviewWorkflow(), + () => + this._permissionsService.isReadyForApproval(this.file(), this.dossier()) && + !this.isDossierOverviewWorkflow() && + !this.file().isError, ); readonly #canToggleAnalysis = computed(() => this._permissionsService.canToggleAnalysis(this.file(), this.dossier())); readonly #toggleTooltip? = computed(() => { @@ -130,7 +147,7 @@ export class FileActionsComponent { readonly #isDocumine = getConfig().IS_DOCUMINE; readonly #canDisableAutoAnalysis = computed( - () => !this.#isDocumine && this._permissionsService.canDisableAutoAnalysis([this.file()], this.dossier()), + () => !this.#isDocumine && this._permissionsService.canDisableAutoAnalysis([this.file()], this.dossier()) && !this.file().isError, ); constructor( From fb8b3a3b094f5f6ee35a52a32119fc9754245c4e Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 3 Dec 2024 12:36:26 +0200 Subject: [PATCH 07/17] RED-10301 - Use RM/DM UI depending on application type of tenant --- apps/red-ui/src/app/app.component.ts | 55 +++++++++++++------ apps/red-ui/src/app/app.module.ts | 2 +- .../src/app/modules/icons/icons.module.ts | 12 +++- apps/red-ui/src/app/utils/main.guard.ts | 4 +- apps/red-ui/src/assets/config/config.json | 13 ++--- .../src/assets/icons/general/knecon-logo.svg | 1 + .../general/{logo.svg => redaction-logo.svg} | 0 apps/red-ui/src/main.ts | 6 +- docker/red-ui/09-set-application-config.sh | 9 +-- libs/common-ui | 2 +- 10 files changed, 65 insertions(+), 39 deletions(-) create mode 100644 apps/red-ui/src/assets/icons/general/knecon-logo.svg rename apps/red-ui/src/assets/icons/general/{logo.svg => redaction-logo.svg} (100%) diff --git a/apps/red-ui/src/app/app.component.ts b/apps/red-ui/src/app/app.component.ts index 4e78439d4..f4667e187 100644 --- a/apps/red-ui/src/app/app.component.ts +++ b/apps/red-ui/src/app/app.component.ts @@ -4,21 +4,21 @@ import { UserPreferenceService } from '@users/user-preference.service'; import { getConfig } from '@iqser/common-ui'; import { AppConfig } from '@red/domain'; import { NavigationEnd, Router } from '@angular/router'; -import { filter, map, switchMap, take } from 'rxjs/operators'; +import { filter, map, switchMap, take, tap } from 'rxjs/operators'; +import { APP_TYPE_PATHS } from '@common-ui/utils/constants'; +import { MatIconRegistry } from '@angular/material/icon'; +import { DomSanitizer } from '@angular/platform-browser'; +import { TenantsService } from '@common-ui/tenants'; -function loadCustomTheme() { - const cssFileName = getConfig().THEME; - - if (cssFileName) { - const head = document.getElementsByTagName('head')[0]; - const link = document.createElement('link'); - link.id = cssFileName; - link.rel = 'stylesheet'; - link.type = 'text/css'; - link.href = 'assets/styles/themes/' + cssFileName + '.css'; - link.media = 'all'; - head.appendChild(link); - } +export function loadCustomTheme(cssFileName: string) { + const head = document.getElementsByTagName('head')[0]; + const link = document.createElement('link'); + link.id = cssFileName; + link.rel = 'stylesheet'; + link.type = 'text/css'; + link.href = 'assets/styles/themes/' + cssFileName + '.css'; + link.media = 'all'; + head.appendChild(link); } @Component({ @@ -34,9 +34,12 @@ export class AppComponent { userPreferenceService: UserPreferenceService, renderer: Renderer2, private readonly _router: Router, + private readonly _iconRegistry: MatIconRegistry, + private readonly _sanitizer: DomSanitizer, + private readonly _tenantsService: TenantsService, ) { + const config = getConfig(); renderer.addClass(document.body, userPreferenceService.getTheme()); - loadCustomTheme(); const removeQueryParams = _router.events.pipe( filter((event): event is NavigationEnd => event instanceof NavigationEnd), @@ -47,9 +50,25 @@ export class AppComponent { ); removeQueryParams.subscribe(); - if (getConfig().IS_DOCUMINE) { - document.getElementById('favicon').setAttribute('href', 'assets/icons/documine-logo.ico'); - } + this._tenantsService + .waitForSettingTenant() + .pipe( + tap(() => { + const isDocumine = this._tenantsService.activeTenant.documine; + const logo = isDocumine ? 'documine' : 'redaction'; + _iconRegistry.addSvgIconInNamespace( + 'iqser', + 'logo', + _sanitizer.bypassSecurityTrustResourceUrl(`/assets/icons/general/${logo}-logo.svg`), + ); + if (isDocumine) { + document.getElementById('favicon').setAttribute('href', 'assets/icons/documine-logo.ico'); + } + loadCustomTheme(isDocumine ? APP_TYPE_PATHS.SCM : APP_TYPE_PATHS.REDACT); + }), + take(1), + ) + .subscribe(); } #removeKeycloakQueryParams() { diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index 82d09377f..5691a4dc3 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -117,7 +117,7 @@ export const appModuleFactory = (config: AppConfig) => { resetTimeoutOnDuplicate: true, }), TenantsModule.forRoot(), - IqserTranslateModule.forRoot({ pathPrefix: config.BASE_TRANSLATIONS_DIRECTORY || '/assets/i18n/redact/' }), + IqserTranslateModule.forRoot({ pathPrefix: config.BASE_TRANSLATIONS_DIRECTORY }), IqserLoadingModule.forRoot(), ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }), LoggerModule.forRoot(undefined, { diff --git a/apps/red-ui/src/app/modules/icons/icons.module.ts b/apps/red-ui/src/app/modules/icons/icons.module.ts index 734413438..092a67d2a 100644 --- a/apps/red-ui/src/app/modules/icons/icons.module.ts +++ b/apps/red-ui/src/app/modules/icons/icons.module.ts @@ -3,6 +3,8 @@ import { CommonModule } from '@angular/common'; import { MatIconModule, MatIconRegistry } from '@angular/material/icon'; import { DomSanitizer } from '@angular/platform-browser'; import { getConfig } from '@common-ui/services'; +import { LANDING_PAGE_THEMES } from '@common-ui/utils/constants'; +import { TenantsService } from '@common-ui/tenants'; @NgModule({ imports: [CommonModule, MatIconModule], @@ -15,6 +17,7 @@ export class IconsModule { constructor( private readonly _iconRegistry: MatIconRegistry, private readonly _sanitizer: DomSanitizer, + private readonly _tenantsService: TenantsService, ) { const icons = [ 'ai', @@ -85,6 +88,9 @@ export class IconsModule { 'user', 'warning', 'pdftron-action-add-redaction', + 'knecon-logo', + 'redaction-logo', + 'documine-logo', ]; for (const icon of icons) { @@ -95,12 +101,12 @@ export class IconsModule { ); } - const logo = this.config.IS_DOCUMINE ? 'documine-logo' : 'logo'; - + const logo = + this.config.LANDING_PAGE_THEME === LANDING_PAGE_THEMES.MIXED ? 'knecon' : this.config.IS_DOCUMINE ? 'documine' : 'redaction'; _iconRegistry.addSvgIconInNamespace( 'iqser', 'logo', - _sanitizer.bypassSecurityTrustResourceUrl(`/assets/icons/general/${logo}.svg`), + _sanitizer.bypassSecurityTrustResourceUrl(`/assets/icons/general/${logo}-logo.svg`), ); } } diff --git a/apps/red-ui/src/app/utils/main.guard.ts b/apps/red-ui/src/app/utils/main.guard.ts index fc137acbb..ba23864a9 100644 --- a/apps/red-ui/src/app/utils/main.guard.ts +++ b/apps/red-ui/src/app/utils/main.guard.ts @@ -60,7 +60,9 @@ export function mainGuard(): AsyncGuard { } loadingService.stop(); - tenantsService.storeTenant(); + + await tenantsService.storeTenant(); + configService.updateIsDocumine(tenantsService.activeTenant); logger.info('[ROUTES] Main guard finished!'); diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index deb14e6da..c7300f060 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -1,9 +1,8 @@ { "ADMIN_CONTACT_NAME": null, "ADMIN_CONTACT_URL": null, - "API_URL": "https://dan1.iqser.cloud", - "APP_NAME": "RedactManager", - "IS_DOCUMINE": false, + "API_URL": "https://dan2.iqser.cloud", + "APP_NAME": "Knecon Cloud", "RULE_EDITOR_DEV_ONLY": false, "AUTO_READ_TIME": 3, "BACKEND_APP_VERSION": "4.4.40", @@ -13,15 +12,15 @@ "MAX_RETRIES_ON_SERVER_ERROR": 3, "OAUTH_CLIENT_ID": "redaction", "OAUTH_IDP_HINT": null, - "OAUTH_URL": "https://dan1.iqser.cloud/auth", + "OAUTH_URL": "https://dan2.iqser.cloud/auth", "RECENT_PERIOD_IN_HOURS": 24, "SELECTION_MODE": "structural", "MANUAL_BASE_URL": "https://docs.redactmanager.com/preview", "ANNOTATIONS_THRESHOLD": 1000, - "THEME": "redact", - "BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/redact/", "AVAILABLE_NOTIFICATIONS_DAYS": 30, "AVAILABLE_OLD_NOTIFICATIONS_MINUTES": 60, "NOTIFICATIONS_THRESHOLD": 1000, - "WATERMARK_PREVIEW_PAPER_FORMAT": "a4" + "WATERMARK_PREVIEW_PAPER_FORMAT": "a4", + "BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/", + "LANDING_PAGE_THEME": "mixed" } diff --git a/apps/red-ui/src/assets/icons/general/knecon-logo.svg b/apps/red-ui/src/assets/icons/general/knecon-logo.svg new file mode 100644 index 000000000..a309085c4 --- /dev/null +++ b/apps/red-ui/src/assets/icons/general/knecon-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/red-ui/src/assets/icons/general/logo.svg b/apps/red-ui/src/assets/icons/general/redaction-logo.svg similarity index 100% rename from apps/red-ui/src/assets/icons/general/logo.svg rename to apps/red-ui/src/assets/icons/general/redaction-logo.svg diff --git a/apps/red-ui/src/main.ts b/apps/red-ui/src/main.ts index 06db7e505..8e21cfc2e 100644 --- a/apps/red-ui/src/main.ts +++ b/apps/red-ui/src/main.ts @@ -5,6 +5,7 @@ import { bool } from '@common-ui/utils'; import { environment } from '@environments/environment'; import { AppConfig } from '@red/domain'; import { appModuleFactory } from './app/app.module'; +import { LANDING_PAGE_THEMES, THEME_DIRECTORIES } from '@common-ui/utils/constants'; if (environment.production) { enableProdMode(); @@ -13,12 +14,15 @@ if (environment.production) { // https://github.com/angular/angular/issues/11195#issuecomment-248020928 async function bootstrap(appConfig: AppConfig, version: { FRONTEND_APP_VERSION: string }) { const ruleEditorDevOnly = appConfig.RULE_EDITOR_DEV_ONLY as unknown as string | boolean; + const isDocumine = bool(appConfig.LANDING_PAGE_THEME !== LANDING_PAGE_THEMES.REDACT_MANAGER); const config = { ...appConfig, - IS_DOCUMINE: bool(appConfig.IS_DOCUMINE), + IS_DOCUMINE: isDocumine, + THEME: !isDocumine ? THEME_DIRECTORIES.REDACT : THEME_DIRECTORIES.SCM, RULE_EDITOR_DEV_ONLY: typeof ruleEditorDevOnly === 'string' ? ruleEditorDevOnly.toLowerCase() !== 'false' : ruleEditorDevOnly !== false, FRONTEND_APP_VERSION: version.FRONTEND_APP_VERSION, + APP_NAME: appConfig.LANDING_PAGE_THEME === LANDING_PAGE_THEMES.MIXED ? 'Knecon Cloud' : isDocumine ? 'DocuMine' : 'RedactManager', } as AppConfig; console.log('Started with local config: ', config); const appModule = appModuleFactory(config); diff --git a/docker/red-ui/09-set-application-config.sh b/docker/red-ui/09-set-application-config.sh index a9fdb61cb..e98fe713f 100755 --- a/docker/red-ui/09-set-application-config.sh +++ b/docker/red-ui/09-set-application-config.sh @@ -4,13 +4,11 @@ ADMIN_CONTACT_NAME="${ADMIN_CONTACT_NAME:-}" ADMIN_CONTACT_URL="${ADMIN_CONTACT_URL:-}" API_URL="${API_URL:-}" APP_NAME="${APP_NAME:-}" -IS_DOCUMINE="${IS_DOCUMINE:-false}" RULE_EDITOR_DEV_ONLY="${RULE_EDITOR_DEV_ONLY:-true}" AUTO_READ_TIME="${AUTO_READ_TIME:-1.5}" BACKEND_APP_VERSION="${BACKEND_APP_VERSION:-4.7.0}" EULA_URL="${EULA_URL:-}" FRONTEND_APP_VERSION="${FRONTEND_APP_VERSION:-}" - MAX_FILE_SIZE_MB="${MAX_FILE_SIZE_MB:-50}" MAX_RETRIES_ON_SERVER_ERROR="${MAX_RETRIES_ON_SERVER_ERROR:-3}" OAUTH_CLIENT_ID="${OAUTH_CLIENT_ID:-gin-client}" @@ -23,16 +21,14 @@ ANNOTATIONS_THRESHOLD="${ANNOTATIONS_THRESHOLD:-1000}" AVAILABLE_NOTIFICATIONS_DAYS="${AVAILABLE_NOTIFICATIONS_DAYS:-30}" AVAILABLE_OLD_NOTIFICATIONS_MINUTES="${AVAILABLE_OLD_NOTIFICATIONS_MINUTES:-60}" NOTIFICATIONS_THRESHOLD="${NOTIFICATIONS_THRESHOLD:-1000}" -BASE_TRANSLATIONS_DIRECTORY="${BASE_TRANSLATIONS_DIRECTORY:-/assets/i18n/redact/}" -THEME="${THEME:-theme-template}" WATERMARK_PREVIEW_PAPER_FORMAT="${WATERMARK_PREVIEW_PAPER_FORMAT:-a4}" +LANDING_PAGE_THEME="${LANDING_PAGE_THEME:-redactmanager}" echo '{ "ADMIN_CONTACT_NAME":"'"$ADMIN_CONTACT_NAME"'", "ADMIN_CONTACT_URL":"'"$ADMIN_CONTACT_URL"'", "API_URL":"'"$API_URL"'", "APP_NAME":"'"$APP_NAME"'", - "IS_DOCUMINE":"'"$IS_DOCUMINE"'", "RULE_EDITOR_DEV_ONLY":"'"$RULE_EDITOR_DEV_ONLY"'", "AUTO_READ_TIME":"'"$AUTO_READ_TIME"'", "BACKEND_APP_VERSION":"'"$BACKEND_APP_VERSION"'", @@ -46,13 +42,12 @@ echo '{ "RECENT_PERIOD_IN_HOURS":"'"$RECENT_PERIOD_IN_HOURS"'", "SELECTION_MODE":"'"$SELECTION_MODE"'", "MANUAL_BASE_URL":"'"$MANUAL_BASE_URL"'", - "BASE_TRANSLATIONS_DIRECTORY":"'"$BASE_TRANSLATIONS_DIRECTORY"'", - "THEME":"'"$THEME"'", "ANNOTATIONS_THRESHOLD":"'"$ANNOTATIONS_THRESHOLD"'", "AVAILABLE_NOTIFICATIONS_DAYS":"'"$AVAILABLE_NOTIFICATIONS_DAYS"'", "AVAILABLE_OLD_NOTIFICATIONS_MINUTES":"'"$AVAILABLE_OLD_NOTIFICATIONS_MINUTES"'", "NOTIFICATIONS_THRESHOLD":"'"$NOTIFICATIONS_THRESHOLD"'", "WATERMARK_PREVIEW_PAPER_FORMAT":"'"$WATERMARK_PREVIEW_PAPER_FORMAT"'" + "LANDING_PAGE_THEME":"'"$LANDING_PAGE_THEME"'" }' >/usr/share/nginx/html/ui/assets/config/config.json echo 'App config: ' diff --git a/libs/common-ui b/libs/common-ui index cbdfcf4d8..911516add 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit cbdfcf4d8fb3a63417b61604496d8fa81bdea671 +Subproject commit 911516add233c6ae96cbe516322546bc160e4467 From e6a03c3b306a6e0cf93bb21c8eec2462f4fde7de Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 3 Dec 2024 12:38:13 +0200 Subject: [PATCH 08/17] RED-10301 - update common ui (lint fix) --- libs/common-ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/common-ui b/libs/common-ui index 911516add..55b21c498 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 911516add233c6ae96cbe516322546bc160e4467 +Subproject commit 55b21c49899149018d0f2fdd82fef97c3a7d301a From 842bd4e2512d08af1749e901a1bd34e286737f9e Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 3 Dec 2024 17:30:58 +0200 Subject: [PATCH 09/17] RED-9585 - updated translation param --- apps/red-ui/src/app/services/translate-chart.service.ts | 2 +- libs/common-ui | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/red-ui/src/app/services/translate-chart.service.ts b/apps/red-ui/src/app/services/translate-chart.service.ts index e55304910..e63a64fb1 100644 --- a/apps/red-ui/src/app/services/translate-chart.service.ts +++ b/apps/red-ui/src/app/services/translate-chart.service.ts @@ -57,7 +57,7 @@ export class TranslateChartService { translateRoles(config: DonutChartConfig[]): DonutChartConfig[] { return config.map(val => ({ ...val, - label: this._translateService.instant(rolesTranslations[val.label], { length: val.value }), + label: this._translateService.instant(rolesTranslations[val.label], { count: val.value }), })); } } diff --git a/libs/common-ui b/libs/common-ui index 55b21c498..b929f1d13 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 55b21c49899149018d0f2fdd82fef97c3a7d301a +Subproject commit b929f1d13687ebd0a4887c620851ae168fc21935 From 0e53484b625485f0847c5c4188da7407b82d866f Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 3 Dec 2024 20:13:43 +0200 Subject: [PATCH 10/17] RED-10600 - updated can assign reviewer logic when file is set to done to assign user when is moved back to "in review" --- apps/red-ui/src/app/services/permissions.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/services/permissions.service.ts b/apps/red-ui/src/app/services/permissions.service.ts index 6c2956310..a7944a227 100644 --- a/apps/red-ui/src/app/services/permissions.service.ts +++ b/apps/red-ui/src/app/services/permissions.service.ts @@ -496,7 +496,7 @@ export class PermissionsService { } #canAssignReviewer(file: File, dossier: Dossier) { - const fileStatesForReviewer = file.isNew || file.isUnderReview || file.isUnderApproval; + const fileStatesForReviewer = file.isNew || file.isUnderReview || file.isUnderApproval || file.isApproved; return fileStatesForReviewer && this.isDossierMember(dossier); } From 49c59897bf49d07d241778e63773e95d41317912 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 3 Dec 2024 23:26:33 +0200 Subject: [PATCH 11/17] RED-10575 - hid the "read only" text when file is in processing state --- .../readonly-banner.component.html | 55 +++++++++++-------- .../readonly-banner.component.scss | 2 +- .../readonly-banner.component.ts | 3 +- 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/readonly-banner/readonly-banner.component.html b/apps/red-ui/src/app/modules/file-preview/components/readonly-banner/readonly-banner.component.html index 1a0a8f423..f37c4646c 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/readonly-banner/readonly-banner.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/readonly-banner/readonly-banner.component.html @@ -1,24 +1,35 @@ -
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.ts index f1c04fec6..9111e481c 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.ts @@ -3,10 +3,8 @@ import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } import { AdminDialogService } from '../../../services/admin-dialog.service'; import { BaseFormComponent, IconButtonComponent, LoadingService, Toaster } from '@iqser/common-ui'; import { rolesTranslations } from '@translations/roles-translations'; -import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { User } from '@red/domain'; import { UserService } from '@users/user.service'; -import { HttpStatusCode } from '@angular/common/http'; import { firstValueFrom } from 'rxjs'; import { IProfileUpdateRequest } from '@iqser/common-ui/lib/users'; import { TranslateModule } from '@ngx-translate/core'; From 34dc025b79d7fcebcec3c1bd5fd490c71b004e6f Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Wed, 4 Dec 2024 19:04:25 +0200 Subject: [PATCH 16/17] RED-10593 - when legalBasisValue = 'n-a' set empty string as param to not display "Annotation based on rule n-a" --- .../annotation-details/annotation-details.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts index a092c15b3..b97d25475 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts @@ -89,7 +89,7 @@ export class AnnotationDetailsComponent { icon: 'red:rule', description: _('annotation-engines.rule'), show: isBasedOn(annotation, LogEntryEngines.RULE), - translateParams: { rule: annotation.legalBasisValue || '' }, + translateParams: { rule: annotation.legalBasisValue === 'n-a' ? '' : annotation.legalBasisValue || '' }, }, { icon: 'red:import_redactions', From 425f3da9d4e4381961d7f0c2dff59eb43846ab14 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Wed, 4 Dec 2024 20:05:43 +0200 Subject: [PATCH 17/17] RED-10587 - Add auto new line for edit-component textfield --- .../editable-structured-component-value.component.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.scss b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.scss index 8e4b4194b..deeacae0f 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.scss +++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.scss @@ -20,6 +20,12 @@ display: flex; flex-direction: column; gap: 10px; + + span { + word-wrap: break-word; + word-break: break-word; + text-overflow: ellipsis; + } } .actions {