Skip to content
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

feat(billing): Delete billing metric history modal in admin #88653

Merged

Conversation

dashed
Copy link
Member

@dashed dashed commented Apr 2, 2025

@dashed dashed requested a review from a team April 2, 2025 23:54
@dashed dashed self-assigned this Apr 2, 2025
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 2, 2025
@dashed dashed requested a review from Copilot April 2, 2025 23:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a modal to allow admin users to delete billing metric history via the admin UI. It adds a new action item in the customer details view, creates a dedicated modal component with a form for deletion, and includes comprehensive tests for rendering, successful deletion, and error handling.

  • Added a new import and feature flag check for billing metric deletion.
  • Integrated a new action in the customer details view to trigger the deletion modal.
  • Added tests to cover UI rendering, API interactions, and error scenarios.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
static/gsAdmin/views/customerDetails.tsx Integrates the delete billing metric history action and feature flag check into the customer details view.
static/gsAdmin/views/customerDetails.spec.tsx Provides thorough tests for the deletion modal, including success and error cases.
static/gsAdmin/components/deleteBillingMetricHistory.tsx Introduces the new modal component with its form and API call logic for deleting billing metric history.

@dashed dashed requested a review from Copilot April 2, 2025 23:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements the deletion of billing metric history from the admin UI. It adds a new action item in the customer details view, corresponding tests to ensure proper functionality and error handling, and a new modal component that handles the deletion process.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
static/gsAdmin/views/customerDetails.tsx Introduces a new action for deleting billing metric history based on a feature flag.
static/gsAdmin/views/customerDetails.spec.tsx Adds test cases to cover rendering, function, and error handling for the delete action.
static/gsAdmin/components/deleteBillingMetricHistory.tsx Implements the deletion modal with API request handling and form interaction.
Comments suppressed due to low confidence (1)

static/gsAdmin/views/customerDetails.spec.tsx:4718

  • [nitpick] The button label 'Customers Actions' is inconsistently capitalized compared to other tests using /customers actions/i. Consider using a consistent label to avoid potential flakiness.
await userEvent.click(screen.getAllByRole('button', {name: 'Customers Actions'})[1]!)

@@ -4494,6 +4494,262 @@ describe('Customer Details', function () {
});
});
});

describe('delete billing metric history', function () {
Copy link
Member

Choose a reason for hiding this comment

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

nit: can we move these tests to the file's own test suite (ie. deleteBillingMetricHistory.spec.tsx)? we should try to keep customerDetails tests to things specific to customerDetails (ie. testing that the action is available to orgs with x feature) and move any tests involving action modals to their own files (ie. testing that you can submit from the action modal and it calls x api)

@dashed dashed merged commit 4252a8d into master Apr 3, 2025
40 checks passed
@dashed dashed deleted the continuous-profiling/delete-billing-metric-history-admin branch April 3, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants