fix(years): format academic years as 2016/17 across all views, remove legacy frontend and data
Some checks failed
Build and Push Docker Images / Build Backend (FastAPI) (push) Failing after 12s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 53s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 12s
Build and Push Docker Images / Trigger Portainer Update (push) Has been skipped
Some checks failed
Build and Push Docker Images / Build Backend (FastAPI) (push) Failing after 12s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 53s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 12s
Build and Push Docker Images / Trigger Portainer Update (push) Has been skipped
Apply formatAcademicYear to all year displays in ComparisonChart, ComparisonView, PerformanceChart, and RankingsView. Remove old vanilla JS frontend and CSV data directory — both superseded by the Next.js app and Meltano pipeline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
||||
ChartOptions,
|
||||
} from 'chart.js';
|
||||
import type { ComparisonData } from '@/lib/types';
|
||||
import { CHART_COLORS } from '@/lib/utils';
|
||||
import { CHART_COLORS, formatAcademicYear } from '@/lib/utils';
|
||||
|
||||
// Register Chart.js components
|
||||
ChartJS.register(
|
||||
@@ -68,7 +68,7 @@ export function ComparisonChart({ comparisonData, metric, metricLabel }: Compari
|
||||
});
|
||||
|
||||
const chartData = {
|
||||
labels: years.map(String),
|
||||
labels: years.map(formatAcademicYear),
|
||||
datasets,
|
||||
};
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { SchoolSearchModal } from './SchoolSearchModal';
|
||||
import { EmptyState } from './EmptyState';
|
||||
import { LoadingSkeleton } from './LoadingSkeleton';
|
||||
import type { ComparisonData, MetricDefinition, School } from '@/lib/types';
|
||||
import { formatPercentage, formatProgress, CHART_COLORS, schoolUrl } from '@/lib/utils';
|
||||
import { formatPercentage, formatProgress, formatAcademicYear, CHART_COLORS, schoolUrl } from '@/lib/utils';
|
||||
import { fetchComparison } from '@/lib/api';
|
||||
import styles from './ComparisonView.module.css';
|
||||
|
||||
@@ -392,7 +392,7 @@ export function ComparisonView({
|
||||
<tbody>
|
||||
{years.map((year) => (
|
||||
<tr key={year}>
|
||||
<td className={styles.yearCell}>{year}</td>
|
||||
<td className={styles.yearCell}>{formatAcademicYear(year)}</td>
|
||||
{activeSchools.map((school) => {
|
||||
const schoolData = activeComparisonData[school.urn];
|
||||
if (!schoolData) return <td key={school.urn}>-</td>;
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
ChartOptions,
|
||||
} from 'chart.js';
|
||||
import type { SchoolResult } from '@/lib/types';
|
||||
import { formatAcademicYear } from '@/lib/utils';
|
||||
import styles from './PerformanceChart.module.css';
|
||||
|
||||
// Register Chart.js components
|
||||
@@ -40,11 +41,7 @@ interface PerformanceChartProps {
|
||||
export function PerformanceChart({ data, schoolName, isSecondary = false }: PerformanceChartProps) {
|
||||
// Sort data by year
|
||||
const sortedData = [...data].sort((a, b) => a.year - b.year);
|
||||
const formatYear = (y: number) => {
|
||||
const s = y.toString();
|
||||
return s.length === 6 ? `${s.slice(0, 4)}/${s.slice(4)}` : s;
|
||||
};
|
||||
const years = sortedData.map(d => formatYear(d.year));
|
||||
const years = sortedData.map(d => formatAcademicYear(d.year));
|
||||
|
||||
// Prepare datasets — phase-aware
|
||||
const datasets = isSecondary ? [
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { useRouter, usePathname, useSearchParams } from 'next/navigation';
|
||||
import { useComparison } from '@/hooks/useComparison';
|
||||
import type { RankingEntry, Filters, MetricDefinition } from '@/lib/types';
|
||||
import { formatPercentage, formatProgress, schoolUrl } from '@/lib/utils';
|
||||
import { formatPercentage, formatProgress, formatAcademicYear, schoolUrl } from '@/lib/utils';
|
||||
import { EmptyState } from './EmptyState';
|
||||
import styles from './RankingsView.module.css';
|
||||
|
||||
@@ -199,11 +199,11 @@ export function RankingsView({
|
||||
className={styles.filterSelect}
|
||||
>
|
||||
<option value="">
|
||||
{filters.years.length > 0 ? `${Math.max(...filters.years)} (Latest)` : 'Latest'}
|
||||
{filters.years.length > 0 ? `${formatAcademicYear(Math.max(...filters.years))} (Latest)` : 'Latest'}
|
||||
</option>
|
||||
{filters.years.map((year) => (
|
||||
<option key={year} value={year}>
|
||||
{year}
|
||||
{formatAcademicYear(year)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user