From 8be06bf2ae7a3c597b90bc84dfbe752b2f1f0bc7 Mon Sep 17 00:00:00 2001 From: snoop Date: Tue, 25 Jul 2017 19:52:20 +0900 Subject: [PATCH] fixed sensor tree --- .../meta/react/components/SensorItemTree.tsx | 15 +++++++++++---- .../react/components/SensorConfiguration.tsx | 5 ++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ts/@overflow/meta/react/components/SensorItemTree.tsx b/src/ts/@overflow/meta/react/components/SensorItemTree.tsx index 0c5d9a5..3dd2c0d 100644 --- a/src/ts/@overflow/meta/react/components/SensorItemTree.tsx +++ b/src/ts/@overflow/meta/react/components/SensorItemTree.tsx @@ -24,7 +24,7 @@ export type SensorItemTreeProps = SensorItemTreeStateProps & SensorItemTreeDispa export interface SensorItemTreeState { - portState: { [key: number]: boolean }; + portState: Map; } interface TreeItem { @@ -42,7 +42,7 @@ export class SensorItemTree extends React.Component { + // this.state.portState[key] = false; elems.push( - + { + + let newPortState: Map = new Map(this.state.portState); + newPortState[key] = true; + this.setState({ portState: newPortState }); + + }} /> Category - {this.ViewSensorItem(data.metaSensorItemList)} + {this.state.portState[key] ? this.ViewSensorItem(data.metaSensorItemList) : ''} , ); diff --git a/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx b/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx index a23d8ff..4dacbbe 100644 --- a/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx +++ b/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx @@ -4,6 +4,8 @@ import { Grid, Image, Label, Segment, Dropdown, Input, List, Accordion, Loader } import MetaCrawler from '@overflow/meta/api/model/MetaCrawler'; +import SensorItemTree from '@overflow/meta/react/SensorItemTree'; + export interface SensorConfigurationStateProps { } @@ -28,7 +30,7 @@ export class SensorConfiguration extends React.Component, , ]; + let steps = [, , ]; return ( @@ -143,6 +145,7 @@ export class ConfigStepper extends React.Component +













); }