admin: persist page view info in url parameters

- persist offset, limit, name_filter in URL parameters,
  so they are stable across page reload
- add UI element to specify items per page

This allows specifying a URL, which will show a specific view of a page of users
This commit is contained in:
Min RK
2024-03-04 15:38:56 +01:00
parent 9c3f98d427
commit cabc05f7dd
7 changed files with 182 additions and 36 deletions

View File

@@ -17,6 +17,13 @@ export const reducers = (state = initialState, action) => {
}),
});
case "USER_LIMIT":
return Object.assign({}, state, {
user_page: Object.assign({}, state.user_page, {
limit: action.value.limit,
}),
});
case "USER_NAME_FILTER":
// set offset to 0 if name filter changed,
// otherwise leave it alone