From 47f21a59c471c60696efcd09f5fbd07dee6e8d37 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 26 Feb 2019 15:57:07 +0530 Subject: Test component Added test component changes as per the mockup Issue-ID: CCSDK-761 Change-Id: Ie0d86a00d6d0b0ae540bcd78a37dcac74ad903a8 Signed-off-by: Arundathi Patil --- .../test-template/test-template.component.html | 75 ++++++++++++++-------- .../test-template/test-template.component.ts | 35 +++++++++- 2 files changed, 81 insertions(+), 29 deletions(-) (limited to 'cds-ui/client/src/app/feature-modules/blueprint/test-template') diff --git a/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.html b/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.html index 1fca8d1b7..7c225d285 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.html +++ b/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.html @@ -19,34 +19,53 @@ limitations under the License. ============LICENSE_END============================================ -->
-
- - - - - - {{node.name}} - - - - - {{node.name}} - - + +
+ + + + + + Workflows + + +
+
{{workflow.name}}
+
+
+
+
+ +
+
+

Request

+ +
+ + +
+
+ +
+

Response

+ +
-
-
-
-
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) { + 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); + + } + } -- cgit 1.2.3-korg