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
7 changes: 5 additions & 2 deletions static/gsApp/views/amCheckout/billingCycleSelectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {t, tct} from 'sentry/locale';

import {ANNUAL} from 'getsentry/constants';
import type {Plan, Subscription} from 'getsentry/types';
import {isDeveloperPlan} from 'getsentry/utils/billing';
import {displayBudgetName, isDeveloperPlan} from 'getsentry/utils/billing';
import CheckoutOption from 'getsentry/views/amCheckout/checkoutOption';
import type {CheckoutFormData} from 'getsentry/views/amCheckout/types';

Expand Down Expand Up @@ -72,7 +72,10 @@ function BillingCycleSelectCard({

const additionalInfo = isAnnual
? tct('[budgetTerm] usage billed monthly, discount does not apply', {
budgetTerm: plan.budgetTerm === 'pay-as-you-go' ? 'PAYG' : plan.budgetTerm,
budgetTerm:
plan.budgetTerm === 'pay-as-you-go'
? 'PAYG'
: displayBudgetName(plan, {title: true}),
})
: t('Cancel anytime');

Expand Down
10 changes: 7 additions & 3 deletions static/gsApp/views/amCheckout/cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import {t, tct} from 'sentry/locale';
import {DataCategory} from 'sentry/types/core';
import type {Organization} from 'sentry/types/organization';
import {capitalize} from 'sentry/utils/string/capitalize';

Check failure on line 18 in static/gsApp/views/amCheckout/cart.tsx

View workflow job for this annotation

GitHub Actions / typescript

'capitalize' is declared but its value is never read.
import {toTitleCase} from 'sentry/utils/string/toTitleCase';
import useApi from 'sentry/utils/useApi';

Expand All @@ -30,6 +30,7 @@
type Subscription,
} from 'getsentry/types';
import {
displayBudgetName,
formatReservedWithUnits,
getPlanIcon,
getProductIcon,
Expand Down Expand Up @@ -238,13 +239,16 @@
budgetTerm:
activePlan.budgetTerm === 'pay-as-you-go'
? 'PAYG'
: activePlan.budgetTerm,
: displayBudgetName(activePlan, {title: true}),
})
) : (
// "Unlock with on-demand" gets cut off in non-chonk theme
<Text size="xs">
{tct('Unlock with [budgetTerm]', {
budgetTerm: activePlan.budgetTerm,
budgetTerm:
activePlan.budgetTerm === 'pay-as-you-go'

Check failure on line 249 in static/gsApp/views/amCheckout/cart.tsx

View workflow job for this annotation

GitHub Actions / typescript

This comparison appears to be unintentional because the types '"on-demand"' and '"pay-as-you-go"' have no overlap.
? 'PAYG'
: displayBudgetName(activePlan, {title: true}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also keep this sentence case for OD in the whole cart? i think it should only title case if it's at the start of the sentence

})}
</Text>
)}
Expand Down Expand Up @@ -364,7 +368,7 @@
<ItemFlex>
<Text>
{tct('[budgetTerm] spend limit', {
budgetTerm: capitalize(activePlan.budgetTerm),
budgetTerm: displayBudgetName(activePlan, {title: true}),
})}
</Text>
<Flex direction="column" gap="sm" align="end">
Expand Down
4 changes: 2 additions & 2 deletions static/gsApp/views/amCheckout/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ function assertCheckoutV3Steps(tier: PlanTier) {
[
'Build your plan',
[PlanTier.AM1, PlanTier.AM2].includes(tier)
? /Set your on-demand limit/
: /Set your pay-as-you-go limit/,
? /Set your On-Demand limit/
: /Set your Pay-as-you-go limit/,
'Pay monthly or yearly, your choice',
'Edit billing information',
].forEach(step => {
Expand Down
3 changes: 2 additions & 1 deletion static/gsApp/views/amCheckout/steps/setSpendLimit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Flex} from 'sentry/components/core/layout';
import {t} from 'sentry/locale';

import type {OnDemandBudgets} from 'getsentry/types';
import {displayBudgetName} from 'getsentry/utils/billing';
import trackGetsentryAnalytics from 'getsentry/utils/trackGetsentryAnalytics';
import ReserveAdditionalVolume from 'getsentry/views/amCheckout/reserveAdditionalVolume';
import StepHeader from 'getsentry/views/amCheckout/steps/stepHeader';
Expand Down Expand Up @@ -55,7 +56,7 @@ function SetSpendCap({
organization={organization}
header={
<StepHeader
title={t('Set your %s limit', activePlan.budgetTerm)}
title={t('Set your %s limit', displayBudgetName(activePlan, {title: true}))}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be title case; it was requested we keep steps sentence-case

isActive
stepNumber={stepNumber}
isCompleted={false}
Expand Down
5 changes: 3 additions & 2 deletions static/gsApp/views/spendLimits/spendLimitSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
type Plan,
} from 'getsentry/types';
import {
displayBudgetName,
formatReservedWithUnits,
getReservedBudgetCategoryForAddOn,
isAm2Plan,
Expand Down Expand Up @@ -656,8 +657,8 @@ function SpendLimitSettings({
{
budgetTerm:
activePlan.budgetTerm === 'pay-as-you-go'
? `${capitalize(activePlan.budgetTerm)} (PAYG)`
: `${capitalize(activePlan.budgetTerm)}`,
? `${displayBudgetName(activePlan, {title: true})} (PAYG)`
: displayBudgetName(activePlan, {title: true}),
}
)}
</Text>
Expand Down
7 changes: 6 additions & 1 deletion static/gsApp/views/subscriptionPage/onDemandSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ export function OnDemandSettings({subscription, organization}: OnDemandSettingsP
},
success: data => {
SubscriptionStore.set(data.slug, data);
addSuccessMessage(t('%s max spend updated', subscription.planDetails.budgetTerm));
addSuccessMessage(
t(
'%s max spend updated',
displayBudgetName(subscription.planDetails, {title: true})
)
);
},
});
}
Expand Down
Loading