Skip to content

feat: Build SearchInput and FilterPanel components for asset filterin…#859

Merged
yusuftomilola merged 1 commit into
DistinctCodes:mainfrom
bibi-fay:feat/Build-SearchInput-and-FilterPanel-components-for-asset-filtering-in-opsce-folder
Jun 1, 2026
Merged

feat: Build SearchInput and FilterPanel components for asset filterin…#859
yusuftomilola merged 1 commit into
DistinctCodes:mainfrom
bibi-fay:feat/Build-SearchInput-and-FilterPanel-components-for-asset-filtering-in-opsce-folder

Conversation

@bibi-fay
Copy link
Copy Markdown

@bibi-fay bibi-fay commented Jun 1, 2026

feat: registration form, data table, pagination, and search/filter components

Summary

Implements four outstanding frontend issues across auth and shared UI infrastructure.

Changes

frontend/opsce/auth/RegisterForm.tsx
Replaces the stub register page with a fully validated form using react-hook-form and zod. Adds a confirmPassword field, field-level error messages on blur, a password strength indicator (weak / medium / strong), a loading + disabled submit state, and a 409 error handler that surfaces "An account with this email already exists" inline on the email field. On success, redirects to /login with a toast.

frontend/opsce/components/DataTable/DataTable.tsx
Generic headless table built on @tanstack/react-table v8 with Tailwind styling. Supports column sorting (ASC / DESC / none), row selection via checkboxes with an onSelectionChange callback, a customisable empty-state slot, and a 3-row loading skeleton. Horizontally scrollable on small screens.

frontend/opsce/components/Pagination/Pagination.tsx
Pagination control that accepts page, totalPages, total, and limit props. Renders numbered page buttons with ellipsis for large ranges, disables Prev/Next at boundaries, highlights the current page, shows a "Showing X–Y of Z results" summary, and includes aria-label attributes throughout.

frontend/opsce/components/SearchInput/SearchInput.tsx + FilterPanel/FilterPanel.tsx + hooks/useFilterState.ts
SearchInput debounces the onChange callback by 300 ms. FilterPanel is a collapsible panel with dropdowns for Status, Condition, Category, Department, and Location, plus a date-range picker. An active filter count badge appears on the toggle button and a "Clear all" button resets everything. Filter state (and search) is synced to URL query params via useFilterState so selections survive page refresh. All components are exported from frontend/opsce/components/index.ts.

Testing

  • Register with a new email → redirects to /login with toast
  • Register with an existing email → inline 409 error on email field
  • Password strength bar updates as you type
  • confirmPassword mismatch shows error on blur
  • Table sorts on header click; checkboxes fire onSelectionChange
  • Empty state and loading skeleton render correctly
  • Pagination ellipsis logic correct at page boundaries
  • Filter state persists on hard refresh via URL params
  • "Clear all" resets URL and closes panel

Closes #773
Closes #772
Closes #770
Closes #771

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

@SheyeJDev is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@bibi-fay Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@yusuftomilola yusuftomilola merged commit ecbce7b into DistinctCodes:main Jun 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants