Skip to content

Commit

Permalink
Add page routes for schedule and escalation policies (#76408)
Browse files Browse the repository at this point in the history
Adds Routes for the Schedule and Escalation Policies pages within the
Alerts product section
  • Loading branch information
MichaelSun48 committed Aug 20, 2024
1 parent 69ecc4c commit 54772f2
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 1 deletion.
14 changes: 14 additions & 0 deletions static/app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,20 @@ function buildRoutes() {
<IndexRoute
component={make(() => import('sentry/views/alerts/list/incidents'))}
/>
<Route path="policies/">
<IndexRoute
component={make(
() => import('sentry/views/alerts/escalationPolicies/escalationPolicyList')
)}
/>
</Route>
<Route path="schedules/">
<IndexRoute
component={make(
() => import('sentry/views/alerts/triageSchedules/triageSchedules')
)}
/>
</Route>
<Route path="rules/">
<IndexRoute
component={make(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {Fragment} from 'react';

import * as Layout from 'sentry/components/layouts/thirds';
import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
import {t} from 'sentry/locale';
import useOrganization from 'sentry/utils/useOrganization';
import useRouter from 'sentry/utils/useRouter';
import AlertHeader from 'sentry/views/alerts/list/header';

function EscalationPolicyList() {
const router = useRouter();
const organization = useOrganization();

return (
<Fragment>
<SentryDocumentTitle title={t('Escalation Policies')} orgSlug={organization.slug} />

<PageFiltersContainer>
<AlertHeader router={router} activeTab="policies" />
<Layout.Body>
<Layout.Main fullWidth>WIP by Michael</Layout.Main>
</Layout.Body>
</PageFiltersContainer>
</Fragment>
);
}

export default EscalationPolicyList;
14 changes: 13 additions & 1 deletion static/app/views/alerts/list/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import useOrganization from 'sentry/utils/useOrganization';
import usePageFilters from 'sentry/utils/usePageFilters';

type Props = {
activeTab: 'stream' | 'rules';
activeTab: 'stream' | 'rules' | 'policies' | 'schedules';
router: InjectedRouter;
};

Expand Down Expand Up @@ -86,6 +86,18 @@ function AlertHeader({router, activeTab}: Props) {
{t('History')}
</GlobalSelectionLink>
</li>
<li className={activeTab === 'policies' ? 'active' : ''}>
<GlobalSelectionLink to={`/organizations/${organization.slug}/alerts/policies`}>
{t('Escalation Policies')}
</GlobalSelectionLink>
</li>
<li className={activeTab === 'schedules' ? 'active' : ''}>
<GlobalSelectionLink
to={`/organizations/${organization.slug}/alerts/schedules`}
>
{t('Schedule')}
</GlobalSelectionLink>
</li>
</Layout.HeaderNavTabs>
</Layout.Header>
);
Expand Down
31 changes: 31 additions & 0 deletions static/app/views/alerts/triageSchedules/triageSchedules.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {Fragment} from 'react';

import * as Layout from 'sentry/components/layouts/thirds';
import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
import {t} from 'sentry/locale';
import useOrganization from 'sentry/utils/useOrganization';
import useRouter from 'sentry/utils/useRouter';
import AlertHeader from 'sentry/views/alerts/list/header';

function TriageSchedulePage() {
const router = useRouter();
const organization = useOrganization();

return (
<Fragment>
<SentryDocumentTitle title={t('Escalation Policies')} orgSlug={organization.slug} />

<PageFiltersContainer>
<AlertHeader router={router} activeTab="schedules" />
<Layout.Body>
<Layout.Main fullWidth>
Add your content to the schedules page here!
</Layout.Main>
</Layout.Body>
</PageFiltersContainer>
</Fragment>
);
}

export default TriageSchedulePage;

0 comments on commit 54772f2

Please sign in to comment.