Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ export function ProcessingErrorItem({error, checkinTooltip}: Props) {
{checkinTooltip}
);
case ProcessingErrorType.MONITOR_DISABLED_NO_QUOTA:
// TODO: this should really be a gsApp hook so we have subscription context, but
// for now we'll just default to "pay-as-you-go" since it's the modern term
return tct(
'A [checkinTooltip:check-in] upsert was sent, but due to insufficient quota a new monitor could not be enabled. Increase your Crons on-demand budget in your [link: subscription settings], and then enable this monitor.',
'A [checkinTooltip:check-in] upsert was sent, but due to insufficient quota a new monitor could not be enabled. Increase your Crons pay-as-you-go budget in your [link: subscription settings], and then enable this monitor.',
{checkinTooltip, link: <Link to="/settings/billing/overview/" />}
);
case ProcessingErrorType.MONITOR_INVALID_CONFIG:
Expand Down
2 changes: 0 additions & 2 deletions static/gsAdmin/components/customerStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ const getTooltip = ({planDetails, trialPlan}: Subscription) => (
)}
<dt>Base Price:</dt>
<dd>{formatCurrency(planDetails?.price)}</dd>
<dt>On-Demand:</dt>
<dd>{formatCurrency(planDetails?.onDemandEventPrice)} / event</dd>
<dt>Contract:</dt>
<dd>{planDetails?.contractInterval}</dd>
<dt>Billed:</dt>
Expand Down
2 changes: 1 addition & 1 deletion static/gsAdmin/components/customers/customerHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function CustomerHistory({orgId, ...props}: Props) {
columns={[
<th key="period">Period</th>,
<th key="onDemand" style={{width: 200, textAlign: 'right'}}>
On-Demand
Pay-as-you-go
</th>,
<th key="reserved" style={{width: 200, textAlign: 'right'}}>
Reserved
Expand Down
12 changes: 5 additions & 7 deletions static/gsAdmin/components/customers/customerOverview.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,20 +190,18 @@ describe('CustomerOverview', () => {
expect(screen.getByText('Total: $0.00 / $3,000,000.00')).toBeInTheDocument();

// CPE information
expect(screen.getByText('Pay-as-you-go Cost-Per-Event Errors:')).toBeInTheDocument();
expect(screen.getByText('On-Demand Cost-Per-Event Errors:')).toBeInTheDocument();
expect(screen.getByText('$0.12345678')).toBeInTheDocument();
expect(
screen.getByText('Pay-as-you-go Cost-Per-Event Performance units:')
screen.getByText('On-Demand Cost-Per-Event Performance units:')
).toBeInTheDocument();
expect(screen.getByText('$1.00000000')).toBeInTheDocument();
expect(screen.getByText('Pay-as-you-go Cost-Per-Event Replays:')).toBeInTheDocument();
expect(screen.getByText('On-Demand Cost-Per-Event Replays:')).toBeInTheDocument();
expect(screen.getByText('$0.50000000')).toBeInTheDocument();
expect(
screen.getByText('Pay-as-you-go Cost-Per-Event Attachments:')
).toBeInTheDocument();
expect(screen.getByText('On-Demand Cost-Per-Event Attachments:')).toBeInTheDocument();
expect(screen.getByText('$0.20300000')).toBeInTheDocument();
expect(
screen.getByText('Pay-as-you-go Cost-Per-Event Cron monitors:')
screen.getByText('On-Demand Cost-Per-Event Cron monitors:')
).toBeInTheDocument();
expect(screen.getByText('$0.07550000')).toBeInTheDocument();
});
Expand Down
6 changes: 5 additions & 1 deletion static/gsAdmin/components/customers/customerOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import type {
} from 'getsentry/types';
import {BillingType, OnDemandBudgetMode} from 'getsentry/types';
import {
displayBudgetName,
formatBalance,
formatReservedWithUnits,
getActiveProductTrial,
Expand Down Expand Up @@ -130,6 +131,7 @@ function SubscriptionSummary({customer, onAction}: SubscriptionSummaryProps) {
<small>{customer.contractInterval}</small>
</DetailLabel>
)}
{/* TODO(billing): Should we start calling On-Demand periods "Pay-as-you-go" periods? */}
<DetailLabel title="On-Demand">
<OnDemandSummary customer={customer} />
</DetailLabel>
Expand Down Expand Up @@ -213,7 +215,9 @@ function ReservedData({customer}: ReservedDataProps) {
: 'None'}
</DetailLabel>
{customer.onDemandInvoicedManual && (
<DetailLabel title={`Pay-as-you-go Cost-Per-Event ${categoryName}`}>
<DetailLabel
title={`${displayBudgetName(customer.planDetails, {title: true})} Cost-Per-Event ${categoryName}`}
>
{typeof categoryHistory.paygCpe === 'number'
? displayPriceWithCents({
cents: categoryHistory.paygCpe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export function CustomerStatsFilters({

const {start, end, period, utc} = pageDateTime;

// TODO(billing): Should we start calling On-Demand periods "Pay-as-you-go" periods?
const onDemandLabel = (
<Fragment>
On-Demand (
Expand Down
10 changes: 6 additions & 4 deletions static/gsAdmin/components/customers/pendingChanges.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe('PendingChanges', () => {
name: 'Team (Enterprise)',
contractInterval: 'annual',
billingInterval: 'annual',
budgetTerm: 'on-demand',
}),
plan: 'am1_team_ent',
planName: 'Team (Enterprise)',
Expand Down Expand Up @@ -87,7 +88,7 @@ describe('PendingChanges', () => {
expect(container).toHaveTextContent(
'The following changes will take effect on Feb 16, 2022'
);
expect(container).toHaveTextContent('On-demand maximum — $0.00 → $500.00');
expect(container).toHaveTextContent('On-Demand maximum — $0.00 → $500.00');
});

it('renders pending changes with all categories', () => {
Expand All @@ -100,6 +101,7 @@ describe('PendingChanges', () => {
name: 'Team (Enterprise)',
contractInterval: 'annual',
billingInterval: 'annual',
budgetTerm: 'on-demand',
}),
plan: 'am3_team_ent',
planName: 'Team (Enterprise)',
Expand Down Expand Up @@ -140,7 +142,7 @@ describe('PendingChanges', () => {
expect(container).toHaveTextContent(
'The following changes will take effect on Feb 20, 2024'
);
expect(container).toHaveTextContent('On-demand maximum — $0.00 → $500.00');
expect(container).toHaveTextContent('On-Demand maximum — $0.00 → $500.00');
});

it('renders on-demand budgets', () => {
Expand Down Expand Up @@ -189,7 +191,7 @@ describe('PendingChanges', () => {
'The following changes will take effect on Feb 16, 2022'
);
expect(container).toHaveTextContent(
'On-demand budget — shared on-demand budget of $100 → per-category on-demand budget (errors at $3, transactions at $2, and attachments at $1)'
'On-Demand Budget — shared on-demand budget of $100 → per-category on-demand budget (errors at $3, transactions at $2, and attachments at $1)'
);
});

Expand Down Expand Up @@ -234,7 +236,7 @@ describe('PendingChanges', () => {
);
expect(container).toHaveTextContent('Plan changes — Developer → Team (Enterprise)');
expect(container).toHaveTextContent(
'On-demand budget — shared on-demand budget of $100 → per-category on-demand budget (errors at $3, transactions at $2, and attachments at $1)'
'On-Demand Budget — shared on-demand budget of $100 → per-category on-demand budget (errors at $3, transactions at $2, and attachments at $1)'
);
expect(screen.getAllByText(/The following changes will take effect on/)).toHaveLength(
1
Expand Down
8 changes: 5 additions & 3 deletions static/gsAdmin/components/customers/pendingChanges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {DataCategory} from 'sentry/types/core';
import {RESERVED_BUDGET_QUOTA} from 'getsentry/constants';
import {usePlanMigrations} from 'getsentry/hooks/usePlanMigrations';
import type {Plan, PlanMigration, Subscription} from 'getsentry/types';
import {formatReservedWithUnits} from 'getsentry/utils/billing';
import {displayBudgetName, formatReservedWithUnits} from 'getsentry/utils/billing';
import {
getPlanCategoryName,
getReservedBudgetDisplayName,
Expand Down Expand Up @@ -307,7 +307,8 @@ function getOnDemandChanges(subscription: Subscription) {
);
changes.push(
<span>
On-demand budget — {current} → {change}
{displayBudgetName(pendingChanges.planDetails, {title: true, withBudget: true})}{' '}
— {current} → {change}
</span>
);
}
Expand All @@ -316,7 +317,8 @@ function getOnDemandChanges(subscription: Subscription) {
const change = getStringForPrice(pendingChanges.onDemandMaxSpend);
changes.push(
<span>
On-demand maximum — {old} → {change}
{displayBudgetName(pendingChanges.planDetails, {title: true})} maximum — {old} →{' '}
{change}
</span>
);
}
Expand Down
38 changes: 19 additions & 19 deletions static/gsAdmin/components/provisionSubscriptionAction.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,22 +281,22 @@ describe('provisionSubscriptionAction', () => {
);

expect(
within(container).getByLabelText('On-Demand Max Spend Setting')
within(container).getByLabelText('Pay-as-you-go Max Spend Setting')
).toBeInTheDocument();
expect(
within(container).queryByLabelText('On-Demand Cost-Per-Event Errors')
within(container).queryByLabelText('Pay-as-you-go Cost-Per-Event Errors')
).not.toBeInTheDocument();
expect(
within(container).queryByLabelText('On-Demand Cost-Per-Event Performance Units')
within(container).queryByLabelText('Pay-as-you-go Cost-Per-Event Performance Units')
).not.toBeInTheDocument();
expect(
within(container).queryByLabelText('On-Demand Cost-Per-Event Replays')
within(container).queryByLabelText('Pay-as-you-go Cost-Per-Event Replays')
).not.toBeInTheDocument();
expect(
within(container).queryByLabelText('On-Demand Cost-Per-Event Attachments')
within(container).queryByLabelText('Pay-as-you-go Cost-Per-Event Attachments')
).not.toBeInTheDocument();
expect(
within(container).queryByLabelText('On-Demand Cost-Per-Event Cron Monitors')
within(container).queryByLabelText('Pay-as-you-go Cost-Per-Event Cron Monitors')
).not.toBeInTheDocument();
});

Expand Down Expand Up @@ -325,19 +325,19 @@ describe('provisionSubscriptionAction', () => {
).not.toBeInTheDocument();

await selectEvent.select(
screen.getByRole('textbox', {name: 'On-Demand Max Spend Setting'}),
screen.getByRole('textbox', {name: 'Pay-as-you-go Max Spend Setting'}),
'Shared'
);
expect(
(await within(container).findAllByLabelText(/On-Demand Cost-Per-Event/)).length
(await within(container).findAllByLabelText(/Pay-as-you-go Cost-Per-Event/)).length
).toBeGreaterThan(0);

await selectEvent.select(
screen.getByRole('textbox', {name: 'On-Demand Max Spend Setting'}),
screen.getByRole('textbox', {name: 'Pay-as-you-go Max Spend Setting'}),
'Disable'
);
expect(
within(container).queryByLabelText(/On-Demand Cost-Per-Event/)
within(container).queryByLabelText(/Pay-as-you-go Cost-Per-Event/)
).not.toBeInTheDocument();
});

Expand All @@ -363,7 +363,7 @@ describe('provisionSubscriptionAction', () => {
'Invoiced'
);
await selectEvent.select(
screen.getByRole('textbox', {name: 'On-Demand Max Spend Setting'}),
screen.getByRole('textbox', {name: 'Pay-as-you-go Max Spend Setting'}),
'Shared'
);
const disabledSoftCapFields = screen.getAllByLabelText(/Soft Cap Type/);
Expand All @@ -389,7 +389,7 @@ describe('provisionSubscriptionAction', () => {
'Invoiced'
);
await selectEvent.select(
screen.getByRole('textbox', {name: 'On-Demand Max Spend Setting'}),
screen.getByRole('textbox', {name: 'Pay-as-you-go Max Spend Setting'}),
'Disable'
);
const enabledSoftCapFields = screen.getAllByLabelText(/Soft Cap Type/);
Expand Down Expand Up @@ -845,21 +845,21 @@ describe('provisionSubscriptionAction', () => {
'Invoiced'
);
await selectEvent.select(
await screen.findByRole('textbox', {name: 'On-Demand Max Spend Setting'}),
await screen.findByRole('textbox', {name: 'Pay-as-you-go Max Spend Setting'}),
'Shared'
);

expect(
within(container).getByLabelText('Retain On-Demand Budget')
within(container).getByLabelText('Retain Pay-as-you-go Budget')
).toBeInTheDocument();

await selectEvent.select(
await screen.findByRole('textbox', {name: 'On-Demand Max Spend Setting'}),
await screen.findByRole('textbox', {name: 'Pay-as-you-go Max Spend Setting'}),
'Per Category'
);

expect(
within(container).queryByLabelText('Retain On-Demand Budget')
within(container).queryByLabelText('Retain Pay-as-you-go Budget')
).not.toBeInTheDocument();

await selectEvent.select(
Expand Down Expand Up @@ -1251,7 +1251,7 @@ describe('provisionSubscriptionAction', () => {
);

await selectEvent.select(
await screen.findByRole('textbox', {name: 'On-Demand Max Spend Setting'}),
await screen.findByRole('textbox', {name: 'Pay-as-you-go Max Spend Setting'}),
'Disable'
);

Expand Down Expand Up @@ -1380,7 +1380,7 @@ describe('provisionSubscriptionAction', () => {
);

await selectEvent.select(
await screen.findByRole('textbox', {name: 'On-Demand Max Spend Setting'}),
await screen.findByRole('textbox', {name: 'Pay-as-you-go Max Spend Setting'}),
'Disable'
);

Expand Down Expand Up @@ -1500,7 +1500,7 @@ describe('provisionSubscriptionAction', () => {
);

await selectEvent.select(
await screen.findByRole('textbox', {name: 'On-Demand Max Spend Setting'}),
await screen.findByRole('textbox', {name: 'Pay-as-you-go Max Spend Setting'}),
'Disable'
);

Expand Down
Loading
Loading