diff --git a/package-lock.json b/package-lock.json index cd242aa..fb5d3bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,13 +10,13 @@ "dependencies": { "@alpinejs/collapse": "^3.13.10", "@astrojs/alpinejs": "^0.4.0", - "@astrojs/db": "^0.11.1", + "@astrojs/db": "^0.11.2", "@astrojs/sitemap": "^3.1.4", "@astrojs/tailwind": "^5.1.0", "@types/alpinejs": "^3.13.10", "@types/alpinejs__collapse": "^3.13.4", "alpinejs": "^3.13.10", - "astro": "^4.8.3", + "astro": "^4.8.4", "tailwindcss": "^3.4.3" } }, @@ -63,9 +63,9 @@ "integrity": "sha512-yrpD1WRGqsJwANaDIdtHo+YVjvIOFAjC83lu5qENIgrafwZcJgSXDuwVMXOgok4tFzpeKLsFQ6c3FoUdloLWBQ==" }, "node_modules/@astrojs/db": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/@astrojs/db/-/db-0.11.1.tgz", - "integrity": "sha512-3hFcSib3u7kBZyYlSzaJVCWBJBz8CKmh1RWndYFiAIi37aT69PGneSSyZ/8w3yy3ARiUOt4oJLvl9sRwwH7Tzg==", + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/@astrojs/db/-/db-0.11.2.tgz", + "integrity": "sha512-zPb1XntDT7efcSaFFrnPiXZe0hEpOnsLNBJ1dhjJeYJKwTw9AllAJMMeGvHpjN5O0CMgY0IY4xPhrUKA1HS00A==", "dependencies": { "@libsql/client": "^0.6.0", "async-listen": "^3.0.1", @@ -1962,9 +1962,9 @@ } }, "node_modules/astro": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/astro/-/astro-4.8.3.tgz", - "integrity": "sha512-pgIKopkmAUXY3EJHdG7zQpudtBzYAsd94A1R7jmLpH2LFZvzHEkAdHnunmSVmgikJCNqtEo3bUCHgLnCPQaN1g==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.8.4.tgz", + "integrity": "sha512-3UExI/Pq47tvdSmYJTDkoyuygIibO+293MBkwc5iUzK5Cu/U4H7P3LwTyP8Gp/wQX+2zBEUifEb4oNO1HfUn2g==", "dependencies": { "@astrojs/compiler": "^2.8.0", "@astrojs/internal-helpers": "0.4.0", diff --git a/package.json b/package.json index 467545b..fb8cca1 100644 --- a/package.json +++ b/package.json @@ -12,13 +12,13 @@ "dependencies": { "@alpinejs/collapse": "^3.13.10", "@astrojs/alpinejs": "^0.4.0", - "@astrojs/db": "^0.11.1", + "@astrojs/db": "^0.11.2", "@astrojs/sitemap": "^3.1.4", "@astrojs/tailwind": "^5.1.0", "@types/alpinejs": "^3.13.10", "@types/alpinejs__collapse": "^3.13.4", "alpinejs": "^3.13.10", - "astro": "^4.8.3", + "astro": "^4.8.4", "tailwindcss": "^3.4.3" } } diff --git a/public/favicon.svg b/public/favicon.svg deleted file mode 100644 index f157bd1..0000000 --- a/public/favicon.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - diff --git a/seed-remote-database.sh b/seed-remote-database.sh deleted file mode 100755 index b45ac8f..0000000 --- a/seed-remote-database.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -a -source .env -set +a - -npx astro db execute ./db/seed.ts --remote diff --git a/src/lib/components/subsession/relevantIds.astro b/src/lib/components/subsession/relevantIds.astro index ac07d37..6463e73 100644 --- a/src/lib/components/subsession/relevantIds.astro +++ b/src/lib/components/subsession/relevantIds.astro @@ -12,7 +12,7 @@ const relevantIds = Object.keys(subsession) (key) => `${key}: ${JSON.stringify(subsession[key as keyof Subsession])}` ); const relevantIdMap: Record> = {}; -const excludeKeys = new Set(["_id", "cust_id", "reason_out_id"]); +const excludeKeys = new Set(["_id", "cust_id", "reason_out_id", "subsession_id"]); sessions.forEach((session: Session) => { const { results } = session; results.forEach((result) => { diff --git a/src/lib/layouts/default.astro b/src/lib/layouts/default.astro index 634e814..958eafc 100644 --- a/src/lib/layouts/default.astro +++ b/src/lib/layouts/default.astro @@ -3,13 +3,60 @@ const { id, title, description } = Astro.props; const seoTitle = title ? `Stat 'n' Track: ${title}` : "Stat 'n' Track"; const seoDescription = description || "An iRacing planner and statistics analyzer"; +const primaryNavigationLinks = [ + { href: "/Stat-N-Track/", label: "Home" }, + { href: "/Stat-N-Track/user/300752/", label: "Jacob Collins" }, + { href: "/Stat-N-Track/user/815162/", label: "Jack Glenzinski" }, + { href: "/Stat-N-Track/shared-subsessions/", label: "Shared Subsessions" }, +]; +const userNavigationLinks = id + ? [ + { href: `/Stat-N-Track/user/${id}/scheduling/`, label: "Scheduling" }, + { + href: `/Stat-N-Track/user/${id}/scheduling/by-week/`, + label: "Scheduling By Week", + }, + { href: `/Stat-N-Track/user/${id}/subsessions/`, label: "All Sessions" }, + { + href: `/Stat-N-Track/user/${id}/subsessions/by-year/`, + label: "Sessions By Year", + }, + { + href: `/Stat-N-Track/user/${id}/subsessions/by-car-class/`, + label: "Sessions By Car Class", + }, + { + href: `/Stat-N-Track/user/${id}/subsessions/by-track/`, + label: "Sessions By Track", + }, + { + href: `/Stat-N-Track/user/${id}/standings/`, + label: "All Season Standings", + }, + { + href: `/Stat-N-Track/user/${id}/standings/full-participation/`, + label: "Fully Participated Season Standings", + }, + { + href: `/Stat-N-Track/user/${id}/standings/by-year/`, + label: "Season Standings By Year", + }, + { + href: `/Stat-N-Track/user/${id}/standings/by-car-class/`, + label: "Season Standings By Car Class", + }, + ] + : []; --- - + + + + @@ -25,84 +72,42 @@ const seoDescription = - Home - Jacob Collins - Jack Glenzinski - Shared Subsessions + { + primaryNavigationLinks.map(({ href, label }) => ( + + {label} + + )) + } - { id ? ( - - Scheduling - - - Scheduling By Week - - - All Sessions - - - Sessions By Year - - - Sessions By Car Class - + { + userNavigationLinks.slice(0, 5).map(({ href, label }) => ( + + + {label} + + + )) + } - - Sessions By Track - - - All Season Standings - - - Fully Participated Season Standings - - - Season Standings By Year - - - Season Standings By Car Class - - ) : <>> } + { + userNavigationLinks.slice(5, 10).map(({ href, label }) => ( + + + {label} + + + )) + } + ) : (<>>) } diff --git a/src/pages/shared-subsessions.astro b/src/pages/shared-subsessions.astro index 1376bcf..bce8d7d 100644 --- a/src/pages/shared-subsessions.astro +++ b/src/pages/shared-subsessions.astro @@ -14,7 +14,7 @@ import userIds from "$lib/utils/user-ids"; import parseLapTime from "$lib/utils/parse-lap-time"; import fieldIdToLabelMap from "$lib/utils/field-id-to-label-map"; import { bgColorByUserDisplayName } from "$lib/utils/background-color-by-user"; -import type { Track } from "$lib/types"; +import type { License as LicenseType, Track } from "$lib/types"; const sharedRaceSessions = await db .select({ subsession_id: SubsessionRaceResults.subsession_id, @@ -93,7 +93,7 @@ const results = sharedSubsessions.map((subsession) => { headToHeadWins[display_name] = [subsession_id]; } const { group_name: License } = Array.isArray(allowed_licenses) - ? allowed_licenses.slice(0, 2).pop() + ? allowed_licenses.slice(0, 2).pop() as LicenseType : { group_name: "" }; const assertTrackAsTrackType = () => track as Track; const trackInfo = assertTrackAsTrackType(); @@ -232,7 +232,10 @@ const description = "Shared subsessions for all Stat 'n' Track users"; {Object.keys(result.subsessionInfo).map((key) => ( - + - +