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

fix: foreign language in export #660

Merged
merged 4 commits into from
Feb 6, 2024

Conversation

emilyjablonski
Copy link
Collaborator

@emilyjablonski emilyjablonski commented Feb 6, 2024

Pull Request Template

Issue Overview

This PR addresses:
bloom-housing#3856
bloom-housing#3857

Description

Support Slack thread: https://exygy.slack.com/archives/C02G1S19QA2/p1707140129651329
Some applications with a specific preference were coming through as non-English, and sometimes they had periods at the end / other times they did not.

How Can This Be Tested/Reviewed?

Create a new preference with the following options:

  • I'm an option, and I have a comma, period, and apostrophe.
  • I'm a custom opt out option, and I also have all three.

The comma, period, and apostrophe are "characters" that react-hook-form removes from object keys. The issue was failing comparisons between the two versions of these strings, so everywhere we are comparing options, I'm stripping the characters. We honestly need a full overhaul of how we are mapping form data to the preference API - we should not be sending the key strings themselves, ideally the option IDs.

Both flows need to be tested in terms of either selecting the first option or the custom opt-out option.

A few additional issues surfaced in testing. The following should be true filling out an application in a foreign language (ideally Spanish):

  • As you are filling out an application, once you select either option and move forward then backward, the appropriate answer should still be selected.
  • When you are on the application summary page before submission, the selected option should include all of the characters.
  • On the partners side, the selected options should come through in English. You should test this first on the individual application form pages. On the view page, the selected option should include all of the characters. On the edit page, the right option should be selected. When changing an option and saving, the right data should be saved on the view page and again when re-opening in edit should be appropriately selected.
  • This data is the same as in the export, but you can also export the data and ensure the responses are all (1) in English and (2) include all characters.

Checklist:

  • My code follows the style guidelines of this project
  • I have added QA notes to the issue with applicable URLs
  • I have performed a self-review of my own code
  • I have reviewed the changes in a desktop view
  • I have reviewed the changes in a mobile view
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have assigned reviewers
  • I have run yarn generate:client and/or created a migration if I made backend changes that require them
  • My commit message(s) is/are polished, and any breaking changes are indicated in the message and are well-described
  • Commits made across packages purposefully have the same commit message/version change, else are separated into different commits

Reviewer Notes:

Steps to review a PR:

  • Read and understand the issue, and ensure the author has added QA notes
  • Review the code itself from a style point of view
  • Pull the changes down locally and test that the acceptance criteria is met
  • Also review the acceptance criteria on the Netlify deploy preview (noting that these do not yet include any backend changes made in the PR)
  • Either explicitly ask a clarifying question, request changes, or approve the PR if there are small remaining changes but the PR is otherwise good to go

On Merge:

If you have one commit and message, squash. If you need each message to be applied, rebase and merge.

Copy link

netlify bot commented Feb 6, 2024

Deploy Preview for housing-sanjoseca-gov ready!

Name Link
🔨 Latest commit 24e807a
🔍 Latest deploy log https://app.netlify.com/sites/housing-sanjoseca-gov/deploys/65c28db1748fec0008a6b9b1
😎 Deploy Preview https://deploy-preview-660--housing-sanjoseca-gov.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@ludtkemorgan ludtkemorgan left a comment

Choose a reason for hiding this comment

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

I tested this out with the production db data and I'm still getting the non-english for this preference

{
    "key": "Homeless or at Risk of Homelessness",
    "claimed": true,
    "options": [
      {
        "key": "Yo, o alguien de mi hogar, vivo en Berkeley y tengo un lugar donde quedarme, pero no es permanente",
        "checked": true,
        "extraData": []
      },
      {
        "key": "Yo, o alguien de mi hogar, no tengo hogar y vivo en Berkeley, o no tengo hogar y tenía una dirección anterior en Berkeley",
        "checked": true,
        "extraData": []
      },
      {
        "key": "I do not qualify for this preference.",
        "checked": false,
        "extraData": []
      }
    ]
  },

Copy link
Collaborator

@ludtkemorgan ludtkemorgan left a comment

Choose a reason for hiding this comment

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

Just a minor comment. After merge can you make sure this is pulled into core right away?

Copy link
Collaborator

@YazeedLoonat YazeedLoonat left a comment

Choose a reason for hiding this comment

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

LGTM I think hba main needs a cherry pick of the netlify fix from core main
once I did that locally it worked perfectly!

@emilyjablonski emilyjablonski merged commit 75be9eb into main Feb 6, 2024
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants