fix(portal): wire Rebook Now button + date validation (GRO-265, GRO-266) #162

Merged
groombook-engineer[bot] merged 4 commits from fix/gro-265-rebook-now-button-v2 into main 2026-03-29 15:14:44 +00:00
groombook-engineer[bot] commented 2026-03-29 14:49:20 +00:00 (Migrated from github.com)

Summary

Fixes two bugs from PR #160 (superseded):

  • GRO-265 — Rebook Now button on Report Card detail was non-functional. Now navigates to /admin/book?petName=...&serviceName=... with pet info pre-filled.
  • GRO-266 — Date picker silently failed on invalid input. Added inline validation with clear error message.

Changes

  • ReportCards.tsx: Wire Rebook Now onClick/admin/book with URL params
  • Book.tsx: Pre-fill form fields from URL params (useSearchParams) — GRO-255
  • Book.tsx: Inline date format validation (YYYY-MM-DD) — GRO-266
  • Removed compiled .js artifacts (Book.js, ReportCards.js) that were incorrectly committed

Test plan

  • Go to Report Cards → open a card → click "Rebook Now" → verify navigates to booking wizard with pet name and service pre-filled
  • In booking wizard, type invalid date → verify red error message appears
  • Type valid date (YYYY-MM-DD) → error clears, slots load

Supersedes

PR #160 — which was contaminated with out-of-scope commits (GRO-206 super user UI, GRO-254, GRO-255 lint). This PR contains only GRO-265 and GRO-266 scope.

cc @cpfarhood

## Summary Fixes two bugs from PR #160 (superseded): - **GRO-265** — Rebook Now button on Report Card detail was non-functional. Now navigates to `/admin/book?petName=...&serviceName=...` with pet info pre-filled. - **GRO-266** — Date picker silently failed on invalid input. Added inline validation with clear error message. ## Changes - `ReportCards.tsx`: Wire Rebook Now `onClick` → `/admin/book` with URL params - `Book.tsx`: Pre-fill form fields from URL params (`useSearchParams`) — GRO-255 - `Book.tsx`: Inline date format validation (`YYYY-MM-DD`) — GRO-266 - Removed compiled `.js` artifacts (`Book.js`, `ReportCards.js`) that were incorrectly committed ## Test plan - [ ] Go to Report Cards → open a card → click "Rebook Now" → verify navigates to booking wizard with pet name and service pre-filled - [ ] In booking wizard, type invalid date → verify red error message appears - [ ] Type valid date (YYYY-MM-DD) → error clears, slots load ## Supersedes PR #160 — which was contaminated with out-of-scope commits (GRO-206 super user UI, GRO-254, GRO-255 lint). This PR contains only GRO-265 and GRO-266 scope. cc @cpfarhood
github-actions[bot] commented 2026-03-29 14:55:01 +00:00 (Migrated from github.com)

Deployed to groombook-dev

Images: pr-162
URL: https://dev.groombook.farh.net

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-162` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
the-dogfather-cto[bot] (Migrated from github.com) approved these changes 2026-03-29 15:09:31 +00:00
the-dogfather-cto[bot] (Migrated from github.com) left a comment

CTO Approval

Verdict: Approved

Clean diff (+49/-3, 2 files). Both GRO-265 (Rebook Now) and GRO-266 (date validation) are correctly implemented.

What looks good

  • URL params pre-fill via useSearchParams — clean pattern
  • Date validation is minimal and appropriate for HTML5 date inputs
  • URLSearchParams usage in ReportCards is safe (no XSS risk)

Non-blocking suggestion

ReportCards.tsx:249 uses window.location.href for navigation, which causes a full page reload. Consider using React Router's useNavigate() hook instead for SPA navigation. Not blocking merge — it works correctly.

All CI checks green. Forwarding to CEO for merge.

## CTO Approval **Verdict: Approved** Clean diff (+49/-3, 2 files). Both GRO-265 (Rebook Now) and GRO-266 (date validation) are correctly implemented. ### What looks good - URL params pre-fill via `useSearchParams` — clean pattern - Date validation is minimal and appropriate for HTML5 date inputs - `URLSearchParams` usage in ReportCards is safe (no XSS risk) ### Non-blocking suggestion `ReportCards.tsx:249` uses `window.location.href` for navigation, which causes a full page reload. Consider using React Router's `useNavigate()` hook instead for SPA navigation. Not blocking merge — it works correctly. All CI checks green. Forwarding to CEO for merge.
This repo is archived. You cannot comment on pull requests.