Skip to content
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
10 changes: 8 additions & 2 deletions static/app/views/alerts/wizard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import styled from '@emotion/styled';
import Feature from 'app/components/acl/feature';
import FeatureDisabled from 'app/components/acl/featureDisabled';
import CreateAlertButton from 'app/components/createAlertButton';
import FeatureBadge from 'app/components/featureBadge';
import Hovercard from 'app/components/hovercard';
import * as Layout from 'app/components/layouts/thirds';
import ExternalLink from 'app/components/links/externalLink';
Expand Down Expand Up @@ -181,9 +182,14 @@ class AlertWizard extends Component<Props, State> {
<WizardOptions>
<CategoryTitle>{t('Errors')}</CategoryTitle>
{getAlertWizardCategories(organization).map(
({categoryHeading, options}, i) => (
({categoryHeading, options, featureBadgeType}, i) => (
<OptionsWrapper key={categoryHeading}>
{i > 0 && <CategoryTitle>{categoryHeading}</CategoryTitle>}
{i > 0 && (
<CategoryTitle>
{categoryHeading}{' '}
{featureBadgeType && <FeatureBadge type={featureBadgeType} />}
</CategoryTitle>
)}
<RadioPanelGroup
choices={options.map(alertType => {
return [alertType, AlertWizardAlertNames[alertType]];
Expand Down
10 changes: 9 additions & 1 deletion static/app/views/alerts/wizard/options.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {ComponentProps} from 'react';

import diagramApdex from 'sentry-images/spot/alerts-wizard-apdex.svg';
import diagramCLS from 'sentry-images/spot/alerts-wizard-cls.svg';
import diagramCrashFreeSessions from 'sentry-images/spot/alerts-wizard-crash-free-sessions.svg';
Expand All @@ -12,6 +14,7 @@ import diagramThroughput from 'sentry-images/spot/alerts-wizard-throughput.svg';
import diagramTransactionDuration from 'sentry-images/spot/alerts-wizard-transaction-duration.svg';
import diagramUsers from 'sentry-images/spot/alerts-wizard-users-experiencing-errors.svg';

import FeatureBadge from 'app/components/featureBadge';
import {t} from 'app/locale';
import {Organization} from 'app/types';
import {
Expand Down Expand Up @@ -53,7 +56,11 @@ export const AlertWizardAlertNames: Record<AlertType, string> = {
crash_free_users: t('Crash Free User Rate'),
};

type AlertWizardCategory = {categoryHeading: string; options: AlertType[]};
type AlertWizardCategory = {
categoryHeading: string;
options: AlertType[];
featureBadgeType?: ComponentProps<typeof FeatureBadge>['type'];
};
export const getAlertWizardCategories = (org: Organization): AlertWizardCategory[] => [
{
categoryHeading: t('Errors'),
Expand All @@ -64,6 +71,7 @@ export const getAlertWizardCategories = (org: Organization): AlertWizardCategory
{
categoryHeading: t('Sessions'),
options: ['crash_free_sessions', 'crash_free_users'] as AlertType[],
featureBadgeType: 'beta' as const,
},
]
: []),
Expand Down