Skip to content

Commit

Permalink
Updated displayed address to meet VA.gov standards
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorJeff committed Jan 16, 2025
1 parent f349786 commit 91b5fe5
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';

Check warning on line 1 in src/applications/pre-need-integration/components/AddressConfirmation.jsx

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import { connect } from 'react-redux';
import { countries } from 'platform/forms/address';

function AddressConfirmation({ subHeader, userAddress }) {

Check warning on line 5 in src/applications/pre-need-integration/components/AddressConfirmation.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/pre-need-integration/components/AddressConfirmation.jsx:5:32:'subHeader' is missing in props validation

Check warning on line 5 in src/applications/pre-need-integration/components/AddressConfirmation.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/pre-need-integration/components/AddressConfirmation.jsx:5:43:'userAddress' is missing in props validation
// Helper function to conditionally return a line with a break
Expand All @@ -16,15 +17,19 @@ function AddressConfirmation({ subHeader, userAddress }) {
const cityStatePostal = [
userAddress?.city,

Check warning on line 18 in src/applications/pre-need-integration/components/AddressConfirmation.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/pre-need-integration/components/AddressConfirmation.jsx:18:18:'userAddress.city' is missing in props validation
userAddress?.city && (userAddress?.state || userAddress?.postalCode)

Check warning on line 19 in src/applications/pre-need-integration/components/AddressConfirmation.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/pre-need-integration/components/AddressConfirmation.jsx:19:18:'userAddress.city' is missing in props validation

Check warning on line 19 in src/applications/pre-need-integration/components/AddressConfirmation.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/pre-need-integration/components/AddressConfirmation.jsx:19:40:'userAddress.state' is missing in props validation

Check warning on line 19 in src/applications/pre-need-integration/components/AddressConfirmation.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/pre-need-integration/components/AddressConfirmation.jsx:19:62:'userAddress.postalCode' is missing in props validation
? ','
: '',
? ', '
: ' ',
userAddress?.state,

Check warning on line 22 in src/applications/pre-need-integration/components/AddressConfirmation.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/pre-need-integration/components/AddressConfirmation.jsx:22:18:'userAddress.state' is missing in props validation
userAddress?.state && userAddress?.postalCode ? ' ' : '',

Check warning on line 23 in src/applications/pre-need-integration/components/AddressConfirmation.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/pre-need-integration/components/AddressConfirmation.jsx:23:18:'userAddress.state' is missing in props validation

Check warning on line 23 in src/applications/pre-need-integration/components/AddressConfirmation.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/pre-need-integration/components/AddressConfirmation.jsx:23:40:'userAddress.postalCode' is missing in props validation
userAddress?.postalCode,

Check warning on line 24 in src/applications/pre-need-integration/components/AddressConfirmation.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/pre-need-integration/components/AddressConfirmation.jsx:24:18:'userAddress.postalCode' is missing in props validation
]
.join('')
.trim();

const getCountry = countryCode => {
return countries.find(c => c.value === countryCode).label || countryCode;
};

return (
<>
<va-alert
Expand All @@ -49,7 +54,8 @@ function AddressConfirmation({ subHeader, userAddress }) {
{renderLine(userAddress?.street)}
{renderLine(userAddress?.street2)}
{cityStatePostal && renderLine(cityStatePostal)}
{renderLine(userAddress?.country)}
{userAddress?.country !== 'USA' &&
renderLine(getCountry(userAddress?.country))}
</p>
</div>
<p>
Expand Down

0 comments on commit 91b5fe5

Please sign in to comment.