Skip to content

Conversation

@stephenwf
Copy link
Member

  • Added server filtering for admin users
  • Hooked that up to the form (quirky at the moment, with tanstack)

@stephenwf stephenwf requested a review from Heather0K January 9, 2026 12:46
@stephenwf stephenwf marked this pull request as ready for review January 12, 2026 10:02
@stephenwf stephenwf requested a review from Copilot January 12, 2026 10:03
Copy link
Contributor

Copilot AI left a 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 filteredUsers useMemo 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.

@stephenwf stephenwf merged commit 20f817b into feature/ghent-improvments-dec-25 Jan 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants