mirror of
https://github.com/sartography/cr-connect-bpmn.git
synced 2025-02-27 15:40:34 +00:00
WIP - categories display. remove display_order from user view
This commit is contained in:
parent
e3f0441cf0
commit
669db60bbe
@ -3,7 +3,7 @@ import {FormGroup} from '@angular/forms';
|
|||||||
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
|
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
|
||||||
import {FormlyFieldConfig, FormlyFormOptions} from '@ngx-formly/core';
|
import {FormlyFieldConfig, FormlyFormOptions} from '@ngx-formly/core';
|
||||||
import {toSnakeCase} from 'sartography-workflow-lib';
|
import {toSnakeCase} from 'sartography-workflow-lib';
|
||||||
import {WorkflowSpecCategoryDialogData, WorkflowSpecDialogData} from '../../_interfaces/dialog-data';
|
import {WorkflowSpecCategoryDialogData} from '../../_interfaces/dialog-data';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-workflow-spec-category-dialog',
|
selector: 'app-workflow-spec-category-dialog',
|
||||||
@ -50,18 +50,6 @@ export class WorkflowSpecCategoryDialogComponent {
|
|||||||
required: true,
|
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(
|
constructor(
|
||||||
|
@ -233,7 +233,7 @@ export class WorkflowSpecListComponent implements OnInit {
|
|||||||
// const reorderedSpecs = this._reorder(specId, direction, specs) as WorkflowSpec[];
|
// const reorderedSpecs = this._reorder(specId, direction, specs) as WorkflowSpec[];
|
||||||
// this._updateSpecDisplayOrders(reorderedSpecs);
|
// this._updateSpecDisplayOrders(reorderedSpecs);
|
||||||
|
|
||||||
this.api.reorderWorkflowSpecification();
|
// this.api.reorderWorkflowSpecification();
|
||||||
}
|
}
|
||||||
|
|
||||||
// sortByDisplayOrder = (a, b) => (a.display_order < b.display_order) ? -1 : 1;
|
// 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) {
|
private _loadWorkflowSpecCategories(selectedSpecName: string = null) {
|
||||||
this.api.getWorkflowSpecCategoryList().subscribe(cats => {
|
this.api.getWorkflowSpecCategoryList().subscribe(cats => {
|
||||||
// this.categories = cats.sort(this.sortByDisplayOrder);
|
// this.categories = cats.sort(this.sortByDisplayOrder);
|
||||||
|
this.categories = cats;
|
||||||
|
|
||||||
// Add a container for specs without a category
|
// Add a container for specs without a category
|
||||||
this.workflowSpecsByCategory = [{
|
this.workflowSpecsByCategory = [{
|
||||||
@ -401,9 +402,9 @@ export class WorkflowSpecListComponent implements OnInit {
|
|||||||
private _reorderWorkflowSpec(specId: string, direction: number) {
|
private _reorderWorkflowSpec(specId: string, direction: number) {
|
||||||
//First, convert direction to string
|
//First, convert direction to string
|
||||||
let d = (direction == -1) ? "moveUp" : "moveDown";
|
let d = (direction == -1) ? "moveUp" : "moveDown";
|
||||||
this.api.reorderWorkflowSpec(specId, d).subscribe(_ => {
|
// this.api.reorderWorkflowSpec(specId, d).subscribe(_ => {
|
||||||
//subscribe to some stuff
|
//subscribe to some stuff
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
private _displayMessage(message: string) {
|
private _displayMessage(message: string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user