WIP Admin flag

This commit is contained in:
alicia pritchett 2021-09-28 14:20:33 -04:00
parent 8e2b7c24a7
commit 9224707de0
3 changed files with 15 additions and 3 deletions

View File

@ -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);
}

View File

@ -34,6 +34,7 @@ export interface WorkflowSpecCategoryDialogData {
name: string;
display_name: string;
display_order?: number;
admin: boolean;
}
export interface DeleteFileDialogData {

View File

@ -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)) {