Skip to content

Commit 2407e50

Browse files
cvxluoclaude
andauthored
ref(promotions): remove cancel subscription promotion trigger (#107871)
We no longer want to offer this promotion. Corresponding getsentry PR: getsentry/getsentry#19340. More context: https://sentry.slack.com/archives/C0910UXTXPX/p1770658228350119?thread_ts=1770657300.573029&cid=C0910UXTXPX Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9e9725a commit 2407e50

10 files changed

Lines changed: 7 additions & 723 deletions

File tree

static/gsApp/actionCreators/modal.tsx

Lines changed: 2 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
1-
import type {ComponentType} from 'react';
21
import type {Theme} from '@emotion/react';
32
import {css} from '@emotion/react';
4-
import styled from '@emotion/styled';
53

64
import {addErrorMessage} from 'sentry/actionCreators/indicator';
75
import {openModal} from 'sentry/actionCreators/modal';
86
import {promptsUpdate} from 'sentry/actionCreators/prompts';
97
import {Client} from 'sentry/api';
10-
import {openConfirmModal} from 'sentry/components/confirm';
11-
import {t, tct} from 'sentry/locale';
8+
import {tct} from 'sentry/locale';
129
import type {Organization} from 'sentry/types/organization';
1310

14-
import type {PromotionModalBodyProps} from 'getsentry/components/promotionModal';
1511
import type {Reservations} from 'getsentry/components/upgradeNowModal/types';
1612
import SubscriptionStore from 'getsentry/stores/subscriptionStore';
17-
import type {
18-
Invoice,
19-
Plan,
20-
PreviewData,
21-
Promotion,
22-
PromotionClaimed,
23-
Subscription,
24-
} from 'getsentry/types';
13+
import type {Invoice, Plan, PreviewData, Subscription} from 'getsentry/types';
2514
import {displayBudgetName, hasBillingAccess, supportsPayg} from 'getsentry/utils/billing';
2615
import type {AM2UpdateSurfaces} from 'getsentry/utils/trackGetsentryAnalytics';
2716

@@ -212,72 +201,6 @@ export async function openAM2ProfilingUpsellModal(options: ProfilingUpsellModalP
212201
openModal(deps => <Modal {...deps} {...options} />, {modalCss});
213202
}
214203

215-
type PromotionModalOptions = {
216-
organization: Organization;
217-
price: number;
218-
promotion: Promotion;
219-
promptFeature: string;
220-
PromotionModalBody?: ComponentType<PromotionModalBodyProps>;
221-
acceptButtonText?: string;
222-
api?: Client;
223-
declineButtonText?: string;
224-
onAccept?: () => void;
225-
};
226-
227-
export async function openPromotionModal(options: PromotionModalOptions) {
228-
const {default: Modal, modalCss} = await import('getsentry/components/promotionModal');
229-
openModal(deps => <Modal {...deps} {...options} />, {closeEvents: 'none', modalCss});
230-
}
231-
232-
export function openPromotionReminderModal(
233-
promotionClaimed: PromotionClaimed,
234-
onCancel?: () => void,
235-
onConfirm?: () => void
236-
) {
237-
const {dateCompleted} = promotionClaimed;
238-
const promo = promotionClaimed.promotion;
239-
const {amount, billingInterval, billingPeriods, maxCentsPerPeriod, reminderText} =
240-
promo.discountInfo;
241-
const date = new Date(dateCompleted);
242-
const percentOff = amount / 100;
243-
244-
const interval = billingInterval === 'monthly' ? t('months') : t('years');
245-
const intervalSingular = interval.slice(0, -1);
246-
247-
/**
248-
* Removed translation because of complicated pluralization and lots of changing
249-
* parameters from the different promotions we can use this for
250-
*/
251-
252-
openConfirmModal({
253-
message: (
254-
<div>
255-
<p>{reminderText}</p>
256-
<Subheader>{t('Current Promotion:')} </Subheader>
257-
<p>
258-
{percentOff}% off (up to ${maxCentsPerPeriod / 100} per {intervalSingular}) for{' '}
259-
{billingPeriods} {interval} starting on {date.toLocaleDateString('en-US')}
260-
</p>
261-
</div>
262-
),
263-
header: <HeaderText>Promotion Conflict</HeaderText>,
264-
priority: 'danger',
265-
confirmText: 'Downgrade Anyway',
266-
onCancel: () => onCancel?.(),
267-
onConfirm: () => onConfirm?.(),
268-
});
269-
}
270-
271-
const HeaderText = styled('div')`
272-
font-size: ${p => p.theme.font.size.xl};
273-
font-weight: bold;
274-
`;
275-
276-
const Subheader = styled('div')`
277-
font-weight: bold;
278-
font-size: ${p => p.theme.font.size.md};
279-
`;
280-
281204
export async function openDataConsentModal() {
282205
const {default: Modal} = await import('getsentry/components/dataConsentModal');
283206

static/gsApp/actionCreators/promotionReminderModal.spec.tsx

Lines changed: 0 additions & 58 deletions
This file was deleted.

static/gsApp/components/promotionModal.spec.tsx

Lines changed: 0 additions & 119 deletions
This file was deleted.

0 commit comments

Comments
 (0)