diff options
author | ShaabanEltanany <shaaban.eltanany.ext@orange.com> | 2020-10-26 13:46:14 +0200 |
---|---|---|
committer | ShaabanEltanany <shaaban.eltanany.ext@orange.com> | 2020-10-26 15:27:30 +0200 |
commit | 4dd2f9d159e12e888e4e6dd9dda245e296e38b98 (patch) | |
tree | fc9b541d51fc131092b1ba8ebc27cbc2ee93af24 /cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts | |
parent | 1741f11216bc1325673373996f806bdc4ec81b42 (diff) |
adding inputs and outputs to entry definition (Designer)
Issue-ID: CCSDK-2943
Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com>
Change-Id: Iffd5c80ecf3fa35b21ab14b8c70308e0d3ee2a50
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts index d3326165f..c59478d91 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts @@ -19,12 +19,14 @@ limitations under the License. ============LICENSE_END============================================ */ -import { Injectable } from '@angular/core'; -import { Store } from '../../../../common/core/stores/Store'; -import { DesignerService } from './designer.service'; -import { DesignerDashboardState } from './model/designer.dashboard.state'; -import { DeclarativeWorkflow } from './model/designer.workflow'; -import { NodeTemplate } from './model/desinger.nodeTemplate.model'; +import {Injectable} from '@angular/core'; +import {Store} from '../../../../common/core/stores/Store'; +import {DesignerService} from './designer.service'; +import {DesignerDashboardState} from './model/designer.dashboard.state'; +import {DeclarativeWorkflow} from './model/designer.workflow'; +import {NodeTemplate} from './model/desinger.nodeTemplate.model'; +import {PackageCreationUtils} from '../package-creation/package-creation.utils'; +import {Action} from './action-attributes/models/Action'; @Injectable({ @@ -32,7 +34,7 @@ import { NodeTemplate } from './model/desinger.nodeTemplate.model'; }) export class DesignerStore extends Store<DesignerDashboardState> { - constructor(private designerService: DesignerService) { + constructor(private designerService: DesignerService, private packageCreationUtils: PackageCreationUtils) { super(new DesignerDashboardState()); } @@ -145,21 +147,26 @@ export class DesignerStore extends Store<DesignerDashboardState> { }); } - setInputsToSpecificWorkflow(inputs: Map<string, string>) { + setInputsAndOutputsToSpecificWorkflow(inputs: string, outputs: string, actionName: string) { + /* tslint:disable:no-string-literal */ - let mapOfWorkflows = this.state.template.workflows['Action1']['steps']; - mapOfWorkflows += inputs; - /*mapOfWorkflows.forEach(((value, key) => { - if (value.includes('resource-assignment')) { - value += inputs; - } - }));*/ - console.log('the new workflows'); - console.log(mapOfWorkflows); + const action = this.state.template.workflows[actionName] as Action; + if (action) { + action.inputs = inputs; + action.outputs = outputs; + this.saveSourceContent(this.packageCreationUtils.transformToJson(this.state.template)); + } + } clear() { this.setState(new DesignerDashboardState()); } + setCurrentAction(customActionName: string) { + this.setState({ + ...this.state, + actionName: customActionName + }); + } } |