From 404f26aee90062fc57b24efd5c9f289492fd8305 Mon Sep 17 00:00:00 2001 From: Nile Walker Date: Tue, 23 Mar 2021 16:52:41 -0400 Subject: [PATCH] fixes 74 --- .../workflow-spec-dialog.component.ts | 14 +------------- .../workflow-spec-list.component.ts | 2 ++ 2 files changed, 3 insertions(+), 13 deletions(-) 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 8fa271a..f4d0a32 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 @@ -89,19 +89,7 @@ export class WorkflowSpecDialogComponent { description: 'Write a few sentences explaining to users why this workflow exists and what it should be used for.', required: true, }, - }, - { - key: 'display_order', - type: 'input', - defaultValue: this.data.display_order, - templateOptions: { - type: 'number', - label: 'Display Order', - placeholder: 'Order in which spec will be displayed', - description: 'Sort order that the spec should appear in within its category. Lower numbers will appear first.', - required: true, - }, - }, + } ]; }); } 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 d6fcf21..589cb88 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.ts +++ b/src/app/workflow-spec-list/workflow-spec-list.component.ts @@ -109,6 +109,7 @@ export class WorkflowSpecListComponent implements OnInit { display_order: hasDisplayOrder ? selectedSpec.display_order : 0, }; + // Open new filename/workflow spec dialog const dialogRef = this.dialog.open(WorkflowSpecDialogComponent, { height: '65vh', @@ -118,6 +119,7 @@ export class WorkflowSpecListComponent implements OnInit { dialogRef.afterClosed().subscribe((data: WorkflowSpecDialogData) => { if (data && data.id && data.name && data.display_name && data.description) { + data.display_order = this.categories.filter(function (entry) { return entry.id === data.category_id;}).length; this._upsertWorkflowSpecification(selectedSpec == null, data); } });