From afcb7e8b652fc08c3fb2b067b536b3dffd3907cd Mon Sep 17 00:00:00 2001 From: RIHTARSIC Joze <joze.rihtarsic@ext.ec.europa.eu> Date: Sun, 20 Oct 2024 08:16:19 +0200 Subject: [PATCH] [EDELIVERY-14167] fix toolbar height --- .../document-edit-panel.component.html | 10 +++---- .../document-edit-panel.component.scss | 18 +++++++++++++ .../document-edit-panel.component.ts | 27 +++++++++---------- smp-angular/src/styles.css | 14 +++++----- 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.html b/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.html index e0b2fa6d7..e0b4cbdbe 100644 --- a/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.html +++ b/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.html @@ -1,5 +1,4 @@ <div id="resource-document-panel"> - <mat-toolbar class="mat-elevation-z2" style="min-height: 50px !important;"> <mat-toolbar-row class="smp-toolbar-row" style="justify-content: space-between;min-height: 50px !important;"> @@ -45,8 +44,7 @@ </mat-toolbar-row> </mat-toolbar> - <div class="panel" [formGroup]="documentForm" - style="display: flex;flex-direction: row;flex-grow: 1; "> + <div class="panel document-edit-panel" [formGroup]="documentForm"> <div style="display:flex; overflow: auto;flex: 2;align-self: stretch; flex-direction: column;"> <ng-container *ngIf="hasDocumentReference && isNotReviewMode; else selectedDocumentVersionDataTemplate" > @@ -122,8 +120,7 @@ </ng-template> - <div - style="display:block; overflow: auto;flex: 2;align-self: stretch; flex-direction: column;border: ridge 3px #b0bec5" + <div class="document-editor-container" (click)="onEditPanelClick()"> <smp-editor #smpDocumentEditor formControlName="editorText" @@ -178,8 +175,7 @@ </expandable-panel> </div> - <mat-toolbar class="mat-elevation-z2" - style="flex-grow: 0;"> + <mat-toolbar class="mat-elevation-z2"> <mat-toolbar-row class="smp-toolbar-row"> <button id="back_id" mat-raised-button color="primary" (click)="onBackButtonClicked()"> diff --git a/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.scss b/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.scss index 629dfc616..cc9154a85 100644 --- a/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.scss +++ b/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.scss @@ -2,7 +2,25 @@ display: flex; height: 100%; flex-direction: column; + min-height: 200px; + overflow: hidden; +} +.document-edit-panel { + display: flex; + flex-direction: row; + flex-grow: 1; + min-height: 150px; +} + +.document-editor-container { + display:flex; + overflow: auto; + flex: 2; + align-self: stretch; + flex-direction: column; + border: ridge 3px #b0bec5; + min-height: 150px; } .CodeMirror { diff --git a/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.ts b/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.ts index db8ffd98c..151a98ff0 100644 --- a/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.ts +++ b/smp-angular/src/app/common/panels/document-edit-panel/document-edit-panel.component.ts @@ -9,36 +9,36 @@ import {MatDialog, MatDialogRef} from "@angular/material/dialog"; import { BeforeLeaveGuard } from "../../../window/sidenav/navigation-on-leave-guard"; -import {GroupRo} from "../../../common/model/group-ro.model"; -import {ResourceRo} from "../../../common/model/resource-ro.model"; +import {GroupRo} from "../../model/group-ro.model"; +import {ResourceRo} from "../../model/resource-ro.model"; import { AlertMessageService -} from "../../../common/alert-message/alert-message.service"; -import {DomainRo} from "../../../common/model/domain-ro.model"; +} from "../../alert-message/alert-message.service"; +import {DomainRo} from "../../model/domain-ro.model"; import { ResourceDefinitionRo } from "../../../system-settings/admin-extension/resource-definition-ro.model"; import {FormBuilder, FormControl, FormGroup} from "@angular/forms"; -import {DocumentRo} from "../../../common/model/document-ro.model"; +import {DocumentRo} from "../../model/document-ro.model"; import { NavigationService } from "../../../window/sidenav/navigation-model.service"; import { ConfirmationDialogComponent -} from "../../../common/dialogs/confirmation-dialog/confirmation-dialog.component"; +} from "../../dialogs/confirmation-dialog/confirmation-dialog.component"; import { SmpEditorComponent -} from "../../../common/components/smp-editor/smp-editor.component"; -import {EntityStatus} from "../../../common/enums/entity-status.enum"; +} from "../../components/smp-editor/smp-editor.component"; +import {EntityStatus} from "../../enums/entity-status.enum"; import {TranslateService} from "@ngx-translate/core"; import {lastValueFrom, Observer} from "rxjs"; import { DocumentVersionsStatus -} from "../../../common/enums/document-versions-status.enum"; +} from "../../enums/document-versions-status.enum"; import { HttpErrorHandlerService -} from "../../../common/error/http-error-handler.service"; +} from "../../error/http-error-handler.service"; import { DocumentWizardDialogComponent } from "../../../edit/edit-resources/document-wizard-dialog/document-wizard-dialog.component"; @@ -264,11 +264,7 @@ export class DocumentEditPanelComponent implements BeforeLeaveGuard, OnInit { subresourceTypeIdentifier: null, } as SubresourceRo; } - if (this.reviewDocument.target === "RESOURCE") { - this.isResourceDocument = true; - } else { - this.isResourceDocument = false; - } + this.isResourceDocument = this.reviewDocument.target === "RESOURCE"; } ngOnInit(): void { @@ -694,6 +690,7 @@ export class DocumentEditPanelComponent implements BeforeLeaveGuard, OnInit { documentVersionStatus: DocumentVersionsStatus.DRAFT, payloadStatus: EntityStatus.NEW, status: EntityStatus.UPDATED, + mimeType: this._document.mimeType, payloadVersion: null, payloadCreatedOn: null, payload: this.documentForm.controls['payload'].value, diff --git a/smp-angular/src/styles.css b/smp-angular/src/styles.css index 0a0baab87..53e0aed37 100644 --- a/smp-angular/src/styles.css +++ b/smp-angular/src/styles.css @@ -109,15 +109,15 @@ div.mat-mdc-tab-body-wrapper { } .mat-toolbar-multiple-rows { - height: unset !important; - min-height: 32px !important; - padding: 5px; + padding: 0; + height: 44px !important; + min-height: 44px !important } .mat-toolbar-row { - padding: unset !important; - height: unset !important; - min-height: 32px !important; + padding: 0 5px; + height: 42px !important; + min-height: 42px !important; } /*-------------------------------------------------- @@ -262,6 +262,8 @@ a:hover { display: flex; flex-direction: column; gap: 0.5em; + height: 42px; + min-height: 42px; } mat-card { -- GitLab