diff --git a/front_end/src/app/(main)/services/components/templates/services_page_template.tsx b/front_end/src/app/(main)/services/components/templates/services_page_template.tsx index 4dc9e99cce..8f5b1de4ae 100644 --- a/front_end/src/app/(main)/services/components/templates/services_page_template.tsx +++ b/front_end/src/app/(main)/services/components/templates/services_page_template.tsx @@ -84,7 +84,7 @@ const ServicesPageTemplate: React.FC = async ({ }); const curated = all.filter(({ id, slug }) => mainPageTournamentsList.some( - ({ id: want }) => want === slug || want === String(id) + ({ id: want }) => String(want) === slug || want === id ) ); tournamentsData = sortServiceTournaments(curated); diff --git a/front_end/src/app/(main)/services/helpers.ts b/front_end/src/app/(main)/services/helpers.ts index 450c901070..e74506ceae 100644 --- a/front_end/src/app/(main)/services/helpers.ts +++ b/front_end/src/app/(main)/services/helpers.ts @@ -6,10 +6,10 @@ export function sortServiceTournaments(tournaments: TournamentPreview[]) { const { tournamentsOrder } = ServiceConfig; return tournaments.sort( (a, b) => - (tournamentsOrder.find((t) => t.id === String(a.slug ?? a.id))?.order ?? - 0) - - (tournamentsOrder.find((t) => t.id === String(b.slug ?? b.id))?.order ?? - 0) + (tournamentsOrder.find((t) => t.id === a.id || String(t.id) === a.slug) + ?.order ?? 0) - + (tournamentsOrder.find((t) => t.id === b.id || String(t.id) === b.slug) + ?.order ?? 0) ); } diff --git a/front_end/src/app/(main)/services/page.tsx b/front_end/src/app/(main)/services/page.tsx index eba02cd455..bb25e42949 100644 --- a/front_end/src/app/(main)/services/page.tsx +++ b/front_end/src/app/(main)/services/page.tsx @@ -25,7 +25,7 @@ export default async function ServicesPage() { ]); const mainPageTournaments = tournaments.filter((tournament) => mainPageTournamentsList.find( - ({ id }) => id === tournament.slug || id === String(tournament.id) + ({ id }) => String(id) === tournament.slug || id === tournament.id ) ); const sortedTournaments = sortServiceTournaments(mainPageTournaments); diff --git a/front_end/src/app/(main)/services/serviceConfig.ts b/front_end/src/app/(main)/services/serviceConfig.ts index 5fa988e44d..af31d22459 100644 --- a/front_end/src/app/(main)/services/serviceConfig.ts +++ b/front_end/src/app/(main)/services/serviceConfig.ts @@ -14,25 +14,41 @@ const ServiceConfig = { "placeholder-for-last-circle", ], mainPageTournamentsList: [ - { id: "bridgewater" }, - { id: "keep-virginia-safe-ii" }, - { id: "fiscal" }, - { id: "climate" }, + // bridgewater + { id: 32567 }, + // keep-virginia-safe-ii + { id: 2100 }, + // fiscal + { id: 32725 }, + // climate + { id: 1756 }, ], // Use order to sort tournaments in the carousel/list tournamentsOrder: [ - { id: "bridgewater", order: 1 }, - { id: "keep-virginia-safe-ii", order: 2 }, - { id: "respiratory-outlook-24-25", order: 3 }, - { id: "fiscal", order: 4 }, - { id: "climate", order: 5 }, - { id: "biosecurity-tournament", order: 6 }, - { id: "market-pulse", order: 7 }, - { id: "flusight-challenge23-24", order: 8 }, - { id: "global-pulse", order: 9 }, - { id: "aibq2", order: 10 }, - { id: "metaculus-cup", order: 11 }, - { id: "ukraine-conflict", order: 12 }, + // bridgewater + { id: 32567, order: 1 }, + // keep-virginia-safe-ii + { id: 2100, order: 2 }, + // respiratory-outlook-24-25 + { id: 3411, order: 3 }, + // fiscal + { id: 32725, order: 4 }, + // climate + { id: 1756, order: 5 }, + // biosecurity-tournament + { id: 1703, order: 6 }, + // market-pulse + { id: 32917, order: 7 }, + // flusight-challenge23-24 + { id: 2569, order: 8 }, + // global-pulse + { id: 2722, order: 9 }, + // aibq2 + { id: 32721, order: 10 }, + // metaculus-cup + { id: 32828, order: 11 }, + // ukraine-conflict + { id: 1426, order: 12 }, ], spotlightTournamentId: "bridgewater", partnersLogos: [