From 79083b4a28e5c9c92fc629d3e121b8f4e396d091 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Tue, 4 Mar 2025 20:51:48 +0000 Subject: [PATCH] feat: add Microsoft Teams integration settings to the dashboard --- Dashboard/src/Pages/Settings/SideMenu.tsx | 10 +++++ Dashboard/src/Routes/SettingsRoutes.tsx | 39 ++++++++++++++----- .../Utils/Breadcrumbs/SettingsBreadcrumbs.ts | 5 +++ Dashboard/src/Utils/PageMap.ts | 2 +- Dashboard/src/Utils/RouteMap.ts | 7 ++++ 5 files changed, 53 insertions(+), 10 deletions(-) diff --git a/Dashboard/src/Pages/Settings/SideMenu.tsx b/Dashboard/src/Pages/Settings/SideMenu.tsx index 4392ae14c0..b8f65f13f7 100644 --- a/Dashboard/src/Pages/Settings/SideMenu.tsx +++ b/Dashboard/src/Pages/Settings/SideMenu.tsx @@ -42,6 +42,16 @@ const DashboardSideMenu: () => JSX.Element = (): ReactElement => { }} icon={IconProp.Slack} /> + + diff --git a/Dashboard/src/Routes/SettingsRoutes.tsx b/Dashboard/src/Routes/SettingsRoutes.tsx index f5d760013c..f52742cb3b 100644 --- a/Dashboard/src/Routes/SettingsRoutes.tsx +++ b/Dashboard/src/Routes/SettingsRoutes.tsx @@ -233,6 +233,13 @@ const ScheduledMaintenanceNoteTemplateView: LazyExoticComponent< return import("../Pages/Settings/ScheduledMaintenanceNoteTemplateView"); }); + +const SettingsMicrosoftTeamsIntegration: LazyExoticComponent< + FunctionComponent +> = lazy(() => { + return import("../Pages/Settings/MicrosoftTeamsIntegration"); +}); + const SettingsUsageHistory: LazyExoticComponent< FunctionComponent > = lazy(() => { @@ -320,7 +327,7 @@ const SettingsRoutes: FunctionComponent = ( {...props} pageRoute={ RouteMap[ - PageMap.SETTINGS_SCHEDULED_MAINTENANCE_TEMPLATES + PageMap.SETTINGS_SCHEDULED_MAINTENANCE_TEMPLATES ] as Route } /> @@ -339,7 +346,7 @@ const SettingsRoutes: FunctionComponent = ( {...props} pageRoute={ RouteMap[ - PageMap.SETTINGS_SCHEDULED_MAINTENANCE_TEMPLATES_VIEW + PageMap.SETTINGS_SCHEDULED_MAINTENANCE_TEMPLATES_VIEW ] as Route } /> @@ -414,7 +421,7 @@ const SettingsRoutes: FunctionComponent = ( {...props} pageRoute={ RouteMap[ - PageMap.SETTINGS_INCIDENT_NOTE_TEMPLATES_VIEW + PageMap.SETTINGS_INCIDENT_NOTE_TEMPLATES_VIEW ] as Route } /> @@ -449,7 +456,7 @@ const SettingsRoutes: FunctionComponent = ( {...props} pageRoute={ RouteMap[ - PageMap.SETTINGS_SCHEDULED_MAINTENANCE_NOTE_TEMPLATES + PageMap.SETTINGS_SCHEDULED_MAINTENANCE_NOTE_TEMPLATES ] as Route } /> @@ -468,7 +475,7 @@ const SettingsRoutes: FunctionComponent = ( {...props} pageRoute={ RouteMap[ - PageMap.SETTINGS_SCHEDULED_MAINTENANCE_NOTE_TEMPLATES_VIEW + PageMap.SETTINGS_SCHEDULED_MAINTENANCE_NOTE_TEMPLATES_VIEW ] as Route } /> @@ -554,6 +561,20 @@ const SettingsRoutes: FunctionComponent = ( } /> + + + + } + /> + = ( {...props} pageRoute={ RouteMap[ - PageMap.SETTINGS_SCHEDULED_MAINTENANCE_STATE + PageMap.SETTINGS_SCHEDULED_MAINTENANCE_STATE ] as Route } /> @@ -687,7 +708,7 @@ const SettingsRoutes: FunctionComponent = ( {...props} pageRoute={ RouteMap[ - PageMap.SETTINGS_TELEMETRY_INGESTION_KEY_VIEW + PageMap.SETTINGS_TELEMETRY_INGESTION_KEY_VIEW ] as Route } /> @@ -749,7 +770,7 @@ const SettingsRoutes: FunctionComponent = ( {...props} pageRoute={ RouteMap[ - PageMap.SETTINGS_SCHEDULED_MAINTENANCE_CUSTOM_FIELDS + PageMap.SETTINGS_SCHEDULED_MAINTENANCE_CUSTOM_FIELDS ] as Route } /> @@ -799,7 +820,7 @@ const SettingsRoutes: FunctionComponent = ( {...props} pageRoute={ RouteMap[ - PageMap.SETTINGS_ON_CALL_DUTY_POLICY_CUSTOM_FIELDS + PageMap.SETTINGS_ON_CALL_DUTY_POLICY_CUSTOM_FIELDS ] as Route } /> diff --git a/Dashboard/src/Utils/Breadcrumbs/SettingsBreadcrumbs.ts b/Dashboard/src/Utils/Breadcrumbs/SettingsBreadcrumbs.ts index fa22dff429..4390ee5db6 100644 --- a/Dashboard/src/Utils/Breadcrumbs/SettingsBreadcrumbs.ts +++ b/Dashboard/src/Utils/Breadcrumbs/SettingsBreadcrumbs.ts @@ -47,6 +47,11 @@ export function getSettingsBreadcrumbs(path: string): Array | undefined { "Settings", "Slack Integration", ]), + ...BuildBreadcrumbLinksByTitles(PageMap.SETTINGS_MICROSOFT_TEAMS_INTEGRATION, [ + "Project", + "Settings", + "Microsoft Teams Integration", + ]), ...BuildBreadcrumbLinksByTitles(PageMap.SETTINGS_INCIDENTS_SEVERITY, [ "Project", "Settings", diff --git a/Dashboard/src/Utils/PageMap.ts b/Dashboard/src/Utils/PageMap.ts index 6f1be7c944..cfa2d3e499 100644 --- a/Dashboard/src/Utils/PageMap.ts +++ b/Dashboard/src/Utils/PageMap.ts @@ -263,7 +263,7 @@ enum PageMap { // Workspace integrations SETTINGS_SLACK_INTEGRATION = "SETTINGS_SLACK_INTEGRATION", - SETTINGS_TEAMS_INTEGRATION = "SETTINGS_TEAMS_INTEGRATION", + SETTINGS_MICROSOFT_TEAMS_INTEGRATION = "SETTINGS_MICROSOFT_TEAMS_INTEGRATION", // Resource settings. SETTINGS_INCIDENTS_STATE = "SETTINGS_INCIDENTS_STATE", diff --git a/Dashboard/src/Utils/RouteMap.ts b/Dashboard/src/Utils/RouteMap.ts index 6c7e8164bd..e48b43bf9f 100644 --- a/Dashboard/src/Utils/RouteMap.ts +++ b/Dashboard/src/Utils/RouteMap.ts @@ -210,6 +210,7 @@ export const SettingsRoutePath: Dictionary = { [PageMap.SETTINGS_INCIDENT_CUSTOM_FIELDS]: "incident-custom-fields", [PageMap.SETTINGS_INCIDENTS_STATE]: "incidents-state", [PageMap.SETTINGS_SLACK_INTEGRATION]: "slack-integration", + [PageMap.SETTINGS_MICROSOFT_TEAMS_INTEGRATION]: "microsoft-teams-integration", [PageMap.SETTINGS_INCIDENTS_SEVERITY]: "incidents-severity", [PageMap.SETTINGS_INCIDENT_TEMPLATES]: "incident-templates", [PageMap.SETTINGS_INCIDENT_TEMPLATES_VIEW]: `incident-templates/${RouteParams.ModelID}`, @@ -1493,6 +1494,12 @@ const RouteMap: Dictionary = { }`, ), + [PageMap.SETTINGS_MICROSOFT_TEAMS_INTEGRATION]: new Route( + `/dashboard/${RouteParams.ProjectID}/settings/${ + SettingsRoutePath[PageMap.SETTINGS_MICROSOFT_TEAMS_INTEGRATION] + }`, + ), + [PageMap.SETTINGS_INCIDENT_TEMPLATES]: new Route( `/dashboard/${RouteParams.ProjectID}/settings/${ SettingsRoutePath[PageMap.SETTINGS_INCIDENT_TEMPLATES]