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

TP2000-885 Use quota origins and exclusions to populate geo data in create measure journey #1032

Merged
merged 14 commits into from
Sep 19, 2023

Conversation

dalecannon
Copy link
Contributor

@dalecannon dalecannon commented Sep 12, 2023

TP2000-885 Use quota origins and exclusions to populate geo data in create measure journey

Why

There exists a requirement for quotas that geographical data (origins and exclusions) held on a quota order number must match geographical data associated with a measure. To save the user from having to manually select the geographical areas and exclusions, we can take the quota's origins and exclusions to populate automatically the geographical data for measures whenever a quota order number is selected in the create measure journey.

What

  • Moves away from cleaned_data["geo_areas_list"] and cleaned_data["geo_area_exclusions"] to combine cleaned_data["geo_areas_and_exclusions"] (list of dictionaries) to accommodate multiple pairs of geo areas and exclusions that can sometimes result from the geo data held on a quota order number

  • Sets cleaned_data["geo_areas_and_exclusions"] either with geo data held on order number if one has been selected or with geo area form data in MeasureGeographicalAreaForm.clean()

  • Conditionally shows geo areas form or a summary of geo data that will be used to create measures depending if an order number has been selected

  • Adds and updates form and view unit tests

  • Amends help text on quota order number form page

  • Add help text to geo area form/summary page

Example of the summary page of geo areas/exclusions automatically populated from the selected quota order number in place of the geo areas form:

Screenshot 2023-09-15 at 10 48 39

@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2023

Codecov Report

Patch coverage: 98.55% and no project coverage change.

Comparison is base (e649a80) 92.71% compared to head (691e771) 92.72%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1032   +/-   ##
=======================================
  Coverage   92.71%   92.72%           
=======================================
  Files         453      453           
  Lines       33046    33085   +39     
  Branches     2527     2538   +11     
=======================================
+ Hits        30639    30678   +39     
+ Misses       1919     1918    -1     
- Partials      488      489    +1     
Files Changed Coverage Δ
measures/views.py 96.28% <93.75%> (-0.13%) ⬇️
measures/forms.py 95.64% <100.00%> (+0.12%) ⬆️
measures/tests/test_forms.py 99.61% <100.00%> (+<0.01%) ⬆️
measures/tests/test_views.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dalecannon dalecannon marked this pull request as ready for review September 15, 2023 09:53
@a-gleeson
Copy link
Contributor

Is this an either or scenario? Where if you add an order number and the geo area's are populated you cannot add more geo area's?

@dalecannon
Copy link
Contributor Author

dalecannon commented Sep 19, 2023

Is this an either or scenario? Where if you add an order number and the geo area's are populated you cannot add more geo area's?

That's right. Using an order number replaces selecting geo areas/exclusions.

measures/views.py Outdated Show resolved Hide resolved
Copy link
Contributor

@a-gleeson a-gleeson left a comment

Choose a reason for hiding this comment

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

LGTM! just a couple minor comments

Copy link
Contributor

@a-gleeson a-gleeson left a comment

Choose a reason for hiding this comment

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

Good catch on the origins! LGTM!

@dalecannon dalecannon merged commit b19f556 into master Sep 19, 2023
@dalecannon dalecannon deleted the TP2000-885--quota-geo-data-measure-creation branch September 19, 2023 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants