Skip to content

Commit

Permalink
feat: add Microsoft Teams integration settings to the dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
simlarsen committed Mar 4, 2025
1 parent a375990 commit 79083b4
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 10 deletions.
10 changes: 10 additions & 0 deletions Dashboard/src/Pages/Settings/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ const DashboardSideMenu: () => JSX.Element = (): ReactElement => {
}}
icon={IconProp.Slack}
/>

<SideMenuItem
link={{
title: "Microsoft Teams",
to: RouteUtil.populateRouteParams(
RouteMap[PageMap.SETTINGS_MICROSOFT_TEAMS_INTEGRATION] as Route,
),
}}
icon={IconProp.MicrosoftTeams}
/>
</SideMenuSection>

<SideMenuSection title="Monitors">
Expand Down
39 changes: 30 additions & 9 deletions Dashboard/src/Routes/SettingsRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ const ScheduledMaintenanceNoteTemplateView: LazyExoticComponent<
return import("../Pages/Settings/ScheduledMaintenanceNoteTemplateView");
});


const SettingsMicrosoftTeamsIntegration: LazyExoticComponent<
FunctionComponent<ComponentProps>
> = lazy(() => {
return import("../Pages/Settings/MicrosoftTeamsIntegration");
});

const SettingsUsageHistory: LazyExoticComponent<
FunctionComponent<ComponentProps>
> = lazy(() => {
Expand Down Expand Up @@ -320,7 +327,7 @@ const SettingsRoutes: FunctionComponent<ComponentProps> = (
{...props}
pageRoute={
RouteMap[
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_TEMPLATES
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_TEMPLATES
] as Route
}
/>
Expand All @@ -339,7 +346,7 @@ const SettingsRoutes: FunctionComponent<ComponentProps> = (
{...props}
pageRoute={
RouteMap[
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_TEMPLATES_VIEW
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_TEMPLATES_VIEW
] as Route
}
/>
Expand Down Expand Up @@ -414,7 +421,7 @@ const SettingsRoutes: FunctionComponent<ComponentProps> = (
{...props}
pageRoute={
RouteMap[
PageMap.SETTINGS_INCIDENT_NOTE_TEMPLATES_VIEW
PageMap.SETTINGS_INCIDENT_NOTE_TEMPLATES_VIEW
] as Route
}
/>
Expand Down Expand Up @@ -449,7 +456,7 @@ const SettingsRoutes: FunctionComponent<ComponentProps> = (
{...props}
pageRoute={
RouteMap[
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_NOTE_TEMPLATES
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_NOTE_TEMPLATES
] as Route
}
/>
Expand All @@ -468,7 +475,7 @@ const SettingsRoutes: FunctionComponent<ComponentProps> = (
{...props}
pageRoute={
RouteMap[
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_NOTE_TEMPLATES_VIEW
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_NOTE_TEMPLATES_VIEW
] as Route
}
/>
Expand Down Expand Up @@ -554,6 +561,20 @@ const SettingsRoutes: FunctionComponent<ComponentProps> = (
}
/>

<PageRoute
path={RouteUtil.getLastPathForKey(PageMap.SETTINGS_MICROSOFT_TEAMS_INTEGRATION)}
element={
<Suspense fallback={Loader}>
<SettingsMicrosoftTeamsIntegration
{...props}
pageRoute={
RouteMap[PageMap.SETTINGS_MICROSOFT_TEAMS_INTEGRATION] as Route
}
/>
</Suspense>
}
/>

<PageRoute
path={RouteUtil.getLastPathForKey(PageMap.SETTINGS_ALERTS_STATE)}
element={
Expand All @@ -576,7 +597,7 @@ const SettingsRoutes: FunctionComponent<ComponentProps> = (
{...props}
pageRoute={
RouteMap[
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_STATE
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_STATE
] as Route
}
/>
Expand Down Expand Up @@ -687,7 +708,7 @@ const SettingsRoutes: FunctionComponent<ComponentProps> = (
{...props}
pageRoute={
RouteMap[
PageMap.SETTINGS_TELEMETRY_INGESTION_KEY_VIEW
PageMap.SETTINGS_TELEMETRY_INGESTION_KEY_VIEW
] as Route
}
/>
Expand Down Expand Up @@ -749,7 +770,7 @@ const SettingsRoutes: FunctionComponent<ComponentProps> = (
{...props}
pageRoute={
RouteMap[
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_CUSTOM_FIELDS
PageMap.SETTINGS_SCHEDULED_MAINTENANCE_CUSTOM_FIELDS
] as Route
}
/>
Expand Down Expand Up @@ -799,7 +820,7 @@ const SettingsRoutes: FunctionComponent<ComponentProps> = (
{...props}
pageRoute={
RouteMap[
PageMap.SETTINGS_ON_CALL_DUTY_POLICY_CUSTOM_FIELDS
PageMap.SETTINGS_ON_CALL_DUTY_POLICY_CUSTOM_FIELDS
] as Route
}
/>
Expand Down
5 changes: 5 additions & 0 deletions Dashboard/src/Utils/Breadcrumbs/SettingsBreadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ export function getSettingsBreadcrumbs(path: string): Array<Link> | undefined {
"Settings",
"Slack Integration",
]),
...BuildBreadcrumbLinksByTitles(PageMap.SETTINGS_MICROSOFT_TEAMS_INTEGRATION, [
"Project",
"Settings",
"Microsoft Teams Integration",
]),
...BuildBreadcrumbLinksByTitles(PageMap.SETTINGS_INCIDENTS_SEVERITY, [
"Project",
"Settings",
Expand Down
2 changes: 1 addition & 1 deletion Dashboard/src/Utils/PageMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions Dashboard/src/Utils/RouteMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export const SettingsRoutePath: Dictionary<string> = {
[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}`,
Expand Down Expand Up @@ -1493,6 +1494,12 @@ const RouteMap: Dictionary<Route> = {
}`,
),

[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]
Expand Down

0 comments on commit 79083b4

Please sign in to comment.