-
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
Add gas utility selector #197
base: main
Are you sure you want to change the base?
Conversation
## Links - https://app.asana.com/0/1208668890181682/1208886892124341 ## Description - Show the gas utility selector if the `/utilities` call returns a response with the `gas_utilities` key present. This is the way I came up with for the API to indicate whether the choice of gas utility matters: key is present means yes, key is absent means no. If the key is present but there are no gas utilities, we still show the selector to offer the choice of "no gas service" vs. "other", which is significant in the Mass Save case. - The selector always has three items at the bottom, after any real utilities: "Delivered propane or fuel oil", "No gas service", and "Other". The former two behave exactly the same behind the scenes, but are intended to reduce confusion: users may not know that we mean natural/methane gas pipeline service when we say "gas service" or "gas utility". - I had to add the `previousResponse` field to FetchState's loading state, so that the gas utility selector can stay visible and populated if you enter a new zip code. Otherwise, the selector would disappear while the `/utilities` call was pending, and it would look janky. As implemented, when you enter a zip code in MA and the `/utilities` call completes, the gas utility selector just pops in. This is pretty disruptive to the rest of the form in the two-column view, because all the other fields reposition --- they're in the same tabbing order, but ones that were on the left are now on the right and vice versa. It's not so bad in one-column view. I think this is tolerable for now, especially since the selector will only appear for MA zip codes. But it may be worth a rethink. ## Test Plan Add `api-host` attribute to the element on index.html to hit my local API server (so gas utilities are returned). Enter zip codes in MA to see the gas selector pop in, and make sure the options make sense. E.g. 02130 (Boston; has Eversource) and 01011 (middle of nowhere; has no gas). Enter one MA zip code, then another; make sure the gas selector stays visible throughout. Then enter a non-MA zip code; make sure the selector disappears once the new location's electric utilities are populated. Submit the form with the various gas options selected. Use network inspector to check the `gas_utility` param sent to the API. (Currently the API's response won't change based on it.) It should be `none` if "delivered fuels" or "no gas service" is selected, absent if "other" is selected, and a utility ID if a real gas utility is selected.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Two Spanish strings are missing translations; if reviewers are OK with the English, I'll take care of that. |
sb2d056e8d2ea5bc5: `Delivered propane or fuel oil`, | ||
s52d768131ca697d4: `No gas service`, |
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.
was this supposed to be en español?
<Select | ||
id="gas_utility" | ||
labelText={msg('Gas Utility', { desc: 'as in utility company' })} | ||
tooltipText={msg('Choose the company you pay your gas bill to.')} |
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.
(no change required) "to which you pay your gas bill" if probably more grammatically correct but also overly formal, hmmm...
<trans-unit id="sb2d056e8d2ea5bc5"> | ||
<source>Delivered propane or fuel oil</source> | ||
</trans-unit> | ||
<trans-unit id="s52d768131ca697d4"> | ||
<source>No gas service</source> | ||
</trans-unit> |
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.
are you waiting on translations for this?
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.
curiosity about a couple translations but this looks great. good catch re: handling changing zip codes, and appreciate your comments to explain the logic flow of the gas utility response
Links
Description
Show the gas utility selector if the
/utilities
call returns aresponse with the
gas_utilities
key present. This is the way Icame up with for the API to indicate whether the choice of gas
utility matters: key is present means yes, key is absent means no.
If the key is present but there are no gas utilities, we still show
the selector to offer the choice of "no gas service" vs. "other",
which is significant in the Mass Save case.
The selector always has three items at the bottom, after any real
utilities: "Delivered propane or fuel oil", "No gas service", and
"Other". The former two behave exactly the same behind the scenes,
but are intended to reduce confusion: users may not know that we
mean natural/methane gas pipeline service when we say "gas service"
or "gas utility".
I had to add the
previousResponse
field to FetchState's loadingstate, so that the gas utility selector can stay visible and
populated if you enter a new zip code. Otherwise, the selector would
disappear while the
/utilities
call was pending, and it would lookjanky.
As implemented, when you enter a zip code in MA and the
/utilities
call completes, the gas utility selector just pops in. This is pretty
disruptive to the rest of the form in the two-column view, because all
the other fields reposition --- they're in the same tabbing order, but
ones that were on the left are now on the right and vice versa. It's
not so bad in one-column view. I think this is tolerable for now,
especially since the selector will only appear for MA zip codes. But
it may be worth a rethink.
Test Plan
Add
api-host
attribute to the element on index.html to hit my localAPI server (so gas utilities are returned).
Enter zip codes in MA to see the gas selector pop in, and make sure
the options make sense. E.g. 02130 (Boston; has Eversource) and 01011
(middle of nowhere; has no gas).
Enter one MA zip code, then another; make sure the gas selector stays
visible throughout. Then enter a non-MA zip code; make sure the
selector disappears once the new location's electric utilities are
populated.
Submit the form with the various gas options selected. Use network
inspector to check the
gas_utility
param sent to the API. (Currentlythe API's response won't change based on it.) It should be
none
if"delivered fuels" or "no gas service" is selected, absent if "other"
is selected, and a utility ID if a real gas utility is selected.