From 58b3fdc704eda7ede2d5606a8815abcaf58b655c Mon Sep 17 00:00:00 2001 From: snoop Date: Tue, 26 Sep 2017 16:01:47 +0900 Subject: [PATCH] =?UTF-8?q?target=20=EC=97=90=EC=84=9C=20sensor=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=EC=8B=9C=20=EC=9E=90=EB=8F=99=20target=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20=EB=90=98=EC=96=B4=EC=9E=88=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sensor/react/components/SensorConfigStepper.tsx | 7 +++++++ .../react/components/SensorConfigTargetSelect.tsx | 8 +++++--- .../sensor/react/components/SensorConfiguration.tsx | 10 ++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/ts/@overflow/sensor/react/components/SensorConfigStepper.tsx b/src/ts/@overflow/sensor/react/components/SensorConfigStepper.tsx index 15db7d0..4ced862 100644 --- a/src/ts/@overflow/sensor/react/components/SensorConfigStepper.tsx +++ b/src/ts/@overflow/sensor/react/components/SensorConfigStepper.tsx @@ -42,6 +42,7 @@ export interface SensorConfigStepperStateProps { infraId?: number; setSensor?(data: SensorRegistInfo): void; getSensor?(): SensorRegistInfo; + isTarget?: boolean; } export interface SensorConfigStepperDispatchProps { @@ -231,6 +232,12 @@ export class SensorConfigStepper extends React.Component diff --git a/src/ts/@overflow/sensor/react/components/SensorConfigTargetSelect.tsx b/src/ts/@overflow/sensor/react/components/SensorConfigTargetSelect.tsx index 24b56e5..14939b7 100644 --- a/src/ts/@overflow/sensor/react/components/SensorConfigTargetSelect.tsx +++ b/src/ts/@overflow/sensor/react/components/SensorConfigTargetSelect.tsx @@ -40,6 +40,7 @@ export interface StateProps { infraId?: number; setSensor?(data: SensorRegistInfo): void; getSensor?(): SensorRegistInfo; + stepNext?(): void; } export interface DispatchProps { @@ -105,11 +106,12 @@ export class SensorConfigTargetSelect extends React.Component { selectionOptions.push(this.createOption(this.props.infra)); this.selectOptions = selectionOptions; - // let sd = this.props.getSensor(); + let sd = this.props.getSensor(); // sd.targetId = this.props.infra.target.id; // sd.type = this.props.infra.infraType.name; - // sd.infra = this.props.infra; - // this.props.setSensor(sd); + sd.infra = this.props.infra; + this.props.setSensor(sd); + this.props.stepNext(); } public createOption(infra: Infra): DropdownItemProps { diff --git a/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx b/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx index ee22286..53fae5c 100644 --- a/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx +++ b/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx @@ -46,6 +46,7 @@ export interface SensorConfigurationDispatchProps { export interface SensorConfigurationState { selectedCrawlerId: number; + isTarget: boolean; } export type SensorConfigurationProps = SensorConfigurationStateProps & SensorConfigurationDispatchProps; @@ -58,6 +59,7 @@ export class SensorConfiguration extends React.Component { + this.setState({isTarget:true}); + } + public render(): JSX.Element { let steps = [ , + infraId={this.props.infraId} stepNext={this.stepNext.bind(this)} />, , @@ -93,7 +99,7 @@ export class SensorConfiguration extends React.Component + setSensor={this.setSensor.bind(this)} getSensor={this.getSensor.bind(this)} isTarget={this.state.isTarget} /> ); } }