From 01f7d7cc789fc5bb210c7e5b5dc18977c9bdbcba Mon Sep 17 00:00:00 2001 From: Nawaz Dhandala Date: Thu, 29 Jan 2026 20:59:58 +0000 Subject: [PATCH] feat: Refactor routing and add ActiveIncidents and ActiveAlerts components --- Dashboard/src/App.tsx | 12 ++++----- Dashboard/src/Components/Header/Header.tsx | 4 +-- .../{NewAlerts.tsx => ActiveAlerts.tsx} | 26 +++++++++---------- .../{NewIncidents.tsx => ActiveIncidents.tsx} | 26 +++++++++---------- Dashboard/src/Utils/PageMap.ts | 4 +-- Dashboard/src/Utils/RouteMap.ts | 6 ++--- 6 files changed, 39 insertions(+), 39 deletions(-) rename Dashboard/src/Pages/Global/{NewAlerts.tsx => ActiveAlerts.tsx} (92%) rename Dashboard/src/Pages/Global/{NewIncidents.tsx => ActiveIncidents.tsx} (91%) diff --git a/Dashboard/src/App.tsx b/Dashboard/src/App.tsx index 6eed36a56e..3545cbdcc3 100644 --- a/Dashboard/src/App.tsx +++ b/Dashboard/src/App.tsx @@ -186,12 +186,12 @@ const ProjectInvitations: React.LazyExoticComponent< const ActiveIncidents: React.LazyExoticComponent< React.FunctionComponent > = lazy(() => { - return import("./Pages/Global/NewIncidents"); + return import("./Pages/Global/ActiveIncidents"); }); const ActiveAlerts: React.LazyExoticComponent< React.FunctionComponent > = lazy(() => { - return import("./Pages/Global/NewAlerts"); + return import("./Pages/Global/ActiveAlerts"); }); const UserSettingsRoutes: React.LazyExoticComponent< React.FunctionComponent @@ -661,21 +661,21 @@ const App: () => JSX.Element = () => { /> } /> } /> diff --git a/Dashboard/src/Components/Header/Header.tsx b/Dashboard/src/Components/Header/Header.tsx index d6f1f9d979..c800b09d4e 100644 --- a/Dashboard/src/Components/Header/Header.tsx +++ b/Dashboard/src/Components/Header/Header.tsx @@ -433,7 +433,7 @@ const DashboardHeader: FunctionComponent = ( onClick={() => { Navigation.navigate( RouteUtil.populateRouteParams( - RouteMap[PageMap.NEW_INCIDENTS]!, + RouteMap[PageMap.ACTIVE_INCIDENTS]!, ), ); }} @@ -458,7 +458,7 @@ const DashboardHeader: FunctionComponent = ( onClick={() => { Navigation.navigate( RouteUtil.populateRouteParams( - RouteMap[PageMap.NEW_ALERTS]!, + RouteMap[PageMap.ACTIVE_ALERTS]!, ), ); }} diff --git a/Dashboard/src/Pages/Global/NewAlerts.tsx b/Dashboard/src/Pages/Global/ActiveAlerts.tsx similarity index 92% rename from Dashboard/src/Pages/Global/NewAlerts.tsx rename to Dashboard/src/Pages/Global/ActiveAlerts.tsx index 2c565ad667..4f240efc9c 100644 --- a/Dashboard/src/Pages/Global/NewAlerts.tsx +++ b/Dashboard/src/Pages/Global/ActiveAlerts.tsx @@ -21,30 +21,30 @@ import Alert from "Common/Models/DatabaseModels/Alert"; import Project from "Common/Models/DatabaseModels/Project"; import React, { FunctionComponent, ReactElement } from "react"; -const NewAlerts: FunctionComponent = (): ReactElement => { +const ActiveAlerts: FunctionComponent = (): ReactElement => { return ( modelType={Alert} - name="New Alerts" - id="new-alerts-table" - userPreferencesKey="new-alerts-table" + name="Active Alerts" + id="active-alerts-table" + userPreferencesKey="active-alerts-table" saveFilterProps={{ - tableId: "new-alerts-table", + tableId: "active-alerts-table", }} isDeleteable={false} query={{ @@ -66,13 +66,13 @@ const NewAlerts: FunctionComponent = (): ReactElement => { isViewable={true} showViewIdButton={true} cardProps={{ - title: "New Alerts", + title: "Active Alerts", description: - "Here is a list of new alerts for all of the projects you are a part of.", + "Here is a list of active alerts for all of the projects you are a part of.", }} noItemsMessage={"No alert found."} - singularName="New Alert" - pluralName="New Alerts" + singularName="Active Alert" + pluralName="Active Alerts" onViewPage={(item: Alert): Promise => { return Promise.resolve( new Route( @@ -255,4 +255,4 @@ const NewAlerts: FunctionComponent = (): ReactElement => { ); }; -export default NewAlerts; +export default ActiveAlerts; diff --git a/Dashboard/src/Pages/Global/NewIncidents.tsx b/Dashboard/src/Pages/Global/ActiveIncidents.tsx similarity index 91% rename from Dashboard/src/Pages/Global/NewIncidents.tsx rename to Dashboard/src/Pages/Global/ActiveIncidents.tsx index a00df02023..57149a6272 100644 --- a/Dashboard/src/Pages/Global/NewIncidents.tsx +++ b/Dashboard/src/Pages/Global/ActiveIncidents.tsx @@ -21,30 +21,30 @@ import Incident from "Common/Models/DatabaseModels/Incident"; import Project from "Common/Models/DatabaseModels/Project"; import React, { FunctionComponent, ReactElement } from "react"; -const Home: FunctionComponent = (): ReactElement => { +const ActiveIncidents: FunctionComponent = (): ReactElement => { return ( modelType={Incident} - name="New Incidents" - id="new-incidents-table" - userPreferencesKey="new-incidents-table" + name="Active Incidents" + id="active-incidents-table" + userPreferencesKey="active-incidents-table" saveFilterProps={{ - tableId: "new-incidents-table", + tableId: "active-incidents-table", }} isDeleteable={false} query={{ @@ -66,13 +66,13 @@ const Home: FunctionComponent = (): ReactElement => { isViewable={true} showViewIdButton={true} cardProps={{ - title: "New Incidents", + title: "Active Incidents", description: - "Here is a list of new incidents for all of the projects you are a part of.", + "Here is a list of active incidents for all of the projects you are a part of.", }} noItemsMessage={"No incident found."} - singularName="New Incident" - pluralName="New Incidents" + singularName="Active Incident" + pluralName="Active Incidents" onViewPage={(item: Incident): Promise => { return Promise.resolve( new Route( @@ -252,4 +252,4 @@ const Home: FunctionComponent = (): ReactElement => { ); }; -export default Home; +export default ActiveIncidents; diff --git a/Dashboard/src/Utils/PageMap.ts b/Dashboard/src/Utils/PageMap.ts index 7a475b35d2..97c93cd377 100644 --- a/Dashboard/src/Utils/PageMap.ts +++ b/Dashboard/src/Utils/PageMap.ts @@ -390,8 +390,8 @@ enum PageMap { USER_PROFILE_PICTURE = "USER_PROFILE_PICTURE", USER_TWO_FACTOR_AUTH = "USER_TWO_FACTOR_AUTH", USER_PROFILE_DELETE = "USER_PROFILE_DELETE", - NEW_INCIDENTS = "NEW_INCIDENTS", - NEW_ALERTS = "NEW_ALERTS", + ACTIVE_INCIDENTS = "ACTIVE_INCIDENTS", + ACTIVE_ALERTS = "ACTIVE_ALERTS", PROJECT_INVITATIONS = "PROJECT_INVITATIONS", // WORKFLOW diff --git a/Dashboard/src/Utils/RouteMap.ts b/Dashboard/src/Utils/RouteMap.ts index 8789bb6e01..6a73ce4fb6 100644 --- a/Dashboard/src/Utils/RouteMap.ts +++ b/Dashboard/src/Utils/RouteMap.ts @@ -913,9 +913,9 @@ const RouteMap: Dictionary = { `/dashboard/user-profile/delete-account`, ), - [PageMap.NEW_INCIDENTS]: new Route(`/dashboard/new-incidents`), + [PageMap.ACTIVE_INCIDENTS]: new Route(`/dashboard/active-incidents`), - [PageMap.NEW_ALERTS]: new Route(`/dashboard/new-alerts`), + [PageMap.ACTIVE_ALERTS]: new Route(`/dashboard/active-alerts`), [PageMap.PROJECT_INVITATIONS]: new Route(`/dashboard/project-invitations`), @@ -2348,7 +2348,7 @@ export class RouteUtil { route.toString() === RouteMap[PageMap.USER_PROFILE_PICTURE]?.toString() || route.toString() === RouteMap[PageMap.USER_PROFILE_DELETE]?.toString() || route.toString() === RouteMap[PageMap.PROJECT_INVITATIONS]?.toString() || - route.toString() === RouteMap[PageMap.NEW_INCIDENTS]?.toString() + route.toString() === RouteMap[PageMap.ACTIVE_INCIDENTS]?.toString() ) { return true; }