From 55f558c5c79ce75adb7bf01a3efd42964f4a4953 Mon Sep 17 00:00:00 2001 From: alicia pritchett Date: Fri, 3 Sep 2021 16:33:44 -0400 Subject: [PATCH] n/a --- .../workflow-spec-list.component.html | 4 ++-- .../workflow-spec-list/workflow-spec-list.component.ts | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) 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 524386c..b137a6d 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.html +++ b/src/app/workflow-spec-list/workflow-spec-list.component.html @@ -84,7 +84,7 @@ mat-icon-button title="Move up" color="primary" - (click)="editSpecDisplayOrder(wfs && wfs.id, -1)" + (click)="editSpecDisplayOrder(cat, wfs.id, 'up')" > arrow_upward @@ -93,7 +93,7 @@ mat-icon-button title="Move down" color="primary" - (click)="editSpecDisplayOrder(wfs.id, 1)" + (click)="editSpecDisplayOrder(cat, wfs.id, 'down')" > arrow_downward 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 0b05ce2..9733850 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.ts +++ b/src/app/workflow-spec-list/workflow-spec-list.component.ts @@ -222,18 +222,20 @@ export class WorkflowSpecListComponent implements OnInit { }); } - editCategoryDisplayOrder(catId: number, direction: number) { + editCategoryDisplayOrder(catId: number, direction: string) { // const reorderedCats = this._reorder(catId, direction, cats) as WorkflowSpecCategoryGroup[]; // this._updateCatDisplayOrders(reorderedCats); // Send this info to a new endpoint } - editSpecDisplayOrder(specId: string, direction: number) { + editSpecDisplayOrder(cat: WorkflowSpecCategoryGroup, specId: string, direction: string) { // const reorderedSpecs = this._reorder(specId, direction, specs) as WorkflowSpec[]; // this._updateSpecDisplayOrders(reorderedSpecs); - - // this.api.reorderWorkflowSpecification(); + this.api.reorderWorkflowSpecification(specId, direction).subscribe(wfs => { + console.log('reorder'); + // cat.workflow_specs= wfs; + }); } // sortByDisplayOrder = (a, b) => (a.display_order < b.display_order) ? -1 : 1;