Skip to content

Commit e547529

Browse files
isabellaenriquezgetsantry[bot]
authored andcommitted
ref(provisioning): Rehaul form pt. 1 (#87138)
Updates: - No more hardcoded plans! Parent component passes down billing config (we query the endpoint for this in the parent component so we can reuse it for other customer overview actions) - Only shows relevant fields; this means if I am provisioning AM3, I won't see any performance unit fields, if I am provisioning AM2, I won't see any spans fields, etc. - Category/SKU fields are generated based on plan, so no more manually adding fields on the frontend when new categories are being launched - Autofills form based on existing subscription, even if existing subscription is not already enterprise - Adds some enterprise plans to our fixtures + updates enterprise plan names in fixtures to reflect recent update - Uses the plan category name (ie. if an AM1 plan is selected, we say "Transactions" over "Performance Units") - Uses paygCpe over onDemandCpe so we can begin removing references to the latter in the backend In follow up PRs I'd like to: - Convert all deprecated field components to their modern versions - Convert to functional component and clean up state management where possible Depends on getsentry/getsentry#16995 https://github.com/user-attachments/assets/0e202f2c-f822-4e71-be39-e029eb4320d9 --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
1 parent 3147000 commit e547529

File tree

17 files changed

+1289
-1620
lines changed

17 files changed

+1289
-1620
lines changed

static/gsAdmin/components/customers/customerOverview.spec.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,31 +115,31 @@ describe('CustomerOverview', function () {
115115
categories: {
116116
errors: MetricHistoryFixture({
117117
customPrice: 300_000_00,
118-
onDemandCpe: 12.345678,
118+
paygCpe: 12.345678,
119119
order: 1,
120120
}),
121121
transactions: MetricHistoryFixture({
122122
category: DataCategory.TRANSACTIONS,
123123
customPrice: 400_000_00,
124-
onDemandCpe: 100,
124+
paygCpe: 100,
125125
order: 2,
126126
}),
127127
replays: MetricHistoryFixture({
128128
category: DataCategory.REPLAYS,
129129
customPrice: 100_000_00,
130-
onDemandCpe: 50,
130+
paygCpe: 50,
131131
order: 4,
132132
}),
133133
monitorSeats: MetricHistoryFixture({
134134
category: DataCategory.MONITOR_SEATS,
135135
customPrice: 10_000_00,
136-
onDemandCpe: 7.55,
136+
paygCpe: 7.55,
137137
order: 7,
138138
}),
139139
attachments: MetricHistoryFixture({
140140
category: DataCategory.ATTACHMENTS,
141141
customPrice: 150_000_00,
142-
onDemandCpe: 20.3,
142+
paygCpe: 20.3,
143143
order: 8,
144144
}),
145145
},

static/gsAdmin/components/customers/customerOverview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ function ReservedData({customer}: ReservedDataProps) {
213213
</DetailLabel>
214214
{customer.onDemandInvoicedManual && (
215215
<DetailLabel title={`Pay-as-you-go Cost-Per-Event ${categoryName}`}>
216-
{typeof categoryHistory.onDemandCpe === 'number'
216+
{typeof categoryHistory.paygCpe === 'number'
217217
? displayPriceWithCents({
218-
cents: categoryHistory.onDemandCpe,
218+
cents: categoryHistory.paygCpe,
219219
minimumFractionDigits: 8,
220220
maximumFractionDigits: 8,
221221
})

static/gsAdmin/components/customers/pendingChanges.spec.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,9 @@ describe('PendingChanges', function () {
344344

345345
const {container} = render(<PendingChanges subscription={subscription} />);
346346

347-
expect(container).toHaveTextContent('Plan changes — Business → Business');
347+
expect(container).toHaveTextContent(
348+
'Plan changes — Business → Enterprise (Business)'
349+
);
348350
expect(container).toHaveTextContent(
349351
'Reserved accepted spans — 10,000,000 → reserved budget'
350352
);
@@ -369,7 +371,6 @@ describe('PendingChanges', function () {
369371
pendingChanges: PendingChangesFixture({
370372
planDetails: PlanDetailsLookupFixture('am3_business_ent_auf'),
371373
plan: 'am3_business_ent_auf',
372-
planName: 'Business',
373374
reserved: {
374375
spans: 10_000_000,
375376
},
@@ -378,7 +379,9 @@ describe('PendingChanges', function () {
378379

379380
const {container} = render(<PendingChanges subscription={subscription} />);
380381

381-
expect(container).toHaveTextContent('Plan changes — Business → Business');
382+
expect(container).toHaveTextContent(
383+
'Plan changes — Enterprise (Business) → Enterprise (Business)'
384+
);
382385
expect(container).toHaveTextContent(
383386
'Reserved accepted spans — reserved budget → 10,000,000 spans'
384387
);

0 commit comments

Comments
 (0)