Fixes 260

This commit is contained in:
Nile Walker 2021-03-22 13:14:36 -04:00
parent 78e59d5f4c
commit 73e261e973
2 changed files with 8 additions and 2 deletions

View File

@ -33,7 +33,7 @@
<div *ngIf="!(searchField.value && cat.workflow_specs.length === 0)"> <div *ngIf="!(searchField.value && cat.workflow_specs.length === 0)">
<ng-container *ngIf="!(cat.id === null && cat.workflow_specs.length === 0)"> <ng-container *ngIf="!(cat.id === null && cat.workflow_specs.length === 0)">
<mat-expansion-panel hideToggle [expanded]="selectedSpec.category_id == cat.id"> <mat-expansion-panel hideToggle (opened)="selectCat(cat)" [expanded]="selectedSpec.category_id == cat.id">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
{{cat.display_name}} {{cat.display_name}}

View File

@ -88,6 +88,10 @@ export class WorkflowSpecListComponent implements OnInit {
}); });
} }
selectCat(selectedCat?: WorkflowSpecCategory) {
this.selectedCat = selectedCat;
}
selectSpec(selectedSpec?: WorkflowSpec) { selectSpec(selectedSpec?: WorkflowSpec) {
this.selectedSpec = selectedSpec; this.selectedSpec = selectedSpec;
this.location.replaceState(environment.homeRoute + '/' + selectedSpec.name); this.location.replaceState(environment.homeRoute + '/' + selectedSpec.name);
@ -200,7 +204,6 @@ export class WorkflowSpecListComponent implements OnInit {
this.workflowSpecsByCategory.push(cat); this.workflowSpecsByCategory.push(cat);
this.workflowSpecsByCategory[i + 1].workflow_specs = []; this.workflowSpecsByCategory[i + 1].workflow_specs = [];
}); });
this._loadWorkflowSpecs(selectedSpecName); this._loadWorkflowSpecs(selectedSpecName);
}); });
} }
@ -371,6 +374,9 @@ export class WorkflowSpecListComponent implements OnInit {
} }
private _updateSpecDisplayOrders(specs: WorkflowSpec[]) { private _updateSpecDisplayOrders(specs: WorkflowSpec[]) {
if (this.selectedCat.id !== this.selectedSpec.category.id) {
this.selectedSpec = specs[0];
}
let numUpdated = 0; let numUpdated = 0;
specs.forEach((spec, j) => { specs.forEach((spec, j) => {
const newSpec = createClone({ circles: true })(spec); const newSpec = createClone({ circles: true })(spec);