RED-8648: added ellipsis for attribute value in workflow mode.

This commit is contained in:
Nicoleta Panaghiu 2024-03-13 14:05:10 +02:00
parent 7920d3d5fd
commit be143566a6
3 changed files with 17 additions and 16 deletions

View File

@ -5,22 +5,22 @@
[ngClass]="{ 'workflow-attribute': mode === 'workflow', 'file-name-column': fileNameColumn }"
class="file-attribute"
>
<div [ngClass]="{ 'workflow-value': mode === 'workflow' }" class="value" *ngIf="!isInEditMode || !fileNameColumn">
<div [ngClass]="{ 'workflow-value': mode === 'workflow' }" class="value" *ngIf="!isInEditMode || mode === 'workflow'">
<mat-icon *ngIf="!fileAttribute.editable" [matTooltip]="'readonly' | translate" svgIcon="red:read-only"></mat-icon>
<div>
<span
*ngIf="!isDate; else date"
[style.max-width]="attributeValueWidth"
[matTooltip]="fileAttributeValue"
[ngClass]="{ hide: isInEditMode, 'clamp-3': mode !== 'workflow' }"
>
<b *ngIf="mode === 'workflow' && !isInEditMode"> {{ fileAttribute.label }}: </b>
<span
*ngIf="!isDate; else date"
[matTooltip]="fileAttributeValue"
[ngClass]="{ hide: isInEditMode, 'clamp-3': mode !== 'workflow' }"
>
{{ fileAttributeValue || '-' }}</span
>
</div>
{{ fileAttributeValue || '-' }}
</span>
<ng-template #date>
<span [ngClass]="{ hide: isInEditMode, 'clamp-3': mode !== 'workflow' }">
{{ fileAttributeValue ? (fileAttributeValue | date: 'd MMM yyyy') : '-' }}</span
>
<b *ngIf="mode === 'workflow' && !isInEditMode"> {{ fileAttribute.label }}: </b>
{{ fileAttributeValue ? (fileAttributeValue | date: 'd MMM yyyy') : '-' }}
</span>
</ng-template>
</div>

View File

@ -40,7 +40,7 @@
.workflow-value {
display: flex;
width: 90%;
width: 95%;
b {
text-transform: uppercase;
@ -174,6 +174,8 @@
}
.workflow-value {
width: 90%;
b {
white-space: nowrap;
overflow: unset;

View File

@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, computed, effect, HostListener, Input, OnDestroy } from '@angular/core';
import { Component, computed, effect, HostListener, Input, OnDestroy } from '@angular/core';
import { Dossier, File, FileAttributeConfigTypes, IFileAttributeConfig } from '@red/domain';
import {
BaseFormComponent,
@ -43,7 +43,6 @@ import { TranslateModule } from '@ngx-translate/core';
NgTemplateOutlet,
TranslateModule,
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FileAttributeComponent extends BaseFormComponent implements OnDestroy {
isInEditMode = false;
@ -165,9 +164,9 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
...value,
{ attribute: this.fileAttribute.id, file: this.file.id },
]);
this.#toggleEdit();
this.fileAttributesService.setFileEdit(this.file.fileId);
this.fileAttributesService.setOpenAttributeEdit(this.fileAttribute.id);
this.#toggleEdit();
}
}