fixed sensorlist

This commit is contained in:
snoop 2017-07-26 15:53:31 +09:00
parent f71fcfb0f8
commit 763db4283f
2 changed files with 7 additions and 3 deletions

View File

@ -33,9 +33,12 @@ export function mapDispatchToProps(dispatch: Dispatch<any>): SensorListDispatchP
onReadAllByDomain: (domain: Domain) => {
dispatch(ReadAllByDomainActions.request(domain));
},
onSensorSelect: (id: number) => {
onSelectSensor: (id: number) => {
dispatch(routerPush('/sensor/' + String(id)));
},
onAddSensor: (target: Target) => {
dispatch(routerPush('/sensor/' + String(11)));
},
};
}

View File

@ -16,7 +16,8 @@ export interface DispatchProps {
onReadAllByTarget?(target: Target): void;
onReadAllByProbe?(probe: Probe): void;
onReadAllByDomain?(domain: Domain): void;
onSensorSelect?(id: number): void;
onSelectSensor?(id: number): void;
onAddSensor?(target: Target): void;
}
export type SensorListProps = StateProps & DispatchProps;
@ -93,7 +94,7 @@ export class SensorList extends React.Component<SensorListProps, SensorListState
selected: selectedSensor,
});
this.props.onSensorSelect(selectedSensor.id);
this.props.onSelectSensor(selectedSensor.id);
}
public checkCellStatus(status: any): boolean {