Merge pull request #68 from sartography/bug/move_workflow_spec_260

Bug/move workflow spec 260
This commit is contained in:
Dan Funk 2021-04-16 14:16:03 -04:00 committed by GitHub
commit 2580b614ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 99 additions and 224 deletions

305
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -52,6 +52,7 @@
"ngx-file-drop": "^9.0.1", "ngx-file-drop": "^9.0.1",
"ngx-highlightjs": "^4.1.1", "ngx-highlightjs": "^4.1.1",
"ngx-markdown": "^9.1.1", "ngx-markdown": "^9.1.1",
"protractor": "^7.0.0",
"rxjs": "~6.5.4", "rxjs": "~6.5.4",
"sartography-workflow-lib": "0.0.415", "sartography-workflow-lib": "0.0.415",
"tslib": "^1.13.0", "tslib": "^1.13.0",
@ -64,10 +65,10 @@
"@angular/cli": "^9.1.11", "@angular/cli": "^9.1.11",
"@angular/compiler-cli": "^9.1.12", "@angular/compiler-cli": "^9.1.12",
"@angular/language-service": "^9.1.12", "@angular/language-service": "^9.1.12",
"@babel/compat-data": "7.9.0",
"@babel/core": "^7.10.5", "@babel/core": "^7.10.5",
"@babel/preset-env": "^7.10.4", "@babel/preset-env": "^7.10.4",
"@babel/preset-react": "^7.10.4", "@babel/preset-react": "^7.10.4",
"@babel/compat-data": "7.9.0",
"@types/jasmine": "^3.5.11", "@types/jasmine": "^3.5.11",
"@types/jasminewd2": "^2.0.8", "@types/jasminewd2": "^2.0.8",
"@types/node": "^12.12.50", "@types/node": "^12.12.50",
@ -82,7 +83,6 @@
"karma-jasmine-html-reporter": "^1.5.4", "karma-jasmine-html-reporter": "^1.5.4",
"mockdate": "^2.0.5", "mockdate": "^2.0.5",
"postcss-short": "^5.0.0", "postcss-short": "^5.0.0",
"protractor": "^7.0.0",
"puppeteer": "^2.1.1", "puppeteer": "^2.1.1",
"sonar-scanner": "^3.1.0", "sonar-scanner": "^3.1.0",
"ts-node": "~8.6.2", "ts-node": "~8.6.2",

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]="categoryExpanded(cat)"> <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);
@ -205,7 +209,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);
}); });
} }
@ -372,6 +375,11 @@ export class WorkflowSpecListComponent implements OnInit {
} }
private _updateSpecDisplayOrders(specs: WorkflowSpec[]) { private _updateSpecDisplayOrders(specs: WorkflowSpec[]) {
if (this.selectedCat && this.selectedSpec.category) {
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);