-
Notifications
You must be signed in to change notification settings - Fork 14
MAD-995 server filtering #859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAD-995 server filtering #859
Conversation
stephenwf
commented
Jan 9, 2026
- Added server filtering for admin users
- Hooked that up to the form (quirky at the moment, with tanstack)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements server-side filtering and sorting for the user list in the admin interface, replacing client-side filtering with backend query parameters. It also adds server-side filtering for manifests based on their published status and user admin permissions.
Changes:
- Added server-side filtering logic for users with support for role, status, and automated filters, plus sortable columns
- Implemented manifest visibility filtering to restrict unpublished manifests to admin users only
- Created reusable UI components (
SortableTableHeader,SortIcon) and hooks (useLocationState) for table sorting with URL state management
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| services/madoc-ts/src/routes/site/site-manifest.ts | Added checks to filter unpublished manifests from non-admin users |
| services/madoc-ts/src/routes/iiif/manifests/get-manifest.ts | Added admin check to restrict access to unpublished manifests |
| services/madoc-ts/src/routes/global/list-all-users.ts | Added query parameter parsing for filtering and sorting users |
| services/madoc-ts/src/repository/site-user-repository.ts | Implemented SQL query building with filters and sorting for user list |
| services/madoc-ts/src/frontend/shared/layout/SortableTableHeader.tsx | New component for sortable table headers with icon indicator |
| services/madoc-ts/src/frontend/shared/layout/SimpleTable.tsx | Added styling for interactive and pinned table headers |
| services/madoc-ts/src/frontend/shared/icons/SortIcon.tsx | New SVG icon component for sort direction indicators |
| services/madoc-ts/src/frontend/shared/hooks/use-location-state.ts | New hook for managing URL query parameters and sorting state |
| services/madoc-ts/src/frontend/admin/pages/global/list-users.tsx | Updated to use server-side filtering/sorting instead of client-side |
| services/madoc-ts/src/extensions/site-manager/extension.ts | Updated API client to support filtering and sorting parameters |
Comments suppressed due to low confidence (1)
services/madoc-ts/src/frontend/admin/pages/global/list-users.tsx:108
- The client-side filtering in the
filteredUsersuseMemo duplicates the server-side filtering. Since filtering is now handled server-side (as evidenced by the query parameters being passed to the API), this client-side filtering is redundant and could cause confusion if the filters don't match. Consider removing the client-side filtering and using the data directly from the server.
const filteredUsers = useMemo(() => {
if (!data?.users) return [];
return data.users.filter(user => {
if (roleFilter && user.role !== roleFilter) return false;
return !(activeFilter && (user.is_active ? 'active' : 'inactive') !== activeFilter);
});
}, [data?.users, roleFilter, activeFilter]);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.