Skip to content

Commit

Permalink
feat: add Slack workspace connection page and update routing and brea…
Browse files Browse the repository at this point in the history
…dcrumbs
  • Loading branch information
simlarsen committed Mar 4, 2025
1 parent 55470e0 commit 194cfd0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Dashboard/src/Pages/Alerts/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ const DashboardSideMenu: FunctionComponent<ComponentProps> = (
}}
/>
</SideMenuSection>

<SideMenuSection title="Workspace Connections">
<SideMenuItem
link={{
title: "Slack",
to: RouteUtil.populateRouteParams(
RouteMap[PageMap.ALERTS_WORKSPACE_CONNECTION_SLACK] as Route,
),
}}
icon={IconProp.Slack}
/>
</SideMenuSection>
</SideMenu>
);
};
Expand Down
18 changes: 18 additions & 0 deletions Dashboard/src/Routes/AlertRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ const AlertView: LazyExoticComponent<FunctionComponent<ComponentProps>> = lazy(
},
);

const AlertsWorkspaceConnectionSlack: LazyExoticComponent<
FunctionComponent<ComponentProps>
> = lazy(() => {
return import("../Pages/Alerts/WorkspaceConnectionSlack");
});

const AlertOnCallPolicyExecutionLogs: LazyExoticComponent<
FunctionComponent<ComponentProps>
> = lazy(() => {
Expand Down Expand Up @@ -107,6 +113,18 @@ const AlertsRoutes: FunctionComponent<ComponentProps> = (
</Suspense>
}
/>

<PageRoute
path={AlertsRoutePath[PageMap.ALERTS_WORKSPACE_CONNECTION_SLACK] || ""}
element={
<Suspense fallback={Loader}>
<AlertsWorkspaceConnectionSlack
{...props}
pageRoute={RouteMap[PageMap.ALERTS_WORKSPACE_CONNECTION_SLACK] as Route}
/>
</Suspense>
}
/>
</PageRoute>

<PageRoute
Expand Down
5 changes: 5 additions & 0 deletions Dashboard/src/Utils/Breadcrumbs/AlertBreadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export function getAlertsBreadcrumbs(path: string): Array<Link> | undefined {
"Alerts",
"Active Alerts",
]),
...BuildBreadcrumbLinksByTitles(PageMap.ALERTS_WORKSPACE_CONNECTION_SLACK, [
"Project",
"Alerts",
"Slack Connection",
]),
...BuildBreadcrumbLinksByTitles(PageMap.ALERT_VIEW, [
"Project",
"Alerts",
Expand Down
1 change: 1 addition & 0 deletions Dashboard/src/Utils/PageMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ enum PageMap {
ALERTS_ROOT = "ALERTS_ROOT",
ALERTS = "ALERTS",
UNRESOLVED_ALERTS = "UNRESOLVED_ALERTS",
ALERTS_WORKSPACE_CONNECTION_SLACK = "ALERTS_WORKSPACE_CONNECTION_SLACK",
ALERT_VIEW = "ALERT_VIEW",
ALERT_VIEW_DELETE = "ALERT_VIEW_DELETE",
ALERT_VIEW_STATE_TIMELINE = "ALERT_VIEW_STATE_TIMELINE",
Expand Down
8 changes: 8 additions & 0 deletions Dashboard/src/Utils/RouteMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export const IncidentsRoutePath: Dictionary<string> = {

export const AlertsRoutePath: Dictionary<string> = {
[PageMap.UNRESOLVED_ALERTS]: "unresolved",
[PageMap.ALERTS_WORKSPACE_CONNECTION_SLACK]: "workspace-connection-slack",
[PageMap.ALERT_VIEW]: `${RouteParams.ModelID}`,
[PageMap.ALERT_VIEW_STATE_TIMELINE]: `${RouteParams.ModelID}/state-timeline`,
[PageMap.ALERT_VIEW_OWNERS]: `${RouteParams.ModelID}/owners`,
Expand Down Expand Up @@ -425,6 +426,13 @@ const RouteMap: Dictionary<Route> = {
}`,
),


[PageMap.ALERTS_WORKSPACE_CONNECTION_SLACK]: new Route(
`/dashboard/${RouteParams.ProjectID}/alerts/${
AlertsRoutePath[PageMap.ALERTS_WORKSPACE_CONNECTION_SLACK]
}`,
),

[PageMap.ALERT_VIEW]: new Route(
`/dashboard/${RouteParams.ProjectID}/alerts/${
AlertsRoutePath[PageMap.ALERT_VIEW]
Expand Down

0 comments on commit 194cfd0

Please sign in to comment.