summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts
diff options
context:
space:
mode:
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.ts41
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
+ });
+ }
}