Skip to content

Commit

Permalink
Order reports on name in test tab
Browse files Browse the repository at this point in the history
  • Loading branch information
celmoussaoui committed Jul 17, 2023
1 parent 85c3f0d commit f441ed4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
12 changes: 5 additions & 7 deletions src/app/debug/table/table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
<app-button [icon]="'fa fa-refresh'" [title]="'Refresh'" (click)="refresh()"></app-button>
<app-button [icon]="'fa fa-cog'" [title]="'Settings'" (click)="openSettingsModal()"></app-button>
<app-button [icon]="'fa fa-filter'" [title]="'Filter'" (click)="toggleFilter()"></app-button>
<button type="button" id="UploadButton" class="btn btn-info my-2 mx-1 px-3"
title="Upload" (click)="uploadFileTable.click()">
<i class="fa fa-upload"></i>
<input #uploadFileTable (change)="uploadReports($event)" type="file" id="uploadFileTable">
</button>


<div ngbDropdown title="Download">
<button class="btn btn-info my-2 mx-1" id="dropdownDownloadTable" ngbDropdownToggle>
<i class="fa fa-download px-2"></i><span class="caret"></span>
Expand All @@ -20,6 +13,11 @@
<button ngbDropdownItem (click)="downloadReports(true, false)">Binary</button>
</div>
</div>
<button type="button" id="UploadButton" class="btn btn-info my-2 mx-1 px-3"
title="Upload" (click)="uploadFileTable.click()">
<i class="fa fa-upload"></i>
<input #uploadFileTable (change)="uploadReports($event)" type="file" id="uploadFileTable">
</button>

<app-button [title]="'Open Selected Reports'" [text]="'Open Selected'" (click)="openSelected()"></app-button>
<app-button [title]="'Select All Reports'" [text]="'Select All'" (click)="selectAll()"></app-button>
Expand Down
4 changes: 2 additions & 2 deletions src/app/test/test.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<app-button [icon]="'fa fa-trash'" [title]="'Delete Selected'" (click)="deleteSelected()"></app-button>
<app-button [text]="'Clone'" [title]="'Clone report'" (click)="openCloneModal()"></app-button>
<app-button [icon]="'fa fa-copy'" [title]="'Copy Selected'" (click)="copySelected()"></app-button>
<app-button [icon]="'fa fa-download'" [title]="'Download Binary'" (click)="downloadSelected()"></app-button>
<button type="button" id="UploadButton" class="btn btn-info my-2 mx-1 px-3"
title="Upload" (click)="uploadFileTest.click()">
<i class="fa fa-upload"></i>
<input #uploadFileTest (change)="uploadReport($event)" type="file" id="uploadFileTest">
</button>
</div>
<app-button [icon]="'fa fa-download'" [title]="'Download Binary'" (click)="downloadSelected()"></app-button>


<div class="form-group mt-2">
Expand Down Expand Up @@ -48,7 +48,7 @@
</tr>
</thead>
<tbody id="testReports">
<ng-container *ngFor="let report of reports" class="form-inline">
<ng-container *ngFor="let report of sortByName()" class="form-inline">
<tr *ngIf="matches(report)">
<td>
<input type="checkbox" [checked]="report.checked" (click)="toggleCheck(report)">
Expand Down
4 changes: 4 additions & 0 deletions src/app/test/test.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,8 @@ export class TestComponent implements OnInit {
}
return resultString.slice(0, -2);
}

sortByName() {
return this.reports.sort((a, b) => (a.name > b.name ? 1 : a.name === b.name ? 0 : -1));
}
}

0 comments on commit f441ed4

Please sign in to comment.