Merge branch 'master' into VM/RED-7980

This commit is contained in:
Valentin Mihai 2024-03-11 15:39:45 +02:00
commit bc704dc7c2
6 changed files with 23 additions and 3 deletions

View File

@ -14,6 +14,8 @@
[noMatchText]="'dossier-templates-listing.no-match.title' | translate"
[selectionEnabled]="true"
[tableColumnConfigs]="tableColumnConfigs"
[rowIdPrefix]="'dossier-template'"
[namePropertyKey]="'name'"
></iqser-table>
<ng-template #bulkActions>

View File

@ -75,6 +75,7 @@
[attr.help-mode-key]="'new_dossier'"
[label]="'dashboard.empty-template.new-dossier' | translate"
[type]="iconButtonTypes.primary"
[buttonId]="(dossierTemplate.name | snakeCase) + '-icon-button'"
icon="iqser:plus"
></iqser-icon-button>
</ng-template>

View File

@ -11,6 +11,7 @@
<b *ngIf="mode === 'workflow' && !isInEditMode"> {{ fileAttribute.label }}: </b>
<span
*ngIf="!isDate; else date"
[style.max-width]="attributeValueWidth"
[matTooltip]="fileAttributeValue"
[ngClass]="{ hide: isInEditMode, 'clamp-3': mode !== 'workflow' }"
>

View File

@ -28,6 +28,15 @@
display: flex;
align-items: center;
gap: 6px;
width: 90%;
span {
display: inline-block;
word-break: unset;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
mat-icon {
min-width: 12px;

View File

@ -70,6 +70,10 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
return this.width ? `${this.width * this.#widthFactor}px` : 'unset';
}
get attributeValueWidth(): string {
return this.width ? `${this.width * 0.9}px` : 'unset';
}
get isDate(): boolean {
return this.fileAttribute.type === FileAttributeConfigTypes.DATE;
}

View File

@ -4,7 +4,7 @@ import { TranslateService } from '@ngx-translate/core';
import { IHeaderElement, RotationTypes } from '@red/domain';
import { FilesMapService } from '@services/files/files-map.service';
import { Roles } from '@users/roles';
import { fromEvent, merge, Observable, Subject, timer } from 'rxjs';
import { fromEvent, merge, Observable, Subject } from 'rxjs';
import { filter, map, switchMap, tap } from 'rxjs/operators';
import { HeaderElements, HeaderElementType } from '../../file-preview/utils/constants';
import { ROTATION_ACTION_BUTTONS, ROTATION_BUTTONS, ViewerEvents } from '../utils/constants';
@ -71,11 +71,14 @@ export class ViewerHeaderService {
}
get layersUpdated() {
const documentListener$ = timer(1000).pipe(switchMap(() => fromEvent(this._documentViewer.document, 'layersUpdated')));
const documentListener$ = this._documentViewer.loaded$.pipe(
filter(Boolean),
switchMap(() => fromEvent(this._documentViewer.document, 'layersUpdated')),
);
return documentListener$.pipe(
tap(async () => {
const layers = await this._documentViewer.document.getLayersArray();
const layersVisible = layers.every(layer => layer.visible);
const layersVisible = layers.filter(layer => layer.name === 'Layout grid').every(layer => layer.visible);
this._layersService.active.set(layersVisible);
}),
);