diff options
author | 2020-11-15 18:44:23 +0200 | |
---|---|---|
committer | 2020-11-16 14:53:23 +0200 | |
commit | 644dc55c1e5ffe2e9a23507af905ac40184dcad2 (patch) | |
tree | d52a03b6cc75e8a323971a9af80f6f4a586a0e67 /cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts | |
parent | 17707e6531d3986e43020725a3de06351d387226 (diff) |
adding value attribute for customized output for action phase2
Issue-ID: CCSDK-2975
Signed-off-by: Eltanany Shaaban <shaaban.eltanany.ext@orange.com>
Change-Id: Iebd4ca5117748ddf86fbbf1c4c382bb1fe737727
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts index 88f28b780..ff6406c28 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts @@ -25,33 +25,33 @@ limitations under the License. import dagre from 'dagre'; import graphlib from 'graphlib'; -import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; +import {Component, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core'; import * as joint from 'jointjs'; import './jointjs/elements/palette.function.element'; import './jointjs/elements/action.element'; import './jointjs/elements/board.function.element'; -import { DesignerStore } from './designer.store'; -import { ActionElementTypeName } from 'src/app/common/constants/app-constants'; -import { GraphUtil } from './graph.util'; -import { GraphGenerator } from './graph.generator.util'; -import { FunctionsStore } from './functions.store'; -import { Subject } from 'rxjs'; -import { distinctUntilChanged, takeUntil } from 'rxjs/operators'; -import { BluePrintDetailModel } from '../model/BluePrint.detail.model'; -import { ActivatedRoute, Router } from '@angular/router'; -import { DesignerService } from './designer.service'; -import { FilesContent, FolderNodeElement } from '../package-creation/mapping-models/metadata/MetaDataTab.model'; -import { PackageCreationModes } from '../package-creation/creationModes/PackageCreationModes'; -import { PackageCreationBuilder } from '../package-creation/creationModes/PackageCreationBuilder'; -import { PackageCreationStore } from '../package-creation/package-creation.store'; -import { PackageCreationService } from '../package-creation/package-creation.service'; -import { PackageCreationUtils } from '../package-creation/package-creation.utils'; +import {DesignerStore} from './designer.store'; +import {ActionElementTypeName} from 'src/app/common/constants/app-constants'; +import {GraphUtil} from './graph.util'; +import {GraphGenerator} from './graph.generator.util'; +import {FunctionsStore} from './functions.store'; +import {Subject} from 'rxjs'; +import {distinctUntilChanged, takeUntil} from 'rxjs/operators'; +import {BluePrintDetailModel} from '../model/BluePrint.detail.model'; +import {ActivatedRoute, Router} from '@angular/router'; +import {DesignerService} from './designer.service'; +import {FilesContent, FolderNodeElement} from '../package-creation/mapping-models/metadata/MetaDataTab.model'; +import {PackageCreationModes} from '../package-creation/creationModes/PackageCreationModes'; +import {PackageCreationBuilder} from '../package-creation/creationModes/PackageCreationBuilder'; +import {PackageCreationStore} from '../package-creation/package-creation.store'; +import {PackageCreationService} from '../package-creation/package-creation.service'; +import {PackageCreationUtils} from '../package-creation/package-creation.utils'; import * as JSZip from 'jszip'; -import { PackageCreationExtractionService } from '../package-creation/package-creation-extraction.service'; -import { CBAPackage } from '../package-creation/mapping-models/CBAPacakge.model'; -import { TopologyTemplate } from './model/designer.topologyTemplate.model'; -import { ToastrService } from 'ngx-toastr'; -import { DesignerDashboardState } from './model/designer.dashboard.state'; +import {PackageCreationExtractionService} from '../package-creation/package-creation-extraction.service'; +import {CBAPackage} from '../package-creation/mapping-models/CBAPacakge.model'; +import {TopologyTemplate} from './model/designer.topologyTemplate.model'; +import {ToastrService} from 'ngx-toastr'; +import {DesignerDashboardState} from './model/designer.dashboard.state'; @Component({ selector: 'app-designer', @@ -75,7 +75,7 @@ export class DesignerComponent implements OnInit, OnDestroy { paletteGraph: joint.dia.Graph; palettePaper: joint.dia.Paper; ngUnsubscribe = new Subject(); - opt = { tx: 100, ty: 100 }; + opt = {tx: 100, ty: 100}; filesData: any = []; folder: FolderNodeElement = new FolderNodeElement(); zipFile: JSZip = new JSZip(); @@ -122,7 +122,7 @@ export class DesignerComponent implements OnInit, OnDestroy { publishBluePrint() { this.create(); - this.zipFile.generateAsync({ type: 'blob' }) + this.zipFile.generateAsync({type: 'blob'}) .then(blob => { const formData = new FormData(); formData.append('file', blob); @@ -169,7 +169,7 @@ export class DesignerComponent implements OnInit, OnDestroy { this.packageCreationService.downloadPackage(this.viewedPackage.artifactName + '/' + this.viewedPackage.artifactVersion) .subscribe(response => { - const blob = new Blob([response], { type: 'application/octet-stream' }); + const blob = new Blob([response], {type: 'application/octet-stream'}); this.packageCreationExtractionService.extractBlobToStore(blob); }); } @@ -232,7 +232,7 @@ export class DesignerComponent implements OnInit, OnDestroy { setLinkVertices: false, marginX: 10, marginY: 10, - clusterPadding: { top: 100, left: 30, right: 10, bottom: 100 }, + clusterPadding: {top: 100, left: 30, right: 10, bottom: 100}, rankDir: 'TB' }); this.actions = []; @@ -240,6 +240,13 @@ export class DesignerComponent implements OnInit, OnDestroy { for (const workflowsKey in topologtTemplate.workflows) { if (workflowsKey && !this.actions.includes(workflowsKey)) { this.actions.push(workflowsKey); + /* tslint:disable:no-string-literal */ + if (!this.designerState.template.workflows[workflowsKey]['inputs']) { + this.designerState.template.workflows[workflowsKey]['inputs'] = {}; + } + if (!this.designerState.template.workflows[workflowsKey]['outputs']) { + this.designerState.template.workflows[workflowsKey]['outputs'] = {}; + } } } } @@ -468,7 +475,7 @@ export class DesignerComponent implements OnInit, OnDestroy { saveBluePrintToDataBase() { this.create(); - this.zipFile.generateAsync({ type: 'blob' }) + this.zipFile.generateAsync({type: 'blob'}) .then(blob => { this.packageCreationService.savePackage(blob).subscribe( bluePrintDetailModels => { @@ -500,11 +507,11 @@ export class DesignerComponent implements OnInit, OnDestroy { // console.log(this.designerState.template.workflows[this.currentActionName] // ['steps'][customFunctionName]['target']); this.designerStore.setCurrentFunction(this.designerState.template.workflows[this.currentActionName] - ['steps'][customFunctionName]['target']); + ['steps'][customFunctionName]['target']); } getTarget(stepname) { return this.designerState.template.workflows[this.currentActionName] - ['steps'][stepname]['target']; + ['steps'][stepname]['target']; } } |