WIP - categories display. remove display_order from user view

This commit is contained in:
alicia pritchett 2021-09-01 09:50:19 -04:00
parent e3f0441cf0
commit 669db60bbe
2 changed files with 5 additions and 16 deletions

View File

@ -3,7 +3,7 @@ import {FormGroup} from '@angular/forms';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import {FormlyFieldConfig, FormlyFormOptions} from '@ngx-formly/core';
import {toSnakeCase} from 'sartography-workflow-lib';
import {WorkflowSpecCategoryDialogData, WorkflowSpecDialogData} from '../../_interfaces/dialog-data';
import {WorkflowSpecCategoryDialogData} from '../../_interfaces/dialog-data';
@Component({
selector: 'app-workflow-spec-category-dialog',
@ -50,18 +50,6 @@ export class WorkflowSpecCategoryDialogComponent {
required: true,
},
},
{
key: 'display_order',
type: 'input',
defaultValue: this.data.display_order,
templateOptions: {
type: 'number',
label: 'Display Order',
placeholder: 'Order in which category will be displayed',
description: 'Sort order that the category should appear in. Lower numbers will appear first.',
required: true,
},
},
];
constructor(

View File

@ -233,7 +233,7 @@ export class WorkflowSpecListComponent implements OnInit {
// const reorderedSpecs = this._reorder(specId, direction, specs) as WorkflowSpec[];
// this._updateSpecDisplayOrders(reorderedSpecs);
this.api.reorderWorkflowSpecification();
// this.api.reorderWorkflowSpecification();
}
// sortByDisplayOrder = (a, b) => (a.display_order < b.display_order) ? -1 : 1;
@ -241,6 +241,7 @@ export class WorkflowSpecListComponent implements OnInit {
private _loadWorkflowSpecCategories(selectedSpecName: string = null) {
this.api.getWorkflowSpecCategoryList().subscribe(cats => {
// this.categories = cats.sort(this.sortByDisplayOrder);
this.categories = cats;
// Add a container for specs without a category
this.workflowSpecsByCategory = [{
@ -401,9 +402,9 @@ export class WorkflowSpecListComponent implements OnInit {
private _reorderWorkflowSpec(specId: string, direction: number) {
//First, convert direction to string
let d = (direction == -1) ? "moveUp" : "moveDown";
this.api.reorderWorkflowSpec(specId, d).subscribe(_ => {
// this.api.reorderWorkflowSpec(specId, d).subscribe(_ => {
//subscribe to some stuff
});
// });
}
private _displayMessage(message: string) {