summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts
diff options
context:
space:
mode:
authorArielk <Ariel.Kenan@amdocs.com>2018-10-16 16:29:14 +0300
committerArielk <Ariel.Kenan@amdocs.com>2018-10-16 16:29:27 +0300
commita8a714ac431ec812b9f25aa540be5bab0b522da8 (patch)
tree78d8dcb3e54120dfaa9bc479af4c179f121274b1 /catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts
parentbc20534de90f17f2215309af6fe986e899c98fa5 (diff)
Fixes for workflow association of operation
Change-Id: Iae0bc661f986614b8223c247339aab728c14f5f7 Issue-ID: SDC-1814 Signed-off-by: Arielk <Ariel.Kenan@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts')
-rw-r--r--catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts16
1 files changed, 9 insertions, 7 deletions
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 207bfa9f55..62473bd868 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
@@ -92,7 +92,9 @@ export class OperationCreatorComponent {
const inputOperation = this.input.operation;
this.operation = new OperationModel(inputOperation || {});
- this.operation.workflowAssociationType = inputOperation ? inputOperation.workflowAssociationType : WORKFLOW_ASSOCIATION_OPTIONS.NONE;
+ if (!inputOperation) {
+ this.operation.workflowAssociationType = WORKFLOW_ASSOCIATION_OPTIONS.NONE;
+ }
if (this.enableWorkflowAssociation) {
this.isLoading = true;
@@ -118,7 +120,6 @@ export class OperationCreatorComponent {
this.buildParams();
this.updateTable();
} else {
- this.operation.workflowAssociationType = WORKFLOW_ASSOCIATION_OPTIONS.EXISTING;
this.onSelectWorkflow(inputOperation.workflowVersionId).add(() => {
this.buildParams();
this.updateTable();
@@ -172,7 +173,7 @@ export class OperationCreatorComponent {
versions, version => version.state === this.workflowServiceNg2.VERSION_STATE_CERTIFIED
).sort((a, b) => a.name.localeCompare(b.name)),
(version: any) => {
- if (!this.assignInputParameters[this.operation.workflowId][version.id] && !selectedVersionId) {
+ if (!this.assignInputParameters[this.operation.workflowId][version.id] && version.id !== selectedVersionId) {
this.assignInputParameters[this.operation.workflowId][version.id] = _.map(version.inputs, (input: OperationParameter) => {
return new OperationParameter({...input, type: input.type.toLowerCase()});
})
@@ -182,14 +183,15 @@ export class OperationCreatorComponent {
return new OperationParameter({...output, type: output.type.toLowerCase()});
})
.sort((a, b) => a.name.localeCompare(b.name));
- } else if (selectedVersionId) {
- this.assignInputParameters[this.operation.workflowId][version.id] = [];
- this.assignOutputParameters[this.operation.workflowId][version.id] = [];
}
return new DropdownValue(version.id, `V ${version.name}`);
}
);
+ if (selectedVersionId) {
+ this.assignInputParameters[this.operation.workflowId][selectedVersionId] = [];
+ this.assignOutputParameters[this.operation.workflowId][selectedVersionId] = [];
+ }
if (!selectedVersionId && this.workflowVersions.length) {
this.operation.workflowVersionId = _.last(this.workflowVersions).value;
}
@@ -264,7 +266,7 @@ export class OperationCreatorComponent {
this.operation.createOutputParamsList(this.outputParameters);
}
- isUsingExistingWF(): boolean {
+ isUsingExistingWF = (): boolean => {
return this.operation.workflowAssociationType === WORKFLOW_ASSOCIATION_OPTIONS.EXISTING;
}