fix(school): show Nursery only for nursery classes, and say Girls' school
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m13s
PR Checks / Backend Smoke (pull_request) Successful in 10s
PR Checks / Build Backend (no push) (pull_request) Successful in 18s
PR Checks / Build Frontend (no push) (pull_request) Successful in 1m19s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 11s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 16s
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m13s
PR Checks / Backend Smoke (pull_request) Successful in 10s
PR Checks / Build Backend (no push) (pull_request) Successful in 18s
PR Checks / Build Frontend (no push) (pull_request) Successful in 1m19s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 11s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 16s
GIAS NurseryProvision is text ("Has Nursery Classes", "No Nursery
Classes", "Not applicable"), but the header and the place table tested it
for truthiness. Every school with a value got a Nursery chip or a "Yes",
including secondaries aged 11-18. hasNurseryClasses() matches the one
value that means a nursery, and the type now says the field is a string.
The single-sex chip appended 's to the plural GIAS gender, giving
"Girls's school". singleSexLabel() gives "Girls' school" / "Boys' school".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dd5b48e612
commit
dea435a906
8 files changed
+158
-14
No files matched your search
@@ -99,6 +99,25 @@ export function formatAgeRange(ageRange: string | null | undefined): string {
|
||||
return /^\d+–\d+$/.test(span) ? `Ages ${span}` : span;
|
||||
}
|
||||
|
||||
/**
|
||||
* GIAS NurseryProvision is text: "Has Nursery Classes", "No Nursery Classes"
|
||||
* or "Not applicable". Only the first means a nursery, so never test the raw
|
||||
* value for truthiness.
|
||||
*/
|
||||
export function hasNurseryClasses(value: string | null | undefined): boolean {
|
||||
return value?.trim().toLowerCase() === 'has nursery classes';
|
||||
}
|
||||
|
||||
/**
|
||||
* "Girls' school" / "Boys' school" for a single-sex school, null otherwise.
|
||||
* GIAS genders are plural, so the possessive is a bare apostrophe.
|
||||
*/
|
||||
export function singleSexLabel(gender: string | null | undefined): string | null {
|
||||
const g = gender?.trim();
|
||||
if (g === 'Girls' || g === 'Boys') return `${g}' school`;
|
||||
return null;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Number Formatting
|
||||
// ============================================================================
|
||||
|
||||
Reference in new issue
Block a user