From e81e8e7252358afffef1ba83d4fdb1abb5f90029 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 3 Sep 2024 13:34:48 +0300 Subject: [PATCH] RED-9454 - Differences between Add Hint- and Add Redaction-Dialog --- .../add-hint-dialog.component.html | 53 ++++++++++++++- .../add-hint-dialog.component.scss | 66 ++++++++++++++++++- .../add-hint-dialog.component.ts | 27 +++++++- 3 files changed, 140 insertions(+), 6 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.html index 3d4c41376..62cb27b02 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.html @@ -3,9 +3,56 @@
-
- - {{ form.get('selectedText').value }} +
+
+
+ +
+ + + + + + +
+
+
div { + gap: 0.5rem; + + span { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +} + +iqser-circle-button { + padding-left: 10px; + + &.undo-button { + margin-left: 8px; + } + + ::ng-deep mat-icon { + padding: 2px; + } +} + +.w-full { + width: 100%; +} + +.fixed-height-36 { + min-height: 36px; +} + +textarea[name='value'] { + margin-top: 0; + min-height: 0; + line-height: 1; +} + +.table { + display: flex; + flex-direction: column; + min-width: calc(100% - 26px); + padding: 0 13px; + + label { + opacity: 0.7; + font-weight: normal; + } + + .row { + display: inline-flex; + flex-direction: row; + align-items: center; + background-color: var(--iqser-alt-background); + min-width: 100%; + + span { + white-space: nowrap; + text-overflow: ellipsis; + list-style-position: inside; + overflow: hidden; + } + } } diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts index 57065e3c2..92258751a 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts @@ -1,4 +1,4 @@ -import { NgForOf, NgIf } from '@angular/common'; +import { NgClass, NgForOf, NgIf, NgStyle } from '@angular/common'; import { Component, OnInit } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { FormBuilder, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms'; @@ -23,12 +23,14 @@ import { ActiveDossiersService } from '@services/dossiers/active-dossiers.servic import { DictionaryService } from '@services/entity-services/dictionary.service'; import { Roles } from '@users/roles'; import { UserPreferenceService } from '@users/user-preference.service'; -import { stringToBoolean } from '@utils/functions'; +import { calcTextWidthInPixels, stringToBoolean } from '@utils/functions'; import { tap } from 'rxjs/operators'; import { SystemDefaultOption, SystemDefaults } from '../../../account/utils/dialog-defaults'; import { getRedactOrHintOptions } from '../../utils/dialog-options'; import { AddHintData, AddHintResult, RedactOrHintOption, RedactOrHintOptions } from '../../utils/dialog-types'; +const MAXIMUM_TEXT_AREA_WIDTH = 421; + @Component({ templateUrl: './add-hint-dialog.component.html', styleUrls: ['./add-hint-dialog.component.scss'], @@ -49,6 +51,8 @@ import { AddHintData, AddHintResult, RedactOrHintOption, RedactOrHintOptions } f CircleButtonComponent, MatDialogClose, NgForOf, + NgClass, + NgStyle, ], }) export class AddHintDialogComponent extends IqserDialogComponent implements OnInit { @@ -58,9 +62,15 @@ export class AddHintDialogComponent extends IqserDialogComponent[]; + readonly initialText = this.data?.manualRedactionEntryWrapper?.manualRedactionEntry?.value; + readonly maximumTextAreaWidth = MAXIMUM_TEXT_AREA_WIDTH; + readonly maximumSelectedTextWidth = 567; dictionaryRequest = false; dictionaries: Dictionary[] = []; form!: UntypedFormGroup; + isEditingSelectedText = false; + selectedTextRows = 1; + textWidth: number; constructor( private readonly _activeDossiersService: ActiveDossiersService, @@ -83,6 +93,7 @@ export class AddHintDialogComponent extends IqserDialogComponent