mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-10 19:43:01 +00:00
Add UI pagination, update Redux and API service lib
This commit is contained in:
@@ -5,25 +5,33 @@ export const initialState = {
|
||||
user_page: 0,
|
||||
groups_data: undefined,
|
||||
groups_page: 0,
|
||||
limit: 50,
|
||||
manage_groups_modal: false,
|
||||
limit: 3,
|
||||
};
|
||||
|
||||
export const reducers = (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case "USER_DATA":
|
||||
return Object.assign({}, state, { user_data: action.value });
|
||||
// Updates the client user model data and stores the page
|
||||
case "USER_PAGE":
|
||||
return Object.assign({}, state, {
|
||||
user_page: action.value.page,
|
||||
user_data: action.value.data,
|
||||
});
|
||||
|
||||
// Deprecated - doesn't store pagination values
|
||||
case "USER_DATA":
|
||||
return Object.assign({}, state, { user_data: action.value });
|
||||
|
||||
// Updates the client group model data and stores the page
|
||||
case "GROUPS_PAGE":
|
||||
return Object.assign({}, state, {
|
||||
groups_page: action.value.page,
|
||||
groups_data: action.value.data,
|
||||
});
|
||||
|
||||
// Deprecated - doesn't store pagination values
|
||||
case "GROUPS_DATA":
|
||||
return Object.assign({}, state, { groups_data: action.value });
|
||||
case "TOGGLE_MANAGE_GROUPS_MODAL":
|
||||
return Object.assign({}, state, {
|
||||
manage_groups_modal: !state.manage_groups_modal,
|
||||
});
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
Reference in New Issue
Block a user