This commit is contained in:
Sébastien André
2021-05-03 09:40:30 +02:00
parent 08c923cc72
commit 2e8182d153
7 changed files with 24 additions and 15 deletions

View File

@@ -5,17 +5,20 @@
<div *ngIf="dataSourceTable != null else loading">
<table mat-table [dataSource]="dataSourceTable">
<ng-container matColumnDef="infos">
<th mat-header-cell *matHeaderCellDef style="width: 60px;"></th>
<th mat-header-cell *matHeaderCellDef style="min-width: 90px;"></th>
<td mat-cell *matCellDef="let element" style="text-align: left;">
<mat-icon aria-hidden="false" aria-label="Additional informations of the jump"
style="cursor: pointer;" (click)='openDialog(element, false)'>info</mat-icon>
<mat-icon aria-hidden="false" aria-label="Special jump" [style.visibility]="element.notes != undefined ? 'visible' : 'hidden'">sticky_note_2</mat-icon>
<mat-icon aria-hidden="false" aria-label="Special jump" [style.visibility]="element.isSpecial ? 'visible' : 'hidden'">celebration</mat-icon>
<mat-icon aria-hidden="false" aria-label="Additional informations of the jump" style="cursor: pointer;"
(click)='openDialog(element, false)' *ngIf="toShow(element)">info</mat-icon>
</td>
</ng-container>
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef style="width: 90px;">Num</th>
<td mat-cell *matCellDef="let element; let i = index">{{ resultsLength - i }}</td>
<th mat-header-cell *matHeaderCellDef style="min-width: 90px;">Num</th>
<td mat-cell *matCellDef="let element; let i = index">
{{ resultsLength - ( (dataSourceTable.paginator.pageIndex * dataSourceTable.paginator.pageSize ) + i ) }}
</td>
</ng-container>
<ng-container matColumnDef="jumpDate">
@@ -52,7 +55,7 @@
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef style="width: 70px;"></th>
<th mat-header-cell *matHeaderCellDef style="min-width: 70px;"></th>
<td mat-cell *matCellDef="let element" style="text-align: left;">
<mat-icon aria-hidden="false" aria-label="Delete this jump" style="cursor: pointer;"
(click)='delete(element)'>delete</mat-icon>

View File

@@ -58,6 +58,7 @@ export class ListOfJumpsComponent implements OnInit {
this.dataSourceTable = new MatTableDataSource<JumpResp>(data);
this.dataSourceTable.paginator = this.paginator;
this.paginator.pageSize
this.resultsLength = data.length;
}, 500);
});
@@ -71,10 +72,6 @@ export class ListOfJumpsComponent implements OnInit {
});
}
toShow(item: JumpResp) {
return item.withCutaway === true || item.notes != undefined;
}
delete(item: JumpResp) {
let data : Array<JumpResp> = this.dataSourceTable.data;
data = data.filter(d => d.id !== item.id);