Skip to content

feat(billing): allow _admin to start product trial for enterprise orgs #93570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
11 changes: 4 additions & 7 deletions static/gsAdmin/components/customers/customerOverview.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ describe('CustomerOverview', function () {
expect(screen.queryByText('Seer:')).not.toBeInTheDocument();
});

it('renders no product trials for non-self-serve account', function () {
it('renders product trials for non-self-serve account', function () {
const organization = OrganizationFixture();
const enterprise_subscription = SubscriptionFixture({
Copy link
Member

Choose a reason for hiding this comment

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

i realized we can just use InvoicedSubscriptionFixture instead of having to overwrite canSelfServe here

organization,
Expand All @@ -384,12 +384,9 @@ describe('CustomerOverview', function () {
/>
);

expect(screen.queryByText('Product Trials')).not.toBeInTheDocument();
expect(screen.queryByText('Replays:')).not.toBeInTheDocument();
expect(screen.queryByText('Spans:')).not.toBeInTheDocument();
expect(screen.queryByText('Performance Units:')).not.toBeInTheDocument();
expect(screen.queryByText('Transactions:')).not.toBeInTheDocument();
expect(screen.queryByText('Seer:')).not.toBeInTheDocument();
expect(screen.getByText('Product Trials')).toBeInTheDocument();
expect(screen.getByText('Spans:')).toBeInTheDocument();
expect(screen.getByText('Seer:')).toBeInTheDocument();
Copy link
Member

Choose a reason for hiding this comment

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

is there a reason we just test for these two?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooops, I forgot to add those back after playing around with the test file.
Good catch!

});

it('render product trials for am1 account', function () {
Expand Down
22 changes: 9 additions & 13 deletions static/gsAdmin/components/customers/customerOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,19 +438,15 @@ function CustomerOverview({customer, onAction, organization}: Props) {
);
const region = regionMap[organization.links.regionUrl] ?? '??';

const productTrialCategories = customer.canSelfServe
? Object.values(BILLED_DATA_CATEGORY_INFO).filter(
categoryInfo =>
categoryInfo.canProductTrial &&
customer.planDetails.categories.includes(categoryInfo.plural)
)
: [];

const productTrialCategoryGroups = customer.canSelfServe
? Object.values(customer.planDetails.availableReservedBudgetTypes).filter(
group => group.canProductTrial
)
: [];
const productTrialCategories = Object.values(BILLED_DATA_CATEGORY_INFO).filter(
categoryInfo =>
categoryInfo.canProductTrial &&
customer.planDetails?.categories.includes(categoryInfo.plural)
);

const productTrialCategoryGroups = Object.values(
customer.planDetails?.availableReservedBudgetTypes || []
).filter(group => group.canProductTrial);

function updateCustomerStatus(action: string, type: string) {
const data = {
Expand Down
Loading