diff options
author | Arielk <Ariel.Kenan@amdocs.com> | 2018-10-03 14:06:13 +0300 |
---|---|---|
committer | Avi Gaffa <avi.gaffa@amdocs.com> | 2018-10-11 11:47:26 +0000 |
commit | 502b7b7839374680a494c1606798a8b4588daa2b (patch) | |
tree | fd8868b0d4c3e142f2a8921600c8cb8b986b7acd /catalog-ui/src/app/ng2/pages/interface-operation/interface-operation.page.component.ts | |
parent | 4d5da30c41326eeeb9344b31875e010b1a7507c1 (diff) |
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 <Ariel.Kenan@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/interface-operation/interface-operation.page.component.ts')
-rw-r--r-- | catalog-ui/src/app/ng2/pages/interface-operation/interface-operation.page.component.ts | 28 |
1 files changed, 20 insertions, 8 deletions
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' }); } }); } |