diff --git a/package.json b/package.json index ec34fdd..c641079 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "ngx-markdown": "^12.0.1", "protractor": "^7.0.0", "rxjs": "^6.5.3", - "sartography-workflow-lib": "^0.0.563", + "sartography-workflow-lib": "0.0.567", "tslib": "^2.3.0", "uuid": "^8.3.2", "zone.js": "^0.11.4" diff --git a/src/app/_dialogs/workflow-spec-category-dialog/workflow-spec-category-dialog.component.ts b/src/app/_dialogs/workflow-spec-category-dialog/workflow-spec-category-dialog.component.ts index 7b04c91..7b98244 100644 --- a/src/app/_dialogs/workflow-spec-category-dialog/workflow-spec-category-dialog.component.ts +++ b/src/app/_dialogs/workflow-spec-category-dialog/workflow-spec-category-dialog.component.ts @@ -50,6 +50,16 @@ export class WorkflowSpecCategoryDialogComponent { required: true, }, }, + { + key: 'admin', + type: 'checkbox', + defaultValue: this.data.admin ? this.data.admin : false, + templateOptions: { + label: 'Admin Category', + description: 'Should this category only be shown to Admins?', + indeterminate: false, + } + } ]; constructor( @@ -63,6 +73,7 @@ export class WorkflowSpecCategoryDialogComponent { } onSubmit() { + console.log('data is ', this.model); this.model.name = toSnakeCase(this.model.name); this.dialogRef.close(this.model); } diff --git a/src/app/_interfaces/dialog-data.ts b/src/app/_interfaces/dialog-data.ts index 9469f63..d5aed86 100644 --- a/src/app/_interfaces/dialog-data.ts +++ b/src/app/_interfaces/dialog-data.ts @@ -34,6 +34,7 @@ export interface WorkflowSpecCategoryDialogData { name: string; display_name: string; display_order?: number; + admin: boolean; } export interface DeleteFileDialogData { diff --git a/src/app/workflow-spec-list/workflow-spec-list.component.html b/src/app/workflow-spec-list/workflow-spec-list.component.html index 5aef44b..9a4276b 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.html +++ b/src/app/workflow-spec-list/workflow-spec-list.component.html @@ -68,9 +68,14 @@ {{cat.display_name}} - - ({{cat.name}}) - + +
+ ({{cat.name}}) +
+
+ ({{cat.name}}) +
+
diff --git a/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts b/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts index d5b096c..cde5f86 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts +++ b/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts @@ -263,6 +263,7 @@ describe('WorkflowSpecListComponent', () => { id: null, name: '', display_name: '', + admin: null, }; const _upsertWorkflowSpecCategorySpy = spyOn((component as any), '_upsertWorkflowSpecCategory') 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 6bf6552..8093d77 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.ts +++ b/src/app/workflow-spec-list/workflow-spec-list.component.ts @@ -37,6 +37,7 @@ export interface WorkflowSpecCategoryGroup { display_name: string; workflow_specs?: WorkflowSpec[]; display_order: number; + admin: boolean, } @Component({ @@ -165,9 +166,9 @@ export class WorkflowSpecListComponent implements OnInit { name: this.selectedCat ? this.selectedCat.name || this.selectedCat.id : '', display_name: this.selectedCat ? this.selectedCat.display_name : '', display_order: this.selectedCat ? this.selectedCat.display_order : null, + admin: this.selectedCat ? this.selectedCat.admin : null, }, }); - dialogRef.afterClosed().subscribe((data: WorkflowSpecCategoryDialogData) => { if (data && isNumberDefined(data.id) && data.name && data.display_name) { this._upsertWorkflowSpecCategory(data); @@ -312,11 +313,9 @@ export class WorkflowSpecListComponent implements OnInit { display_name: data.display_name, description: data.description, category_id: data.category_id, - // display_order: data.display_order, standalone: data.standalone, library: data.library, }; - console.log('DO: ', data.display_order); if (isNew) { this._addWorkflowSpec(newSpec); @@ -338,6 +337,7 @@ export class WorkflowSpecListComponent implements OnInit { name: data.name, display_name: data.display_name, display_order: data.display_order, + admin: data.admin, }; if (isNumberDefined(catId)) {