Skip to content

Commit 25aa4bf

Browse files
cjcenizaljen-huang
authored andcommitted
Fix table manipulation. (#22728)
1 parent 786bb2b commit 25aa4bf

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed

x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,16 @@ const COLUMNS = [{
110110
export class JobTableUi extends Component {
111111
static propTypes = {
112112
jobs: PropTypes.array,
113+
pager: PropTypes.object.isRequired,
114+
filter: PropTypes.string.isRequired,
115+
sortField: PropTypes.string.isRequired,
116+
isSortAscending: PropTypes.bool.isRequired,
113117
closeDetailPanel: PropTypes.func.isRequired,
118+
filterChanged: PropTypes.func.isRequired,
119+
pageChanged: PropTypes.func.isRequired,
120+
pageSizeChanged: PropTypes.func.isRequired,
121+
sortChanged: PropTypes.func.isRequired,
122+
dispatch: PropTypes.func.isRequired,
114123
}
115124

116125
static defaultProps = {

x-pack/plugins/rollup/public/crud_app/store/action_types.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ export const CLEAR_CREATE_JOB_ERRORS = 'CLEAR_CREATE_JOB_ERRORS';
2323
export const DELETE_JOBS_SUCCESS = 'DELETE_JOBS_SUCCESS';
2424

2525
// Table state
26-
export const APPLY_FILTERS = 'APPLY_FILTERS';
27-
export const FILTERS_APPLIED = 'FILTERS_APPLIED';
2826
export const FILTER_CHANGED = 'FILTER_CHANGED';
2927
export const PAGE_CHANGED = 'PAGE_CHANGED';
3028
export const PAGE_SIZE_CHANGED = 'PAGE_SIZE_CHANGED';

x-pack/plugins/rollup/public/crud_app/store/actions/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ export {
2828
} from './detail_panel';
2929

3030
export {
31-
applyFilters,
32-
filtersApplied,
3331
filterChanged,
3432
pageChanged,
3533
pageSizeChanged,

x-pack/plugins/rollup/public/crud_app/store/actions/table_state.js

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,36 @@
55
*/
66

77
import {
8-
APPLY_FILTERS,
9-
FILTERS_APPLIED,
108
FILTER_CHANGED,
119
PAGE_CHANGED,
1210
PAGE_SIZE_CHANGED,
1311
SORT_CHANGED,
1412
} from '../action_types';
1513

16-
export const applyFilters = () => (dispatch) => {
17-
dispatch({
18-
type: APPLY_FILTERS,
19-
});
20-
};
21-
22-
export const filtersApplied = () => (dispatch) => {
23-
dispatch({
24-
type: FILTERS_APPLIED,
25-
});
26-
};
27-
28-
export const filterChanged = () => (dispatch) => {
14+
export const filterChanged = ({ filter }) => (dispatch) => {
2915
dispatch({
3016
type: FILTER_CHANGED,
17+
payload: { filter },
3118
});
3219
};
3320

34-
export const pageChanged = () => (dispatch) => {
21+
export const pageChanged = ({ pageNumber }) => (dispatch) => {
3522
dispatch({
3623
type: PAGE_CHANGED,
24+
payload: { pageNumber },
3725
});
3826
};
3927

40-
export const pageSizeChanged = () => (dispatch) => {
28+
export const pageSizeChanged = ({ pageSize }) => (dispatch) => {
4129
dispatch({
4230
type: PAGE_SIZE_CHANGED,
31+
payload: { pageSize },
4332
});
4433
};
4534

46-
export const sortChanged = () => (dispatch) => {
35+
export const sortChanged = ({ sortField, isSortAscending }) => (dispatch) => {
4736
dispatch({
4837
type: SORT_CHANGED,
38+
payload: { sortField, isSortAscending },
4939
});
5040
};

0 commit comments

Comments
 (0)