From c47f0f8d6f78c46bd6d68baff6e3f0524949278b Mon Sep 17 00:00:00 2001 From: Evan H Date: Thu, 17 Oct 2024 21:36:26 -0400 Subject: [PATCH] comment resloves --- README.md | 2 +- TelemetrySite/client/src/App.jsx | 2 ++ TelemetrySite/client/src/contextForm/ContextForm.jsx | 4 ++++ TelemetrySite/server/Context/context.py | 4 ++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b40086b..c325ecb 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ As we do not have means to collect context data yet, we use a dummy context with This react-strap based website is responsible for gathering all context and data relating to the bikes and all events
-Ideally, mechies will just download the files and run it on their computer. This includes running both the website and backend api that goes along with it.
+Ideally, MECE's will just download the files and run it on their computer. This includes running both the website and backend api that goes along with it.
In the future, I hope to host at least the backend restful api, and eventually the website itself, on a web server, but that is not going to happen for a long time. To anyone that works on this in the future, if this message is still here, that means I never went back and fixed the mess I made, and for that I sincerely apologize for. This was meant to be quick and dirty, but I attempted to follow best practices and self document the code where I could.
diff --git a/TelemetrySite/client/src/App.jsx b/TelemetrySite/client/src/App.jsx index 2312c86..c725ca5 100644 --- a/TelemetrySite/client/src/App.jsx +++ b/TelemetrySite/client/src/App.jsx @@ -1,5 +1,6 @@ import { Route, Routes, BrowserRouter as Router } from "react-router-dom"; import ContextForm from "./contextForm/ContextForm"; // Import other components +import DataUpload from "./DataUpload/DataUpload"; import "./App.css"; import Page404 from "./404/404"; import { CheckServerStatus } from "./ServerCall"; @@ -46,6 +47,7 @@ function App() { {ServerStatus ? ( } /> + } /> ) : null} diff --git a/TelemetrySite/client/src/contextForm/ContextForm.jsx b/TelemetrySite/client/src/contextForm/ContextForm.jsx index ab0a576..3da1881 100644 --- a/TelemetrySite/client/src/contextForm/ContextForm.jsx +++ b/TelemetrySite/client/src/contextForm/ContextForm.jsx @@ -20,6 +20,7 @@ import "./ContextForm.css"; import ContextJSONIdValues from "./jsonFiles/ContextForm.json"; //all elements to have as input field and their properties import ContextJSONFormElements from "./jsonFiles/FormElementFormat.json"; +import { useNavigate } from "react-router-dom"; /** * Create needed context forms. Return the configured elements @@ -94,6 +95,7 @@ function ContextForm() { let FormId = "ContextForm"; + let navigate = useNavigate(); /* -------------------------------------------------------------------------- */ /* ----------------------------- Const Functions ---------------------------- */ /* -------------------------------------------------------------------------- */ @@ -326,6 +328,8 @@ function ContextForm() { PostContextData(collectedData).then((result) => { if (result) { document.getElementById(FormId).reset(); + //switch to new screen + navigate("/DataUpload"); } else { throw new Error("An error has occurred while submitting data"); } diff --git a/TelemetrySite/server/Context/context.py b/TelemetrySite/server/Context/context.py index f3e91b8..9b40e13 100644 --- a/TelemetrySite/server/Context/context.py +++ b/TelemetrySite/server/Context/context.py @@ -115,12 +115,12 @@ def put(self): def post(self): - + #setup later to adjust data return jsonify(["Post Called"]) def delete(self): - + #setup later to deactivate data return jsonify(["Delete Called"])