This commit is contained in:
Nile Walker 2021-03-23 16:52:41 -04:00
parent 8c6d2b2991
commit 404f26aee9
2 changed files with 3 additions and 13 deletions

View File

@ -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.', description: 'Write a few sentences explaining to users why this workflow exists and what it should be used for.',
required: true, 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,
},
},
]; ];
}); });
} }

View File

@ -109,6 +109,7 @@ export class WorkflowSpecListComponent implements OnInit {
display_order: hasDisplayOrder ? selectedSpec.display_order : 0, display_order: hasDisplayOrder ? selectedSpec.display_order : 0,
}; };
// Open new filename/workflow spec dialog // Open new filename/workflow spec dialog
const dialogRef = this.dialog.open(WorkflowSpecDialogComponent, { const dialogRef = this.dialog.open(WorkflowSpecDialogComponent, {
height: '65vh', height: '65vh',
@ -118,6 +119,7 @@ export class WorkflowSpecListComponent implements OnInit {
dialogRef.afterClosed().subscribe((data: WorkflowSpecDialogData) => { dialogRef.afterClosed().subscribe((data: WorkflowSpecDialogData) => {
if (data && data.id && data.name && data.display_name && data.description) { 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); this._upsertWorkflowSpecification(selectedSpec == null, data);
} }
}); });