Remove unused DESC1-4 from front

This commit is contained in:
Michał Zieliski
2024-07-03 19:27:05 +02:00
parent 17037a1a3d
commit fe8118c42a
3 changed files with 11 additions and 42 deletions

View File

@@ -35,10 +35,6 @@ export class Record extends Base {
value31?: number; value31?: number;
value32?: number; value32?: number;
desc1?: string; desc1?: string;
desc2?: string;
desc3?: string;
desc4?: string;
desc5?: string;
constructor(data: Partial<Record> = {}) { constructor(data: Partial<Record> = {}) {
super(); super();

View File

@@ -250,30 +250,6 @@
<td mat-footer-cell *matFooterCellDef></td> <td mat-footer-cell *matFooterCellDef></td>
</ng-container> </ng-container>
<ng-container matColumnDef="desc2">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Description2</th>
<td mat-cell *matCellDef="let row"> {{row.desc2}} </td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="desc3">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Description3</th>
<td mat-cell *matCellDef="let row"> {{row.desc3}} </td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="desc4">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Description4</th>
<td mat-cell *matCellDef="let row"> {{row.desc4}} </td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="desc5">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Description5</th>
<td mat-cell *matCellDef="let row"> {{row.desc5}} </td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns, sticky: true"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns, sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr mat-footer-row *matFooterRowDef="displayedColumns"></tr> <tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>

View File

@@ -80,16 +80,14 @@ export class LayerDetailComponent implements OnInit {
} }
} }
} }
for (let i = 1; i < 6; i++) {
for (const record of this.document.records) { for (const record of this.document.records) {
const propertyName = `desc${i}` as keyof typeof record; if (record.desc1 !== null) {
if (record[propertyName] !== null) { this.displayedColumns.push(`desc1`);
this.displayedColumns.push(`desc${i}`);
break; break;
} }
} }
} }
}
processLayer() { processLayer() {
Layer.processLayer(this.document.id!, this.http$).then(() => { Layer.processLayer(this.document.id!, this.http$).then(() => {
@@ -143,7 +141,6 @@ export class LayerDetailComponent implements OnInit {
//= codes.map(code => this.getRecordValue(this.document.records.find(x => x.code === code)!, i+1)); //= codes.map(code => this.getRecordValue(this.document.records.find(x => x.code === code)!, i+1));
this.shortRecords.push(res); this.shortRecords.push(res);
} }
console.log('shortRecords', this.shortRecords);
}); });
} }