-
Notifications
You must be signed in to change notification settings - Fork 3
Updating Offline Mode #505
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
Merged
Merged
Changes from all commits
Commits
Show all changes
110 commits
Select commit
Hold shift + click to select a range
674e1c7
Added initial tag.
BanEvading 184c577
Updating wording and stying
BanEvading 578e404
Updating styling
BanEvading 1d6a49f
Formatting
BanEvading 67ea9b9
1.2.25
gearbox4026 6d311e4
Shuffles scouters.
BanEvading 02447c3
Merge pull request #491 from Decatur-Robotics/signin-method-warning
renatodellosso 64f6a66
1.2.25
gearbox4026 43dffca
Fixes Formatting
BanEvading 7bf66b9
Merge pull request #492 from Decatur-Robotics/randomize-scouters
renatodellosso 5198097
Initted Playwright
renatodellosso f53844e
Move old tests into tests/unit
renatodellosso a222904
Config web server for playwright
renatodellosso 7898a8f
Add tests for index page
renatodellosso 766450d
1.2.26
gearbox4026 c153ece
Update Jest configuration and CI workflows for Playwright tests
renatodellosso aa1a0af
Merge branch 'e2e-testing' of github.com:Decatur-Robotics/Gearbox int…
renatodellosso 1691b78
Fix package.json formatting
renatodellosso 1a34bce
Don't error if ROLLBAR_TOKEN isn't set
renatodellosso ae8a167
Update environment configuration and CI workflows for Playwright tests
renatodellosso a761475
Set up sign in function for e2e tests
renatodellosso b66169e
Use mongodb in e2e tests
renatodellosso 5aebd52
No more Resend errors when API key is missing
renatodellosso aa4cf8c
Fewer Rollbar errors, no request helper constructor logs
renatodellosso a488833
Add API key check in request method and safeguard user ID assignment …
renatodellosso e510aec
Fix error in allCompetitionsToPairings when TBA is disabled
renatodellosso bfadfff
Add NextAuth vars to .env.test
renatodellosso 59541de
[npm]: Bump jose from 6.0.8 to 6.0.10
dependabot[bot] 513082d
[npm]: Bump react-icons from 5.4.0 to 5.5.0
dependabot[bot] 8b3bd8b
1.2.26
gearbox4026 50d8704
1.2.26
gearbox4026 76d246a
Merge pull request #494 from Decatur-Robotics/dependabot/npm_and_yarn…
renatodellosso 18d7a1e
Merge pull request #495 from Decatur-Robotics/dependabot/npm_and_yarn…
renatodellosso 0403029
Merge branch 'main' into e2e-testing
renatodellosso c4410ed
Log Mongo connection string
renatodellosso 3d612e6
Merge branch 'e2e-testing' of github.com:Decatur-Robotics/Gearbox int…
renatodellosso 2b10cb1
Log on mongo connection
renatodellosso 5b57044
Clean up uri determination
renatodellosso 1057545
Changing
BanEvading 76402d2
Making paragraph hidden
BanEvading 008acf3
Fix sign in
renatodellosso 6a38380
Tried to add an xs style, realized one shouldn't exist, not sure what…
BanEvading 1e023b3
Removes the text on xs devices.
BanEvading cfa49d1
Adds break and makes the thing work
BanEvading 6e7f841
Fixed some profile tests
renatodellosso f690bf6
Increase retries and workers for CI in Playwright configuration
renatodellosso 9234dd2
almost got it working.
BanEvading bab7bae
export Reeefscape namespace
BanEvading 3122e3b
got it /functional/ still lots of work to do
BanEvading eae7332
adding getMaximum
BanEvading ca22b80
fixing the math in GetMinimum
BanEvading ee987e3
switch from hardcode to parameter for determining calculated stat
BanEvading 3ccbbe1
Add comments explaining what the functions do.
BanEvading fab5527
Change GetMaximum variable name from minimum to maximum
BanEvading e506998
Move labels below.
BanEvading e481a18
commit
BanEvading a5953b9
Don't add BASE_URL twice
renatodellosso 3a42155
Add more stats
BanEvading a571a31
Shard playwright CI tests
renatodellosso cdb45f2
Remove hardcode in GetMax
BanEvading 65e6b13
Change hardcode in check to based on stat
BanEvading a78dc1f
Update Playwright test command to use npm script
renatodellosso fe77851
Complete min/max coverage for auto
BanEvading e3924a9
Remove faulty stat
BanEvading 36389f9
Update CI workflow to set permissions and modify Playwright test command
renatodellosso 51c018d
Bump version to 1.3.0, add note about requiring individual shard in G…
renatodellosso e2bf7e6
Complete coverage for teleop.
BanEvading 71f1ea5
Fix Breaking Typos
BanEvading 8754455
Remove invalid stat
BanEvading bfcd395
Repeat tests in CI
renatodellosso 53f7fdf
Change processor value to be more accurate.
BanEvading 8dc29ae
1.2.27
gearbox4026 a73b9f9
Changing Types
BanEvading a3d1f38
Merge branch 'minimums-and-maximums-on-stat-page' of https://github.c…
BanEvading 46fb7da
Remove export from Reefscape namespace
BanEvading 418ff47
Remove import of now non-exported namespace
BanEvading be6bf80
Merge pull request #496 from Decatur-Robotics/minimums-and-maximums-o…
renatodellosso 7e7324d
Merge branch 'main' into e2e-testing
renatodellosso 0812bce
Fix signUp and signIn being flaky
renatodellosso 3f845bf
Merge branch 'e2e-testing' of github.com:Decatur-Robotics/Gearbox int…
renatodellosso bcac56f
Tweak line breaks
renatodellosso 563cc8e
Merge pull request #493 from Decatur-Robotics/e2e-testing
renatodellosso 74dbe65
[npm]: Bump next from 15.2.3 to 15.2.4 in the npm_and_yarn group
dependabot[bot] a9dc744
1.3.1
gearbox4026 e17052e
Merge pull request #497 from Decatur-Robotics/dependabot/npm_and_yarn…
renatodellosso b086a3d
Add better API error logging
renatodellosso 7e35f6d
Even better API error logging
renatodellosso 9808034
Add avatar editing functionality
renatodellosso 5526712
Ctrl + S
renatodellosso 5aeba61
Add e2e test for avatar editing functionality
renatodellosso e79b2e6
Ctrl + S & added Title attribute to card
renatodellosso e1660bb
Add altText prop to Avatar component and add remaining e2e tests for …
renatodellosso cc3fa30
getAttribute -> toHaveAttribute
renatodellosso b1cfdb7
Level no longer displays above top bar
renatodellosso c062c78
Ctrl + S
renatodellosso 3cecea6
Add ViewMatchesModal component and integrate it into CompHeaderCard
renatodellosso 83b438a
Add key prop to ViewMatchCard in ViewMatchesModal
renatodellosso 0baab92
Add export schedule as CSV, style my matches modal
renatodellosso 9dbd7af
[npm]: Bump @eslint/js from 9.18.0 to 9.24.0
dependabot[bot] a6ae069
1.3.2
gearbox4026 860d331
[npm]: Bump resend from 4.1.2 to 4.2.0
dependabot[bot] 58946df
1.3.2
gearbox4026 7c4a9aa
[npm]: Bump eslint-config-next from 15.2.2 to 15.2.4
dependabot[bot] fa719f0
1.3.2
gearbox4026 7995a3f
[npm]: Bump @serwist/next from 9.0.11 to 9.0.13
dependabot[bot] 6bbd1f8
1.3.2
gearbox4026 cd9677b
Merge pull request #499 from Decatur-Robotics/dependabot/npm_and_yarn…
renatodellosso e96aab5
Merge pull request #500 from Decatur-Robotics/dependabot/npm_and_yarn…
renatodellosso 9ae0c43
Merge pull request #501 from Decatur-Robotics/dependabot/npm_and_yarn…
renatodellosso 132d65b
Merge pull request #502 from Decatur-Robotics/dependabot/npm_and_yarn…
renatodellosso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,20 @@ | ||
| NEXT_PUBLIC_API_URL=http://localhost:3000/api | ||
| NEXTAUTH_URL=http://localhost:3000/ | ||
| NEXTAUTH_SECRET=testsecret | ||
|
|
||
| NEXT_PUBLIC_API_URL=/api/ | ||
|
|
||
| DEVELOPER_EMAILS=["[email protected]"] | ||
|
|
||
| TOA_URL=https://example.com | ||
| TOA_APP_ID=123 | ||
| TOA_KEY=456 | ||
|
|
||
| DEFAULT_IMAGE=https://example.com/default.jpg | ||
| DEFAULT_IMAGE=https://example.com/default.jpg | ||
|
|
||
| BASE_URL_FOR_PLAYWRIGHT=http://localhost:3000/ | ||
| ENABLE_TEST_SIGNIN_ROUTE=true | ||
| FALLBACK_MONGODB_URI=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000 | ||
|
|
||
| ENV_FILE=.env.test | ||
|
|
||
| DB=playwright_tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| name: Playwright Tests | ||
| on: [workflow_dispatch, workflow_call] | ||
| jobs: | ||
| e2e_tests: | ||
| timeout-minutes: 60 | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # Make sure to require each shard in GitHub! | ||
| shardIndex: [1, 2, 3, 4] | ||
| shardTotal: [4] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: lts/* | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Install Playwright browsers | ||
| run: npx playwright install --with-deps | ||
|
|
||
| - name: Start MongoDB | ||
| uses: supercharge/[email protected] | ||
| with: | ||
| mongodb-version: "8.0" | ||
|
|
||
| - name: Run Playwright tests | ||
| run: npx cross-env NODE_ENV=test playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | ||
|
|
||
| - name: Upload blob report to GitHub Actions Artifacts | ||
| if: ${{ !cancelled() }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: blob-report-${{ matrix.shardIndex }} | ||
| path: blob-report | ||
| retention-days: 1 | ||
|
|
||
| merge_reports: | ||
| # Merge reports after playwright-tests, even if some shards have failed | ||
| if: ${{ !cancelled() }} | ||
| needs: [e2e_tests] | ||
|
|
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: lts/* | ||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Download blob reports from GitHub Actions Artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: all-blob-reports | ||
| pattern: blob-report-* | ||
| merge-multiple: true | ||
|
|
||
| - name: Merge into HTML Report | ||
| run: npx playwright merge-reports --reporter html ./all-blob-reports | ||
|
|
||
| - name: Upload HTML report | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: html-report--attempt-${{ github.run_attempt }} | ||
| path: playwright-report | ||
| retention-days: 14 | ||
|
Comment on lines
+44
to
+71
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import { useState } from "react"; | ||
| import Card from "./Card"; | ||
| import ClientApi from "@/lib/api/ClientApi"; | ||
| import Avatar from "./Avatar"; | ||
| import Image from "next/image"; | ||
| import { Session } from "inspector/promises"; | ||
| import toast from "react-hot-toast"; | ||
|
|
||
| const api = new ClientApi(); | ||
| export default function EditAvatarModal(props: { | ||
| currentImg: string; | ||
| close: () => void; | ||
| }) { | ||
| const [newAvatar, setNewAvatar] = useState<string>(props.currentImg); | ||
|
|
||
| async function updateAvatar() { | ||
| toast.promise( | ||
| api.changePFP(newAvatar).then(() => location.reload()), | ||
| { | ||
| loading: "Updating profile picture...", | ||
| success: "Successfully updated profile picture!", | ||
| error: "Failed to update profile picture!", | ||
| }, | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <dialog | ||
| open={true} | ||
| className="modal" | ||
| > | ||
| <Card | ||
| title="Edit Avatar" | ||
| coloredTop="bg-secondary" | ||
| > | ||
| <div className="my-9 flex justify-center w-full"> | ||
| <Avatar | ||
| user={{ image: newAvatar }} | ||
| scale="scale-150" | ||
| altText="New Avatar" | ||
| showLevel={false} | ||
| /> | ||
| </div> | ||
|
|
||
| <input | ||
| defaultValue={props.currentImg} | ||
| className="input" | ||
| onChange={(e) => setNewAvatar(e.target.value)} | ||
| placeholder="Enter new avatar url" | ||
| /> | ||
| <div className="flex gap-2 justify-start w-full"> | ||
| <button | ||
| className="btn btn-primary mt-2" | ||
| onClick={updateAvatar} | ||
| > | ||
| Save | ||
| </button> | ||
| <button | ||
| className="btn btn-accent mt-2" | ||
| onClick={props.close} | ||
| > | ||
| Cancel | ||
| </button> | ||
| </div> | ||
| </Card> | ||
| </dialog> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| import { Match, Report } from "@/lib/Types"; | ||
| import Card from "./Card"; | ||
| import { User } from "../lib/Types"; | ||
| import { match } from "assert"; | ||
| import { report } from "process"; | ||
| import Checkbox from "./forms/Checkboxes"; | ||
| import { CheckmarkIcon } from "react-hot-toast"; | ||
| import { useState } from "react"; | ||
| import { toDict } from "@/lib/client/ClientUtils"; | ||
|
|
||
| type MatchData = { | ||
| number: number; | ||
| url: string; | ||
| message: string; | ||
| completed: boolean; | ||
| subjective: boolean; | ||
| }; | ||
|
|
||
| function ViewMatchCard(props: MatchData) { | ||
| return ( | ||
| <Card | ||
| title={"Match " + props.number} | ||
| className="w-full" | ||
| > | ||
| {props.message} | ||
| <a | ||
| href={props.url} | ||
| className={`btn btn-sm ${props.completed ? `btn-ghost` : props.subjective ? `btn-secondary` : `btn-primary`}`} | ||
| > | ||
| {props.completed ? "Submitted" : "Click to scout"} | ||
| </a> | ||
| </Card> | ||
| ); | ||
| } | ||
| export default function ViewMatchesModal(props: { | ||
| close: () => void; | ||
| matches: Match[]; | ||
| reports: Report[]; | ||
| user: User; | ||
| matchPathway: string; | ||
| }) { | ||
| const reportsById = toDict(props.reports); | ||
| const myMatches: MatchData[] = []; | ||
| const [showSubmittedReports, setShowSubmittedReports] = useState(false); | ||
|
|
||
| async function toggleShowSubmittedReports() { | ||
| setShowSubmittedReports(!showSubmittedReports); | ||
| } | ||
|
|
||
| for (const match of props.matches) { | ||
| if (match.subjectiveScouter == props.user._id?.toString()) { | ||
| myMatches.push({ | ||
| number: match.number, | ||
| url: props.matchPathway + `/${match._id}/subjective`, | ||
| message: "You are subjective scouting match " + match.number + ".", | ||
| completed: match.assignedSubjectiveScouterHasSubmitted, | ||
| subjective: true, | ||
| }); | ||
| } | ||
|
|
||
| for (const report of match.reports) { | ||
| if (reportsById[report]?.user == props.user._id?.toString()) { | ||
| myMatches.push({ | ||
| number: match.number, | ||
| url: props.matchPathway + `/${report.toString()}`, | ||
| message: | ||
| "You are scouting team " + | ||
| reportsById[report].robotNumber + | ||
| " in match " + | ||
| match.number + | ||
| ".", | ||
| completed: reportsById[report].submitted, | ||
| subjective: false, | ||
| }); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return ( | ||
| <dialog | ||
| open={true} | ||
| className="modal" | ||
| > | ||
| <Card title="My Matches"> | ||
| <div className="absolute right-2 top-2 flex gap-4 items-center"> | ||
| <div className="flex gap-2"> | ||
| <div>Show Submitted Reports</div> | ||
| <input | ||
| type="checkbox" | ||
| onChange={toggleShowSubmittedReports} | ||
| className="checkbox checkbox-primary" | ||
| /> | ||
| </div> | ||
| <button | ||
| className="btn btn-sm btn-circle btn-ghost " | ||
| onClick={props.close} | ||
| > | ||
| ✕ | ||
| </button> | ||
| </div> | ||
| <div className="overflow-y-scroll h-[650px]"> | ||
| {myMatches | ||
| .filter((matchData) => showSubmittedReports || !matchData.completed) | ||
| .map((matchData, index) => ( | ||
| <ViewMatchCard | ||
| {...matchData} | ||
| key={index} | ||
| /> | ||
| ))} | ||
| </div> | ||
| </Card> | ||
| </dialog> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium