fixes some category things
up-arrow always present though. subscription problem WIP
This commit is contained in:
parent
7fcaf72416
commit
10e138d497
|
@ -59,7 +59,7 @@
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-accordion class="example-headers-align" multi="false">
|
<mat-accordion class="example-headers-align" multi="false">
|
||||||
<ng-container *ngFor="let cat of workflowSpecsByCategory">
|
<ng-container *ngFor="let cat of workflowSpecsByCategory; let j = index">
|
||||||
|
|
||||||
<div *ngIf="!(searchField.value && cat.workflow_specs.length === 0)">
|
<div *ngIf="!(searchField.value && cat.workflow_specs.length === 0)">
|
||||||
<ng-container *ngIf="!(cat.id === null && cat.workflow_specs.length === 0)">
|
<ng-container *ngIf="!(cat.id === null && cat.workflow_specs.length === 0)">
|
||||||
|
@ -110,20 +110,20 @@
|
||||||
<mat-icon>edit</mat-icon>
|
<mat-icon>edit</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
*ngIf="!cat[0]"
|
*ngIf="j!==1"
|
||||||
mat-mini-fab
|
mat-mini-fab
|
||||||
title="Move up"
|
title="Move up"
|
||||||
color="primary"
|
color="primary"
|
||||||
(click)="editCategoryDisplayOrder(cat.id, -1)"
|
(click)="editCategoryDisplayOrder(cat, cat.id, 'up')"
|
||||||
>
|
>
|
||||||
<mat-icon>arrow_upward</mat-icon>
|
<mat-icon>arrow_upward</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
*ngIf="!cat[workflowSpecsByCategory.length-1]"
|
*ngIf="j!== cat[workflowSpecsByCategory.length-1]"
|
||||||
mat-mini-fab
|
mat-mini-fab
|
||||||
title="Move down"
|
title="Move down"
|
||||||
color="primary"
|
color="primary"
|
||||||
(click)="editCategoryDisplayOrder(cat.id, 1)"
|
(click)="editCategoryDisplayOrder(cat, cat.id, 'down')"
|
||||||
>
|
>
|
||||||
<mat-icon>arrow_downward</mat-icon>
|
<mat-icon>arrow_downward</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -222,16 +222,16 @@ export class WorkflowSpecListComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
editCategoryDisplayOrder(catId: number, direction: string) {
|
editCategoryDisplayOrder(cat: WorkflowSpecCategoryGroup, catId: number, direction: string) {
|
||||||
// const reorderedCats = this._reorder(catId, direction, cats) as WorkflowSpecCategoryGroup[];
|
this.api.reorderWorkflowCategory(catId, direction).subscribe(cat_change => {
|
||||||
// this._updateCatDisplayOrders(reorderedCats);
|
console.log('wfsbcat: ', this.workflowSpecsByCategory);
|
||||||
|
console.log('this.categories', this.categories);
|
||||||
// Send this info to a new endpoint
|
console.log('changed is ', cat_change);
|
||||||
|
// this.workflowSpecsByCategory = cat_change;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
editSpecDisplayOrder(cat: WorkflowSpecCategoryGroup, specId: string, direction: string) {
|
editSpecDisplayOrder(cat: WorkflowSpecCategoryGroup, specId: string, direction: string) {
|
||||||
// const reorderedSpecs = this._reorder(specId, direction, specs) as WorkflowSpec[];
|
|
||||||
// this._updateSpecDisplayOrders(reorderedSpecs);
|
|
||||||
this.api.reorderWorkflowSpecification(specId, direction).subscribe(wfs => {
|
this.api.reorderWorkflowSpecification(specId, direction).subscribe(wfs => {
|
||||||
cat.workflow_specs= wfs;
|
cat.workflow_specs= wfs;
|
||||||
});
|
});
|
||||||
|
@ -253,7 +253,6 @@ export class WorkflowSpecListComponent implements OnInit {
|
||||||
display_order: -1, // Display it at the top
|
display_order: -1, // Display it at the top
|
||||||
}];
|
}];
|
||||||
|
|
||||||
// ?
|
|
||||||
this.categories.forEach((cat, i) => {
|
this.categories.forEach((cat, i) => {
|
||||||
this.workflowSpecsByCategory.push(cat);
|
this.workflowSpecsByCategory.push(cat);
|
||||||
this.workflowSpecsByCategory[i + 1].workflow_specs = [];
|
this.workflowSpecsByCategory[i + 1].workflow_specs = [];
|
||||||
|
|
Loading…
Reference in New Issue