Skip to content

Commit 11cba78

Browse files
fix(billing): Use ff for prevent notification (#99489)
fixes #99475 Moves Prevent Users toggle behind feature flag
1 parent 4b46e74 commit 11cba78

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

static/app/constants/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ export const DATA_CATEGORY_INFO = {
577577
titleName: t('Prevent Reviews'),
578578
productName: t('Prevent Reviews'),
579579
uid: 30,
580-
isBilledCategory: true,
580+
isBilledCategory: false,
581581
statsInfo: {
582582
...DEFAULT_STATS_INFO,
583583
showExternalStats: false, // TODO(prevent): add external stats when ready

static/app/views/settings/account/notifications/notificationSettingsByType.spec.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ describe('NotificationSettingsByType', () => {
325325
'continuous-profiling-billing',
326326
'seer-billing',
327327
'logs-billing',
328+
'prevent-billing',
328329
],
329330
});
330331
renderComponent({
@@ -345,6 +346,7 @@ describe('NotificationSettingsByType', () => {
345346
expect(screen.getByText('UI Profile Hours', {exact: true})).toBeInTheDocument();
346347
expect(screen.getByText('Seer Budget')).toBeInTheDocument();
347348
expect(screen.getByText('Logs')).toBeInTheDocument();
349+
expect(screen.getByText('Prevent Users')).toBeInTheDocument();
348350
expect(screen.queryByText('Transactions')).not.toBeInTheDocument();
349351

350352
const editSettingMock = MockApiClient.addMockResponse({
@@ -521,5 +523,6 @@ describe('NotificationSettingsByType', () => {
521523
expect(screen.queryByText('Transactions')).not.toBeInTheDocument();
522524
expect(screen.queryByText('Seer Budget')).not.toBeInTheDocument();
523525
expect(screen.queryByText('Logs')).not.toBeInTheDocument();
526+
expect(screen.queryByText('Prevent Users')).not.toBeInTheDocument();
524527
});
525528
});

static/app/views/settings/account/notifications/notificationSettingsByType.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ export function NotificationSettingsByType({notificationType}: Props) {
212212
organization.features?.includes('logs-billing')
213213
);
214214

215+
const hasPreventBilling = organizations.some(organization =>
216+
organization.features?.includes('prevent-billing')
217+
);
218+
215219
const excludeTransactions = hasOrgWithAm3 && !hasOrgWithoutAm3;
216220
const includeSpans = hasOrgWithAm3;
217221
const includeProfileDuration =
@@ -238,6 +242,9 @@ export function NotificationSettingsByType({notificationType}: Props) {
238242
if (field.name.startsWith('quotaLogBytes') && !includeLogs) {
239243
return false;
240244
}
245+
if (field.name.startsWith('quotaPrevent') && !hasPreventBilling) {
246+
return false;
247+
}
241248
return true;
242249
});
243250
};

0 commit comments

Comments
 (0)