|
@@ -19,6 +19,7 @@ import {
|
|
} from 'sentry/views/settings/account/notifications/fields';
|
|
} from 'sentry/views/settings/account/notifications/fields';
|
|
import NotificationSettingsByType from 'sentry/views/settings/account/notifications/notificationSettingsByType';
|
|
import NotificationSettingsByType from 'sentry/views/settings/account/notifications/notificationSettingsByType';
|
|
import {
|
|
import {
|
|
|
|
+ getNotificationTypeFromPathname,
|
|
groupByOrganization,
|
|
groupByOrganization,
|
|
isGroupedByProject,
|
|
isGroupedByProject,
|
|
} from 'sentry/views/settings/account/notifications/utils';
|
|
} from 'sentry/views/settings/account/notifications/utils';
|
|
@@ -32,6 +33,16 @@ const PanelBodyLineItem = styled(PanelBody)`
|
|
}
|
|
}
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
+const accountNotifications = [
|
|
|
|
+ 'alerts',
|
|
|
|
+ 'deploy',
|
|
|
|
+ 'workflow',
|
|
|
|
+ 'activeRelease',
|
|
|
|
+ 'approval',
|
|
|
|
+ 'quota',
|
|
|
|
+ 'spikeProtection',
|
|
|
|
+];
|
|
|
|
+
|
|
type ANBPProps = {
|
|
type ANBPProps = {
|
|
field: FineTuneField;
|
|
field: FineTuneField;
|
|
projects: Project[];
|
|
projects: Project[];
|
|
@@ -128,7 +139,8 @@ type State = AsyncView['state'] & {
|
|
|
|
|
|
class AccountNotificationFineTuning extends AsyncView<Props, State> {
|
|
class AccountNotificationFineTuning extends AsyncView<Props, State> {
|
|
getEndpoints(): ReturnType<AsyncView['getEndpoints']> {
|
|
getEndpoints(): ReturnType<AsyncView['getEndpoints']> {
|
|
- const {fineTuneType} = this.props.params;
|
|
|
|
|
|
+ const {fineTuneType: pathnameType} = this.props.params;
|
|
|
|
+ const fineTuneType = getNotificationTypeFromPathname(pathnameType);
|
|
const endpoints = [
|
|
const endpoints = [
|
|
['notifications', '/users/me/notifications/'],
|
|
['notifications', '/users/me/notifications/'],
|
|
['fineTuneData', `/users/me/notifications/${fineTuneType}/`],
|
|
['fineTuneData', `/users/me/notifications/${fineTuneType}/`],
|
|
@@ -167,13 +179,10 @@ class AccountNotificationFineTuning extends AsyncView<Props, State> {
|
|
|
|
|
|
renderBody() {
|
|
renderBody() {
|
|
const {params} = this.props;
|
|
const {params} = this.props;
|
|
- const {fineTuneType} = params;
|
|
|
|
|
|
+ const {fineTuneType: pathnameType} = params;
|
|
|
|
+ const fineTuneType = getNotificationTypeFromPathname(pathnameType);
|
|
|
|
|
|
- if (
|
|
|
|
- ['alerts', 'deploy', 'workflow', 'activeRelease', 'approval', 'quota'].includes(
|
|
|
|
- fineTuneType
|
|
|
|
- )
|
|
|
|
- ) {
|
|
|
|
|
|
+ if (accountNotifications.includes(fineTuneType)) {
|
|
return <NotificationSettingsByType notificationType={fineTuneType} />;
|
|
return <NotificationSettingsByType notificationType={fineTuneType} />;
|
|
}
|
|
}
|
|
|
|
|