Skip to content
Snippets Groups Projects
Commit dabb9088 authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Merge branch 'ws2903-sort_tiles_on_jobspec_name' into '2.4.4-RC1'

WS-2903: Sort tiles on jobspec name

See merge request !31
parents 8e0ca6ba 90aa5588
No related branches found
Tags 2.0.0
2 merge requests!32Merge 2.4.4 UI to main,!31WS-2903: Sort tiles on jobspec name
......@@ -89,12 +89,13 @@ export class ExecutionDetailComponent implements OnInit, OnDestroy, OnChanges {
}
refreshTiles(newTiles: Tile[]) {
// Sort newTiles by name before they're stored on this component
this.tiles = new Map<string, Tile>(
newTiles
.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true }))
.map(tile => [tile.name, tile])
);
if (this.job.jobspec_name.includes('_')) {
// Sort newTiles by their order in the jobspec name before they're stored on this component
const tileOrder: string[] = this.job.jobspec_name.split('_')[1].split('.');
newTiles = newTiles.sort((a, b) => tileOrder.indexOf(a.name) - tileOrder.indexOf(b.name));
}
this.tiles = new Map<string, Tile>(newTiles.map(tile => [tile.name, tile]));
for (const controlName in this.tilesFormGroup.controls) {
this.tilesFormGroup.removeControl(controlName);
}
......
......@@ -12,7 +12,7 @@
<button class="btn btn-link p-0" (click)="toggleDetails()">{{ job.jobspec_name }}</button>
</ng-container>
<ng-template #notHomeTabName>
<a [routerLink]="['/jobs']" [queryParams]="{pattern: job.jobspec_id, queue: jobspec.queueName}">{{job.jobspec_name}}</a>
<a [routerLink]="['/jobs']" [queryParams]="{pattern: job.jobspec_id, queue: jobspec?.queueName}">{{job.jobspec_name}}</a>
<button class="btn btn-xs btn-outline-primary border-0 ml-2" (click)="toggleDetails()">
<fa-icon [icon]="faCaretDown" *ngIf="!detailsExposed"></fa-icon>
<fa-icon [icon]="faCaretUp" *ngIf="detailsExposed"></fa-icon>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment