fixed sensor
This commit is contained in:
parent
e0f91c03a0
commit
c5561a915e
|
@ -4,21 +4,22 @@ import {
|
||||||
SensorDetailStateProps,
|
SensorDetailStateProps,
|
||||||
SensorDetailDispatchProps,
|
SensorDetailDispatchProps,
|
||||||
} from './components/SensorDetail';
|
} from './components/SensorDetail';
|
||||||
import State from '../redux/state/ReadAllByTarget';
|
import State from '../redux/state/Read';
|
||||||
|
|
||||||
import * as ReadAllByTargetActions from '../redux/action/read_all_by_target';
|
import * as ReadActions from '../redux/action/read';
|
||||||
import Target from '@overflow/target/api/model/Target';
|
import Target from '@overflow/target/api/model/Target';
|
||||||
import Sensor from '@overflow/sensor/api/model/Sensor';
|
import Sensor from '@overflow/sensor/api/model/Sensor';
|
||||||
|
|
||||||
export function mapStateToProps(state: any): SensorDetailStateProps {
|
export function mapStateToProps(state: any): SensorDetailStateProps {
|
||||||
return {
|
return {
|
||||||
|
sensor:state.sensor,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mapDispatchToProps(dispatch: Dispatch<any>): SensorDetailDispatchProps {
|
export function mapDispatchToProps(dispatch: Dispatch<any>): SensorDetailDispatchProps {
|
||||||
return {
|
return {
|
||||||
onReadAllByTarget: (target: Target) => {
|
onRead: (id: number) => {
|
||||||
dispatch(ReadAllByTargetActions.request(target));
|
dispatch(ReadActions.request(id));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ export interface SensorDetailStateProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SensorDetailDispatchProps {
|
export interface SensorDetailDispatchProps {
|
||||||
|
onRead?(id: number): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ export class SensorDetail extends React.Component<SensorDetailProps, SensorDetai
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentWillMount(): void {
|
public componentWillMount(): void {
|
||||||
super.componentWillMount();
|
console.log('');
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Table, Button, Header, Container } from 'semantic-ui-react';
|
import { Table, Button, Header, Container } from 'semantic-ui-react';
|
||||||
import { SensorDetail } from './SensorDetail';
|
import SensorDetailContainer from '../SensorDetail';
|
||||||
|
|
||||||
import Probe from '@overflow/probe/api/model/Probe';
|
import Probe from '@overflow/probe/api/model/Probe';
|
||||||
import Sensor from '@overflow/sensor/api/model/Sensor';
|
import Sensor from '@overflow/sensor/api/model/Sensor';
|
||||||
|
@ -116,7 +116,8 @@ export class SensorList extends React.Component<SensorListProps, SensorListState
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
if (this.state.isDetail) {
|
if (this.state.isDetail) {
|
||||||
return (<SensorDetail sensor={this.state.selected} />);
|
// return (<SensorDetailContainer sensor={this.state.selected} />);
|
||||||
|
return (<SensorDetailContainer />);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Container fluid>
|
<Container fluid>
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
/**
|
import Sensor from '../../api/model/Sensor';
|
||||||
* Created by geek on 17. 7. 3.
|
|
||||||
*/
|
export interface State {
|
||||||
|
readonly isGetSensor: boolean;
|
||||||
|
readonly error?: Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const defaultState: State = {
|
||||||
|
isGetSensor: undefined,
|
||||||
|
error: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default State;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user