discovery ing
This commit is contained in:
parent
d0d86877a6
commit
3f061ba3df
|
@ -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)));
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ export interface StateProps {
|
|||
}
|
||||
|
||||
export interface DispatchProps {
|
||||
onProbeChange?(state: object): void;
|
||||
onProbeChange?(state: DiscoveryStartInfo): void;
|
||||
}
|
||||
|
||||
export type Props = StateProps & DispatchProps;
|
||||
|
|
10
src/ts/@overflow/discovery/redux/action/start.ts
Normal file
10
src/ts/@overflow/discovery/redux/action/start.ts
Normal 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';
|
||||
|
25
src/ts/@overflow/discovery/redux/reducer/start.ts
Normal file
25
src/ts/@overflow/discovery/redux/reducer/start.ts
Normal 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;
|
12
src/ts/@overflow/discovery/redux/state/Start.ts
Normal file
12
src/ts/@overflow/discovery/redux/state/Start.ts
Normal 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;
|
|
@ -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)));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user