diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2019-02-26 15:57:07 +0530 |
---|---|---|
committer | IBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com> | 2019-02-26 15:57:28 +0530 |
commit | 47f21a59c471c60696efcd09f5fbd07dee6e8d37 (patch) | |
tree | 0a256d37921213c1db2cc4d7e3f8f59ebc36cf63 /cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.ts | |
parent | a9a51128e6197fbb4efb38b5cd73e247d7c1fa45 (diff) |
Test component
Added test component changes as per the mockup
Issue-ID: CCSDK-761
Change-Id: Ie0d86a00d6d0b0ae540bcd78a37dcac74ad903a8
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.ts')
-rw-r--r-- | cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.ts | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.ts index 2c87e8739..ee33fd737 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.ts +++ b/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.ts @@ -22,6 +22,14 @@ limitations under the License. import { Component, OnInit } from '@angular/core'; import {FlatTreeControl} from '@angular/cdk/tree'; import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; +import { Observable, Subscription } from 'rxjs'; +import { Store } from '@ngrx/store'; + +import { IAppState } from '../../../common/core/store/state/app.state'; +import { IBlueprintState } from 'src/app/common/core/store/models/blueprintState.model'; +import { IBlueprint } from 'src/app/common/core/store/models/blueprint.model'; +import { IMetaData } from '../../../common/core/store/models/metadata.model'; +import { LoadBlueprintSuccess } from 'src/app/common/core/store/actions/blueprint.action'; @@ -86,6 +94,9 @@ interface ExampleFlatNode { styleUrls: ['./test-template.component.scss'] }) export class TestTemplateComponent implements OnInit { + private blueprintpState: Subscription; + private request ; + private workflows = []; private transformer = (node: FoodNode, level: number) => { return { @@ -103,7 +114,15 @@ export class TestTemplateComponent implements OnInit { dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); - constructor() { + constructor(private store: Store<IAppState>) { + this.blueprintpState = this.store.select('blueprint') + .subscribe((data: any)=>{ + console.log(data); + if(data.blueprint.topology_template && data.blueprint.topology_template.workflows) { + this.buildWorkflowData(data.blueprint.topology_template.workflows); + // this.request = JSON.stringify(data.blueprint.topology_template.workflows[0], undefined, 4); + } + }); this.dataSource.data = TREE_DATA; } @@ -116,4 +135,18 @@ export class TestTemplateComponent implements OnInit { console.log('selected file:' + file); } + buildWorkflowData(data) { + this.workflows = []; + for (var property1 in data) { + data[property1].name = property1; + this.workflows.push(data[property1]) + } + this.request = this.workflows[0]; + } + + createRequest(workflow) { + this.request = JSON.stringify(workflow, undefined, 4); + + } + } |