|
1 | 1 | <div class="content"> |
2 | 2 |
|
3 | 3 | <app-top-header section="Mappings"></app-top-header> |
| 4 | + <div class="filterandsort"> |
| 5 | + <mat-form-field class="filterSection" appearance="fill"> |
| 6 | + <mat-label>Filter</mat-label> |
| 7 | + <mat-chip-list #chipList aria-label="Filter" color="primary"> |
| 8 | + <mat-chip |
| 9 | + *ngFor="let chip of currentChip" |
| 10 | + (removed)="remove(chip)"> |
| 11 | + {{chip}} |
| 12 | + <button matChipRemove> |
| 13 | + <mat-icon>cancel</mat-icon> |
| 14 | + </button> |
| 15 | + </mat-chip> |
| 16 | + <input |
| 17 | + #chipInput |
| 18 | + [formControl]="FilterCtrl" |
| 19 | + [matAutocomplete]="auto" |
| 20 | + [matChipInputFor]="chipList" |
| 21 | + [matChipInputSeparatorKeyCodes]="separatorKeysCodes"> |
| 22 | + </mat-chip-list> |
| 23 | + <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)"> |
| 24 | + <mat-option *ngFor="let filter of filteredChips | async" [value]="filter"> |
| 25 | + {{filter}} |
| 26 | + </mat-option> |
| 27 | + </mat-autocomplete> |
| 28 | + </mat-form-field> |
4 | 29 |
|
5 | | - <mat-form-field class="example-chip-list" appearance="fill"> |
6 | | - <mat-label>Filter</mat-label> |
7 | | - <mat-chip-list #chipList aria-label="Filter" color="primary"> |
8 | | - <mat-chip |
9 | | - *ngFor="let chip of currentChip" |
10 | | - (removed)="remove(chip)"> |
11 | | - {{chip}} |
12 | | - <button matChipRemove> |
13 | | - <mat-icon>cancel</mat-icon> |
14 | | - </button> |
15 | | - </mat-chip> |
16 | | - <input |
17 | | - #chipInput |
18 | | - [formControl]="chipCtrl" |
19 | | - [matAutocomplete]="auto" |
20 | | - [matChipInputFor]="chipList" |
21 | | - [matChipInputSeparatorKeyCodes]="separatorKeysCodes"> |
22 | | - </mat-chip-list> |
23 | | - <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)"> |
24 | | - <mat-option *ngFor="let fruit of filteredChips | async" [value]="fruit"> |
25 | | - {{fruit}} |
26 | | - </mat-option> |
27 | | - </mat-autocomplete> |
28 | | - </mat-form-field> |
| 30 | + |
| 31 | + <section class="sortSection"> |
| 32 | + <mat-button-toggle-group [formControl]="SortCtrl" aria-label="Sort By"> |
| 33 | + <mat-button-toggle value="sortByTask" (click)="changeTableBasedOnCurrentSort()">Tasks</mat-button-toggle> |
| 34 | + <mat-button-toggle value="sortBySAMM" (click)="changeTableBasedOnCurrentSort()">SAMM</mat-button-toggle> |
| 35 | + <mat-button-toggle value="sortByISO" (click)="changeTableBasedOnCurrentSort()">ISO</mat-button-toggle> |
| 36 | + </mat-button-toggle-group> |
| 37 | + </section> |
| 38 | + </div> |
| 39 | + |
29 | 40 |
|
30 | 41 |
|
31 | 42 | <table mat-table [dataSource]="dataSource" class="mat-elevation-z8 matrix-table" > |
|
46 | 57 | </ng-container> |
47 | 58 |
|
48 | 59 | <ng-container matColumnDef="samm2"> |
49 | | - <th mat-header-cell *matHeaderCellDef> SAMM </th> |
50 | | - <td mat-cell *matCellDef="let element"> |
51 | | - <ul> |
52 | | - <li *ngFor="let sammElement of element.samm2"> |
53 | | - {{sammElement}} |
54 | | - </li> |
55 | | - </ul> |
56 | | - </td> |
| 60 | + <ng-container *ngIf="currentlySortingBySAMM"> |
| 61 | + <th mat-header-cell *matHeaderCellDef> SAMM </th> |
| 62 | + <td mat-cell *matCellDef="let element"> {{element.samm2}} </td> |
| 63 | + </ng-container> |
| 64 | + <ng-container *ngIf="currentlySortingByTask || currentlySortingByISO"> |
| 65 | + <th mat-header-cell *matHeaderCellDef> SAMM </th> |
| 66 | + <td mat-cell *matCellDef="let element"> |
| 67 | + <ul> |
| 68 | + <li *ngFor="let sammElement of element.samm2"> |
| 69 | + {{sammElement}} |
| 70 | + </li> |
| 71 | + </ul> |
| 72 | + </td> |
| 73 | + </ng-container> |
57 | 74 | </ng-container> |
58 | 75 |
|
59 | 76 | <ng-container matColumnDef="ISO"> |
60 | | - <th mat-header-cell *matHeaderCellDef> ISO </th> |
61 | | - <td mat-cell *matCellDef="let element"> |
62 | | - <ul> |
63 | | - <li *ngFor="let ISOElement of element.ISO"> |
64 | | - {{ISOElement}} |
65 | | - </li> |
66 | | - </ul> |
67 | | - </td> |
| 77 | + <ng-container *ngIf="currentlySortingByISO"> |
| 78 | + <th mat-header-cell *matHeaderCellDef> ISO </th> |
| 79 | + <td mat-cell *matCellDef="let element"> {{element.ISO}} </td> |
| 80 | + </ng-container> |
| 81 | + |
| 82 | + <ng-container *ngIf="currentlySortingByTask || currentlySortingBySAMM"> |
| 83 | + <th mat-header-cell *matHeaderCellDef> ISO </th> |
| 84 | + <td mat-cell *matCellDef="let element"> |
| 85 | + <ul> |
| 86 | + <li *ngFor="let ISOElement of element.ISO"> |
| 87 | + {{ISOElement}} |
| 88 | + </li> |
| 89 | + </ul> |
| 90 | + </td> |
| 91 | + </ng-container> |
68 | 92 | </ng-container> |
69 | 93 |
|
70 | 94 | <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
|
0 commit comments