CopyProcessor: update existing layer

This commit is contained in:
Michał Zieliński
2023-10-03 22:29:42 +02:00
parent f22b1933df
commit ac7b01482e
6 changed files with 81 additions and 50 deletions

View File

@@ -19,6 +19,7 @@ export class Layer extends Base {
name?: string;
records: Record[] = [];
created?: string;
modified?: string;
type?: LayerType;
constructor(data: Partial<Layer> = {}) {

View File

@@ -30,7 +30,12 @@
<input matInput disabled [value]="document.created">
</mat-form-field>
</div>
<div class="col"></div>
<div class="col">
<mat-form-field class="full-width" appearance="outline" *ngIf="document">
<mat-label>Modified</mat-label>
<input matInput disabled [value]="document.modified">
</mat-form-field>
</div>
</div>
<table mat-table [dataSource]="dataSource" matSort matSortActive="code" matSortDisableClear

View File

@@ -54,6 +54,7 @@ export class LayerDetailComponent implements OnInit {
this.document.fillForm(this.form);
this.form.disable();
this.document.created = `${this.datePipe.transform(this.document.createdAt?.toDate(), 'short')}, ${this.document.createdBy?.userName}`;
this.document.modified = `${this.datePipe.transform(this.document.modifiedAt?.toDate(), 'short')}, ${this.document.modifiedBy?.userName}`;
this.valueSum = this.document.records.map(t => t.value1 || 0).reduce((acc, value) => acc + value, 0);
this.createColumns();
}