From 502b7b7839374680a494c1606798a8b4588daa2b Mon Sep 17 00:00:00 2001 From: Arielk Date: Wed, 3 Oct 2018 14:06:13 +0300 Subject: Operation screen changes. 1. [ATTASDC-7390] Output parameter support 2. VF Workflow context 3. [ATTASDC-7420] "Opening same operation displays invalid fields and values" Change-Id: I7bb94b50ad299af6080266076b5e0b632ef5e0e7 Issue-ID: SDC-1814 Signed-off-by: Arielk --- .../interface-operation.page.component.ts | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'catalog-ui/src/app/ng2/pages/interface-operation/interface-operation.page.component.ts') 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 21ac60981a..f23f66a5ff 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 @@ -1,5 +1,5 @@ import * as _ from "lodash"; -import {Component, Input, ComponentRef, Inject} from '@angular/core'; +import {Component, Input, Output, ComponentRef, Inject} from '@angular/core'; import {Component as IComponent} from 'app/models/components/component'; import {SdcConfigToken, ISdcConfig} from "app/ng2/config/sdc-config.config"; @@ -32,9 +32,12 @@ export class InterfaceOperationComponent { @Input() component: IComponent; @Input() readonly: boolean; + @Input() enableMenuItems: Function; + @Input() disableMenuItems: Function; constructor( - @Inject(SdcConfigToken) sdcConfig: ISdcConfig, + @Inject(SdcConfigToken) private sdcConfig: ISdcConfig, + @Inject("$state") private $state: ng.ui.IStateService, private ComponentServiceNg2: ComponentServiceNg2, private WorkflowServiceNg2: WorkflowServiceNg2, private ModalServiceNg2: ModalService, @@ -44,17 +47,24 @@ export class InterfaceOperationComponent { ngOnInit(): void { this.isLoading = true; + let gotOperations = false; + let gotInputs = false; + this.ComponentServiceNg2.getInterfaceOperations(this.component).subscribe((response: ComponentGenericResponse) => { - if (this.inputs) { + if (gotInputs) { this.isLoading = false; + } else { + gotOperations = true; } - let {interfaceOperations} = response; - this.component.interfaceOperations = interfaceOperations; - this.operationList = _.toArray(interfaceOperations).sort((a, b) => a.operationType.localeCompare(b.operationType)); + this.component.interfaceOperations = response.interfaceOperations; + this.operationList = _.toArray(response.interfaceOperations).sort((a, b) => a.operationType.localeCompare(b.operationType)); }); + this.ComponentServiceNg2.getComponentInputs(this.component).subscribe((response: ComponentGenericResponse) => { - if (this.component.interfaceOperations) { + if (gotOperations) { this.isLoading = false; + } else { + gotInputs = true; } this.inputs = response.inputs; }); @@ -99,7 +109,7 @@ export class InterfaceOperationComponent { modalData.saveBtnText, 'blue', () => { - this.modalInstance.instance.dynamicContent.instance.createInputParamList(); + this.modalInstance.instance.dynamicContent.instance.createParamLists(); this.ModalServiceNg2.closeCurrentModal(); const {operation, isAssociateWorkflow} = this.modalInstance.instance.dynamicContent.instance; @@ -180,6 +190,8 @@ export class InterfaceOperationComponent { const versionId = response.workflowVersionId; const artifactId = response.artifactUUID; this.WorkflowServiceNg2.associateWorkflowArtifact(resourceId, operationId, workflowId, versionId, artifactId).subscribe(); + } else { + this.$state.go('workspace.plugins', { path: 'workflowDesigner' }); } }); } -- cgit 1.2.3-korg