From b734ea21ac7be393c59cf9976f0e5ddeaf27d568 Mon Sep 17 00:00:00 2001 From: siddharth0905 Date: Thu, 22 Nov 2018 13:37:31 +0530 Subject: Service Workflow changes Service workflow change with few bug fixes Change-Id: Ice2376565bf46fb8d86fb6062654ec54bb2daa43 Issue-ID: SDC-1937 Signed-off-by: siddharth0905 --- .../interface-operation.page.component.ts | 8 ++- .../operation-creator.component.html | 3 +- .../operation-creator.component.ts | 19 ++----- .../param-row/param-row.component.html | 6 +-- .../param-row/param-row.component.less | 2 +- .../param-row/param-row.component.ts | 58 +++++++++++++++++++--- 6 files changed, 64 insertions(+), 32 deletions(-) (limited to 'catalog-ui/src/app/ng2/pages/interface-operation') diff --git a/catalog-ui/src/app/ng2/pages/interface-operation/interface-operation.page.component.ts b/catalog-ui/src/app/ng2/pages/interface-operation/interface-operation.page.component.ts index da9cf5f752..e19d3457b3 100644 --- a/catalog-ui/src/app/ng2/pages/interface-operation/interface-operation.page.component.ts +++ b/catalog-ui/src/app/ng2/pages/interface-operation/interface-operation.page.component.ts @@ -174,12 +174,11 @@ export class InterfaceOperationComponent { this.operationList.sort((a, b) => a.operationType.localeCompare(b.operationType)); if (response.workflowId && operation.workflowAssociationType === WORKFLOW_ASSOCIATION_OPTIONS.EXISTING) { - const resourceId = this.component.uuid; const operationId = response.uniqueId; const workflowId = response.workflowId; const versionId = response.workflowVersionId; const artifactId = response.artifactUUID; - this.WorkflowServiceNg2.associateWorkflowArtifact(resourceId, operationId, workflowId, versionId, artifactId).subscribe(); + this.WorkflowServiceNg2.associateWorkflowArtifact(this.component, operationId, workflowId, versionId, artifactId).subscribe(); } else if (operation.workflowAssociationType === WORKFLOW_ASSOCIATION_OPTIONS.NEW) { this.$state.go('workspace.plugins', { path: 'workflowDesigner' }); } @@ -193,13 +192,12 @@ export class InterfaceOperationComponent { this.operationList.splice(index, 1, newOperation); this.component.interfaceOperations = this.operationList; - if (newOperation.workflowId) { - const resourceId = this.component.uuid; + if (newOperation.workflowId && operation.workflowAssociationType === WORKFLOW_ASSOCIATION_OPTIONS.EXISTING) { const operationId = newOperation.uniqueId; const workflowId = newOperation.workflowId; const versionId = newOperation.workflowVersionId; const artifactId = newOperation.artifactUUID; - this.WorkflowServiceNg2.associateWorkflowArtifact(resourceId, operationId, workflowId, versionId, artifactId).subscribe(); + this.WorkflowServiceNg2.associateWorkflowArtifact(this.component, operationId, workflowId, versionId, artifactId).subscribe(); } }); } diff --git a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.html b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.html index 982cbb204c..6010bca10f 100644 --- a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.html +++ b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.html @@ -127,11 +127,10 @@ diff --git a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts index 5d3b027493..a6c1fb1c4c 100644 --- a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts +++ b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts @@ -18,7 +18,6 @@ export interface OperationCreatorInput { isService: boolean } - @Component({ selector: 'operation-creator', templateUrl: './operation-creator.component.html', @@ -33,7 +32,7 @@ export class OperationCreatorComponent { workflows: Array = []; workflowVersions: Array = []; - inputProperties: Array = []; + inputProperties: Array = []; inputPropertyTypes: { [key: string]: string }; inputParameters: Array = []; @@ -76,19 +75,10 @@ export class OperationCreatorComponent { } ngOnInit() { - this.readonly = this.input.readonly; this.isService = this.input.isService; - this.enableWorkflowAssociation = this.input.enableWorkflowAssociation && !this.isService; - - this.inputProperties = _.map(this.input.inputProperties, - (input: InputBEModel) => new DropdownValue(input.uniqueId, input.name) - ); - - this.inputPropertyTypes = {}; - _.forEach(this.input.inputProperties, (input: InputBEModel) => { - this.inputPropertyTypes[input.uniqueId] = input.type; - }); + this.enableWorkflowAssociation = this.input.enableWorkflowAssociation; + this.inputProperties = this.input.inputProperties; const inputOperation = this.input.operation; this.operation = new OperationModel(inputOperation || {}); @@ -108,13 +98,12 @@ export class OperationCreatorComponent { } else { this.reconstructOperation(); } - } reconstructOperation = () => { const inputOperation = this.input.operation; if (inputOperation) { - if (!this.enableWorkflowAssociation || !inputOperation.workflowVersionId || this.isService) { + if (!this.enableWorkflowAssociation || !inputOperation.workflowVersionId) { this.inputParameters = this.noAssignInputParameters; this.outputParameters = this.noAssignOutputParameters; this.buildParams(); diff --git a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.html b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.html index 94d2fce1ea..9a5c101e87 100644 --- a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.html +++ b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.html @@ -1,5 +1,5 @@