-
Notifications
You must be signed in to change notification settings - Fork 5
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
Make address fields dynamic, based on the selected country for the address field, handle international addresses #281
Comments
Some code related to this that I'm removing from its original branch for now:
|
* Fix #296 * Provide some placeholders to allow dynamically updating state list - #281 * Format phone numbers * 🎨 Format Python code with psf/black * Check if the `suffix_to_append` attribute exists On older objects, the attribute might not exist, so make sure it's updated to the standard default. * 🎨 Format Python code with psf/black * Bump version: 2.15.0 → 2.16.0 * Bump version: 2.16.0 → 2.17.0 * Update CHANGELOG.md Remove accidental 2.16 * Fix #585 - improve usability of signature question * Fix #578 fix #571 - let author filter irrelevant sessions and remove sessions at step 1 by default * Incorporate feedback from PR * Fix #573 Fix #572 * reformat with black * Improve #571 - add to global config * Fix #592 - redirect if user logged out * language changes from @CaroRob * User user_role, not users * more using user_role * Use `user_started_case`, not `user_role` The latter isn't actually used in AL core much, so even though it is the better variable name, changing the logic of other variables is more likely to break others interviews. * Fix #598 * 🎨 Format Python code with psf/black * Added black hook + black opts to pyproject.toml Also moved mypy configs to the same pyproject.toml instead of a separate mypy.ini * Add note about `exclude_newly_started_sessions` * Decrease the size of images in tables Commonly in review tables. * Added a max size feature to the ExhibitDocument (#604) * Added a max size feature to the ExhibitDocument Also give suggested remaining upload size in human readable file sizes in errors and in between upload screens. * Teams bump hook, in a github action (#602) * Teams bump hook, in a github action Fixes #547 * Don't check if the ref equals the version on branches, only tags * Use `|` instead of `/`, otherwise sed can't use repo names and URLs. * If address is empty, `on_one_line()` will be empty (#605) * If address is empty, `on_one_line()` will be empty Originally, was ", ", which is def a bug * Mypy changed defaults about implicit optionals * No more implicit optionals in function signatures Apparently not allowed by PEP-484. Personally, I've gotten used to it, but I remember being confused by it, and the change isn't too bad. * Fix #243, don't cut off words for addendum in mid-sentence * 🎨 Format Python code with psf/black * Multi-line return value * Bump version to v2.18.0 * failure was in a name, not an if * Tag URL had extra https:// * Improve calculation of max lines, better test cases, consistent overflow and safe_value handling of whitespace * 🎨 Format Python code with psf/black * Test case * Some correctness fixes for whitespace, working tests without 'define()' * Update docassemble/AssemblyLine/al_document.py * Add preserve_words option to alternate API * Remove words 'the' and 'project' from opening screen - Fix #611 * Bump version * Update CHANGELOG.md * Change OCR to use ocrmypdf in the background Triggers an event in `al_document.yml`, which calls back into a module. * Add config option for OCRMyPDF * Added OCRmyPDF to changelog * Add visible trigger variable to the developer-only heads up display (#617) * Fix #616 * Update docassemble/AssemblyLine/data/questions/al_visual.yml Co-authored-by: Bryce Willey <Bryce.Steven.Willey@gmail.com> Co-authored-by: Bryce Willey <Bryce.Steven.Willey@gmail.com> * First version of DACatchAll, #618 * Add css to all catchall qs * Progress on #620 * WIP * Fix #615, additional refinement of #620 * Cleanup error page a bit * Add focus shadow for back button Before this change, you aren't able to see that you are keyboard tabbing over the back button, as the value bootstrap uses to color the shadow doesn't have a value for the `daquestionbackbutton` class, only the `btn-primary` class. TBH, I'm not a huge fan of the default focus indicators in bootstrap, they don't have enough contrast. But that will likely have to wait for a different PR, as it's a much larger change. * Put 'download work in progress' behind a config option- anyone w/ a paywall won't want this turned on * `will_send_to_real_court` false if debug == True Necessary to safely test on any new server being spun up. Debug: true shouldn't be on in production servers. * Fix #625 - make answer sets unencrypted to match interview state * Put actions behind config + individual interview option * Try to cache python deps when running unittests Also bump to python 3.9: closer to still working with python 3.8 for older docassemble versions, but still on by default in ubuntu 22.04, the new test runners on github. * Quick remove old blank step * Trying for easier unittest workflow * Add wheel package * Start using --use-pep517? * Can't actually use `--use-pep517` yet One of the packages fails with an obscure error message, so I'll just have to turn it off now. ``` Collecting guess-language-spirit==0.5.3 Using cached guess_language-spirit-0.5.3.tar.bz2 (81 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/tmp/tmpdpiv1dse/output.json' ``` * Move everything to a different action * Address SuffolkLITLab/docassemble-MassAccess#8 * Remove unnecessary 'logo' from alt text * Fix #636 * Add simple service of process questions, Fix #597, fix #597 * Add marriage questions, fix #630 * Update docassemble/AssemblyLine/data/questions/ql_baseline.yml Co-authored-by: Bryce Willey <Bryce.Steven.Willey@gmail.com> * Update docassemble/AssemblyLine/data/questions/ql_baseline.yml Co-authored-by: Bryce Willey <Bryce.Steven.Willey@gmail.com> * PR feedback * Fix #637 - better API for how a lot of states organize courts, by county. Added some useful features like searching by keyword too. * Reformat with black * Fix #296 * A little extra safety for existing sessions that might be in the wild * Fix #260 * set country at a better point in interview; remove commented out section for now * Readd newlines between each step on intro screen 2 or more trailing whitespaces in markdown will add a line break (<br>) to the line. The trailing whitespaces that were separating out the 3 introduction steps for each AL interview were mistakenly removed in 57df4ab#diff-55dff7108dded7bbc3ce8459dd669a79baec6674c1558af86f66dbc878268288L44. This PR replaces those trailing whitespaces with a more explicit `<br>`. * Address some linting feedback * Bump version * Update CHANGELOG.md * Fix issue where al_sessions_to_exclude kept growing * Update docassemble/AssemblyLine/al_general.py Co-authored-by: Bryce Willey <Bryce.Steven.Willey@gmail.com> * Adjust comments per review + add docstring * 🎨 Format Python code with psf/black * Cleanup appearance of error action page, make technical information optional * Split if statement for trace and history Co-authored-by: Quinten Steenhuis <qsteenhuis@gmail.com> Co-authored-by: nonprofittechy <nonprofittechy@users.noreply.github.com> Co-authored-by: Bryce Willey <bryce.steven.willey@gmail.com> Co-authored-by: BryceStevenWilley <BryceStevenWilley@users.noreply.github.com> Co-authored-by: Quinten Steenhuis <qsteenhuis@suffolk.edu>
There is a recipe for this now, albeit in a weird place: https://docassemble.org/docs/background.html#background_response_choices |
Started working on this, got some initial experiments working in Notes on what I still need to work on:
|
Worked on this some more today, updates in the comment above; I'm still a bit skeptical that the approach of the state dropdown for every country is the best UI, as fancy as it is. I'm leaning towards just making an optional text field state input for countries that aren't the US, which avoids the remaining two problems mentioned, and depending on the country, should be enough information. Google autocomplete should still fill in the state's name if present, and if it's not present, I'm not sure that it's necessary for a physical or mailing address, and would prefer to let users who know their country better than us fill it in. |
Minor changes that address #281. More details in that issue, but I don't think it's possible to get the full state dropdown for each country without messing up Google autocomplete, so when the country is an input, we turn the state list into a text box (I tried swapping out a dropdown for just the US and text input for other countries, but Google autocomplete also has a problem with that). Only other changes were to change the "State" label to "State / Province" when the country is an input, and a few comments / docs, for accuracy.
MVP: update the "states list" if someone selects a country outside of the US. Also update the label of "zip code" to "postal code"
Beyond MVP: figure out which countries we can have country-specific address fields for, and which countries might benefit instead from just an open text input. We could probably just hardcode a small list of fields for countries that our client population frequently encounters, such as Canada and Mexico, although we might also consider using all of the fields that Google knows about and using a Python library that helps figure out which fields are relevant in a particular country. See https://docassemble.org/docs/objects.html#Address
See #127, and also the way that the "state" field is made dynamic when someone selects a country in https://github.com/SuffolkLITLab/docassemble-ALWeaver/pull/478/files
The text was updated successfully, but these errors were encountered: