Merge pull request #117 from sartography/chore/tweak-libraries-504

Fixes #504- Tweak Library Category Behavior
This commit is contained in:
Dan Funk 2021-10-21 14:30:22 -04:00 committed by GitHub
commit 216c005752
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -31,7 +31,7 @@
</div>
<mat-divider></mat-divider>
<mat-accordion class="example-headers-align">
<mat-expansion-panel [expanded]="selectedSpec && selectedSpec.library === true">
<mat-expansion-panel [expanded]="library_toggle" (opened)="libraryToggle(true)">
<mat-expansion-panel-header>
<mat-panel-title>
<h4>All Libraries</h4>
@ -69,7 +69,7 @@
<div *ngIf="!(searchField.value && cat.workflow_specs.length === 0)">
<ng-container *ngIf="!(cat.id === null && cat.workflow_specs.length === 0)">
<mat-expansion-panel hideToggle (opened)="selectCat(cat)" [expanded]="isSelected(cat)">
<mat-expansion-panel hideToggle (opened)="selectCat(cat); libraryToggle(false)" [expanded]="isSelected(cat) && !library_toggle" >
<mat-expansion-panel-header>
<mat-panel-description>
<div *ngIf="cat.admin" style="color: darkorange">

View File

@ -52,9 +52,8 @@ export class WorkflowSpecListComponent implements OnInit {
selectedCat: WorkflowSpecCategory;
workflowSpecsByCategory: WorkflowSpecCategoryGroup[] = [];
categories: WorkflowSpecCategory[];
// moveUp = moveArrayElementUp;
// moveDown = moveArrayElementDown;
searchField: FormControl;
library_toggle: boolean;
constructor(
private api: ApiService,
@ -101,6 +100,10 @@ export class WorkflowSpecListComponent implements OnInit {
return this.selectedCat && this.selectedCat.id === cat.id;
}
libraryToggle(t: boolean) {
this.library_toggle = t;
}
selectSpec(selectedSpec?: WorkflowSpec) {
this.selectedSpec = selectedSpec;
this.location.replaceState(environment.homeRoute + '/' + selectedSpec.id);
@ -251,6 +254,7 @@ export class WorkflowSpecListComponent implements OnInit {
wfs.forEach(ws => {
if (selectedSpecName && selectedSpecName === ws.id) {
this.selectedSpec = ws;
this.library_toggle = true;
}
});
} else {