Skip to content

Commit

Permalink
feat(aci): connect views to router
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Jan 9, 2025
1 parent a22c000 commit 027f823
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions static/app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import withDomainRedirect from 'sentry/utils/withDomainRedirect';
import withDomainRequired from 'sentry/utils/withDomainRequired';
import App from 'sentry/views/app';
import AuthLayout from 'sentry/views/auth/layout';
import {AutomationRoutes} from 'sentry/views/automations/routes';
import {DetectorRoutes} from 'sentry/views/detectors/routes';
import {MODULE_BASE_URLS} from 'sentry/views/insights/common/utils/useModuleURL';
import {SUMMARY_PAGE_BASE_URL} from 'sentry/views/insights/mobile/screenRendering/settings';
import {AI_LANDING_SUB_PATH} from 'sentry/views/insights/pages/ai/settings';
Expand Down Expand Up @@ -2275,6 +2277,8 @@ function buildRoutes() {

const organizationRoutes = (
<Route component={errorHandler(OrganizationLayout)}>
<AutomationRoutes />
<DetectorRoutes />
{settingsRoutes}
{projectsRoutes}
{dashboardRoutes}
Expand Down
21 changes: 21 additions & 0 deletions static/app/views/automations/routes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {IndexRoute, Redirect, Route} from 'sentry/components/route';
import {makeLazyloadComponent as make} from 'sentry/routes';

export function AutomationRoutes() {
const root = `/automations/`;
return (
<Route path={root} withOrgPath>
<IndexRoute component={make(() => import('sentry/views/automations/list'))} />
<Redirect from=":slug/" to={root} />
<Redirect from=":slug/edit/" to={root} />
<Route
path=":projectId/:slug/"
component={make(() => import('sentry/views/automations/detail'))}
/>
<Route
path=":projectId/:slug/edit/"
component={make(() => import('sentry/views/automations/edit'))}
/>
</Route>
);
}
21 changes: 21 additions & 0 deletions static/app/views/detectors/routes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {IndexRoute, Redirect, Route} from 'sentry/components/route';
import {makeLazyloadComponent as make} from 'sentry/routes';

export function DetectorRoutes() {
const root = `/monitors/`;
return (
<Route path={root} withOrgPath>
<IndexRoute component={make(() => import('sentry/views/detectors/list'))} />
<Redirect from=":slug/" to={root} />
<Redirect from=":slug/edit/" to={root} />
<Route
path=":projectId/:slug/"
component={make(() => import('sentry/views/detectors/detail'))}
/>
<Route
path=":projectId/:slug/edit/"
component={make(() => import('sentry/views/detectors/edit'))}
/>
</Route>
);
}

0 comments on commit 027f823

Please sign in to comment.