From 88ef8830c24e69721e895d99949e4e8672b29355 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Tue, 20 Aug 2024 13:22:40 +0300 Subject: [PATCH 01/11] RED-9916: update common ui. --- libs/common-ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/common-ui b/libs/common-ui index 0ca5e7e2a..007e761bd 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 0ca5e7e2ad7ca2b788f7234d7a38a3b810d9b31a +Subproject commit 007e761bd597a1534599b05d28826258bfc52570 From 6a6db17d2c475b4f2f18dee8a4e4535ca5f8e057 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Tue, 20 Aug 2024 15:11:30 +0300 Subject: [PATCH 02/11] RED-9889: escape html in component values. --- .../editable-structured-component-value.component.html | 2 +- .../editable-structured-component-value.component.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html index 39d8bf3d4..6a0624a6e 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html @@ -4,7 +4,7 @@
@for (componentValue of entry.componentValues; track componentValue) { - + }
diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts index 5617d84e0..9683f667e 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts @@ -8,6 +8,8 @@ import { TranslateModule } from '@ngx-translate/core'; import { IComponentLogEntry, IComponentValue } from '@red/domain'; import { RevertValueDialogComponent } from '../../dialogs/docu-mine/revert-value-dialog/revert-value-dialog.component'; import { FilePreviewStateService } from '../../services/file-preview-state.service'; +import { escapeHtml } from '@common-ui/utils'; +import { ReplaceNbspPipe } from '@common-ui/pipes/replace-nbsp.pipe'; @Component({ selector: 'redaction-editable-structured-component-value [entry] [canEdit]', @@ -28,6 +30,7 @@ import { FilePreviewStateService } from '../../services/file-preview-state.servi CdkDragHandle, FormsModule, AsyncPipe, + ReplaceNbspPipe, ], }) export class EditableStructuredComponentValueComponent implements OnInit { @@ -149,7 +152,7 @@ export class EditableStructuredComponentValueComponent implements OnInit { } transformNewLines(value: string) { - return value.replace(/\n/g, '
'); + return escapeHtml(value).replace(/\n/g, '
'); } #getUniqueReferencesIds(values: IComponentValue[]) { From 2daa033b8e635683d90eb7d504dc9640ce56e07b Mon Sep 17 00:00:00 2001 From: project_703_bot_497bb7eb186ca592c63b3e50cd5c69e1 Date: Wed, 21 Aug 2024 01:03:27 +0000 Subject: [PATCH 03/11] push back localazy update --- apps/red-ui/src/assets/i18n/redact/de.json | 4 ++-- apps/red-ui/src/assets/i18n/redact/en.json | 2 +- apps/red-ui/src/assets/i18n/scm/de.json | 2 +- apps/red-ui/src/assets/i18n/scm/en.json | 2 +- 4 files 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 f7f86b58b..7649bf24f 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -1556,7 +1556,7 @@ "select-none": "Keine", "show-skipped": "Ignorierte im Dokument anzeigen", "the-filters": "zurück.", - "wrong-filters": "Die ausgewählte Filterkombination ist nicht möglich. Bitte ändern Sie die Auswahl oder" + "wrong-filters": "Keine Annotationen für die ausgewählte Filterkombination. Bitte ändern Sie die Auswahl oder" }, "document-info": { "close": "Datei-Info schließen", @@ -2046,7 +2046,7 @@ "auto-expand-filters-on-action": "Filter ausgehend von meinen Aktionen automatisch anpassen", "help-mode-dialog": "Dialog zur Aktivierung des Hilfemodus", "load-all-annotations-warning": "Warnung bei gleichzeitigem Laden aller Annotationen in der Miniaturansicht", - "overwrite-file-option": "Preferred action when re-uploading of an already existing file", + "overwrite-file-option": "Bevorzugte Aktion beim erneuten Hochladen einer bereits vorhandenen Datei", "table-extraction-type": "Art der Tabellenextraktion" }, "label": "Präferenzen", diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index 80fa632c2..ca9d1b829 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -2046,7 +2046,7 @@ "auto-expand-filters-on-action": "Auto-expand filters on my actions", "help-mode-dialog": "Help mode activation dialog", "load-all-annotations-warning": "Warning regarding simultaneous loading of all annotations in thumbnails", - "overwrite-file-option": "Preferred action when re-uploading of an already existing file", + "overwrite-file-option": "Preferred action when re-uploading an already existing file", "table-extraction-type": "Table extraction type" }, "label": "Preferences", diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index 1fc741491..6adf5369f 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -2046,7 +2046,7 @@ "auto-expand-filters-on-action": "Auto expand filters on my actions", "help-mode-dialog": "Help Mode Dialog", "load-all-annotations-warning": "Warning regarding loading all annotations at once in file preview", - "overwrite-file-option": "Preferred action when re-uploading of an already existing file", + "overwrite-file-option": "Preferred action when re-uploading an already existing file", "table-extraction-type": "Table extraction type" }, "label": "Preferences", diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index bec6bbe33..9f3272876 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -2046,7 +2046,7 @@ "auto-expand-filters-on-action": "Auto expand filters on my actions", "help-mode-dialog": "Help Mode Dialog", "load-all-annotations-warning": "Warning regarding loading all annotations at once in file preview", - "overwrite-file-option": "Preferred action when re-uploading of an already existing file", + "overwrite-file-option": "Preferred action when re-uploading an already existing file", "table-extraction-type": "Table extraction type" }, "label": "Preferences", From 4438f90af408b788b77f7c18f0c328cabb8d50af Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Wed, 21 Aug 2024 10:53:13 +0300 Subject: [PATCH 04/11] RED-9893: show missing type toaster only once. --- .../src/app/modules/file-preview/services/file-data.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts b/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts index 0906fb42d..8a255b226 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts @@ -137,7 +137,7 @@ export class FileDataService extends EntitiesService !a.isFalsePositive); this.#annotations.set(annotations); } From 7ad36ea6f62c239d3e5ad2f652307e17482ea872 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Wed, 21 Aug 2024 11:33:33 +0300 Subject: [PATCH 05/11] RED-9824: fixed toaster notification message for edit annotation action. --- apps/red-ui/src/assets/i18n/scm/de.json | 6 +++--- apps/red-ui/src/assets/i18n/scm/en.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index 6adf5369f..a032d4768 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -324,8 +324,8 @@ "success": "Schwärzung eingefügt!" }, "recategorize-annotation": { - "error": "", - "success": "" + "error": "Bearbeiten des Typs fehlgeschlagen: {error}", + "success": "Annotation wurde bearbeitet: {changes} geändert." }, "recategorize-image": { "error": "Rekategorisierung des Bildes gescheitert: {error}", @@ -2584,4 +2584,4 @@ } }, "yesterday": "Gestern" -} \ No newline at end of file +} diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index 9f3272876..a21912888 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -321,8 +321,8 @@ "success": "Annotation added!" }, "recategorize-annotation": { - "error": "", - "success": "" + "error": "Failed to edit type: {error}", + "success": "Annotation was edited: Changed {changes}" }, "recategorize-image": { "error": "Failed to recategorize image: {error}", @@ -2584,4 +2584,4 @@ } }, "yesterday": "Yesterday" -} \ No newline at end of file +} From 80a713d850b23f96ba7d3509bd707c826aab0fcd Mon Sep 17 00:00:00 2001 From: project_703_bot_497bb7eb186ca592c63b3e50cd5c69e1 Date: Thu, 22 Aug 2024 01:03:26 +0000 Subject: [PATCH 06/11] push back localazy update --- apps/red-ui/src/assets/i18n/redact/de.json | 2 +- apps/red-ui/src/assets/i18n/redact/en.json | 2 +- apps/red-ui/src/assets/i18n/scm/de.json | 6 +++--- apps/red-ui/src/assets/i18n/scm/en.json | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index 7649bf24f..f630f4d70 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -1657,7 +1657,7 @@ "test-connection": "Verbindung testen" }, "app-name": { - "label": "Workspace-Name", + "label": "Anzeigename", "placeholder": "RedactManager" }, "form": { diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index ca9d1b829..79faf6e1f 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -1657,7 +1657,7 @@ "test-connection": "Test connection" }, "app-name": { - "label": "Workspace name", + "label": "Display name", "placeholder": "RedactManager" }, "form": { diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index a032d4768..6adf5369f 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -324,8 +324,8 @@ "success": "Schwärzung eingefügt!" }, "recategorize-annotation": { - "error": "Bearbeiten des Typs fehlgeschlagen: {error}", - "success": "Annotation wurde bearbeitet: {changes} geändert." + "error": "", + "success": "" }, "recategorize-image": { "error": "Rekategorisierung des Bildes gescheitert: {error}", @@ -2584,4 +2584,4 @@ } }, "yesterday": "Gestern" -} +} \ No newline at end of file diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index a21912888..b828a2d39 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -321,8 +321,8 @@ "success": "Annotation added!" }, "recategorize-annotation": { - "error": "Failed to edit type: {error}", - "success": "Annotation was edited: Changed {changes}" + "error": "", + "success": "" }, "recategorize-image": { "error": "Failed to recategorize image: {error}", @@ -1657,7 +1657,7 @@ "test-connection": "Test connection" }, "app-name": { - "label": "Workspace name", + "label": "Display name", "placeholder": "RedactManager" }, "form": { @@ -2584,4 +2584,4 @@ } }, "yesterday": "Yesterday" -} +} \ No newline at end of file From 6f8edaf4bade5bfb0dd0315e671518d09523d938 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Tue, 27 Aug 2024 14:28:40 +0300 Subject: [PATCH 07/11] RED-9887: fixed component fields cancel and revert actions. --- ...-structured-component-value.component.html | 18 ++-- ...le-structured-component-value.component.ts | 95 ++++++++++--------- 2 files changed, 57 insertions(+), 56 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html index 6a0624a6e..1d8262154 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html @@ -3,12 +3,12 @@ @if (!editing) {
- @for (componentValue of entry.componentValues; track componentValue) { + @for (componentValue of currentEntry().componentValues; track componentValue) { }
- @if (canEdit) { + @if (canEdit()) { - @if (hasUpdatedValues) { + @if (hasUpdatedValues()) {
} } @@ -24,10 +24,10 @@
} @else {
- @for (value of entry.componentValues; track value) { + @for (value of currentEntry().componentValues; track value) {
-
+
- @if (hasUpdatedValues && canEdit) { + @if (hasUpdatedValues() && canEdit()) { (); + currentEntry: WritableSignal; + readonly canEdit = input(); + readonly deselectLast = output(); + readonly overrideValue = output(); + readonly revertOverride = output(); + hasUpdatedValues = computed(() => this.currentEntry().overridden); + selected = false; + valueBeforeCurrentEdit: IComponentValue[]; protected entryLabel: string; protected editing = false; - protected hasUpdatedValues = false; protected initialEntry: IComponentLogEntry; + disabled = computed(() => { + for (let i = 0; i < this.currentEntry().componentValues.length; i++) { + if (this.currentEntry().componentValues[i].value !== this.initialEntry.componentValues[i]?.value) { + return false; + } + } + return this.currentEntry().componentValues.length === this.initialEntry.componentValues.length; + }); protected readonly iconButtonTypes = IconButtonTypes; - @Input() entry: IComponentLogEntry; - @Input() canEdit: boolean; - @Output() readonly deselectLast = new EventEmitter(); - @Output() readonly overrideValue = new EventEmitter(); - @Output() readonly revertOverride = new EventEmitter(); - selected = false; constructor( readonly helpModeService: HelpModeService, @@ -52,39 +62,18 @@ export class EditableStructuredComponentValueComponent implements OnInit { private readonly _state: FilePreviewStateService, ) {} - get disabled() { - for (let i = 0; i < this.entry.componentValues.length; i++) { - if (this.entry.componentValues[i].value !== this.initialEntry.componentValues[i]?.value) { - return false; - } - } - return this.entry.componentValues.length === this.initialEntry.componentValues.length; - } - - get #hasUpdatedValues() { - for (const value of this.entry.componentValues) { - if (value.originalValue === null && value.value === '') { - continue; - } - if (value.originalValue !== value.value) { - return true; - } - } - return false; - } - get #initialEntry() { - return JSON.parse(JSON.stringify(this.entry)); + return JSON.parse(JSON.stringify(this.entry())); } ngOnInit() { + this.currentEntry = signal(this.entry()); this.reset(); } reset() { this.initialEntry = this.#initialEntry; - this.hasUpdatedValues = this.#hasUpdatedValues; - this.entryLabel = this.parseName(this.entry.name); + this.entryLabel = this.parseName(this.currentEntry().name); this.deselect(); } @@ -96,11 +85,12 @@ export class EditableStructuredComponentValueComponent implements OnInit { } this.deselectLast.emit(); this.selected = true; - this._state.componentReferenceIds = this.#getUniqueReferencesIds(this.entry.componentValues); + this._state.componentReferenceIds = this.#getUniqueReferencesIds(this.currentEntry().componentValues); } } edit() { + this.valueBeforeCurrentEdit = JSON.parse(JSON.stringify([...this.currentEntry().componentValues])); this.deselectLast.emit(); this.selected = true; this.editing = true; @@ -114,37 +104,48 @@ export class EditableStructuredComponentValueComponent implements OnInit { this._state.componentReferenceIds = null; } + cancel($event?: MouseEvent) { + this.currentEntry.update(value => ({ ...value, componentValues: this.valueBeforeCurrentEdit })); + this.deselect($event); + } + removeValue(index: number) { - this.entry.componentValues.splice(index, 1); + this.currentEntry.update(value => ({ ...value, componentValues: value.componentValues.filter((_, i) => i !== index) })); } save() { - this.entry.overridden = true; - this.overrideValue.emit(this.entry); + this.currentEntry.update(value => ({ ...value, overridden: true })); + this.overrideValue.emit(this.currentEntry()); this.reset(); } async undo() { - const dialog = this._iqserDialog.openDefault(RevertValueDialogComponent, { data: { entry: this.entry }, width: '800px' }); + const dialog = this._iqserDialog.openDefault(RevertValueDialogComponent, { data: { entry: this.currentEntry() }, width: '800px' }); const result = await dialog.result(); if (result) { - this.revertOverride.emit(this.entry.name); + this.revertOverride.emit(this.currentEntry().name); this.reset(); } } add() { - this.entry.componentValues.push({ - componentRuleId: null, - entityReferences: [], - originalValue: null, - value: '', - valueDescription: '', - }); + this.currentEntry.update(value => ({ + ...value, + componentValues: [ + ...value.componentValues, + { + componentRuleId: null, + entityReferences: [], + originalValue: null, + value: '', + valueDescription: '', + }, + ], + })); } drop(event: CdkDragDrop) { - moveItemInArray(this.entry.componentValues, event.previousIndex, event.currentIndex); + moveItemInArray(this.currentEntry().componentValues, event.previousIndex, event.currentIndex); } parseName(name: string) { @@ -167,7 +168,7 @@ export class EditableStructuredComponentValueComponent implements OnInit { #updateTextAreaHeight() { setTimeout(() => { - for (let i = 0; i < this.entry.componentValues.length; i++) { + for (let i = 0; i < this.currentEntry().componentValues.length; i++) { const textArea = document.getElementById(`value-input-${i}`); textArea.style.height = 'auto'; textArea.style.height = `${textArea.scrollHeight}px`; From e7981971100ce8cd33b3e6e3b1d29c7d0c1f57c2 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Tue, 27 Aug 2024 15:09:41 +0300 Subject: [PATCH 08/11] RED-9946: added tooltip with valueDescription. --- .../editable-structured-component-value.component.html | 6 +++++- .../editable-structured-component-value.component.ts | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html index 1d8262154..ee52fc338 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html @@ -4,7 +4,11 @@
@for (componentValue of currentEntry().componentValues; track componentValue) { - + }
diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts index 34efc54e0..923fc5b3c 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts @@ -10,6 +10,7 @@ import { RevertValueDialogComponent } from '../../dialogs/docu-mine/revert-value import { FilePreviewStateService } from '../../services/file-preview-state.service'; import { escapeHtml } from '@common-ui/utils'; import { ReplaceNbspPipe } from '@common-ui/pipes/replace-nbsp.pipe'; +import { MatTooltip } from '@angular/material/tooltip'; @Component({ selector: 'redaction-editable-structured-component-value [entry] [canEdit]', @@ -31,6 +32,7 @@ import { ReplaceNbspPipe } from '@common-ui/pipes/replace-nbsp.pipe'; FormsModule, AsyncPipe, ReplaceNbspPipe, + MatTooltip, ], }) export class EditableStructuredComponentValueComponent implements OnInit { From db1257751ad140fe52a6bb2cb5c4fa976303217e Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Wed, 28 Aug 2024 13:22:37 +0300 Subject: [PATCH 09/11] RED-9887: fixed save button being disabled. --- ...le-structured-component-value.component.html | 2 +- ...able-structured-component-value.component.ts | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html index ee52fc338..b12b528d5 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html @@ -54,7 +54,7 @@
diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts index 923fc5b3c..128482377 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts @@ -48,14 +48,6 @@ export class EditableStructuredComponentValueComponent implements OnInit { protected entryLabel: string; protected editing = false; protected initialEntry: IComponentLogEntry; - disabled = computed(() => { - for (let i = 0; i < this.currentEntry().componentValues.length; i++) { - if (this.currentEntry().componentValues[i].value !== this.initialEntry.componentValues[i]?.value) { - return false; - } - } - return this.currentEntry().componentValues.length === this.initialEntry.componentValues.length; - }); protected readonly iconButtonTypes = IconButtonTypes; constructor( @@ -64,6 +56,15 @@ export class EditableStructuredComponentValueComponent implements OnInit { private readonly _state: FilePreviewStateService, ) {} + get disabled() { + for (let i = 0; i < this.currentEntry().componentValues.length; i++) { + if (this.currentEntry().componentValues[i].value !== this.initialEntry.componentValues[i]?.value) { + return false; + } + } + return this.currentEntry().componentValues.length === this.initialEntry.componentValues.length; + } + get #initialEntry() { return JSON.parse(JSON.stringify(this.entry())); } From a55571a381c347c2d59ec8187f5535926999e9e6 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Thu, 29 Aug 2024 13:03:14 +0300 Subject: [PATCH 10/11] RED-9951: made document info scrollable & fixed paginator position. --- .../components/document-info/document-info.component.scss | 7 ++----- .../components/file-workload/file-workload.component.scss | 2 +- .../modules/file-preview/services/document-info.service.ts | 4 ++++ .../components/paginator/paginator.component.scss | 2 +- apps/red-ui/src/styles.scss | 6 +++--- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/document-info/document-info.component.scss b/apps/red-ui/src/app/modules/file-preview/components/document-info/document-info.component.scss index c066e0ebf..d2b3853c0 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/document-info/document-info.component.scss +++ b/apps/red-ui/src/app/modules/file-preview/components/document-info/document-info.component.scss @@ -18,13 +18,10 @@ .right-content { flex-direction: column; + height: calc(100% - 71px); @include common-mixins.scroll-bar; - overflow: hidden; - - &:hover { - overflow: auto; - } + overflow-y: auto; &.has-scrollbar .section { padding-right: 13px; diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss index 9d8652eb3..1867ae1ab 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss +++ b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss @@ -79,7 +79,7 @@ .quick-navigation { height: 100%; border-right: 1px solid var(--iqser-separator); - min-width: var(--qiuck-navigation-width); + min-width: var(--quick-navigation-width); overflow: hidden; display: flex; flex-direction: column; diff --git a/apps/red-ui/src/app/modules/file-preview/services/document-info.service.ts b/apps/red-ui/src/app/modules/file-preview/services/document-info.service.ts index 63738433e..96e5dd0a9 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/document-info.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/document-info.service.ts @@ -32,6 +32,10 @@ export class DocumentInfoService { }, { allowSignalWrites: true }, ); + + effect(() => { + document.body.style.setProperty('--quick-navigation-width', this.shown() ? '350px' : '61px'); + }); } fileAttributes$(fileId: string, dossierId: string, dossierTemplateId: string) { diff --git a/apps/red-ui/src/app/modules/pdf-viewer/components/paginator/paginator.component.scss b/apps/red-ui/src/app/modules/pdf-viewer/components/paginator/paginator.component.scss index 097e2a09d..558f1e724 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/components/paginator/paginator.component.scss +++ b/apps/red-ui/src/app/modules/pdf-viewer/components/paginator/paginator.component.scss @@ -14,7 +14,7 @@ align-items: center; &.documine-pagination { - left: calc(100% - (var(--documine-viewer-width) / 2) - var(--qiuck-navigation-width)); + left: calc(100% - (var(--documine-viewer-width) / 2) - var(--quick-navigation-width)); } > div { diff --git a/apps/red-ui/src/styles.scss b/apps/red-ui/src/styles.scss index 9714aca6b..4872be031 100644 --- a/apps/red-ui/src/styles.scss +++ b/apps/red-ui/src/styles.scss @@ -165,12 +165,12 @@ body { --workload-width: 350px; --documine-workload-content-width: 287px; --structured-component-management-width: 40%; - --qiuck-navigation-width: 61px; + --quick-navigation-width: 61px; --iqser-app-name-font-family: OpenSans Extrabold, sans-serif; --iqser-app-name-font-size: 13px; --iqser-logo-size: 28px; --documine-viewer-width: calc( - 100% - var(--structured-component-management-width) - var(--documine-workload-content-width) - var(--qiuck-navigation-width) - 3px + 100% - var(--structured-component-management-width) - var(--documine-workload-content-width) - var(--quick-navigation-width) - 3px ); --viewer-height: calc(100% - calc(var(--iqser-top-bar-height) + 50px)); } @@ -189,7 +189,7 @@ body { width: var(--documine-viewer-width); height: var(--viewer-height); bottom: 0; - right: calc(var(--qiuck-navigation-width) + 3px); + right: calc(var(--quick-navigation-width) + 3px); position: absolute; &.document-info { From 095853d0906fa1459cee9d1f369163af854d3366 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Thu, 29 Aug 2024 17:19:27 +0300 Subject: [PATCH 11/11] RED-9950: increased document viewer space. --- .../components/file-workload/file-workload.component.scss | 2 +- .../structured-component-management.component.scss | 2 -- apps/red-ui/src/styles.scss | 4 +++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss index 1867ae1ab..87df23079 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss +++ b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss @@ -43,7 +43,7 @@ flex-direction: column; &.documine-width { - width: calc(var(--documine-workload-content-width)); + width: calc(var(--documine-workload-content-width) - 50px); border-right: 1px solid var(--iqser-separator); z-index: 1; diff --git a/apps/red-ui/src/app/modules/file-preview/components/structured-component-management/structured-component-management.component.scss b/apps/red-ui/src/app/modules/file-preview/components/structured-component-management/structured-component-management.component.scss index ca68bc707..282b13568 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/structured-component-management/structured-component-management.component.scss +++ b/apps/red-ui/src/app/modules/file-preview/components/structured-component-management/structured-component-management.component.scss @@ -48,8 +48,6 @@ mat-icon { border-bottom: 1px solid var(--iqser-separator); } border-bottom: 1px solid var(--iqser-separator); - margin-left: 26px; - margin-right: 26px; } } } diff --git a/apps/red-ui/src/styles.scss b/apps/red-ui/src/styles.scss index 4872be031..3af183e3e 100644 --- a/apps/red-ui/src/styles.scss +++ b/apps/red-ui/src/styles.scss @@ -170,7 +170,9 @@ body { --iqser-app-name-font-size: 13px; --iqser-logo-size: 28px; --documine-viewer-width: calc( - 100% - var(--structured-component-management-width) - var(--documine-workload-content-width) - var(--quick-navigation-width) - 3px + 100% - var(--structured-component-management-width) - calc(var(--documine-workload-content-width) - 50px) - var( + --quick-navigation-width + ) - 3px ); --viewer-height: calc(100% - calc(var(--iqser-top-bar-height) + 50px)); }