Skip to content
Open
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
4 changes: 1 addition & 3 deletions static/app/views/alerts/rules/metric/details/body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,7 @@ export function MetricDetailsBody({
/>
<DetailWrapper>
<Stack flex="1" width="100%">
{organization.features.includes('workflow-engine-metric-issue-ui') && (
<MetricAlertOngoingIssues project={project} rule={rule} />
)}
<MetricAlertOngoingIssues project={project} rule={rule} />
<SectionHeading>{t('Alert History')}</SectionHeading>
<MetricHistory incidents={incidents} />
{[Dataset.METRICS, Dataset.SESSIONS, Dataset.ERRORS].includes(dataset) && (
Expand Down
4 changes: 4 additions & 0 deletions static/app/views/alerts/rules/metric/details/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ describe('MetricAlertDetails', () => {
url: '/organizations/org-slug/issues/',
body: [GroupFixture()],
});
MockApiClient.addMockResponse({
url: '/organizations/org-slug/alert-rule-detector/',
body: [],
});
});

afterEach(() => {
Expand Down
20 changes: 6 additions & 14 deletions static/app/views/alerts/rules/metric/ruleForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1427,10 +1427,6 @@ class RuleFormContainer extends DeprecatedAsyncComponent<Props, State> {
dataset,
traceItemType
);
const showWorkflowEngineMetricIssueUi = organization.features.includes(
'workflow-engine-metric-issue-ui'
);

// Rendering the main form body
return (
<Main width="full">
Expand Down Expand Up @@ -1536,9 +1532,7 @@ class RuleFormContainer extends DeprecatedAsyncComponent<Props, State> {
{
<div>
<Flex align="center" gap="sm">
{showWorkflowEngineMetricIssueUi
? t('Set issue detection thresholds')
: t('Set thresholds')}
{t('Set issue detection thresholds')}

{showExtrapolationModeChangeWarning && (
<WarningIcon
Expand All @@ -1564,13 +1558,11 @@ class RuleFormContainer extends DeprecatedAsyncComponent<Props, State> {
}
</AlertListItem>
<Stack gap="lg">
{showWorkflowEngineMetricIssueUi && (
<Text>
{t(
'Metric alerts create metric issues and events. The thresholds below will determine: when the issue is created, resolved, and re-opened, as well as the issue priority.'
)}
</Text>
)}
<Text>
{t(
'Metric alerts create metric issues and events. The thresholds below will determine: when the issue is created, resolved, and re-opened, as well as the issue priority.'
)}
</Text>
{thresholdTypeForm(formDisabled)}
</Stack>
{showErrorMigrationWarning && (
Expand Down
8 changes: 2 additions & 6 deletions static/app/views/alerts/wizard/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ describe('AlertWizard', () => {
});

await userEvent.click(screen.getByText('Throughput'));
expect(
screen.getByText(/Throughput is the total number of spans/)
).toBeInTheDocument();
expect(screen.getByText(/total number of spans/)).toBeInTheDocument();
});

it('hides logs aggregate alerts according to feature flag', () => {
Expand Down Expand Up @@ -188,9 +186,7 @@ describe('AlertWizard', () => {
});

await userEvent.click(screen.getByText('Throughput'));
expect(
screen.getByText(/Throughput is the total number of transactions/)
).toBeInTheDocument();
expect(screen.getByText(/total number of spans/)).toBeInTheDocument();
});

it('hides custom metrics alerts when feature flag is disabled', () => {
Expand Down
5 changes: 1 addition & 4 deletions static/app/views/alerts/wizard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ export default function AlertWizard() {
);
}

const hasMetricIssues = organization.features.includes(
'workflow-engine-metric-issue-ui'
);
const panelContent = getAlertWizardPanelContent({hasMetricIssues})[alertOption];
const panelContent = getAlertWizardPanelContent()[alertOption];
return (
<Stack flex={1}>
<SentryDocumentTitle title={t('Alert Creation Wizard')} projectSlug={projectSlug} />
Expand Down
212 changes: 71 additions & 141 deletions static/app/views/alerts/wizard/panelContent.tsx

Large diffs are not rendered by default.

24 changes: 0 additions & 24 deletions static/app/views/alerts/workflowEngineRedirects.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ describe('workflowEngineRedirects', () => {
it('redirects metric issue notification links to issue details', async () => {
const organization = OrganizationFixture({
slug: 'org-slug',
features: ['workflow-engine-metric-issue-ui'],
});

MockApiClient.addMockResponse({
Expand Down Expand Up @@ -166,29 +165,6 @@ describe('workflowEngineRedirects', () => {
notification_uuid: 'notification-uuid',
});
});

it('does not redirect without workflow-engine-metric-issue-ui flag', async () => {
const organization = OrganizationFixture({
slug: 'org-slug',
features: [],
});

const Wrapped = withMetricIssueRedirect(TestComponent);
const initialRouterConfig: RouterConfig = {
location: {
pathname: `/organizations/${organization.slug}/alerts/`,
query: {alert: 'alert-1', notification_uuid: 'notification-uuid'},
},
};

const {router} = render(<Wrapped />, {organization, initialRouterConfig});

// Path stays the same and we render the wrapped component
await screen.findByText('Wrapped content');
expect(router.location.pathname).toBe(
`/organizations/${organization.slug}/alerts/`
);
});
});

describe('withDetectorDetailsRedirect', () => {
Expand Down
9 changes: 2 additions & 7 deletions static/app/views/alerts/workflowEngineRedirects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,13 @@ export const withMetricIssueRedirect = <P extends Record<string, any>>(
Component: React.ComponentType<P>
) => {
return function MetricIssueRedirectWrapper(props: P) {
const organization = useOrganization();
const location = useLocation();
const alertId = location.query.alert as string | undefined;
const notificationUuid = location.query.notification_uuid;

const hasWorkflowEngineMetricIssueUI = organization.features.includes(
'workflow-engine-metric-issue-ui'
);
const hasMetricIssues = hasWorkflowEngineMetricIssueUI;
const shouldRedirectToIssue = notificationUuid && alertId && hasMetricIssues;
const shouldRedirectToIssue = notificationUuid && alertId;

// If the org has metric issues, we want notification links to redirect to the metric issue details page
// We want notification links to redirect to the metric issue details page
if (shouldRedirectToIssue) {
return (
<RedirectToIssue alertId={alertId}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ describe('DetectorSection', () => {
issueCategory: IssueCategory.METRIC,
issueType: IssueType.METRIC_ISSUE,
});
const orgWithOnlyMetricIssues = OrganizationFixture({
features: ['workflow-engine-metric-issue-ui'],
});
const orgWithOnlyMetricIssues = OrganizationFixture();
const metricDetector = MetricDetectorFixture({
id: detectorId,
alertRuleId,
Expand Down
Loading