feat(ui): add phase indicators to school list rows
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 12s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 49s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 11s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s

Add coloured left-border and phase label pill to visually differentiate
school phases (Primary, Secondary, All-through, Post-16, Nursery) in
search result lists. Colours are accessible (WCAG AA) and don't clash
with existing Ofsted/trend semantic colours.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Tudor Sitaru
2026-04-01 15:47:51 +01:00
parent cacbeeb068
commit 4db36b9099
6 changed files with 92 additions and 6 deletions

View File

@@ -364,6 +364,25 @@ export function parseQueryString(search: string): Record<string, string> {
* Handles both 4-digit start years (2023 → "2023/24") and
* 6-digit EES codes (202526 → "2025/26").
*/
export function getPhaseStyle(phase?: string | null): { key: string; label: string } {
switch (phase?.toLowerCase()) {
case 'primary':
case 'middle deemed primary':
return { key: 'Primary', label: 'Primary' };
case 'secondary':
case 'middle deemed secondary':
return { key: 'Secondary', label: 'Secondary' };
case 'all-through':
return { key: 'AllThrough', label: 'All-through' };
case '16 plus':
return { key: 'Post16', label: 'Post-16' };
case 'nursery':
return { key: 'Nursery', label: 'Nursery' };
default:
return { key: '', label: '' };
}
}
export function formatAcademicYear(year: number): string {
const s = year.toString();
if (s.length === 6) {