From 65bbc0bb06e247601048ccc198b97f49aa7564e2 Mon Sep 17 00:00:00 2001 From: snoop Date: Mon, 14 Aug 2017 16:51:57 +0900 Subject: [PATCH] sensor list --- src/ts/@overflow/sensor/react/SensorList.tsx | 2 +- .../sensor/react/components/SensorList.tsx | 65 ++++--------------- .../target/react/components/TargetList.tsx | 2 +- 3 files changed, 14 insertions(+), 55 deletions(-) diff --git a/src/ts/@overflow/sensor/react/SensorList.tsx b/src/ts/@overflow/sensor/react/SensorList.tsx index be83567..fc7d1f2 100644 --- a/src/ts/@overflow/sensor/react/SensorList.tsx +++ b/src/ts/@overflow/sensor/react/SensorList.tsx @@ -34,7 +34,7 @@ export function mapDispatchToProps(dispatch: Dispatch): SensorListDispatchP dispatch(ReadAllByProbeActions.request(probe)); }, onReadAllByDomain: (domain: Domain) => { - dispatch(asyncRequestActions.request('SensorService', 'readAllByDomain', ReadAllByDomainActions.REQUEST, domain)); + dispatch(asyncRequestActions.request('SensorService', 'readAllByDomain', ReadAllByDomainActions.REQUEST, JSON.stringify(domain))); }, onSelectSensor: (id: number) => { dispatch(routerPush('/sensor/' + String(id))); diff --git a/src/ts/@overflow/sensor/react/components/SensorList.tsx b/src/ts/@overflow/sensor/react/components/SensorList.tsx index 5d71311..d9beb85 100644 --- a/src/ts/@overflow/sensor/react/components/SensorList.tsx +++ b/src/ts/@overflow/sensor/react/components/SensorList.tsx @@ -11,6 +11,7 @@ export interface StateProps { probe?: Probe; target?: Target; sensorList?: Sensor[]; + targetId?: number; } export interface DispatchProps { @@ -37,64 +38,22 @@ export class SensorList extends React.Component { public componentWillMount(): void { let probe: Probe = { - id: Number(this.props.probeId), + id: Number(1), }; this.props.onReadAllByProbe(probe); }