diff --git a/site/src/components/intake/steps/BDCDataStep.astro b/site/src/components/intake/steps/BDCDataStep.astro index ad8f55b..ca366c1 100644 --- a/site/src/components/intake/steps/BDCDataStep.astro +++ b/site/src/components/intake/steps/BDCDataStep.astro @@ -46,7 +46,13 @@ const mode = service_slug === "bdc-voice" ? "voice" : service_slug === "bdc-broa diff --git a/site/src/components/intake/steps/ClassificationWizard.astro b/site/src/components/intake/steps/ClassificationWizard.astro index 39742c3..d31602d 100644 --- a/site/src/components/intake/steps/ClassificationWizard.astro +++ b/site/src/components/intake/steps/ClassificationWizard.astro @@ -214,8 +214,11 @@ return { primary, categories: [...new Set(cats)], reason }; } - // Render Q&A - const container = document.getElementById("cw-questions")!; + // Render Q&A. This script is bundled into every order page, so the container + // is absent on pages without the classification step — bail rather than throw + // on the top-level renderQuestion(0) call below (container.appendChild → null). + const container = document.getElementById("cw-questions"); + if (container) { const answers: Record = {}; let questionIndex = 0; @@ -306,4 +309,5 @@ // Also start immediately if this is the current step renderQuestion(0); + } // end classification step guard diff --git a/site/src/components/intake/steps/DOTIntakeStep.astro b/site/src/components/intake/steps/DOTIntakeStep.astro index c9641fd..e7161df 100644 --- a/site/src/components/intake/steps/DOTIntakeStep.astro +++ b/site/src/components/intake/steps/DOTIntakeStep.astro @@ -465,6 +465,7 @@ if (dfwpRow) dfwpRow.hidden = false; if (dfwpStateEl && d.state_dfwp) dfwpStateEl.value = d.state_dfwp; } + }); // Save all data on step-next window.addEventListener("pw:step-next", (evt) => { diff --git a/site/src/components/intake/steps/EarthStationStep.astro b/site/src/components/intake/steps/EarthStationStep.astro index 2dd707f..d87ed5d 100644 --- a/site/src/components/intake/steps/EarthStationStep.astro +++ b/site/src/components/intake/steps/EarthStationStep.astro @@ -83,7 +83,8 @@ return row; } - document.getElementById("pw-add-circuit")!.addEventListener("click", () => { + const addCircuitBtn = document.getElementById("pw-add-circuit"); + if (addCircuitBtn) addCircuitBtn.addEventListener("click", () => { circuitsDiv.appendChild(newCircuitRow()); }); diff --git a/site/src/components/intake/steps/ForeignQualStep.astro b/site/src/components/intake/steps/ForeignQualStep.astro index 551ce4a..0323f05 100644 --- a/site/src/components/intake/steps/ForeignQualStep.astro +++ b/site/src/components/intake/steps/ForeignQualStep.astro @@ -90,7 +90,13 @@ diff --git a/site/src/components/intake/steps/ReviewStep.astro b/site/src/components/intake/steps/ReviewStep.astro index 25ad70d..8832fcb 100644 --- a/site/src/components/intake/steps/ReviewStep.astro +++ b/site/src/components/intake/steps/ReviewStep.astro @@ -49,7 +49,15 @@ const vertical = slugVertical(service_slug);