From dc3941def717062cc327311928086006d9c83ef1 Mon Sep 17 00:00:00 2001 From: insanity Date: Fri, 21 Jul 2017 14:17:49 +0900 Subject: [PATCH] targetdetail --- src/ts/@overflow/target/react/TargetDetail.tsx | 5 +++++ src/ts/@overflow/target/react/components/TargetDetail.tsx | 2 +- src/ts/@overflow/target/react/components/TargetList.tsx | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ts/@overflow/target/react/TargetDetail.tsx b/src/ts/@overflow/target/react/TargetDetail.tsx index c0c11d1..a0ceb56 100644 --- a/src/ts/@overflow/target/react/TargetDetail.tsx +++ b/src/ts/@overflow/target/react/TargetDetail.tsx @@ -5,6 +5,8 @@ import { DispatchProps as DispatchProps, } from './components/TargetDetail'; +import * as targetDetailActions from '../redux/action/read'; + export function mapStateToProps(state: any): StateProps { return { probe: state.probe, @@ -13,6 +15,9 @@ export function mapStateToProps(state: any): StateProps { export function mapDispatchToProps(dispatch: Dispatch): DispatchProps { return { + onRead: (id: string) => { + dispatch(targetDetailActions.request(id)); + }, }; } diff --git a/src/ts/@overflow/target/react/components/TargetDetail.tsx b/src/ts/@overflow/target/react/components/TargetDetail.tsx index 2f108e7..d5d3f6c 100644 --- a/src/ts/@overflow/target/react/components/TargetDetail.tsx +++ b/src/ts/@overflow/target/react/components/TargetDetail.tsx @@ -13,7 +13,7 @@ export interface StateProps { } export interface DispatchProps { - + onRead(id: string): void; } export type Props = StateProps & DispatchProps; diff --git a/src/ts/@overflow/target/react/components/TargetList.tsx b/src/ts/@overflow/target/react/components/TargetList.tsx index 5c47d1c..bdb2ba2 100644 --- a/src/ts/@overflow/target/react/components/TargetList.tsx +++ b/src/ts/@overflow/target/react/components/TargetList.tsx @@ -23,7 +23,7 @@ export interface State { export class TargetList extends React.Component { - private data: any; + private data: any; constructor(props: Props, context: State) { super(props, context); this.state = { @@ -34,7 +34,6 @@ export class TargetList extends React.Component { } public handleAddTarget(event: React.MouseEvent, data: ButtonProps): void { - alert('test'); this.setState({ openAddTarget: true, });