-
Notifications
You must be signed in to change notification settings - Fork 429
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: sort by Overage in sales dashboard #3858
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Uffizzi Preview |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3858 +/- ##
=======================================
Coverage 95.87% 95.87%
=======================================
Files 1129 1130 +1
Lines 35787 35791 +4
=======================================
+ Hits 34309 34313 +4
Misses 1478 1478 ☔ View full report in Codecov by Sentry. |
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.
I have one question but otherwise PR looks good to merge.
@@ -44,7 +44,8 @@ <h1 class="h2">Organisations</h1> | |||
<option value="num_features" {% if sort_field == "num_features" %}selected{% endif %}>Flags</option> | |||
<option value="subscription_information_cache__api_calls_24h" {% if sort_field == "subscription_information_cache__api_calls_24h" %}selected{% endif %}>24h API calls</option> | |||
<option value="subscription_information_cache__api_calls_7d" {% if sort_field == "subscription_information_cache__api_calls_7d" %}selected{% endif %}>7d API calls</option> | |||
<option value="subscription_information_cache__api_calls_30d" {% if sort_field == "subscription_information_cache__api_calls_30d" or not sort_field %}selected{% endif %}>30d API calls</option> | |||
<option value="subscription_information_cache__api_calls_30d" {% if sort_field == "subscription_information_cache__a pi_calls_30d" or not sort_field %}selected{% endif %}>30d API calls</option> |
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.
I don't understand what subscription_information_cache__a
does here. I understand it's part of a sort field, but what is the __a
portion from the cache represent?
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
Allows sorting by Overage in the sales dashboard organisation list view.
We're changing the view's query set to use a calculated
overage
field instead of theget_api_call_overage
method. In my local environment, this adds the following column to the result set:How did you test this code?
Manually in a local environment. I have not tested this with a large number of organisations, but also don't foresee any issues.
This individual test can be run with
pytest tests/unit/sales_dashboard
.