From 887efa2982b6827f1fcec8b5f6fd213b1892cbba Mon Sep 17 00:00:00 2001 From: Kelly McDonald Date: Mon, 2 Aug 2021 09:31:12 -0400 Subject: [PATCH] Make a separate area to show the workflow-specs that are marked as 'Libraries' --- package.json | 2 +- .../workflow-spec-dialog.component.ts | 11 ++++++ src/app/_interfaces/dialog-data.ts | 1 + .../workflow-spec-list.component.html | 39 +++++++++++++++++++ .../workflow-spec-list.component.spec.ts | 3 +- .../workflow-spec-list.component.ts | 16 +++++++- 6 files changed, 69 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1d18e77..3ee64e3 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "ngx-markdown": "^9.1.1", "protractor": "^7.0.0", "rxjs": "~6.5.4", - "sartography-workflow-lib": "0.0.522", + "sartography-workflow-lib": "0.0.532", "tslib": "^1.13.0", "uuid": "^7.0.2", "zone.js": "^0.10.3" diff --git a/src/app/_dialogs/workflow-spec-dialog/workflow-spec-dialog.component.ts b/src/app/_dialogs/workflow-spec-dialog/workflow-spec-dialog.component.ts index 4b6eeda..10e9f54 100644 --- a/src/app/_dialogs/workflow-spec-dialog/workflow-spec-dialog.component.ts +++ b/src/app/_dialogs/workflow-spec-dialog/workflow-spec-dialog.component.ts @@ -101,6 +101,17 @@ export class WorkflowSpecDialogComponent { indeterminate: false, }, }, + { + key: 'library', + type: 'checkbox', + defaultValue: this.data.library, + templateOptions: { + label: 'Library', + description: 'Is this a library workflow?', + required: true, + indeterminate: false, + }, + }, ]; }); } diff --git a/src/app/_interfaces/dialog-data.ts b/src/app/_interfaces/dialog-data.ts index 82dcb51..9469f63 100644 --- a/src/app/_interfaces/dialog-data.ts +++ b/src/app/_interfaces/dialog-data.ts @@ -26,6 +26,7 @@ export interface WorkflowSpecDialogData { category_id: number; display_order: number; standalone: boolean; + library: boolean; } export interface WorkflowSpecCategoryDialogData { diff --git a/src/app/workflow-spec-list/workflow-spec-list.component.html b/src/app/workflow-spec-list/workflow-spec-list.component.html index c1e43ef..102553a 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.html +++ b/src/app/workflow-spec-list/workflow-spec-list.component.html @@ -26,7 +26,45 @@ + +
+

Libraries

+ + + {{wfs.display_name}} + + + + + + + + +
+
+ + + +
+

Categories

+
+ @@ -108,6 +146,7 @@ +
diff --git a/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts b/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts index 31075a8..5b8af5f 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts +++ b/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts @@ -141,7 +141,8 @@ describe('WorkflowSpecListComponent', () => { description: '', category_id: 0, display_order: 0, - standalone: false + standalone: false, + library: false }; const _upsertWorkflowSpecificationSpy = spyOn((component as any), '_upsertWorkflowSpecification') diff --git a/src/app/workflow-spec-list/workflow-spec-list.component.ts b/src/app/workflow-spec-list/workflow-spec-list.component.ts index d6e5feb..2f5f709 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.ts +++ b/src/app/workflow-spec-list/workflow-spec-list.component.ts @@ -44,6 +44,7 @@ export interface WorkflowSpecCategoryGroup { }) export class WorkflowSpecListComponent implements OnInit { workflowSpecs: WorkflowSpec[] = []; + workflowLibraries: WorkflowSpec[] = []; selectedSpec: WorkflowSpec; masterStatusSpec: WorkflowSpec; selectedCat: WorkflowSpecCategory; @@ -72,6 +73,7 @@ export class WorkflowSpecListComponent implements OnInit { this._loadWorkflowSpecCategories(); } }); + this._loadWorkflowLibraries(); this.searchField = new FormControl(); this.searchField.valueChanges.subscribe(value => { this._loadWorkflowSpecs(null, value); @@ -118,6 +120,7 @@ export class WorkflowSpecListComponent implements OnInit { category_id: selectedSpec ? selectedSpec.category_id : null, display_order: hasDisplayOrder ? selectedSpec.display_order : 0, standalone: selectedSpec ? selectedSpec.standalone : null, + library: selectedSpec ? selectedSpec.library : null, }; @@ -221,8 +224,17 @@ export class WorkflowSpecListComponent implements OnInit { this.workflowSpecsByCategory[i + 1].workflow_specs = []; }); this._loadWorkflowSpecs(selectedSpecName); + this._loadWorkflowLibraries(); }); } + private _loadWorkflowLibraries() { + + this.api.getWorkflowSpecificationLibraries().subscribe(wfs => { + this.workflowLibraries = wfs; + }); + } + + private _loadWorkflowSpecs(selectedSpecName: String = null, searchSpecName: String = null) { this.api.getWorkflowSpecList().subscribe(wfs => { @@ -269,7 +281,8 @@ export class WorkflowSpecListComponent implements OnInit { description: data.description, category_id: data.category_id, display_order: data.display_order, - standalone: data.standalone + standalone: data.standalone, + library: data.library }; if (isNew) { @@ -304,6 +317,7 @@ export class WorkflowSpecListComponent implements OnInit { private _updateWorkflowSpec(specId: string, newSpec: WorkflowSpec) { this.api.updateWorkflowSpecification(specId, newSpec).subscribe(_ => { + this._loadWorkflowLibraries(); this._loadWorkflowSpecs(); this._displayMessage('Saved changes to workflow spec.'); });