-
Notifications
You must be signed in to change notification settings - Fork 0
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
Handle multi-item incentives, and more items #158
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Description This adds human-friendly labels for all the new items, plus labels for a few specific groups of items. (E.g. an incentive for both `ducted_heat_pump` and `ductless_heat_pump` will be shown as being for "an air-source heat pump".) I factored out the name logic into a new file because it's getting pretty extensive. The Spanish translations are taken from existing translations of incentive descriptions (which, helpfully, serves to validate that all the new items exist in incentives we already have). So I can't fully vouch for them myself, but they are sourced from our human-vetted translations. ## Test Plan Cypress tests pass. New unit test for names of multi-item incentives. Manual testing of a few queries. The results should still match prod exactly because none of the new items are used in the backend yet. (The exception is the non-HP dryers and water heaters -- those are already being used in the backend so will newly show up in the frontend with this PR. Looked at those in English and Spanish to make sure the headline looks good.)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
matelau
approved these changes
May 7, 2024
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 had one suggested improvement to item-name and a question, but otherwise LGTM!
oyamauchi
added a commit
that referenced
this pull request
May 9, 2024
## Description In #158 I changed the constants that identify projects. I didn't realize this would break the calculator for users who had the old constants in local storage (as saved form values). This is the simplest solution: change the local storage key for saved form values, which will effectively clear the stored values for everyone, one time. There's no attempt to migrate the old values. We would have to support that code indefinitely (unless we eventually cleared storage anyway), and I don't think there's a ton of value in preserving form prefills. The old key will still be there in users' local storage; if we want, we can follow up with a change to delete it. ## Test Plan Before making this change, reproed the problem by manually editing local storage and changing the `RA-calc-form-values` value to have the old constant `heat_pump_clothes_dryer` in the `projects` field. Submit the form and make sure there was an error (trying to read `shortLabel` of `undefined`). Apply this change, make sure the form is reset to defaults, and submitting it doesn't cause an error, and results show up.
oyamauchi
added a commit
that referenced
this pull request
May 9, 2024
## Description In #158 I changed the constants that identify projects. I didn't realize this would break the calculator for users who had the old constants in local storage (as saved form values). This is the simplest solution: change the local storage key for saved form values, which will effectively clear the stored values for everyone, one time. There's no attempt to migrate the old values. We would have to support that code indefinitely (unless we eventually cleared storage anyway), and I don't think there's a ton of value in preserving form prefills. The old key will still be there in users' local storage; if we want, we can follow up with a change to delete it. ## Test Plan Before making this change, reproed the problem by manually editing local storage and changing the `RA-calc-form-values` value to have the old constant `heat_pump_clothes_dryer` in the `projects` field. Submit the form and make sure there was an error (trying to read `shortLabel` of `undefined`). Apply this change, make sure the form is reset to defaults, and submitting it doesn't cause an error, and results show up.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This adds human-friendly labels for all the new items, plus labels for
a few specific groups of items. (E.g. an incentive for both
ducted_heat_pump
andductless_heat_pump
will be shown as being for"an air-source heat pump".)
I factored out the name logic into a new file because it's getting
pretty extensive.
The Spanish translations are taken from existing translations of
incentive descriptions (which, helpfully, serves to validate that all
the new items exist in incentives we already have). So I can't fully
vouch for them myself, but they are sourced from our human-vetted
translations.
Test Plan
Cypress tests pass. New unit test for names of multi-item incentives.
Manual testing of a few queries. The results should still match prod
exactly because none of the new items are used in the backend yet.
(The exception is the non-HP dryers and water heaters -- those are
already being used in the backend so will newly show up in the
frontend with this PR. Looked at those in English and Spanish to make
sure the headline looks good. ZIPs 81130 + Gunnison County Electric
and 81004 + San Isabel Electric)