Show 'Intake Already Completed' screen with Revise button on revisit
When the user revisits a completed intake (intake_data_validated=true), shows a success screen with Go to Portal and Revise buttons instead of the blank form. Revise adds ?revise=1 to bypass the check. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
314a711e95
commit
e1b95a20fb
1 changed files with 27 additions and 0 deletions
|
|
@ -366,6 +366,33 @@ const STEP_LABELS: Record<string, string> = {
|
|||
if (order.intake_data) {
|
||||
state.intake_data = { ...state.intake_data, ...order.intake_data };
|
||||
}
|
||||
|
||||
// If intake was already completed and user isn't revising, show "completed" screen
|
||||
if (order.intake_data_validated && !urlParams.has("revise")) {
|
||||
const body = document.querySelector(".pw-wizard-body") as HTMLElement;
|
||||
const footer = document.querySelector(".pw-wizard-nav") as HTMLElement;
|
||||
body.innerHTML = `
|
||||
<div style="text-align:center;padding:2.5rem 1rem;">
|
||||
<div style="width:64px;height:64px;margin:0 auto 1rem;background:#dcfce7;border-radius:50%;display:flex;align-items:center;justify-content:center;">
|
||||
<svg style="width:32px;height:32px;color:#16a34a" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/></svg>
|
||||
</div>
|
||||
<h2 style="font-size:1.25rem;font-weight:700;color:#111827;margin-bottom:0.5rem;">Intake Already Completed</h2>
|
||||
<p style="color:#6b7280;font-size:0.92rem;margin-bottom:1.5rem;">You've already submitted your information for this order. We're processing your filing now.</p>
|
||||
<div style="display:flex;gap:0.75rem;justify-content:center;flex-wrap:wrap;">
|
||||
<a href="https://portal.performancewest.net" style="display:inline-block;background:#1a2744;color:#fff;padding:10px 24px;border-radius:8px;text-decoration:none;font-weight:600;font-size:0.9rem;">Go to Portal</a>
|
||||
<button type="button" id="pw-revise-btn" style="display:inline-block;background:#fff;color:#1a2744;padding:10px 24px;border-radius:8px;font-weight:600;font-size:0.9rem;border:2px solid #e5e7eb;cursor:pointer;">Revise My Information</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
if (footer) footer.hidden = true;
|
||||
document.getElementById("pw-revise-btn")?.addEventListener("click", () => {
|
||||
sessionStorage.removeItem(\`pw-intake-\${slug}\`);
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.set("revise", "1");
|
||||
window.location.href = url.toString();
|
||||
});
|
||||
return; // Don't render steps
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue