-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
feat(billing): Delete billing metric history modal in admin #88653
Conversation
There was a problem hiding this 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. |
There was a problem hiding this 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 () { |
There was a problem hiding this comment.
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)
This is the admin UI piece for https://github.com/getsentry/getsentry/pull/17096.