Skip to content

Commit

Permalink
ref(settings): Clean up unused notifications constants (#82692)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper authored Dec 31, 2024
1 parent d2cca28 commit 5773681
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 39 deletions.
38 changes: 1 addition & 37 deletions static/app/views/settings/account/notifications/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
import {t} from 'sentry/locale';

export const ALL_PROVIDERS = {
email: 'default',
slack: 'never',
msteams: 'never',
};
export const ALL_PROVIDER_NAMES = Object.keys(ALL_PROVIDERS);

/**
* These values are stolen from the DB.
*/
export const VALUE_MAPPING = {
default: 0,
never: 10,
always: 20,
subscribe_only: 30,
committed_only: 40,
};

export const SUPPORTED_PROVIDERS = ['email', 'slack', 'msteams'] as const;
export type SupportedProviders = (typeof SUPPORTED_PROVIDERS)[number];

export const MIN_PROJECTS_FOR_CONFIRMATION = 3;
export const MIN_PROJECTS_FOR_SEARCH = 3;
export const MIN_PROJECTS_FOR_PAGINATION = 100;
export type ProviderValue = 'always' | 'never';

interface NotificationBaseObject {
Expand Down Expand Up @@ -65,7 +42,7 @@ export const SELF_NOTIFICATION_SETTINGS_TYPES = [
];

// 'alerts' | 'workflow' ...
export type NotificationSettingsType = (typeof NOTIFICATION_SETTINGS_TYPES)[number];
type NotificationSettingsType = (typeof NOTIFICATION_SETTINGS_TYPES)[number];

export const NOTIFICATION_SETTINGS_PATHNAMES: Record<NotificationSettingsType, string> = {
alerts: 'alerts',
Expand All @@ -79,19 +56,6 @@ export const NOTIFICATION_SETTINGS_PATHNAMES: Record<NotificationSettingsType, s
brokenMonitors: 'broken-monitors',
};

export const CONFIRMATION_MESSAGE = (
<div>
<p style={{marginBottom: '20px'}}>
<strong>Are you sure you want to disable these notifications?</strong>
</p>
<p>
{t(
'Turning this off will irreversibly overwrite all of your fine-tuning settings to "off".'
)}
</p>
</div>
);

export const NOTIFICATION_FEATURE_MAP: Partial<
Record<NotificationSettingsType, string | Array<string>>
> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class NotificationSettingsByTypeV2 extends DeprecatedAsyncComponent<Props, State

export default withOrganizations(NotificationSettingsByTypeV2);

export const TopJsonForm = styled(JsonForm)`
const TopJsonForm = styled(JsonForm)`
${Panel} {
border-bottom: 0;
margin-bottom: 0;
Expand All @@ -483,7 +483,7 @@ export const TopJsonForm = styled(JsonForm)`
}
`;

export const BottomJsonForm = styled(JsonForm)`
const BottomJsonForm = styled(JsonForm)`
${Panel} {
border-top-right-radius: 0;
border-top-left-radius: 0;
Expand Down

0 comments on commit 5773681

Please sign in to comment.