diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 93e1552a..52b4ed74 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -6,13 +6,19 @@ FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} # Install MongoDB command line tools if on buster and x86_64 (arm64 not supported) ARG MONGO_TOOLS_VERSION=5.0 RUN . /etc/os-release \ - && if [ "${VERSION_CODENAME}" = "buster" ] && [ "$(dpkg --print-architecture)" = "amd64" ]; then \ - curl -sSL "https://www.mongodb.org/static/pgp/server-${MONGO_TOOLS_VERSION}.asc" | gpg --dearmor > /usr/share/keyrings/mongodb-archive-keyring.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/${MONGO_TOOLS_VERSION} main" | tee /etc/apt/sources.list.d/mongodb-org-${MONGO_TOOLS_VERSION}.list \ - && apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get install -y mongodb-database-tools mongodb-mongosh \ - && apt-get clean -y && rm -rf /var/lib/apt/lists/*; \ - fi + && if [ "${VERSION_CODENAME}" = "bullseye" ] && [ "$(dpkg --print-architecture)" = "amd64" ]; then \ + curl -sSL "https://www.mongodb.org/static/pgp/server-${MONGO_TOOLS_VERSION}.asc" | gpg --dearmor > /usr/share/keyrings/mongodb-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/${MONGO_TOOLS_VERSION} main" | tee /etc/apt/sources.list.d/mongodb-org-${MONGO_TOOLS_VERSION}.list \ + && apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get install -y mongodb-database-tools mongodb-mongosh \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/*; \ + elif [ "${VERSION_CODENAME}" = "buster" ] && [ "$(dpkg --print-architecture)" = "amd64" ]; then \ + curl -sSL "https://www.mongodb.org/static/pgp/server-${MONGO_TOOLS_VERSION}.asc" | gpg --dearmor > /usr/share/keyrings/mongodb-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/${MONGO_TOOLS_VERSION} main" | tee /etc/apt/sources.list.d/mongodb-org-${MONGO_TOOLS_VERSION}.list \ + && apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get install -y mongodb-database-tools mongodb-mongosh \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/*; \ + fi # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index 423cd767..f5a9d90d 100755 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -23,5 +23,42 @@ for dbsfile in "${dbsfiles[@]}"; do fi done +# Detect OS version +detect_os_version() { + if [ -f /etc/os-release ]; then + . /etc/os-release + OS_VERSION=$VERSION_CODENAME + else + echo "Unsupported OS: /etc/os-release not found" + exit 1 + fi +} + +# Set NODE_VARIANT based on OS version +set_node_variant() { + case $OS_VERSION in + "bullseye") + export VARIANT="18-bullseye" + ;; + "buster") + export VARIANT="18-buster" + ;; + *) + echo "Unsupported OS version: $OS_VERSION" + exit 1 + ;; + esac +} + # Install node modules yarn setup + +# Main script execution +detect_os_version +set_node_variant + +# Make setup.sh executable if not already +chmod +x setup.sh + +# Execute docker-compose with the appropriate VARIANT +docker-compose up --build \ No newline at end of file diff --git a/.gitignore b/.gitignore index f8123c33..e7dcab73 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ yarn-error.log # below: temporary voyager/static/*.css* voyager/.sst +scoutradioz-utilities/types/utilities.d.ts diff --git a/build-and-run.sh b/build-and-run.sh new file mode 100644 index 00000000..e69de29b diff --git a/voyager/package.json b/voyager/package.json index 6e8d6991..6725e0c7 100644 --- a/voyager/package.json +++ b/voyager/package.json @@ -73,7 +73,7 @@ "svelte-markdown": "^0.4.1", "tailwindcss": "^3.4.1", "typescript": "^5.3.2", - "vite": "^5.1.3", + "vite": "^5.2.12", "workbox-precaching": "^7.0.0", "workbox-routing": "^7.0.0" }, diff --git a/voyager/src/routes/scouting/match/+page.svelte b/voyager/src/routes/scouting/match/+page.svelte index 1e4fde1b..6a59db60 100644 --- a/voyager/src/routes/scouting/match/+page.svelte +++ b/voyager/src/routes/scouting/match/+page.svelte @@ -13,11 +13,11 @@ setPageTitle(msg('scouting.match'), msg('scouting.scheduleVersion', {checksum: data.checksum})); const tabs = [ - { id: 'mine', icon: 'person', label: 'Assigned' }, + { id: 'mine', icon: 'person', label: 'Mine' }, { id: 'all', icon: 'groups', label: 'All' } ]; - $: initialActiveIndex = data.myMatches.length ? 0 : 1; + $: initialActiveIndex = data.myTeams.length ? 0 : 1; const { snackbar } = getPageLayoutContexts(); addRefreshButtonFunctionality(async () => { @@ -52,7 +52,7 @@

- + diff --git a/voyager/src/routes/scouting/match/+page.ts b/voyager/src/routes/scouting/match/+page.ts index b49fb16a..dcb0a8f1 100644 --- a/voyager/src/routes/scouting/match/+page.ts +++ b/voyager/src/routes/scouting/match/+page.ts @@ -36,6 +36,10 @@ export const load: PageLoad = async ({ fetch, parent, url }) => { const myMatches = grouped.filter(match => match.some(asg => asg.assigned_scorer?.id === user_id) ).slice(0, maxNumMatches); + + const myTeams = myMatches.map(match => + match.filter(asg => asg.assigned_scorer?.id === user_id) + ); const allMatches = grouped.slice(0, maxNumMatches); @@ -49,5 +53,6 @@ export const load: PageLoad = async ({ fetch, parent, url }) => { } let checksum = syncStatus.data.checksum.substring(0, 3) as string; - return { myMatches, allMatches, firstMatchNumber, checksum }; + return { myMatches, myTeams, allMatches, firstMatchNumber, checksum }; + }; diff --git a/voyager/src/routes/scouting/pit/+page.svelte b/voyager/src/routes/scouting/pit/+page.svelte index fc87c9f9..991c5628 100644 --- a/voyager/src/routes/scouting/pit/+page.svelte +++ b/voyager/src/routes/scouting/pit/+page.svelte @@ -9,7 +9,7 @@ export let data: PageData; const tabs = [ - { id: 'mine', icon: 'person', label: 'Assigned' }, + { id: 'mine', icon: 'person', label: 'Mine' }, { id: 'partner', icon: 'group', label: "Partner's" }, { id: 'all', icon: 'groups', label: 'All' } ]; diff --git a/voyager/src/routes/sync/LeadQRCode.svelte b/voyager/src/routes/sync/LeadQRCode.svelte index dab98edb..bd96f03b 100644 --- a/voyager/src/routes/sync/LeadQRCode.svelte +++ b/voyager/src/routes/sync/LeadQRCode.svelte @@ -141,9 +141,9 @@
-
-
- @@ -186,4 +186,4 @@
{/if} -
+ \ No newline at end of file