Skip to content

feat:Build forgot password page — email submission form with success …#1016

Closed
bibi-fay wants to merge 1 commit into
DistinctCodes:mainfrom
bibi-fay:feat/Build-forgot-password-page—email-submission-form-with-success-state

Hidden character warning

The head ref may contain hidden characters: "feat/Build-forgot-password-page\u2014email-submission-form-with-success-state"
Closed

feat:Build forgot password page — email submission form with success …#1016
bibi-fay wants to merge 1 commit into
DistinctCodes:mainfrom
bibi-fay:feat/Build-forgot-password-page—email-submission-form-with-success-state

Conversation

@bibi-fay

Copy link
Copy Markdown

PR 1 — feat(assets): add Change Status modal with transition guard
What

Wires up the previously inert "Update Status" button on the asset detail page. Introduces a ChangeStatusModal that presents only the statuses an asset can legally transition to, calls useUpdateAssetStatus, and feeds back loading and error states inline.
Why

Users had no way to change an asset's status from the UI. The mutation hook existed but was never called.
Changes

frontend/app/(dashboard)/assets/[id]/page.tsx

Added STATUS_TRANSITIONS map defining allowed moves per status (RETIRED is terminal — button is disabled)
Added useUpdateAssetStatus to the hook import list
New ChangeStatusModal component: dropdown filtered to valid next-states, inline API error display, loading state on Confirm button
showChangeStatus state wired to the "Update Status" button's onClick
Modal renders at the bottom of the page alongside the other modals

Testing

Open any active asset → click "Update Status" → modal appears with valid transitions (INACTIVE, MAINTENANCE, RETIRED)
Select a status → click Confirm → button shows spinner → asset status updates, modal closes
Open a RETIRED asset → "Update Status" button is disabled
Simulate a 500 from the API → inline error message appears inside the modal

PR 2 — feat(auth): add Forgot Password page
What

Adds frontend/app/(auth)/forgot-password/page.tsx — a single-field form that posts { email } to POST /auth/forgot-password and, on any non-5xx response, replaces itself with a success message.
Why

Users had no recovery path when they forgot their password. Unblocks BE-12 integration — the route and UI are ready to go live once the backend endpoint ships.
Changes

frontend/app/(auth)/forgot-password/page.tsx (new file)

Zod-validated email field
Always shows success state on 2xx/4xx (security: doesn't reveal whether an account exists)
Shows inline error only on 5xx / network failure
"Back to Login" link in both the form and success states
Sits inside the existing (auth) layout — no layout changes needed

frontend/app/(auth)/login/page.tsx — no changes needed (link was already present)

Testing

Navigate to /forgot-password → form renders inside the auth card
Submit with an invalid email → Zod error shown inline, no request fired
Submit a valid email → button shows spinner → success message replaces the form
Simulate a 500 → inline network error shown, form stays editable
Click "Back to Login" from either state → navigates to /login

Closes #944
Closes #991
Closes #942
Closes #940

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@favour-GL 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

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@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

@bibi-fay bibi-fay closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment