Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add page routes for schedule and escalation policies #76408

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Loading