From a65ef1ab95b10711097bc323cca3aeaae9a712d0 Mon Sep 17 00:00:00 2001 From: Chris Alexander Date: Thu, 27 Jun 2024 15:34:38 -0600 Subject: [PATCH 01/21] Upgrade mobile-component-library and eslint-config-mobile --- VAMobile/package.json | 4 +-- VAMobile/yarn.lock | 67 ++++++++++++++----------------------------- 2 files changed, 23 insertions(+), 48 deletions(-) diff --git a/VAMobile/package.json b/VAMobile/package.json index c5d266630e7..9f0735ee1ed 100644 --- a/VAMobile/package.json +++ b/VAMobile/package.json @@ -37,7 +37,7 @@ "pods": "cd ios && pod install && cd .." }, "dependencies": { - "@department-of-veterans-affairs/mobile-component-library": "0.16.0", + "@department-of-veterans-affairs/mobile-component-library": "0.19.0", "@expo/react-native-action-sheet": "^4.1.0", "@react-native-async-storage/async-storage": "^1.23.1", "@react-native-firebase/analytics": "^18.9.0", @@ -90,7 +90,7 @@ "@babel/preset-env": "^7.24.7", "@babel/preset-typescript": "^7.24.7", "@babel/runtime": "^7.24.7", - "@department-of-veterans-affairs/eslint-config-mobile": "0.15.0", + "@department-of-veterans-affairs/eslint-config-mobile": "0.18.0", "@react-native/babel-preset": "0.74.83", "@react-native/eslint-config": "^0.73.2", "@react-native/metro-config": "^0.74.84", diff --git a/VAMobile/yarn.lock b/VAMobile/yarn.lock index 67bce470eab..d17c3fce2d7 100644 --- a/VAMobile/yarn.lock +++ b/VAMobile/yarn.lock @@ -1386,35 +1386,35 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@department-of-veterans-affairs/eslint-config-mobile@0.15.0": - version "0.15.0" - resolved "https://registry.yarnpkg.com/@department-of-veterans-affairs/eslint-config-mobile/-/eslint-config-mobile-0.15.0.tgz#f86b29f5ef8bad6c8a36cea8340e5cfa18ff93a1" - integrity sha512-sEFu9Akkommf9y7aDWXjvWfwDfY50cqjMBTAIaYctixGonUX0wKzk2yEhgGzlwF3Feo/zkyLhLBi1VixrhT3xg== +"@department-of-veterans-affairs/eslint-config-mobile@0.18.0": + version "0.18.0" + resolved "https://registry.yarnpkg.com/@department-of-veterans-affairs/eslint-config-mobile/-/eslint-config-mobile-0.18.0.tgz#4187517fb890af6f271a23364255f52cfe106cfd" + integrity sha512-JTLMMiRWhriVMo3hkG88nhXvF0q1W4nxhSFIQPQaBTrSmX6JcX/gaThSMz1MsoFokFNgDlzeimbk60PRSTQJlg== dependencies: eslint-plugin-deprecate "^0.8.4" -"@department-of-veterans-affairs/mobile-assets@^0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@department-of-veterans-affairs/mobile-assets/-/mobile-assets-0.4.1.tgz#d25af3609f71356e68994a733bf86670a7334b05" - integrity sha512-H5hv4IKmbC+aqudb/NH10J6ZvtNkWz+zPqfFPFmBk/fUuU7ScpDorJnGD0jH8oZjGTZ93V35PdKeU79QTDuvrg== +"@department-of-veterans-affairs/mobile-assets@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@department-of-veterans-affairs/mobile-assets/-/mobile-assets-0.12.0.tgz#8656683640d2f11d79adb202535f4ce324c92d2d" + integrity sha512-85h4yb4Nq0A3PMh5wG5NKya2RnSYsZ/H7Xk9arMhyZpF3IuMi8I9rmGs0Qo+PiI4oi99kj+12VVtIElzyvGJAw== -"@department-of-veterans-affairs/mobile-component-library@0.16.0": - version "0.16.0" - resolved "https://registry.yarnpkg.com/@department-of-veterans-affairs/mobile-component-library/-/mobile-component-library-0.16.0.tgz#6cd56523410a25220b44ecad74c8d164fc1bea38" - integrity sha512-9z9ZqmwPrqtAZfhd3KCnQS6kgqkQZcFRzorYZSkP3QEbFS8c0tsSNJ29f5Uz/LbzzzQ2cZksWpkfNDAW665XZQ== +"@department-of-veterans-affairs/mobile-component-library@0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@department-of-veterans-affairs/mobile-component-library/-/mobile-component-library-0.19.0.tgz#65f6baf164f569875867c2835a711deee5d881e2" + integrity sha512-l9WT4Zl8f/yQPqG74GoUfVEDU1aNuEsc6jxJeomqlOHlI7abXuDMojuZHJVg3+YD0h2XQXfWbprdl1mKe2VF1w== dependencies: - "@department-of-veterans-affairs/mobile-assets" "^0.4.1" - "@department-of-veterans-affairs/mobile-tokens" "0.5.1" + "@department-of-veterans-affairs/mobile-assets" "0.12.0" + "@department-of-veterans-affairs/mobile-tokens" "0.12.0" "@os-team/i18next-react-native-language-detector" "^1.0.31" i18next "^23.8.2" react-i18next "^14.0.5" react-native-svg "15.2.0" styled-components "^6.1.8" -"@department-of-veterans-affairs/mobile-tokens@0.5.1": - version "0.5.1" - resolved "https://registry.yarnpkg.com/@department-of-veterans-affairs/mobile-tokens/-/mobile-tokens-0.5.1.tgz#afb4d38cd2bfa49cb61a244ae356cc6efdb379c3" - integrity sha512-IWaYMenb0m8/FCI719Woknr5RO9x5iys0Isgk0ytJJzZZXNOnbmArb8y2zgztFMwPjA5maAj7INgA+YbwbFH+w== +"@department-of-veterans-affairs/mobile-tokens@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@department-of-veterans-affairs/mobile-tokens/-/mobile-tokens-0.12.0.tgz#df255401790dbb8ac0ecac02f956d6512a1645b2" + integrity sha512-cACiKuaU1154l42U+cnnSOa1bRedFiQPG9lX/s+Sb8eJZjCsEmQW4SkqEbRzy5lViYj/59ACnY5JCD7+wslvRw== "@egjs/hammerjs@^2.0.17": version "2.0.17" @@ -10240,7 +10240,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -10257,15 +10257,6 @@ string-width@^2.0.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -10387,7 +10378,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -10408,13 +10399,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -11272,7 +11256,7 @@ word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f" integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -11290,15 +11274,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 4a9326d40e86ed728e791e49d2edff218cadfa08 Mon Sep 17 00:00:00 2001 From: Chris Alexander Date: Wed, 3 Jul 2024 09:21:37 -0600 Subject: [PATCH 02/21] Convert first set of components to use Alert component --- .../CommonErrorComponents/CallHelpCenter.tsx | 16 ++++----- .../CommonErrorComponents/DowntimeError.tsx | 18 +++++----- .../CommonErrorComponents/ErrorAlert.tsx | 8 ++--- VAMobile/src/components/EncourageUpdate.tsx | 8 ++--- .../ClaimTimeline/ClaimTimeline.tsx | 12 ++++--- .../EstimatedDecisionDate.tsx | 8 ++--- .../ClaimsHistoryScreen.tsx | 6 ++-- .../Letters/GenericLetter/GenericLetter.tsx | 8 ++--- .../PrescriptionHistoryNoPrescriptions.tsx | 13 ++++---- .../PrescriptionHistoryNotAuthorized.tsx | 10 +++--- .../RefillScreens/RefillRequestSummary.tsx | 33 +++++++------------ .../screens/auth/LoginScreen/LoginScreen.tsx | 6 ++-- 12 files changed, 71 insertions(+), 75 deletions(-) diff --git a/VAMobile/src/components/CommonErrorComponents/CallHelpCenter.tsx b/VAMobile/src/components/CommonErrorComponents/CallHelpCenter.tsx index 7535a55ea13..e686c185fae 100644 --- a/VAMobile/src/components/CommonErrorComponents/CallHelpCenter.tsx +++ b/VAMobile/src/components/CommonErrorComponents/CallHelpCenter.tsx @@ -3,9 +3,9 @@ import { useEffect } from 'react' import { useTranslation } from 'react-i18next' import { ViewStyle } from 'react-native' -import { Button } from '@department-of-veterans-affairs/mobile-component-library' +import { Alert, Button } from '@department-of-veterans-affairs/mobile-component-library' -import { AlertBox, Box, ClickToCallPhoneNumber, TextView, VAScrollView } from 'components' +import { Box, ClickToCallPhoneNumber, TextView, VAScrollView } from 'components' import { Events } from 'constants/analytics' import { NAMESPACE } from 'constants/namespaces' import { a11yLabelID, a11yLabelVA } from 'utils/a11yLabel' @@ -64,11 +64,11 @@ const CallHelpCenter: FC = ({ return ( - + = ({ )} - + ) diff --git a/VAMobile/src/components/CommonErrorComponents/DowntimeError.tsx b/VAMobile/src/components/CommonErrorComponents/DowntimeError.tsx index dd7bc6802b3..52fc0402748 100644 --- a/VAMobile/src/components/CommonErrorComponents/DowntimeError.tsx +++ b/VAMobile/src/components/CommonErrorComponents/DowntimeError.tsx @@ -3,7 +3,9 @@ import { useTranslation } from 'react-i18next' import { ViewStyle } from 'react-native' import { useSelector } from 'react-redux' -import { AlertBox, Box, ClickToCallPhoneNumber, TextView, VAScrollView } from 'components' +import { Alert } from '@department-of-veterans-affairs/mobile-component-library' + +import { Box, ClickToCallPhoneNumber, TextView, VAScrollView } from 'components' import { NAMESPACE } from 'constants/namespaces' import { RootState } from 'store' import { DowntimeFeatureType, ScreenIDToDowntimeFeatures, ScreenIDTypes } from 'store/api/types' @@ -50,12 +52,12 @@ const DowntimeError: FC = ({ screenID }) => { return ( - + {t('downtime.message.2')} @@ -64,7 +66,7 @@ const DowntimeError: FC = ({ screenID }) => { phone={t('8006982411')} a11yLabel={a11yLabelID(t('8006982411'))} /> - + ) diff --git a/VAMobile/src/components/CommonErrorComponents/ErrorAlert.tsx b/VAMobile/src/components/CommonErrorComponents/ErrorAlert.tsx index 109765eac3a..625f57e1a00 100644 --- a/VAMobile/src/components/CommonErrorComponents/ErrorAlert.tsx +++ b/VAMobile/src/components/CommonErrorComponents/ErrorAlert.tsx @@ -2,9 +2,9 @@ import React, { FC } from 'react' import { useTranslation } from 'react-i18next' import { ViewStyle } from 'react-native' -import { Button } from '@department-of-veterans-affairs/mobile-component-library' +import { Alert, Button } from '@department-of-veterans-affairs/mobile-component-library' -import { AlertBox, Box, VAScrollView } from 'components' +import { Box, VAScrollView } from 'components' import { NAMESPACE } from 'constants/namespaces' import { useTheme } from 'utils/hooks' @@ -33,11 +33,11 @@ const ErrorAlert: FC = ({ onTryAgain, title, text }) => { return ( - +