From 9224707de05124803f4e11d2b80689f5c9f1ff86 Mon Sep 17 00:00:00 2001 From: alicia pritchett Date: Tue, 28 Sep 2021 14:20:33 -0400 Subject: [PATCH 1/4] WIP Admin flag --- .../workflow-spec-category-dialog.component.ts | 11 +++++++++++ src/app/_interfaces/dialog-data.ts | 1 + .../workflow-spec-list.component.ts | 6 +++--- 3 files changed, 15 insertions(+), 3 deletions(-) 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.ts b/src/app/workflow-spec-list/workflow-spec-list.component.ts index 9697a2c..d654534 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); @@ -303,11 +304,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); @@ -329,6 +328,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)) { From 2f6ea0dddadfb4654afd882db40da34b63e2750d Mon Sep 17 00:00:00 2001 From: alicia pritchett Date: Wed, 29 Sep 2021 16:27:22 -0400 Subject: [PATCH 2/4] Make admin cat text color orange --- .../workflow-spec-list.component.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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}}) +
+
From 3abb00afe1feda96fc1ed412254514369da95085 Mon Sep 17 00:00:00 2001 From: alicia pritchett Date: Wed, 29 Sep 2021 16:54:54 -0400 Subject: [PATCH 3/4] update a test --- src/app/workflow-spec-list/workflow-spec-list.component.spec.ts | 1 + 1 file changed, 1 insertion(+) 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') From f4168e82545e5edbf31ceebba7275bf52c9cef72 Mon Sep 17 00:00:00 2001 From: alicia pritchett Date: Thu, 30 Sep 2021 10:28:13 -0400 Subject: [PATCH 4/4] Bump libs -> 567 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"