fix(detail): add missing location map section to secondary school page
Some checks failed
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 33s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Has been cancelled
Build and Push Docker Images / Trigger Portainer Update (push) Has been cancelled
Build and Push Docker Images / Build Frontend (Next.js) (push) Has been cancelled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-29 15:06:27 +01:00
parent 15c0055687
commit 17b8873f0f
2 changed files with 25 additions and 1 deletions

View File

@@ -373,13 +373,20 @@
color: var(--accent-teal, #2d7d7d); color: var(--accent-teal, #2d7d7d);
} }
/* ── Charts ──────────────────────────────────────────── */ /* ── Charts & Map ────────────────────────────────────── */
.chartContainer { .chartContainer {
width: 100%; width: 100%;
height: 280px; height: 280px;
position: relative; position: relative;
} }
.mapContainer {
width: 100%;
height: 300px;
border-radius: 6px;
overflow: hidden;
}
/* ── History table ───────────────────────────────────── */ /* ── History table ───────────────────────────────────── */
.tableWrapper { .tableWrapper {
overflow-x: auto; overflow-x: auto;

View File

@@ -11,6 +11,7 @@ import { useRouter } from 'next/navigation';
import { useComparison } from '@/hooks/useComparison'; import { useComparison } from '@/hooks/useComparison';
import { PerformanceChart } from './PerformanceChart'; import { PerformanceChart } from './PerformanceChart';
import { MetricTooltip } from './MetricTooltip'; import { MetricTooltip } from './MetricTooltip';
import { SchoolMap } from './SchoolMap';
import type { import type {
School, SchoolResult, AbsenceData, School, SchoolResult, AbsenceData,
OfstedInspection, OfstedParentView, SchoolCensus, OfstedInspection, OfstedParentView, SchoolCensus,
@@ -91,6 +92,7 @@ export function SecondarySchoolDetailView({
const hasFinance = finance != null && finance.per_pupil_spend != null; const hasFinance = finance != null && finance.per_pupil_spend != null;
const hasParents = parentView != null && parentView.total_responses != null && parentView.total_responses > 0; const hasParents = parentView != null && parentView.total_responses != null && parentView.total_responses > 0;
const hasDeprivation = deprivation != null && deprivation.idaci_decile != null; const hasDeprivation = deprivation != null && deprivation.idaci_decile != null;
const hasLocation = schoolInfo.latitude != null && schoolInfo.longitude != null;
const hasWellbeing = (latestResults?.sen_support_pct != null || latestResults?.sen_ehcp_pct != null) || hasDeprivation; const hasWellbeing = (latestResults?.sen_support_pct != null || latestResults?.sen_ehcp_pct != null) || hasDeprivation;
const p8Suspended = latestResults != null && latestResults.year >= 202425; const p8Suspended = latestResults != null && latestResults.year >= 202425;
const hasResults = latestResults?.attainment_8_score != null; const hasResults = latestResults?.attainment_8_score != null;
@@ -118,6 +120,7 @@ export function SecondarySchoolDetailView({
if (hasResults) navItems.push({ id: 'gcse', label: 'GCSEs' }); if (hasResults) navItems.push({ id: 'gcse', label: 'GCSEs' });
if (admissions) navItems.push({ id: 'admissions', label: 'Admissions' }); if (admissions) navItems.push({ id: 'admissions', label: 'Admissions' });
if (hasWellbeing) navItems.push({ id: 'wellbeing', label: 'Wellbeing' }); if (hasWellbeing) navItems.push({ id: 'wellbeing', label: 'Wellbeing' });
if (hasLocation) navItems.push({ id: 'location', label: 'Location' });
if (hasFinance) navItems.push({ id: 'finances', label: 'Finances' }); if (hasFinance) navItems.push({ id: 'finances', label: 'Finances' });
if (yearlyData.length > 1) navItems.push({ id: 'history', label: 'History' }); if (yearlyData.length > 1) navItems.push({ id: 'history', label: 'History' });
@@ -618,6 +621,20 @@ export function SecondarySchoolDetailView({
</section> </section>
)} )}
{/* ── Location ───────────────────────────────────── */}
{hasLocation && (
<section id="location" className={styles.card}>
<h2 className={styles.sectionTitle}>Location</h2>
<div className={styles.mapContainer}>
<SchoolMap
schools={[schoolInfo]}
center={[schoolInfo.latitude!, schoolInfo.longitude!]}
zoom={15}
/>
</div>
</section>
)}
{/* ── Finances ───────────────────────────────────── */} {/* ── Finances ───────────────────────────────────── */}
{hasFinance && finance && ( {hasFinance && finance && (
<section id="finances" className={styles.card}> <section id="finances" className={styles.card}>