This commit is contained in:
insanity 2017-08-23 19:41:26 +09:00
parent b2bf464700
commit 08a4bf2f6b
3 changed files with 8 additions and 6 deletions

View File

@ -3,10 +3,11 @@ import { Table, Button, Header, Container, Menu, Icon } from 'semantic-ui-react'
import { ListContainer } from '@overflow/commons/react/component/ListContainer'; import { ListContainer } from '@overflow/commons/react/component/ListContainer';
import Probe from '@overflow/probe/api/model/Probe'; import Probe from '@overflow/probe/api/model/Probe';
import History from '@overflow/history/api/model/History'; import History from '@overflow/history/api/model/History';
import Page from '@overflow/commons/api/model/Page';
export interface StateProps { export interface StateProps {
probeId: string; probeId: string;
histories: any; histories: Page;
} }
export interface DispatchProps { export interface DispatchProps {
@ -66,7 +67,7 @@ export class HistoryList extends React.Component<Props, State> {
this.props.onReadAllByProbe(probe, String(p), String(this.countPerPage)); this.props.onReadAllByProbe(probe, String(p), String(this.countPerPage));
} }
public renderPagination = (pageObj: any): (JSX.Element | JSX.Element[]) => { public renderPagination = (pageObj: Page): (JSX.Element | JSX.Element[]) => {
if (pageObj === undefined) { if (pageObj === undefined) {
return null; return null;
} }

View File

@ -2,17 +2,17 @@ import Action from '@overflow/commons/redux/Action';
import { ReducersMapObject } from 'redux'; import { ReducersMapObject } from 'redux';
import Probe from '@overflow/probe/api/model/Probe'; import Probe from '@overflow/probe/api/model/Probe';
import History from '../../api/model/History'; import History from '../../api/model/History';
import Page from '@overflow/commons/api/model/Page';
import * as ReadAllByProbeActionTypes from '../action/read_all_by_probe'; import * as ReadAllByProbeActionTypes from '../action/read_all_by_probe';
import ReadAllByProbeState, { defaultState as ReadAllByProbeDefaultState } from '../state/ReadAllByProbe'; import ReadAllByProbeState, { defaultState as ReadAllByProbeDefaultState } from '../state/ReadAllByProbe';
const reducer: ReducersMapObject = { const reducer: ReducersMapObject = {
[ReadAllByProbeActionTypes.REQUEST_SUCCESS]: [ReadAllByProbeActionTypes.REQUEST_SUCCESS]:
(state: ReadAllByProbeState = ReadAllByProbeDefaultState, action: Action<object>): (state: ReadAllByProbeState = ReadAllByProbeDefaultState, action: Action<Page>):
ReadAllByProbeState => { ReadAllByProbeState => {
return { return {
...state, ...state,
historyPage: action.payload, historyPage: <Page>action.payload,
}; };
}, },
[ReadAllByProbeActionTypes.REQUEST_FAILURE]: [ReadAllByProbeActionTypes.REQUEST_FAILURE]:

View File

@ -1,7 +1,8 @@
import History from '../../api/model/History'; import History from '../../api/model/History';
import Page from '@overflow/commons/api/model/Page';
export interface State { export interface State {
readonly historyPage?: object; readonly historyPage?: Page;
readonly error?: Error; readonly error?: Error;
} }