From dbc609765bf855673e5a941e5d554e1892eba059 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Mon, 29 Jul 2024 01:02:46 +0300 Subject: [PATCH] WIP on master RED-8748 - Integrated component view in DocuMine --- .../documine-export.component.html | 1 - .../documine-export.component.ts | 13 +- ...-structured-component-value.component.html | 130 +++--- ...-structured-component-value.component.scss | 24 +- .../file-header/file-header.component.html | 2 +- .../file-workload.component.html | 373 +++++++++--------- ...ile-preview-right-container.component.html | 4 +- .../file-preview-screen.component.scss | 2 +- .../services/viewer-header.service.ts | 9 +- apps/red-ui/src/styles.scss | 2 +- 10 files changed, 303 insertions(+), 257 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/documine-export/documine-export.component.html b/apps/red-ui/src/app/modules/file-preview/components/documine-export/documine-export.component.html index c54c1298b..7dc0226f5 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/documine-export/documine-export.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/documine-export/documine-export.component.html @@ -6,7 +6,6 @@ [matMenuTriggerFor]="bulkComponentDownloadMenu" [matTooltipPosition]="'above'" [matTooltip]="'documine-export.export-tooltip' | translate" - [hidden]="true" class="red-tab" > {{ 'documine-export.export' | translate }} diff --git a/apps/red-ui/src/app/modules/file-preview/components/documine-export/documine-export.component.ts b/apps/red-ui/src/app/modules/file-preview/components/documine-export/documine-export.component.ts index 2a412ffb4..74c75e514 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/documine-export/documine-export.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/documine-export/documine-export.component.ts @@ -1,6 +1,6 @@ -import { Component, Input } from '@angular/core'; +import { Component, input, Input } from '@angular/core'; import { firstValueFrom } from 'rxjs'; -import { Dossier } from '@red/domain'; +import { Dossier, File } from '@red/domain'; import { ComponentLogService } from '@services/files/component-log.service'; import { MatTooltip } from '@angular/material/tooltip'; import { TranslateModule } from '@ngx-translate/core'; @@ -13,15 +13,18 @@ import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; imports: [MatTooltip, TranslateModule, MatMenuTrigger, MatMenu, MatMenuItem], }) export class DocumineExportComponent { - @Input() dossier: Dossier; + readonly dossier = input(); + readonly file = input(); constructor(private readonly _componentLogService: ComponentLogService) {} downloadComponentAsJSON() { - return firstValueFrom(this._componentLogService.exportJSON(this.dossier.dossierTemplateId, this.dossier.dossierId)); + return firstValueFrom( + this._componentLogService.exportJSON(this.dossier().dossierTemplateId, this.dossier().dossierId, this.file()), + ); } async downloadComponentAsXML() { - return firstValueFrom(this._componentLogService.exportXML(this.dossier.dossierTemplateId, this.dossier.dossierId)); + return firstValueFrom(this._componentLogService.exportXML(this.dossier().dossierTemplateId, this.dossier().dossierId, this.file())); } } 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 42be825f6..92216e66a 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 @@ -1,64 +1,76 @@
{{ entryLabel }}
-
-
- - -
-
- -
-
-
- -
- - -
-
- -
- + @if (!editing) { +
+
+ @for (componentValue of entry.componentValues; track componentValue) { + + } +
+
+ @if (canEdit) { + + @if (hasUpdatedValues) { +
+ } + }
-
-
-
- -
-
- - + } @else { +
+ @for (value of entry.componentValues; track value) { +
+ +
+ +
+ +
+ }
-
- +
+ +
+
+ @if (hasUpdatedValues && canEdit) { + + } + +
+
+ } + @if (!editing) { + + } +
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 288ed4125..3ee2c0515 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 @@ -59,7 +59,6 @@ &:not(.header):hover, &.selected { background-color: var(--iqser-grey-8); - border-left: 4px solid var(--iqser-primary); margin-left: 0; margin-right: 0; @@ -67,18 +66,31 @@ cursor: pointer; } - .component { - margin-left: 22px; - } .value { margin-right: 26px; + } + } + &:hover { + .component { + margin-left: 26px; + } + + .value { .actions { iqser-circle-button { visibility: visible; } } } + } + + &.selected { + border-left: 4px solid var(--iqser-primary); + + .component { + margin-left: 22px; + } .arrow-right { visibility: visible; @@ -129,6 +141,10 @@ } } +.hidden-button { + visibility: hidden; +} + ::ng-deep .add-value { mat-icon { transform: scale(2); diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.html b/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.html index a18228626..f7606feb3 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.html @@ -1,7 +1,7 @@