fixed sensor

This commit is contained in:
snoop 2017-07-26 16:22:59 +09:00
parent 763db4283f
commit ed11bb6619
3 changed files with 7 additions and 7 deletions

View File

@ -39,10 +39,6 @@ class SensorDetailLayout extends React.Component<Props, State> {
'name': 'Setup',
'path': this.state.currUrl + '/setup',
},
{
'name': 'Tree',
'path': this.state.currUrl + '/tree',
},
];
return (
<Container fluid>
@ -57,6 +53,7 @@ class SensorDetailLayout extends React.Component<Props, State> {
<Route exact={true} path={`${this.props.match.url}/:id/items`} component={SensorDetailItems} />
{/*<Route path={`${this.props.match.url}/:id/history/`} component={EmailConfirm}/>*/}
<Route exact={true} path={`${this.props.match.url}/:id/setup`} component={SensorSetup} />
<Route exact={true} path={`${this.props.match.url}/setup`} component={SensorSetup} />
<Route exact={true} path={`${this.props.match.url}/:id/tree`} component={SensorItemTree} />
</Switch>
<Footer />

View File

@ -37,7 +37,7 @@ export function mapDispatchToProps(dispatch: Dispatch<any>): SensorListDispatchP
dispatch(routerPush('/sensor/' + String(id)));
},
onAddSensor: (target: Target) => {
dispatch(routerPush('/sensor/' + String(11)));
dispatch(routerPush('/sensor/setup'));
},
};
}

View File

@ -116,7 +116,7 @@ export class SensorList extends React.Component<SensorListProps, SensorListState
console.log(event);
}
public handleAddSensor(): void {
console.log('adding a sensor');
this.props.onAddSensor(this.props.target);
}
public render(): JSX.Element {
@ -148,8 +148,11 @@ export class SensorList extends React.Component<SensorListProps, SensorListState
</Table.Row>
))}
</Table.Body>
</Table>
<Table.Footer>
<Button content='Add' icon='add' labelPosition='left' floated='right' positive onClick={this.handleAddSensor.bind(this)} />
</Table.Footer>
</Table>
</Container>
);
}