Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 5 additions & 3 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NEXTAUTH_URL=http://localhost:3000/
NEXTAUTH_URL=http://localhost:3000/api/
NEXTAUTH_SECRET=testsecret

NEXT_PUBLIC_API_URL=/api/
Expand All @@ -9,12 +9,14 @@ TOA_URL=https://example.com
TOA_APP_ID=123
TOA_KEY=456

API_URL=/api/
API_KEY=gearboxiscool

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

FALLBACK_MONGODB_URI=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.5.10
ENV_FILE=.env.test

DB=playwright_tests
2 changes: 1 addition & 1 deletion .github/workflows/increment_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
increment:
runs-on: ubuntu-latest
if:
if:
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
314 changes: 153 additions & 161 deletions LICENSE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export default function Container(props: ContainerProps) {
"w-16 h-16 btn btn-ghost " +
(selected ? "border-2 border-accent" : "border-2")
}
key={team._id.toString()}
key={team._id?.toString()}
onClick={() => {
setSelectedTeamIndex(index);
}}
Expand Down
4 changes: 2 additions & 2 deletions components/TeamCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ export default function TeamCard(props: { team: Team | undefined }) {
return (
<Card
title={team?.name}
key={team?._id.toString()}
key={team?._id?.toString()}
className="w-full bg-base-300 border-4 border-base-300 transition ease-in hover:border-primary"
>
<h1 className="font-semibold max-sm:text-sm">
{team?.league} {team?.alliance ? "Alliance" : "Team"}{" "}
<span className="text-accent">{team?.number}</span> -{" "}
<span className="text-primary">{team?.users.length}</span> members
<span className="text-primary">{team?.users?.length}</span> members
</h1>
</Card>
);
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const config = [
},
},
{
// Ignores has to go in its own config object
// Ignores has to go in its own config object
ignores: ["coverage/**/*", ".next/**/*"],
},
];
Expand Down
16 changes: 16 additions & 0 deletions lib/Enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,19 @@ export namespace ReefscapeEnums {
Shallow = "Shallow",
}
}

export namespace DecodeEnums {
export enum EndgameParkStatus {
No = "No",
Partial = "Partial",
Full = "Full",
TwoBotPark = "Two Bot Park",
}

export enum AutoCapabilities {
NoAuto = "No Auto",
MovePastStart = "Move Past Start",
ScoreOneArtifact = "Score One Artifact",
ScoreMultipleArtifacts = "Score Multiple Artifacts",
}
}
6 changes: 6 additions & 0 deletions lib/Layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
IntoTheDeepEnums,
FtcDrivetrain,
ReefscapeEnums,
DecodeEnums,
} from "./Enums";
import { PitReportData, QuantData, Pitreport, Report, League } from "./Types";

Expand Down Expand Up @@ -217,6 +218,8 @@ export function keyToType(
ReefscapeEnums.Climbing,
ReefscapeEnums.DriveThroughDeepCage,
ReefscapeEnums.EndgameClimbStatus,
DecodeEnums.AutoCapabilities,
DecodeEnums.EndgameParkStatus,
];

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

if (key == "EndgameParkStatusDecode") return DecodeEnums.EndgameParkStatus;
if (key == "AutoAbilities") return DecodeEnums.AutoCapabilities;

for (const e of enums) {
if (Object.values(e).includes(exampleData[key])) return e;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/api/ClientApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export default class ClientApi extends NextApiTemplate<ApiDependencies> {
if (number <= 0) {
return res.status(200).send(undefined);
}

console.log("Getting autofill data for team:", number, league);
res
.status(200)
.send(
Expand Down
1 change: 1 addition & 0 deletions lib/client/GameId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export enum GameId {
CenterStage = "CenterStage",
IntoTheDeep = "IntoTheDeep",
Reefscape = "Reefscape",
Decode = "Decode",
}

export const defaultGameId = GameId.Reefscape;
5 changes: 5 additions & 0 deletions lib/client/StatsMath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export const AmpAutoPoints = 2;
export const AmpTeleopPoints = 1;
export const TrapPoints = 5;

export const ArtifactPoints = 3;
export const MotifArtifactPoints = 5;
export const OverflowArtifactPoints = 1;
export const DepotArtifactPoints = 1;

type Selector<T extends QuantData> = ((r: T) => number) | (keyof T & string);

function getSelection<T extends QuantData>(
Expand Down
6 changes: 3 additions & 3 deletions lib/dev/FakeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { ObjectId } from "bson";
import CollectionId from "../client/CollectionId";
import DbInterface from "../client/dbinterfaces/DbInterface";

const firstNameMaleURL = "https://www.randomlists.com/data/names-male.json";
const firstNameFemaleURL = "https://www.randomlists.com/data/names-female.json";
const firstNameMaleURL = "https://www.randomlists.com/male-names";
const firstNameFemaleURL = "https://www.randomlists.com/female-names";

var cachedFirstNames: string[] = [];
var cachedLastNames: string[] = [];
Expand Down Expand Up @@ -43,7 +43,7 @@ export async function fakeUser(
db: DbInterface,
teamId: ObjectId | undefined,
): Promise<User> {
const name = await randomName();
const name = String(Math.random() * 101);
const user = new User(
name,
"[email protected]",
Expand Down
Loading
Loading