Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#221 - Voyager: Made "my assignments" tab only show the one team you're assigned to #258

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
47a319a
set up
daonguyenk06 Mar 10, 2024
b7926cb
Merge branch 'FIRSTTeam102:new-voyager' into new-voyager
daonguyenk06 May 21, 2024
7dfe798
Update .gitignore
daonguyenk06 May 31, 2024
cac8163
make 'pit scouting' dropdown full-width and centered
daonguyenk06 Jun 3, 2024
296c0c0
Revert "set up"
daonguyenk06 Jun 4, 2024
ff2c59a
Reapply "set up"
daonguyenk06 Jun 4, 2024
7642ce3
Merge branch 'FIRSTTeam102:master' into new-voyager
daonguyenk06 Jun 4, 2024
8225938
Fixes issue #221
daonguyenk06 Jun 5, 2024
89a16df
Revert "set up"
daonguyenk06 Jun 5, 2024
162675a
Revert "Reapply "set up""
daonguyenk06 Jun 5, 2024
926b870
Got rid of all the console logs
daonguyenk06 Jun 5, 2024
5a7e371
Reapply "Reapply "set up""
daonguyenk06 Jun 5, 2024
e0966c2
Reapply "set up"
daonguyenk06 Jun 5, 2024
0f4edfa
update 'vite'
daonguyenk06 Jun 10, 2024
f93c295
Revert "Reapply "set up""
daonguyenk06 Jun 10, 2024
d1108f4
Changed "Assigned" text to "Mine"
daonguyenk06 Jun 10, 2024
1fe7fdd
change "Assigned" text to "Mine"
daonguyenk06 Jun 10, 2024
2989ce2
Merge branch 'Issue-#221' of https://github.com/daonguyenk06/scoutrad…
daonguyenk06 Jun 10, 2024
df8485c
Merge branch 'Issue-#221' of https://github.com/daonguyenk06/scoutrad…
daonguyenk06 Jun 10, 2024
9fbfd26
Merge branch 'Issue-#221' of https://github.com/daonguyenk06/scoutrad…
daonguyenk06 Jun 10, 2024
dcef295
Changes between 'buster' and 'bullseye' conditioned with OP system
daonguyenk06 Jun 18, 2024
028ad80
Changes between 'buster' and 'bullseye' conditioned with OP system
daonguyenk06 Jun 18, 2024
feab879
setup
daonguyenk06 Jun 18, 2024
a084234
Merge branch 'Issue-#221' of https://github.com/daonguyenk06/scoutrad…
daonguyenk06 Jun 18, 2024
cbe4746
Update docker-compose.yml
daonguyenk06 Jun 18, 2024
2254aa9
Merge branch 'debian-bullseye-buster-switch' of https://github.com/da…
daonguyenk06 Jun 18, 2024
b2b993b
Merge branch 'new-voyager' into debian-bullseye-buster-switch
daonguyenk06 Jun 18, 2024
f9597d5
Merge branch 'Issue-#221' into debian-bullseye-buster-switch
daonguyenk06 Jun 18, 2024
e6cc74c
Merge pull request #2 from daonguyenk06/debian-bullseye-buster-switch
daonguyenk06 Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
37 changes: 37 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ yarn-error.log
# below: temporary
voyager/static/*.css*
voyager/.sst
scoutradioz-utilities/types/utilities.d.ts
Empty file added build-and-run.sh
Empty file.
2 changes: 1 addition & 1 deletion voyager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
6 changes: 3 additions & 3 deletions voyager/src/routes/scouting/match/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -52,7 +52,7 @@
</p>

<SlidingTabs {tabs} {initialActiveIndex}>
<MatchAssignmentList slot="1" matches={data.myMatches} firstMatchNumber={data.firstMatchNumber} />
<MatchAssignmentList slot="1" matches={data.myTeams} firstMatchNumber={data.firstMatchNumber} />
<MatchAssignmentList slot="2" matches={data.allMatches} firstMatchNumber={data.firstMatchNumber} />
</SlidingTabs>
</section>
7 changes: 6 additions & 1 deletion voyager/src/routes/scouting/match/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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 };

};
2 changes: 1 addition & 1 deletion voyager/src/routes/scouting/pit/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
];
Expand Down
8 changes: 4 additions & 4 deletions voyager/src/routes/sync/LeadQRCode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@
</script>

<section class="pad grid grid-cols-1 place-items-center gap-4">
<div class="grid grid-cols-2 gap-4">
<div>
<Select variant="filled" bind:value={qrCodeType} on:MDCSelect:change={handleChange}>
<div class={`grid ${qrCodeType === 'pitscouting' ? 'grid-cols-1' : 'grid-cols-2'} gap-4`}>
<div style="width: 100%; display: flex; justify-content: center;">
<Select variant="filled" bind:value={qrCodeType} on:MDCSelect:change={handleChange} style={`width: ${qrCodeType === 'pitscouting' ? '400px' : 'auto'}; `}>
<Option value="matchscouting">{msg('scouting.match')}</Option>
<Option value="pitscouting">{msg('scouting.pit')}</Option>
<Option value="metadata">{msg('qrsync.usersAndTeams')}</Option>
Expand Down Expand Up @@ -186,4 +186,4 @@
</div>
{/if}
<QrCodeDisplay data={base64Data} />
</section>
</section>