diff --git a/package-lock.json b/package-lock.json index bed88e9..c7cb6b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11734,9 +11734,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sartography-workflow-lib": { - "version": "0.0.59", - "resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.59.tgz", - "integrity": "sha512-Aylrdco6fei7P4VAF+ZG+q3F3TJLkyobPmzGJDe+8vfZ5jlUJ+EffWKFV6LKCdLdkaV3oYRpo4voPnm1OvuRSA==" + "version": "0.0.61", + "resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.61.tgz", + "integrity": "sha512-Gv3wZO4RTmApGeQc4SRoH5ioH+BBscFfwMZ9DmhrY7wsnWh/Zym9TjRYd4cEygVjlHsgSY6CAqiDMOxZ6Grf6A==" }, "sass": { "version": "1.23.3", diff --git a/package.json b/package.json index 94d1ad2..db1da6e 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "dmn-js-properties-panel": "^0.3.4", "file-saver": "^2.0.2", "rxjs": "~6.5.4", - "sartography-workflow-lib": "^0.0.59", + "sartography-workflow-lib": "^0.0.61", "tslib": "^1.10.0", "uuid": "^7.0.0", "zone.js": "~0.10.2" diff --git a/src/app/_dialogs/workflow-spec-category-dialog/workflow-spec-category-dialog.component.html b/src/app/_dialogs/workflow-spec-category-dialog/workflow-spec-category-dialog.component.html index bbca394..a1fa962 100644 --- a/src/app/_dialogs/workflow-spec-category-dialog/workflow-spec-category-dialog.component.html +++ b/src/app/_dialogs/workflow-spec-category-dialog/workflow-spec-category-dialog.component.html @@ -1,5 +1,5 @@
-

Workflow Specification

+

Workflow Spec Category

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 6506d61..ae890f8 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 @@ -19,13 +19,12 @@ export class WorkflowSpecCategoryDialogComponent { { key: 'id', type: 'input', - defaultValue: this.data.id || uuidv4(), + defaultValue: this.data.id, templateOptions: { label: 'ID', - placeholder: 'UUID of workflow specification', - description: 'This is an autogenerated unique ID and is not editable.', + type: 'number', + placeholder: 'ID of workflow spec category', required: true, - disabled: true, }, }, { @@ -34,7 +33,7 @@ export class WorkflowSpecCategoryDialogComponent { defaultValue: this.data.name, templateOptions: { label: 'Name', - placeholder: 'Name of workflow specification', + placeholder: 'Name of workflow spec category', description: 'Enter a name, in lowercase letters, separated by underscores, that is easy for you to remember.' + 'It will be converted to all_lowercase_with_underscores when you save.', required: true, @@ -46,23 +45,12 @@ export class WorkflowSpecCategoryDialogComponent { defaultValue: this.data.display_name, templateOptions: { label: 'Display Name', - placeholder: 'Title of the workflow specification', - description: 'This is a human readable title for the workflow specification,' + + placeholder: 'Title of the workflow spec category', + description: 'This is a human-readable title for the workflow spec category,' + 'which should be easy for others to read and remember.', required: true, }, }, - { - key: 'description', - type: 'textarea', - defaultValue: this.data.description, - templateOptions: { - label: 'Description', - placeholder: 'Description of workflow specification', - description: 'Write a few sentences explaining to users why this workflow exists and what it should be used for.', - required: true, - }, - }, ]; constructor( diff --git a/src/app/_dialogs/workflow-spec-dialog/workflow-spec-dialog.component.ts b/src/app/_dialogs/workflow-spec-dialog/workflow-spec-dialog.component.ts index 7413e68..d741888 100644 --- a/src/app/_dialogs/workflow-spec-dialog/workflow-spec-dialog.component.ts +++ b/src/app/_dialogs/workflow-spec-dialog/workflow-spec-dialog.component.ts @@ -47,7 +47,7 @@ export class WorkflowSpecDialogComponent { templateOptions: { label: 'Display Name', placeholder: 'Title of the workflow specification', - description: 'This is a human readable title for the workflow specification,' + + description: 'This is a human-readable title for the workflow specification,' + 'which should be easy for others to read and remember.', required: true, }, diff --git a/src/app/_interfaces/dialog-data.ts b/src/app/_interfaces/dialog-data.ts index 79b061a..f525b32 100644 --- a/src/app/_interfaces/dialog-data.ts +++ b/src/app/_interfaces/dialog-data.ts @@ -21,7 +21,7 @@ export interface WorkflowSpecDialogData { } export interface WorkflowSpecCategoryDialogData { - id: string; + id: number; name: string; display_name: string; } 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 5a961d4..e1af6d9 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.html +++ b/src/app/workflow-spec-list/workflow-spec-list.component.html @@ -6,7 +6,7 @@ library_add Add new workflow specification - 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 064c7ae..55ec975 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.ts +++ b/src/app/workflow-spec-list/workflow-spec-list.component.ts @@ -152,11 +152,11 @@ export class WorkflowSpecListComponent implements OnInit { } } - private _upsertWorkflowCategorySpecification(data: WorkflowSpecCategoryDialogData) { + private _upsertWorkflowSpecCategory(data: WorkflowSpecCategoryDialogData) { if (data.id && data.name && data.display_name) { // Save old workflow spec id, in case it's changed - const specId = this.selectedSpec ? this.selectedSpec.id : undefined; + const catId = this.selectedCat ? this.selectedCat.id : undefined; const newCat: WorkflowSpecCategory = { id: data.id, @@ -164,8 +164,8 @@ export class WorkflowSpecListComponent implements OnInit { display_name: data.display_name, }; - if (specId) { - this._updateWorkflowSpecCategory(specId, newCat); + if (catId) { + this._updateWorkflowSpecCategory(catId, newCat); } else { this._addWorkflowSpecCategory(newCat); } @@ -186,20 +186,6 @@ export class WorkflowSpecListComponent implements OnInit { }); } - private _updateWorkflowSpecCategory(specId: string, newCat: WorkflowSpecCategory) { - this.api.updateWorkflowSpecCategory(specId, newCat).subscribe(spec => { - this._loadWorkflowSpecs(); - this._displayMessage('Saved changes to workflow spec.'); - }); - } - - private _addWorkflowSpecCategory(newCat: WorkflowSpecCategory) { - this.api.addWorkflowSpecCategory(newCat).subscribe(spec => { - this._loadWorkflowSpecs(); - this._displayMessage('Saved new workflow spec.'); - }); - } - private _deleteWorkflowSpec(workflowSpec: WorkflowSpec) { this.api.deleteWorkflowSpecification(workflowSpec.id).subscribe(() => { this._loadWorkflowSpecs(); @@ -207,12 +193,30 @@ export class WorkflowSpecListComponent implements OnInit { }); } + private _updateWorkflowSpecCategory(catId: number, newCat: WorkflowSpecCategory) { + this.api.updateWorkflowSpecCategory(catId, newCat).subscribe(spec => { + this._loadWorkflowSpecs(); + this._displayMessage('Saved changes to workflow spec category.'); + }); + } + + private _addWorkflowSpecCategory(newCat: WorkflowSpecCategory) { + this.api.addWorkflowSpecCategory(newCat).subscribe(spec => { + this._loadWorkflowSpecs(); + this._displayMessage('Saved new workflow spec category.'); + }); + } + + private _deleteWorkflowSpecCategory(workflowSpecCategory: WorkflowSpecCategory) { + this.api.deleteWorkflowSpecCategory(workflowSpecCategory.id).subscribe(() => { + this._loadWorkflowSpecs(); + this._displayMessage(`Deleted workflow spec category ${workflowSpecCategory.name}.`); + }); + } + private _displayMessage(message: string) { this.snackBar.open(message, 'Ok', {duration: 3000}); } - addWorkflowSpecCategory() { - - } }