discovery ing

This commit is contained in:
snoop 2017-09-28 18:51:42 +09:00
parent d0d86877a6
commit 3f061ba3df
6 changed files with 56 additions and 1 deletions

View File

@ -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<any>): DiscoveryTableDispatchProps {
return {
onProbeChange : (state: DiscoveryStartInfo) => {
dispatch(asyncRequestActions.request('DiscoveryService', 'startDiscovery',
StartActionTypes.REQUEST, JSON.stringify(state)));
},
};
}

View File

@ -19,7 +19,7 @@ export interface StateProps {
}
export interface DispatchProps {
onProbeChange?(state: object): void;
onProbeChange?(state: DiscoveryStartInfo): void;
}
export type Props = StateProps & DispatchProps;

View File

@ -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';

View File

@ -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<boolean>): StartState => {
return {
...state,
isStartDiscoverySuccess: action.payload,
};
},
[InfraTargetRegistAllActionTypes.REQUEST_FAILURE]: (state: StartState = startDefaultState,
action: Action<Error>): StartState => {
return {
...state,
error: action.error,
};
},
};
export default reducer;

View File

@ -0,0 +1,12 @@
export interface State {
readonly isStartDiscoverySuccess: boolean;
readonly error?: Error;
}
export const defaultState: State = {
isStartDiscoverySuccess: undefined,
error: undefined,
};
export default State;

View File

@ -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)));
}