Conversation
| ? t('in_person_proofing.body.location.distance_singular', { | ||
| distance: 1, | ||
| }) | ||
| : t('in_person_proofing.body.location.distance_plural', { | ||
| distance: numericDistance[0], | ||
| })} |
There was a problem hiding this comment.
The JavaScript implementation of t has support for how pluralization works in Rails, so if you change the keys from to one and other, you could do something like...
t('in_person_proofing.body.location.distance', { count: numericDistance[0] });in_person_proofing:
body:
location:
distance:
one: %{count} mile away
other: %{count} miles awayThere was a problem hiding this comment.
@svalexander This LGTM!
Adding one note for awareness: For French, we don't want to convert/translate the distance and will be fixing this in https://cm-jira.usa.gov/browse/LG-8357
sheldon-b
left a comment
There was a problem hiding this comment.
Few minor comments otherwise looks good to me!
| const addressParent = getByText('123 Test Address').parentElement!; | ||
| expect(addressParent.textContent).to.contain('in_person_proofing.body.location.distance'); | ||
| expect(addressParent.textContent).to.contain('555-123-4567'); | ||
| expect(addressParent.textContent).to.contain('222-222-2222'); |
There was a problem hiding this comment.
Any reason not to merge this test with the one above? They're very similar already
There was a problem hiding this comment.
not really, i'll adjust it so its one test
There was a problem hiding this comment.
oh wait, they do have to be separate as locationCollectionItem can display either name or distance but not both. when the po search page goes into production though we should remove the above test as we'd just display the distance and not the po name.
| {distance && numericDistance && ( | ||
| <h3 className="usa-collection__heading"> | ||
| {t('in_person_proofing.body.location.distance', { | ||
| count: parseFloat(numericDistance[0]), |
There was a problem hiding this comment.
Mostly just curious: does this need to be parsed to a float? Perhaps to make the i18n count logic work? Rather than just passing the distance in as a string
There was a problem hiding this comment.
yes, it's to make the count work w/ i18n
| weekdayHours, | ||
| }: LocationCollectionItemProps) { | ||
| const { t } = useI18n(); | ||
| const numericDistance = distance?.split(' '); |
There was a problem hiding this comment.
This is kind of confusing because numericDistance will have a value like ['0.1', 'mi'] which isn't numeric. Would prefer pulling out the numeric piece here instead of in the rendering logic
| const numericDistance = distance?.split(' '); | |
| // distance is a string like '0.1 mi'. Split out the numeric piece | |
| const numericDistance = distance?.split(' ')[0]; |
| {phone || tty ? ( | ||
| <div> | ||
| <h4>{t('in_person_proofing.body.location.contact_info_heading')}</h4> | ||
| <div>{`${t('in_person_proofing.body.location.phone')} ${phone}`}</div> | ||
| <div>{`${t('in_person_proofing.body.location.tty')} ${tty}`}</div> | ||
| </div> | ||
| ) : ( | ||
| '' | ||
| )} |
There was a problem hiding this comment.
Slight preference for && instead of ternary operator, so you don't have to specify the empty string
| {phone || tty ? ( | |
| <div> | |
| <h4>{t('in_person_proofing.body.location.contact_info_heading')}</h4> | |
| <div>{`${t('in_person_proofing.body.location.phone')} ${phone}`}</div> | |
| <div>{`${t('in_person_proofing.body.location.tty')} ${tty}`}</div> | |
| </div> | |
| ) : ( | |
| '' | |
| )} | |
| {(phone || tty) && ( | |
| <div> | |
| <h4>{t('in_person_proofing.body.location.contact_info_heading')}</h4> | |
| <div>{`${t('in_person_proofing.body.location.phone')} ${phone}`}</div> | |
| <div>{`${t('in_person_proofing.body.location.tty')} ${tty}`}</div> | |
| </div> | |
| )} |
There was a problem hiding this comment.
that's definitely a lot neater!
* build-sass: Add CLI flag for additional load paths (#7525) changelog: Internal, Build Tooling, Improve Sass compilation tool to support additional load paths * Updating ThreatMetrix failure (sad face) screen content (#7529) * Updating ThreatMetrix failure (sad face) screen content changelog: User Facing Improvements, UX, ThreatMetrix failure screen content * Lints [skipe changelog] * Adding contact center number to config and setting dummy default [skip changelog] * Ignore non-yaml files when normalizing yamls (#7531) [skip changelog] * Lg-8264 po search frontend updates (#7519) * show updated ui for location page when arcgis is enabled * add mile(s) away to distance * changelog: Improvements, Location page, update ui on location pg when arcgis is enabled * normalize yaml * fix missing translation test failure * update strings to include count to handle pluralization * update collection item test * add es translation for tty to untranslated keys * refactor * Fix flakey in-person feature test (#7533) * make it okay for the interstitial to not show it's possible for the interstitial to disappear before the matcher can catch it. changelog: Internal, Automated Testing, Improve reliability of successful automated tests * Make `lintfix` fix erb, javascript, and CSS files too (#7528) * Make lintfix fix erb files too * Autofix javascript and CSS files * [skip changelog] * Mention that we're fixing things in status updates * Fix untranslated email input in password reset (#7537) * Fix untranslated email input in password reset changelog: Bug Fixes, Internationalization, Fix untranslated email input in password reset * fix specs * Update app/views/devise/passwords/new.html.erb Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov> Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov> * Move favicons to asset pipeline (#7532) * Move favicons to asset pipeline changelog: Internal, Assets, Move favicons to asset pipeline * use existing design system assets * LG-7489: Remove show_account_recovery_recovery_options Feature flag (#7524) * changelog: Internal, Authentication, Remove show_account_recovery_recovery_options feature flag since feature is permanently turned on * LG-7489: rspec fixes * remove unneeded spec * LG-8089: Update to support notifying user of OTP format in message (#7486) * Improvements, Voice messaging, Notify voice OTP users how long and what type of code to expect (LG-8089) * update voice * translation update * add check to otp_sender * changelog: Improvements, Voice messaging, Notify voice OTP users how long and what type of code to expect * fix spec * Revert "LG-8432: SAML - Update ForceAuthn check (#7514)" (#7520) This reverts commit a7577b6. [skip changelog] * LG-8388: Confirm ThreatMetrix doesn't block IPP (#7521) * LG-8388: Confirm ThreatMetrix doesn't block IPP Spec to confirm that IPP is not blocked by a ThreatMetrix result of 'Reject' [skip changelog] * ensure the threatmetrix profiling is enabled * lints * Update spec/features/idv/in_person_spec.rb Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov> Co-authored-by: Eric Gade <105373963+eric-gade@users.noreply.github.com> Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov> * Switching newer Acuant SDK to be the default version (#7513) * Switching newer Acuant SDK to be the default version -- What The introduction of the AB Testing framework for upgrading the Acuant SDK assumes that the "newer" version is the one being tested, and that the older is the "default". This change updates the step doc capture step to assume that version 11.7.1 should be used in all cases when the ab test is switched off. changelog: Internal, Upgrades, Acuant SDK Upgrade * Specifying acuant versions in configs and updating names Specifically, we are switching from use_newer_sdk to use_alternate_sdk changelog: Internal, Upgrades, Acuant SDK Upgrade * Acuant context should use config's acuant version by default changelog: Internal, Upgrades, Acuant SDK Upgrade * Fixing lints [skip changelog] * Revert "Acuant context should use config's acuant version by default" This reverts commit b420998. [skip changelog] * Removing redundant condition (via @aduth) [skip changelog] * Add logging criteria, abstract logging decision into method (#7516) * Abstract logging decision into method * [skip changelog] * lintfix * Test logic in should_log? method * lintfix * Add filename fingerprint to JavaScript locale data script (#7527) * Add filename fingerprint to JavaScript locale data script changelog: Internal, Build Tooling, Invalidate cache for content-only revisions to JavaScript bundles * Update specs * LG-8438: Update language on pages related to OTP (#7515) Update OTP language changelog: Improvements, Multi-Factor Authentication, Update OTP language * Doc auth retry timer should decrease (#7498) * Move timeout calculation to helper * Fix calculation of attempted_at and expires_at * changelog: Bug Fixes, DocAuth, Modify retry timer to decrease * Remove instance variable from helper * Revert helper * Indent Co-authored-by: Mitchell Henke <mitchell.henke@gsa.gov> * build-sass: Add CLI flag for additional load paths (#7525) changelog: Internal, Build Tooling, Improve Sass compilation tool to support additional load paths Co-authored-by: Oren Kanner <oren.kanner@gsa.gov> Co-authored-by: Doug Price <douglas.price@gsa.gov> Co-authored-by: Eric Gade <105373963+eric-gade@users.noreply.github.com> Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov> Co-authored-by: John Skiles Skinner <john.skinner@gsa.gov> Co-authored-by: jc-gsa <104452882+jc-gsa@users.noreply.github.com> Co-authored-by: Kimball Bighorse <kimball.bighorse@gsa.gov> Co-authored-by: Mitchell Henke <mitchell.henke@gsa.gov> * LG-8414 Remove flag from batch job (#7534) * LG-8414 Remove flag from batch job changelog: Internal, Attempts API, Events Batch work * LG-8390 Write rake tasks to pass or reject users (#7536) * initial steps for rake script to review profile * rewrite tasks for passing and rejecting * add tests for review_profile rake task * add changelog changelog: Internal, IdV, Make script to pass or reject TMX review * activate profile upon passing review also changed the deactivation reason upon rejection to :threatmetrix_review_rejected * check for deactivation reason in passing Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov> Co-authored-by: Eric Gade <105373963+eric-gade@users.noreply.github.com> Co-authored-by: Sheldon Bachstein <sheldon.bachstein@gsa.gov> Co-authored-by: Shannon A <20867088+svalexander@users.noreply.github.com> Co-authored-by: Tomas Apodaca <thomas.apodaca@gsa.gov> Co-authored-by: Malick Diarra <malick.diarra@gsa.gov> Co-authored-by: Oren Kanner <oren.kanner@gsa.gov> Co-authored-by: Doug Price <douglas.price@gsa.gov> Co-authored-by: John Skiles Skinner <john.skinner@gsa.gov> Co-authored-by: jc-gsa <104452882+jc-gsa@users.noreply.github.com> Co-authored-by: Kimball Bighorse <kimball.bighorse@gsa.gov> Co-authored-by: Luis H. Matos <ThatSpaceGuy@users.noreply.github.com> Co-authored-by: Alex Bradley <alexander.bradley@gsa.gov>
🎫 Ticket
Lg-8264
🛠 Summary of changes
Updates to the location page so it reflects the figma design. These changes should only be visible when arcgis is enabled.
📜 Testing Plan
Provide a checklist of steps to confirm the changes.
application.ymlfile:arcgis_api_username: arcgis_api_password: arcgis_search_enabled: platform_auth_set_up_enabled:usps_locations_controller.rbfile and replace with:render json: proofer.request_pilot_facilities.to_json10421 Motor City Dr, Bethesda, MD 20817works?locale=frand make sure french translations are correct?locale=esand make sure spanish translations are correct👀 Screenshots
If relevant, include a screenshot or screen capture of the changes.
En:
Es:
Fr: