|
@@ -4,6 +4,7 @@ import styled from '@emotion/styled';
|
|
|
|
|
|
import Feature from 'sentry/components/acl/feature';
|
|
|
import FeatureDisabled from 'sentry/components/acl/featureDisabled';
|
|
|
+import Tag from 'sentry/components/badge/tag';
|
|
|
import CreateAlertButton from 'sentry/components/createAlertButton';
|
|
|
import {Hovercard} from 'sentry/components/hovercard';
|
|
|
import * as Layout from 'sentry/components/layouts/thirds';
|
|
@@ -18,6 +19,7 @@ import {t} from 'sentry/locale';
|
|
|
import {space} from 'sentry/styles/space';
|
|
|
import type {Organization} from 'sentry/types/organization';
|
|
|
import {trackAnalytics} from 'sentry/utils/analytics';
|
|
|
+import {hasCustomMetricsExtractionRules} from 'sentry/utils/metrics/features';
|
|
|
import BuilderBreadCrumbs from 'sentry/views/alerts/builder/builderBreadCrumbs';
|
|
|
import {Dataset} from 'sentry/views/alerts/rules/metric/types';
|
|
|
import {AlertRuleType} from 'sentry/views/alerts/types';
|
|
@@ -156,11 +158,18 @@ function AlertWizard({organization, params, location, projectId}: AlertWizardPro
|
|
|
({categoryHeading, options}) => (
|
|
|
<div key={categoryHeading}>
|
|
|
<CategoryTitle>{categoryHeading} </CategoryTitle>
|
|
|
- <RadioPanelGroup
|
|
|
+ <WizardGroupedOptions
|
|
|
choices={options.map(alertType => {
|
|
|
- return [alertType, AlertWizardAlertNames[alertType]];
|
|
|
+ return [
|
|
|
+ alertType,
|
|
|
+ AlertWizardAlertNames[alertType],
|
|
|
+ alertType === 'custom_metrics' &&
|
|
|
+ hasCustomMetricsExtractionRules(organization) ? (
|
|
|
+ <Tag type="warning">{t('deprecated')}</Tag>
|
|
|
+ ) : null,
|
|
|
+ ];
|
|
|
})}
|
|
|
- onChange={handleChangeAlertOption}
|
|
|
+ onChange={option => handleChangeAlertOption(option as AlertType)}
|
|
|
value={alertOption}
|
|
|
label="alert-option"
|
|
|
/>
|
|
@@ -288,4 +297,10 @@ const WizardButtonContainer = styled('div')`
|
|
|
}
|
|
|
`;
|
|
|
|
|
|
+const WizardGroupedOptions = styled(RadioPanelGroup)`
|
|
|
+ label {
|
|
|
+ grid-template-columns: repeat(3, max-content);
|
|
|
+ }
|
|
|
+`;
|
|
|
+
|
|
|
export default AlertWizard;
|