Skip to content

Commit a495abf

Browse files
committed
feat(ui): Add basic templates for Incident Rules in settings
This just adds some placeholder views, routes, and tests for the new Incident Rules feature. These will change as we develop the feature.
1 parent 53e3360 commit a495abf

File tree

10 files changed

+1648
-3
lines changed

10 files changed

+1648
-3
lines changed

src/sentry/static/sentry/app/components/charts/baseChart.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class BaseChart extends React.Component {
108108
onFinished: PropTypes.func,
109109

110110
// Forwarded Ref
111-
forwardedRef: PropTypes.object,
111+
forwardedRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
112112

113113
// Custom chart props that are implemented by us (and not a feature of eCharts)
114114
/**

src/sentry/static/sentry/app/routes.jsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ function routes() {
597597
component={errorHandler(LazyLoad)}
598598
/>
599599
</Route>
600+
600601
<Route name="Developer Settings" path="developer-settings/">
601602
<IndexRoute
602603
componentPromise={() =>
@@ -621,6 +622,38 @@ function routes() {
621622
component={errorHandler(LazyLoad)}
622623
/>
623624
</Route>
625+
626+
<Route
627+
name="Incident Rules"
628+
path="incident-rules/"
629+
componentPromise={() =>
630+
import(/* webpackChunkName: "OrganizationIncidentRules" */ 'app/views/settings/organizationIncidentRules')
631+
}
632+
component={errorHandler(LazyLoad)}
633+
>
634+
<IndexRoute
635+
componentPromise={() =>
636+
import(/* webpackChunkName: "IncidentRulesList" */ 'app/views/settings/organizationIncidentRules/list')
637+
}
638+
component={errorHandler(LazyLoad)}
639+
/>
640+
<Route
641+
name="New Incident Rule"
642+
path="new/"
643+
componentPromise={() =>
644+
import(/* webpackChunkName: "IncidentRulesCreate" */ 'app/views/settings/organizationIncidentRules/create')
645+
}
646+
component={errorHandler(LazyLoad)}
647+
/>
648+
<Route
649+
name="Edit Incident Rule"
650+
path=":incidentRuleId/"
651+
componentPromise={() =>
652+
import(/* webpackChunkName: "IncidentRulesDetails" */ 'app/views/settings/organizationIncidentRules/details')
653+
}
654+
component={errorHandler(LazyLoad)}
655+
/>
656+
</Route>
624657
</React.Fragment>
625658
);
626659

src/sentry/static/sentry/app/views/settings/organization/navigationConfiguration.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const organizationNavigation = [
2929
path: `${pathPrefix}/members/`,
3030
title: t('Members'),
3131
// eslint-disable-next-line no-shadow
32-
badge: ({organization, access, features}) => {
32+
badge: ({organization, access}) => {
3333
if (!access.has('org:write')) {
3434
return null;
3535
}
@@ -76,6 +76,13 @@ const organizationNavigation = [
7676
description: t('Manage repositories connected to the organization'),
7777
id: 'repos',
7878
},
79+
{
80+
path: `${pathPrefix}/incident-rules/`,
81+
title: t('Incident Rules'),
82+
show: ({features}) => features.has('incidents'),
83+
description: t('Manage Incident Rules'),
84+
id: 'incident-rules',
85+
},
7986
{
8087
path: `${pathPrefix}/integrations/`,
8188
title: t('Integrations'),
@@ -87,7 +94,7 @@ const organizationNavigation = [
8794
{
8895
path: `${pathPrefix}/developer-settings/`,
8996
title: t('Developer Settings'),
90-
show: ({access, features}) => features.has('sentry-apps'),
97+
show: ({features}) => features.has('sentry-apps'),
9198
description: t('Manage developer applications'),
9299
id: 'developer-settings',
93100
},

0 commit comments

Comments
 (0)