diff --git a/src/ts/@overflow/discovery/react/DiscoveryTable.tsx b/src/ts/@overflow/discovery/react/DiscoveryTable.tsx index c564ade..4dcb2ce 100644 --- a/src/ts/@overflow/discovery/react/DiscoveryTable.tsx +++ b/src/ts/@overflow/discovery/react/DiscoveryTable.tsx @@ -5,6 +5,9 @@ import { DispatchProps as DiscoveryTableDispatchProps, } from './components/DiscoveryTable'; +import DiscoveryStartInfo from '../api/model/DiscoveryStartInfo'; +import * as asyncRequestActions from '@overflow/commons/redux/action/asyncRequest'; +import * as StartActionTypes from '../redux/action/start'; export function mapStateToProps(state: any, props: any): DiscoveryTableStateProps { return { @@ -14,6 +17,10 @@ export function mapStateToProps(state: any, props: any): DiscoveryTableStateProp export function mapDispatchToProps(dispatch: Dispatch): DiscoveryTableDispatchProps { return { + onProbeChange : (state: DiscoveryStartInfo) => { + dispatch(asyncRequestActions.request('DiscoveryService', 'startDiscovery', + StartActionTypes.REQUEST, JSON.stringify(state))); + }, }; } diff --git a/src/ts/@overflow/discovery/react/components/DiscoveryTable.tsx b/src/ts/@overflow/discovery/react/components/DiscoveryTable.tsx index d7626f9..1fffdc4 100644 --- a/src/ts/@overflow/discovery/react/components/DiscoveryTable.tsx +++ b/src/ts/@overflow/discovery/react/components/DiscoveryTable.tsx @@ -19,7 +19,7 @@ export interface StateProps { } export interface DispatchProps { - onProbeChange?(state: object): void; + onProbeChange?(state: DiscoveryStartInfo): void; } export type Props = StateProps & DispatchProps; diff --git a/src/ts/@overflow/discovery/redux/action/start.ts b/src/ts/@overflow/discovery/redux/action/start.ts new file mode 100644 index 0000000..7c3a38f --- /dev/null +++ b/src/ts/@overflow/discovery/redux/action/start.ts @@ -0,0 +1,10 @@ + +// Action Type +export type REQUEST = '@overflow/discovery/start/REQUEST'; +export type REQUEST_SUCCESS = '@overflow/discovery/start/REQUEST/SUCCESS'; +export type REQUEST_FAILURE = '@overflow/discovery/start/REQUEST/FAILURE'; + +export const REQUEST: REQUEST = '@overflow/discovery/start/REQUEST'; +export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/discovery/start/REQUEST/SUCCESS'; +export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/discovery/start/REQUEST/FAILURE'; + diff --git a/src/ts/@overflow/discovery/redux/reducer/start.ts b/src/ts/@overflow/discovery/redux/reducer/start.ts new file mode 100644 index 0000000..394eb6c --- /dev/null +++ b/src/ts/@overflow/discovery/redux/reducer/start.ts @@ -0,0 +1,25 @@ +import Action from '@overflow/commons/redux/Action'; +import { ReducersMapObject } from 'redux'; + + +import * as InfraTargetRegistAllActionTypes from '../action/start'; +import StartState, { defaultState as startDefaultState } from '../state/Start'; + +const reducer: ReducersMapObject = { + [InfraTargetRegistAllActionTypes.REQUEST_SUCCESS]: (state: StartState = startDefaultState, + action: Action): StartState => { + return { + ...state, + isStartDiscoverySuccess: action.payload, + }; + }, + [InfraTargetRegistAllActionTypes.REQUEST_FAILURE]: (state: StartState = startDefaultState, + action: Action): StartState => { + return { + ...state, + error: action.error, + }; + }, +}; + +export default reducer; diff --git a/src/ts/@overflow/discovery/redux/state/Start.ts b/src/ts/@overflow/discovery/redux/state/Start.ts new file mode 100644 index 0000000..08b2e8d --- /dev/null +++ b/src/ts/@overflow/discovery/redux/state/Start.ts @@ -0,0 +1,12 @@ + +export interface State { + readonly isStartDiscoverySuccess: boolean; + readonly error?: Error; +} + +export const defaultState: State = { + isStartDiscoverySuccess: undefined, + error: undefined, +}; + +export default State; diff --git a/src/ts/@overflow/noauthprobe/api/service/NoAuthProbeService.ts b/src/ts/@overflow/noauthprobe/api/service/NoAuthProbeService.ts index a40ef00..dcfb41f 100644 --- a/src/ts/@overflow/noauthprobe/api/service/NoAuthProbeService.ts +++ b/src/ts/@overflow/noauthprobe/api/service/NoAuthProbeService.ts @@ -17,6 +17,7 @@ export class NoAuthProbeService extends Service { return; } // this.dispatch(NewActions.REQUEST_SUCCESS, noAuthProbe); + // FIXME:: 부분 갱신 해봐 this.store.dispatch(asyncRequestActions.request('NoAuthProbeService', 'readAllByDomain', noauthListActions.REQUEST, JSON.stringify(noAuthProbe.domain))); }