mirror of
https://github.com/Team4388/ScoutingApp2022.git
synced 2026-06-09 00:38:03 -06:00
charge it to the game it's an IOU
This commit is contained in:
@@ -1,17 +1,17 @@
|
|||||||
{
|
{
|
||||||
"files": {
|
"files": {
|
||||||
"main.css": "/static/css/main.b03461c0.css",
|
"main.css": "/static/css/main.b03461c0.css",
|
||||||
"main.js": "/static/js/main.36f65ff1.js",
|
"main.js": "/static/js/main.64a1750c.js",
|
||||||
"static/js/787.f3328bc8.chunk.js": "/static/js/787.f3328bc8.chunk.js",
|
"static/js/787.f3328bc8.chunk.js": "/static/js/787.f3328bc8.chunk.js",
|
||||||
"service-worker.js": "/service-worker.js",
|
"service-worker.js": "/service-worker.js",
|
||||||
"static/media/logo.svg": "/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg",
|
"static/media/logo.svg": "/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg",
|
||||||
"index.html": "/index.html",
|
"index.html": "/index.html",
|
||||||
"main.b03461c0.css.map": "/static/css/main.b03461c0.css.map",
|
"main.b03461c0.css.map": "/static/css/main.b03461c0.css.map",
|
||||||
"main.36f65ff1.js.map": "/static/js/main.36f65ff1.js.map",
|
"main.64a1750c.js.map": "/static/js/main.64a1750c.js.map",
|
||||||
"787.f3328bc8.chunk.js.map": "/static/js/787.f3328bc8.chunk.js.map"
|
"787.f3328bc8.chunk.js.map": "/static/js/787.f3328bc8.chunk.js.map"
|
||||||
},
|
},
|
||||||
"entrypoints": [
|
"entrypoints": [
|
||||||
"static/css/main.b03461c0.css",
|
"static/css/main.b03461c0.css",
|
||||||
"static/js/main.36f65ff1.js"
|
"static/js/main.64a1750c.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#00a65a"/><meta name="description" content="Ridgebotics Scouting App 2022"/><meta name="viewport" content="width=device-width,user-scalable=no"><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Scouting 2022</title><script defer="defer" src="/static/js/main.36f65ff1.js"></script><link href="/static/css/main.b03461c0.css" rel="stylesheet"></head><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></html>
|
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#00a65a"/><meta name="description" content="Ridgebotics Scouting App 2022"/><meta name="viewport" content="width=device-width,user-scalable=no"><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Scouting 2022</title><script defer="defer" src="/static/js/main.64a1750c.js"></script><link href="/static/css/main.b03461c0.css" rel="stylesheet"></head><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></html>
|
||||||
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -14,6 +14,7 @@ import InputPage from "./Pages/InputPage";
|
|||||||
import TeamListPage from "./Pages/TeamListPage";
|
import TeamListPage from "./Pages/TeamListPage";
|
||||||
import DevPage from "./Pages/DevPage";
|
import DevPage from "./Pages/DevPage";
|
||||||
import TeamPage from "./Pages/TeamPage";
|
import TeamPage from "./Pages/TeamPage";
|
||||||
|
import MatchPage from "./Pages/MatchPage";
|
||||||
import { createTheme, ThemeProvider } from "@mui/material";
|
import { createTheme, ThemeProvider } from "@mui/material";
|
||||||
import { ProcessedDataBucketProvider } from "./ProcessedDataBucketContext";
|
import { ProcessedDataBucketProvider } from "./ProcessedDataBucketContext";
|
||||||
import NotesPage from "./Pages/NotesPage";
|
import NotesPage from "./Pages/NotesPage";
|
||||||
@@ -54,6 +55,7 @@ function App() {
|
|||||||
<Route path="/TeamList" element={<TeamListPage />} />
|
<Route path="/TeamList" element={<TeamListPage />} />
|
||||||
<Route path="/Dev" element={<DevPage />} />
|
<Route path="/Dev" element={<DevPage />} />
|
||||||
<Route path="/Team" element={<TeamPage />} />
|
<Route path="/Team" element={<TeamPage />} />
|
||||||
|
<Route path="/Match" element={<MatchPage />} />
|
||||||
<Route path="/404" element={<NotFoundPage />} />
|
<Route path="/404" element={<NotFoundPage />} />
|
||||||
<Route path="*" element={<NotFoundPage />} />
|
<Route path="*" element={<NotFoundPage />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
|
import { useLocalDb, useRemoteDb } from "../DbContext";
|
||||||
|
import { Formik, FastField, Form, useFormikContext } from "formik";
|
||||||
|
import { TextField, Button, Grid, FormRow, Divider, Checkbox, Radio, FormControlLabel, FormControl, FormLabel, RadioGroup, IconButton, NotesAdornment, Box } from "@mui/material";
|
||||||
|
import { useProcessedDataBucket } from "../ProcessedDataBucketContext";
|
||||||
|
import { getProcessedDataBucket, updateProcessedDataBucket } from "../ProcessedDataBucket";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
import TeamInfo from "../components/TeamInfo";
|
||||||
|
|
||||||
|
const MatchPage= () => {
|
||||||
|
const location = useLocation();
|
||||||
|
const { teams } = location.state;
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Box sx={{display: "flex", flexDirection: "row", gap: 1, overflowX: "scroll"}}>
|
||||||
|
<TeamInfo team={teams[0]}/>
|
||||||
|
<TeamInfo team={teams[1]}/>
|
||||||
|
<TeamInfo team={teams[2]}/>
|
||||||
|
<TeamInfo team={teams[3]}/>
|
||||||
|
<TeamInfo team={teams[4]}/>
|
||||||
|
<TeamInfo team={teams[5]}/>
|
||||||
|
</Box>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MatchPage;
|
||||||
@@ -5,91 +5,14 @@ import { TextField, Button, Grid, FormRow, Divider, Checkbox, Radio, FormControl
|
|||||||
import { useProcessedDataBucket } from "../ProcessedDataBucketContext";
|
import { useProcessedDataBucket } from "../ProcessedDataBucketContext";
|
||||||
import { getProcessedDataBucket, updateProcessedDataBucket } from "../ProcessedDataBucket";
|
import { getProcessedDataBucket, updateProcessedDataBucket } from "../ProcessedDataBucket";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
|
import TeamInfo from "../components/TeamInfo";
|
||||||
|
|
||||||
const TeamPage = () => {
|
const TeamPage = () => {
|
||||||
let { localdb, setLocaldb } = useLocalDb();
|
|
||||||
let { remotedb } = useRemoteDb();
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { team } = location.state;
|
const { team } = location.state;
|
||||||
console.log(team);
|
|
||||||
|
|
||||||
let panel_sx = {
|
|
||||||
display: "flex",
|
|
||||||
flexDirection: "column",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "flex-start",
|
|
||||||
bgcolor: "background.paper",
|
|
||||||
p: 2,
|
|
||||||
m: 1,
|
|
||||||
gap: 2,
|
|
||||||
maxWidth: "fit-content",
|
|
||||||
borderRadius: "10px",
|
|
||||||
boxShadow: 7,
|
|
||||||
};
|
|
||||||
|
|
||||||
const [oldDoc, setOldDoc] = useState(null);
|
|
||||||
const onSubmit = useCallback(
|
|
||||||
// (old_doc, new_doc) => {
|
|
||||||
(values, { setSubmitting, resetForm }) => {
|
|
||||||
localdb
|
|
||||||
.saveChanges(oldDoc, values)
|
|
||||||
.then((result) => {
|
|
||||||
alert("Saved Successfully!");
|
|
||||||
setSubmitting(false);
|
|
||||||
})
|
|
||||||
.then(localdb.sync(remotedb))
|
|
||||||
.catch(console.log);
|
|
||||||
},
|
|
||||||
[localdb, oldDoc]
|
|
||||||
);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
localdb.all().then((res) => {
|
|
||||||
let old_doc = {
|
|
||||||
$id: team,
|
|
||||||
weight: "",
|
|
||||||
drive_train: "",
|
|
||||||
drive_motors: "",
|
|
||||||
wheels: "",
|
|
||||||
climb_level: "",
|
|
||||||
which_hub: "",
|
|
||||||
shooter_type: "",
|
|
||||||
alignment_strategy: "",
|
|
||||||
misc_design: "",
|
|
||||||
};
|
|
||||||
if (typeof res[team] !== "undefined") {
|
|
||||||
old_doc = res[team];
|
|
||||||
}
|
|
||||||
setOldDoc(old_doc);
|
|
||||||
});
|
|
||||||
}, [setOldDoc]);
|
|
||||||
|
|
||||||
if (oldDoc == null) return null;
|
|
||||||
console.log(oldDoc);
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Formik initialValues={oldDoc} onSubmit={onSubmit}>
|
<TeamInfo team={team}/>
|
||||||
{({ isSubmitting }) => (
|
|
||||||
<Form>
|
|
||||||
<Box sx={panel_sx}>
|
|
||||||
<FastField type="input" as={TextField} name="weight" label="Weight" />
|
|
||||||
<FastField type="input" as={TextField} name="drive_train" label="Drive Train Type" />
|
|
||||||
<FastField type="input" as={TextField} name="drive_motors" label="# of Drive Motors" />
|
|
||||||
<FastField type="input" as={TextField} name="wheels" label="Wheels" />
|
|
||||||
<FastField type="input" as={TextField} name="climb_level" label="Climb Level" />
|
|
||||||
<FastField type="input" as={TextField} name="which_hub" label="Which Hub" />
|
|
||||||
<FastField type="input" as={TextField} name="shooter_type" label="Shooter Type" />
|
|
||||||
<FastField type="input" as={TextField} name="alignment_strategy" label="Alignment Strat" />
|
|
||||||
<FastField type="input" as={TextField} name="misc_design" label="Misc" />
|
|
||||||
</Box>
|
|
||||||
<Box sx={{ ...panel_sx, display: "flex", flexDirection: "column" }}>
|
|
||||||
<Button type="submit" disabled={isSubmitting}>
|
|
||||||
Save
|
|
||||||
</Button>
|
|
||||||
</Box>
|
|
||||||
</Form>
|
|
||||||
)}
|
|
||||||
</Formik>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ const Schedule = (props) => {
|
|||||||
|
|
||||||
const TeamNumberComponent = (props) => {
|
const TeamNumberComponent = (props) => {
|
||||||
return (
|
return (
|
||||||
<Link to="/Input" state={{ id: props.match_id + "_" + props.number }} style={{ color: "inherit" }}>
|
// <Link to="/Input" state={{ id: props.match_id + "_" + props.number }} style={{ color: "inherit" }}>
|
||||||
|
<Link to="/Team" state={{ team: props.number }} style={{ color: "inherit" }}>
|
||||||
<h3>{props.number}</h3>
|
<h3>{props.number}</h3>
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
@@ -44,7 +45,16 @@ const Schedule = (props) => {
|
|||||||
// console.log(item);
|
// console.log(item);
|
||||||
return (
|
return (
|
||||||
<Box sx={panel_sx} key={index}>
|
<Box sx={panel_sx} key={index}>
|
||||||
|
<Link to="/Match" state={{ teams: [
|
||||||
|
item.red[0],
|
||||||
|
item.red[1],
|
||||||
|
item.red[2],
|
||||||
|
item.blue[0],
|
||||||
|
item.blue[1],
|
||||||
|
item.blue[2],
|
||||||
|
]}} style={{ color: "inherit" }}>
|
||||||
<h3>{item.match_id}</h3>
|
<h3>{item.match_id}</h3>
|
||||||
|
</Link>
|
||||||
<Box sx={{ display: "flex", flexDirection: { xs: "column", sm: "row" }, gap: { xs: 0, sm: 1.5 }, color: "red_alliance", textDecoration: "none" }}>
|
<Box sx={{ display: "flex", flexDirection: { xs: "column", sm: "row" }, gap: { xs: 0, sm: 1.5 }, color: "red_alliance", textDecoration: "none" }}>
|
||||||
<TeamNumberComponent number={item.red[0]} match_id={item.match_id} />
|
<TeamNumberComponent number={item.red[0]} match_id={item.match_id} />
|
||||||
<TeamNumberComponent number={item.red[1]} match_id={item.match_id} />
|
<TeamNumberComponent number={item.red[1]} match_id={item.match_id} />
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
|
import { useLocalDb, useRemoteDb } from "../DbContext";
|
||||||
|
import { Formik, FastField, Form, useFormikContext } from "formik";
|
||||||
|
import { TextField, Button, Grid, FormRow, Divider, Checkbox, Radio, FormControlLabel, FormControl, FormLabel, RadioGroup, IconButton, NotesAdornment, Box } from "@mui/material";
|
||||||
|
import { useProcessedDataBucket } from "../ProcessedDataBucketContext";
|
||||||
|
import { getProcessedDataBucket, updateProcessedDataBucket } from "../ProcessedDataBucket";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
|
||||||
|
const TeamInfo = (props) => {
|
||||||
|
let { localdb, setLocaldb } = useLocalDb();
|
||||||
|
let { remotedb } = useRemoteDb();
|
||||||
|
const team = props.team;
|
||||||
|
console.log(team);
|
||||||
|
|
||||||
|
let panel_sx = {
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "flex-start",
|
||||||
|
bgcolor: "background.paper",
|
||||||
|
p: 2,
|
||||||
|
m: 1,
|
||||||
|
gap: 2,
|
||||||
|
maxWidth: "fit-content",
|
||||||
|
borderRadius: "10px",
|
||||||
|
boxShadow: 7,
|
||||||
|
minWidth: 200,
|
||||||
|
};
|
||||||
|
|
||||||
|
const [oldDoc, setOldDoc] = useState(null);
|
||||||
|
const [teamName, setTeamName] = useState("");
|
||||||
|
const onSubmit = useCallback(
|
||||||
|
// (old_doc, new_doc) => {
|
||||||
|
(values, { setSubmitting, resetForm }) => {
|
||||||
|
localdb
|
||||||
|
.saveChanges(oldDoc, values)
|
||||||
|
.then((result) => {
|
||||||
|
alert("Saved Successfully!");
|
||||||
|
setSubmitting(false);
|
||||||
|
})
|
||||||
|
.then(localdb.sync(remotedb))
|
||||||
|
.catch(console.log);
|
||||||
|
},
|
||||||
|
[localdb, oldDoc]
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
localdb.all().then((res) => {
|
||||||
|
let old_doc = {
|
||||||
|
$id: team,
|
||||||
|
weight: "",
|
||||||
|
drive_train: "",
|
||||||
|
drive_motors: "",
|
||||||
|
wheels: "",
|
||||||
|
climb_level: "",
|
||||||
|
which_hub: "",
|
||||||
|
shooter_type: "",
|
||||||
|
alignment_strategy: "",
|
||||||
|
misc_design: "",
|
||||||
|
};
|
||||||
|
if (typeof res[team] !== "undefined") {
|
||||||
|
old_doc = res[team];
|
||||||
|
}
|
||||||
|
if (typeof res["team_list"] !== undefined) {
|
||||||
|
console.log("team list");
|
||||||
|
console.log(res["team_list"]);
|
||||||
|
if (typeof res["team_list"]["teams"][team] !== undefined) {
|
||||||
|
const teamData = res["team_list"]["teams"][team];
|
||||||
|
// console.log(res["team_list"]["teams"][team]);
|
||||||
|
setTeamName(teamData.number + " " + teamData.nickname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setOldDoc(old_doc);
|
||||||
|
});
|
||||||
|
}, [setOldDoc]);
|
||||||
|
|
||||||
|
if (oldDoc == null) return null;
|
||||||
|
console.log(oldDoc);
|
||||||
|
return (
|
||||||
|
<Box>
|
||||||
|
<Box sx={panel_sx}>
|
||||||
|
<h3>
|
||||||
|
{teamName}
|
||||||
|
</h3>
|
||||||
|
<Formik initialValues={oldDoc} onSubmit={onSubmit}>
|
||||||
|
{({ isSubmitting }) => (
|
||||||
|
<Form>
|
||||||
|
<FastField type="input" as={TextField} name="weight" label="Weight" />
|
||||||
|
<FastField type="input" as={TextField} name="drive_train" label="Drive Train Type" />
|
||||||
|
<FastField type="input" as={TextField} name="drive_motors" label="# of Drive Motors" />
|
||||||
|
<FastField type="input" as={TextField} name="wheels" label="Wheels" />
|
||||||
|
<FastField type="input" as={TextField} name="climb_level" label="Climb Level" />
|
||||||
|
<FastField type="input" as={TextField} name="which_hub" label="Which Hub" />
|
||||||
|
<FastField type="input" as={TextField} name="shooter_type" label="Shooter Type" />
|
||||||
|
<FastField type="input" as={TextField} name="alignment_strategy" label="Alignment Strat" />
|
||||||
|
<FastField type="input" as={TextField} name="misc_design" label="Misc" />
|
||||||
|
<Box sx={{ ...panel_sx, display: "flex", flexDirection: "column" }}>
|
||||||
|
<Button type="submit" disabled={isSubmitting}>
|
||||||
|
Save
|
||||||
|
</Button>
|
||||||
|
</Box>
|
||||||
|
</Form>
|
||||||
|
)}
|
||||||
|
</Formik>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default TeamInfo;
|
||||||
Reference in New Issue
Block a user