diff options
author | 2018-01-10 17:29:26 +0800 | |
---|---|---|
committer | 2018-01-10 17:29:26 +0800 | |
commit | 32222a4010ebdc739ee1586b09da6758136d9813 (patch) | |
tree | 769985a62592636ee578595d5514b536bcf48a24 /sdc-workflow-designer-ui/src/app/components/property/properties.component.ts | |
parent | 38dfd59a8b5d05266e5567f79dcf30fd10ef7c54 (diff) |
support edit rest task properties
modify rest taks config info, and enable edit rest task properties.component.css
Issue-ID: SDC-897
Change-Id: Icad8c1ee60d7572f311d5cba97cda6b2144a7469
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/components/property/properties.component.ts')
-rw-r--r-- | sdc-workflow-designer-ui/src/app/components/property/properties.component.ts | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/sdc-workflow-designer-ui/src/app/components/property/properties.component.ts b/sdc-workflow-designer-ui/src/app/components/property/properties.component.ts index d3a6a416..c49b4661 100644 --- a/sdc-workflow-designer-ui/src/app/components/property/properties.component.ts +++ b/sdc-workflow-designer-ui/src/app/components/property/properties.component.ts @@ -10,13 +10,17 @@ * ZTE - initial API and implementation and/or initial documentation */ -import { AfterViewInit, Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { TreeNode } from 'primeng/primeng'; +import { PlanTreeviewItem } from '../../model/plan-treeview-item'; +import { ValueSource } from '../../model/value-source.enum'; +import { NodeType } from '../../model/workflow/node-type.enum'; +import { Parameter } from '../../model/workflow/parameter'; import { WorkflowNode } from '../../model/workflow/workflow-node'; import { BroadcastService } from '../../services/broadcast.service'; import { JsPlumbService } from '../../services/jsplumb.service'; -import { PlanTreeviewItem } from "../../model/plan-treeview-item"; -import { ModelService } from "../../services/model.service"; +import { ModelService } from '../../services/model.service'; /** * property component presents information of a workflow node. @@ -28,23 +32,38 @@ import { ModelService } from "../../services/model.service"; styleUrls: ['./properties.component.css'], templateUrl: 'properties.component.html', }) -export class PropertiesComponent implements AfterViewInit { +export class PropertiesComponent implements OnInit { public node: WorkflowNode; + public planTreeviewItems: PlanTreeviewItem[]; + public nodeType = NodeType; + // public nodeTypes: string[] = WorkflowNodeType; public show = false; public titleEditing = false; - public planItems: PlanTreeviewItem[]; + public valueSource = [ValueSource.String]; constructor(private broadcastService: BroadcastService, - private jsPlumbService: JsPlumbService, - private modelService: ModelService) { + private modelService: ModelService, + private jsPlumbService: JsPlumbService) { } - public ngAfterViewInit() { - this.broadcastService.showProperty$.subscribe(show => this.show = show); - this.broadcastService.nodeProperty$.subscribe(node => { - this.node = node; - this.planItems = this.modelService.getPlanParameters(this.node.id); + public ngOnInit() { + this.broadcastService.showProperty$.subscribe(element => { + if (element && this.modelService.isNode(element)) { + this.node = element as WorkflowNode; + // temporarily, if config info not exists then close the property panel + // TODOS: 1) save config info in case config info no exists on a different environment. + // 2) display property panel even if config info not exists for it may be adjust. + try { + this.planTreeviewItems = this.modelService.getPlanParameters(this.node.id); + this.show = true; + } catch (error) { + this.show = false; + console.log(error); + } + } else { + this.show = false; + } }); } |