Skip to content

Commit 8914767

Browse files
authored
Merge pull request #528 from Decatur-Robotics/ftc-decode
FTC Decode
2 parents c4f9f52 + 615915c commit 8914767

File tree

19 files changed

+1402
-669
lines changed

19 files changed

+1402
-669
lines changed

.env.test

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
NEXTAUTH_URL=http://localhost:3000/
1+
NEXTAUTH_URL=http://localhost:3000/api/
22
NEXTAUTH_SECRET=testsecret
33

44
NEXT_PUBLIC_API_URL=/api/
@@ -9,12 +9,14 @@ TOA_URL=https://example.com
99
TOA_APP_ID=123
1010
TOA_KEY=456
1111

12+
API_URL=/api/
13+
API_KEY=gearboxiscool
14+
1215
DEFAULT_IMAGE=https://example.com/default.jpg
1316

1417
BASE_URL_FOR_PLAYWRIGHT=http://localhost:3000/
1518
ENABLE_TEST_SIGNIN_ROUTE=true
16-
FALLBACK_MONGODB_URI=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000
17-
19+
FALLBACK_MONGODB_URI=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.5.10
1820
ENV_FILE=.env.test
1921

2022
DB=playwright_tests

.github/workflows/increment_version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
increment:
1212
runs-on: ubuntu-latest
13-
if:
13+
if:
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v4

LICENSE.md

Lines changed: 153 additions & 161 deletions
Large diffs are not rendered by default.

components/Container.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ export default function Container(props: ContainerProps) {
317317
"w-16 h-16 btn btn-ghost " +
318318
(selected ? "border-2 border-accent" : "border-2")
319319
}
320-
key={team._id.toString()}
320+
key={team._id?.toString()}
321321
onClick={() => {
322322
setSelectedTeamIndex(index);
323323
}}

components/TeamCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ export default function TeamCard(props: { team: Team | undefined }) {
66
return (
77
<Card
88
title={team?.name}
9-
key={team?._id.toString()}
9+
key={team?._id?.toString()}
1010
className="w-full bg-base-300 border-4 border-base-300 transition ease-in hover:border-primary"
1111
>
1212
<h1 className="font-semibold max-sm:text-sm">
1313
{team?.league} {team?.alliance ? "Alliance" : "Team"}{" "}
1414
<span className="text-accent">{team?.number}</span> -{" "}
15-
<span className="text-primary">{team?.users.length}</span> members
15+
<span className="text-primary">{team?.users?.length}</span> members
1616
</h1>
1717
</Card>
1818
);

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const config = [
2020
},
2121
},
2222
{
23-
// Ignores has to go in its own config object
23+
// Ignores has to go in its own config object
2424
ignores: ["coverage/**/*", ".next/**/*"],
2525
},
2626
];

lib/Enums.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,19 @@ export namespace ReefscapeEnums {
109109
Shallow = "Shallow",
110110
}
111111
}
112+
113+
export namespace DecodeEnums {
114+
export enum EndgameParkStatus {
115+
No = "No",
116+
Partial = "Partial",
117+
Full = "Full",
118+
TwoBotPark = "Two Bot Park",
119+
}
120+
121+
export enum AutoCapabilities {
122+
NoAuto = "No Auto",
123+
MovePastStart = "Move Past Start",
124+
ScoreOneArtifact = "Score One Artifact",
125+
ScoreMultipleArtifacts = "Score Multiple Artifacts",
126+
}
127+
}

lib/Layout.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
IntoTheDeepEnums,
1111
FtcDrivetrain,
1212
ReefscapeEnums,
13+
DecodeEnums,
1314
} from "./Enums";
1415
import { PitReportData, QuantData, Pitreport, Report, League } from "./Types";
1516

@@ -217,6 +218,8 @@ export function keyToType(
217218
ReefscapeEnums.Climbing,
218219
ReefscapeEnums.DriveThroughDeepCage,
219220
ReefscapeEnums.EndgameClimbStatus,
221+
DecodeEnums.AutoCapabilities,
222+
DecodeEnums.EndgameParkStatus,
220223
];
221224

222225
if (key === "Defense") return Defense;
@@ -231,6 +234,9 @@ export function keyToType(
231234
if (key == "DriveThroughDeepCage") return ReefscapeEnums.DriveThroughDeepCage;
232235
if (key == "EndgameClimbStatus") return ReefscapeEnums.EndgameClimbStatus;
233236

237+
if (key == "EndgameParkStatusDecode") return DecodeEnums.EndgameParkStatus;
238+
if (key == "AutoAbilities") return DecodeEnums.AutoCapabilities;
239+
234240
for (const e of enums) {
235241
if (Object.values(e).includes(exampleData[key])) return e;
236242
}

lib/api/ClientApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export default class ClientApi extends NextApiTemplate<ApiDependencies> {
214214
if (number <= 0) {
215215
return res.status(200).send(undefined);
216216
}
217-
217+
console.log("Getting autofill data for team:", number, league);
218218
res
219219
.status(200)
220220
.send(

lib/client/GameId.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export enum GameId {
33
CenterStage = "CenterStage",
44
IntoTheDeep = "IntoTheDeep",
55
Reefscape = "Reefscape",
6+
Decode = "Decode",
67
}
78

89
export const defaultGameId = GameId.Reefscape;

0 commit comments

Comments
 (0)