From 16069b47b9f62b73db02a394e2f74afdbdae2846 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 26 Nov 2024 14:34:24 +0800 Subject: [PATCH] remove test route and page --- Client/src/App.jsx | 6 -- Client/src/Pages/test.jsx | 192 -------------------------------------- 2 files changed, 198 deletions(-) delete mode 100644 Client/src/Pages/test.jsx diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 62b6bd9ff..82c8203a8 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -41,7 +41,6 @@ import { logger } from "./Utils/Logger"; // Import the logger import { networkService } from "./main"; import { Infrastructure } from "./Pages/Infrastructure"; import InfrastructureDetails from "./Pages/Infrastructure/Details"; -import Test from "./Pages/test"; function App() { const AdminCheckedRegister = withAdminCheck(Register); const MonitorsWithAdminProp = withAdminProp(Monitors); @@ -90,11 +89,6 @@ function App() { path="/" element={} > - } - /> - { - const [originalValue, setOriginalValue] = useState(""); - const [originalError, setOriginalError] = useState(""); - - const [newValue, setNewValue] = useState(""); - const [newError, setNewError] = useState(""); - - const [thresholdValue, setThresholdValue] = useState(20); - const [thresholdError, setThresholdError] = useState(""); - - const [thresholdValue2, setThresholdValue2] = useState(20); - const [thresholdError2, setThresholdError2] = useState(""); - - const inputRef = useRef(null); - - useEffect(() => { - if (inputRef.current) { - inputRef.current.focus(); - } - }, []); - - const checkError = (value) => { - if (value !== "clear") { - return "This is an error"; - } - return ""; - }; - - const checkThresholdError = (value) => { - if (value !== 99) { - return "This is a threshold error"; - } - return ""; - }; - const checkThresholdError2 = (value) => { - if (value !== 99) { - return "This is a threshold error 2"; - } - return ""; - }; - - const handleOriginalValue = (e) => { - setOriginalError(checkError(e.target.value)); - setOriginalValue(e.target.value); - }; - - const handleNewValue = (e) => { - setNewError(checkError(e.target.value)); - setNewValue(e.target.value); - }; - - const handleThresholdValue = (e) => { - const parsedVal = parseInt(e.target.value); - setThresholdError(checkThresholdError(parsedVal)); - setThresholdValue(parsedVal); - }; - - const handleThresholdValue2 = (e) => { - const parsedVal = parseInt(e.target.value); - setThresholdError2(checkThresholdError2(parsedVal)); - setThresholdValue2(parsedVal); - }; - - return ( - - - This is a test page for the TextInput component. It is a rationalized Input - component. - - Type anything for an error. - Typing "clear" will clear the error for text based input - Typing "99" will clear the error for threshold based input - - - - - } - onChange={handleNewValue} - error={newError !== ""} - helperText={newError} - /> - - - } - onChange={handleNewValue} - error={newError !== ""} - helperText={newError} - ref={inputRef} - /> - - - - - - Short field for threshold. Easily show/hide error text - - - - {thresholdError} {thresholdError2} - - - ); -}; - -export default Test;