From 9358ab541f307ea4e40c7575fd2166caf1e47a08 Mon Sep 17 00:00:00 2001 From: Tracewebstudio Dev Date: Thu, 30 Jul 2026 15:36:29 +0200 Subject: [PATCH] fix: verification page transitions cleanly to Pending Review after wizard submit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - VerificationStatusPage: showInlineEditors now hides for PENDING and UNDER_REVIEW (only shows when user action is needed: NOT_SUBMITTED, DOCUMENTS_REQUESTED, REVISION_REQUESTED, REJECTED). Previously the old ProfilePage form with validation errors appeared after submission. - VerificationStatusPage: wrap onVerificationStatusChange passed to ProfilePage so the local status signal also updates when the wizard calls onSubmitted. Previously the status card kept showing NOT_SUBMITTED until a page reload. - VerificationStatusPage progress tracker: inline signal reads directly in JSX instead of capturing them in local variables. In Solid.js, local const done = signal() inside a For callback is computed once and goes stale — the step circles stayed grey even after status changed to PENDING. Co-Authored-By: Claude Sonnet 4.6 --- src/components/dashboard/ProfilePage.tsx | 8 ++- src/components/dashboard/RoleWizard.tsx | 40 +++++++++-- .../dashboard/VerificationStatusPage.tsx | 67 ++++++++++--------- src/lib/api.ts | 4 +- 4 files changed, 80 insertions(+), 39 deletions(-) diff --git a/src/components/dashboard/ProfilePage.tsx b/src/components/dashboard/ProfilePage.tsx index 5119183..b7224fb 100644 --- a/src/components/dashboard/ProfilePage.tsx +++ b/src/components/dashboard/ProfilePage.tsx @@ -581,7 +581,9 @@ export default function ProfilePage(props: Props) { ? "jobseeker" : props.roleKey === "COMPANY" ? "companies" - : props.roleKey.toLowerCase().replace(/_/g, "-") + "s"; + : props.roleKey === "CATERING_SERVICES" + ? "catering-services" + : props.roleKey.toLowerCase().replace(/_/g, "-") + "s"; // Statuses during which the guided wizard (rather than free-form tabs) // should be shown: first-time setup, or the admin sent it back for fixes. @@ -1277,7 +1279,9 @@ export default function ProfilePage(props: Props) { ? 'jobseeker' : props.roleKey === 'COMPANY' ? 'companies' - : props.roleKey.toLowerCase().replace(/_/g, '-') + 's'; + : props.roleKey === 'CATERING_SERVICES' + ? 'catering-services' + : props.roleKey.toLowerCase().replace(/_/g, '-') + 's'; try { const result = await uploadDocument(rolePrefix, file, doc.key); const url = result?.url ?? result?.file_url ?? result?.path ?? String(result); diff --git a/src/components/dashboard/RoleWizard.tsx b/src/components/dashboard/RoleWizard.tsx index 58eea28..eadfce3 100644 --- a/src/components/dashboard/RoleWizard.tsx +++ b/src/components/dashboard/RoleWizard.tsx @@ -62,8 +62,11 @@ export default function RoleWizard(props: Props) { return step.fields.filter(fieldRequired).every((f) => String(portfolioForm()[f.id] ?? "").trim().length > 0); } if (step.type === "review") return true; - // basic - return step.fields.filter(fieldRequired).every((f) => String(form()[f.id] ?? "").trim().length > 0); + // basic — file fields are tracked in docUrls, not form + return step.fields.filter(fieldRequired).every((f) => { + if (f.type === "file") return Boolean(docUrls()[f.id]); + return String(form()[f.id] ?? "").trim().length > 0; + }); }; const canAdvance = createMemo(() => stepIsComplete(currentStep())); @@ -108,7 +111,7 @@ export default function RoleWizard(props: Props) { }); if (status === 200 || status === 201) { setSubmitSuccess(true); - props.onSubmitted("PENDING"); + setTimeout(() => props.onSubmitted("PENDING"), 2500); } } catch (err: any) { setSubmitMsg(err?.message || "Submission failed. Please try again."); @@ -178,7 +181,7 @@ export default function RoleWizard(props: Props) {
{(field) => ( -
+