From 8b8a0962dba43a87cfb3945ef0c0f24a76089e09 Mon Sep 17 00:00:00 2001 From: Shemy Gan Date: Tue, 19 Nov 2024 09:57:39 -0500 Subject: [PATCH] - Move create infrastructure folder to infrastructure and remove Infrastructuremonitor folder - Add create infrastructure page to globle routes and add "infrastructure" to PATH_MAP - Add navigation/breadcrumb to create infrastructure page - Connect create infrastructure page to create monitor button on home page --- Client/src/App.jsx | 6 +++++- Client/src/Components/Sidebar/index.jsx | 1 + .../CreateMonitor/CustomThreshold/index.jsx | 0 .../CreateMonitor/index.jsx | 6 +++--- Client/src/Pages/Infrastructure/index.jsx | 4 +++- 5 files changed, 12 insertions(+), 5 deletions(-) rename Client/src/Pages/{InfrastructureMonitors => Infrastructure}/CreateMonitor/CustomThreshold/index.jsx (100%) rename Client/src/Pages/{InfrastructureMonitors => Infrastructure}/CreateMonitor/index.jsx (98%) diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 151512701..b7a01c9d9 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -10,6 +10,7 @@ import Register from "./Pages/Auth/Register/Register"; import Account from "./Pages/Account"; import Monitors from "./Pages/Monitors/Home"; import CreateMonitor from "./Pages/Monitors/CreateMonitor"; +import CreateInfrastructureMonitor from "./Pages/Infrastructure/CreateMonitor"; import Incidents from "./Pages/Incidents"; import Status from "./Pages/Status"; import Integrations from "./Pages/Integrations"; @@ -127,7 +128,10 @@ function App() { path="infrastructure" element={} /> - + } + /> } diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index 2e91289f8..e6507c6e4 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -90,6 +90,7 @@ const URL_MAP = { const PATH_MAP = { monitors: "Dashboard", pagespeed: "Dashboard", + infrastructure: "Dashboard", account: "Account", settings: "Other", }; diff --git a/Client/src/Pages/InfrastructureMonitors/CreateMonitor/CustomThreshold/index.jsx b/Client/src/Pages/Infrastructure/CreateMonitor/CustomThreshold/index.jsx similarity index 100% rename from Client/src/Pages/InfrastructureMonitors/CreateMonitor/CustomThreshold/index.jsx rename to Client/src/Pages/Infrastructure/CreateMonitor/CustomThreshold/index.jsx diff --git a/Client/src/Pages/InfrastructureMonitors/CreateMonitor/index.jsx b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx similarity index 98% rename from Client/src/Pages/InfrastructureMonitors/CreateMonitor/index.jsx rename to Client/src/Pages/Infrastructure/CreateMonitor/index.jsx index 56b37662a..6a7081d9c 100644 --- a/Client/src/Pages/InfrastructureMonitors/CreateMonitor/index.jsx +++ b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx @@ -177,7 +177,7 @@ const CreateInfrastructureMonitor = () => { ); if (action.meta.requestStatus === "fulfilled") { createToast({ body: "Infrastructure monitor created successfully!" }); - navigate("/infrastructure-monitors/create"); + navigate("/infrastructure"); } else { createToast({ body: "Failed to create monitor." }); } @@ -217,8 +217,8 @@ const CreateInfrastructureMonitor = () => {