RED-6410 - File attributes in-place editing look & feel changes in file list
This commit is contained in:
parent
b8f07f5c31
commit
02f4f33115
@ -1,5 +1,5 @@
|
||||
<div class="file-attribute">
|
||||
<div class="value">
|
||||
<div class="value" (click)="editFileAttribute($event)">
|
||||
<span *ngIf="!isDate; else date" class="clamp-3"> {{ fileAttributeValue || '-' }}</span>
|
||||
<ng-template #date>
|
||||
<span class="clamp-3"> {{ fileAttributeValue ? (fileAttributeValue | date : 'd MMM yyyy') : '-' }}</span>
|
||||
@ -24,23 +24,23 @@
|
||||
<mat-icon [svgIcon]="'iqser:edit'"></mat-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #input>
|
||||
<div class="edit-input" stopPropagation>
|
||||
<form (submit)="save()" [formGroup]="form">
|
||||
<iqser-dynamic-input
|
||||
(closedDatepicker)="closedDatepicker = $event"
|
||||
(keydown.escape)="close()"
|
||||
[formControlName]="fileAttribute.id"
|
||||
[id]="fileAttribute.id"
|
||||
[type]="fileAttribute.type"
|
||||
></iqser-dynamic-input>
|
||||
|
||||
<iqser-circle-button (action)="save()" [disabled]="disabled" [icon]="'iqser:check'" class="save"></iqser-circle-button>
|
||||
|
||||
<iqser-circle-button (action)="close()" [icon]="'iqser:close'"></iqser-circle-button>
|
||||
</form>
|
||||
</div>
|
||||
</ng-template>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
||||
<ng-template #input>
|
||||
<div class="edit-input" stopPropagation>
|
||||
<form (submit)="save()" [formGroup]="form">
|
||||
<iqser-dynamic-input
|
||||
(closedDatepicker)="closedDatepicker = $event"
|
||||
(keydown.escape)="close()"
|
||||
[formControlName]="fileAttribute.id"
|
||||
[id]="fileAttribute.id"
|
||||
[type]="fileAttribute.type"
|
||||
></iqser-dynamic-input>
|
||||
|
||||
<iqser-circle-button (action)="save()" [disabled]="disabled" [icon]="'iqser:check'" class="save"></iqser-circle-button>
|
||||
|
||||
<iqser-circle-button (action)="close()" [icon]="'iqser:close'"></iqser-circle-button>
|
||||
</form>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
@ -59,8 +59,10 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
|
||||
}
|
||||
|
||||
async editFileAttribute($event: MouseEvent): Promise<void> {
|
||||
$event.stopPropagation();
|
||||
this.#toggleEdit();
|
||||
if (!this.file.isInitialProcessing && this.permissionsService.canEditFileAttributes(this.file, this.dossier)) {
|
||||
$event.stopPropagation();
|
||||
this.#toggleEdit();
|
||||
}
|
||||
}
|
||||
|
||||
async save() {
|
||||
@ -139,7 +141,7 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
|
||||
#focusOnEditInput(): void {
|
||||
setTimeout(() => {
|
||||
const input = document.getElementById(this.fileAttribute.id);
|
||||
input.focus();
|
||||
input?.focus();
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user