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} /> ); } }