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

feature/8467-UseDesignSystemAlertComponent #9022

Merged
merged 29 commits into from
Aug 22, 2024

Conversation

alexandec
Copy link
Contributor

@alexandec alexandec commented Jul 9, 2024

Description of Change

Replace the AlertBox and CollapsibleAlert components with the new design system Alert component.

Note that the Alert component doesn't contain the existing AlertBox haptics and scrolling features. I created an AlertWithHaptics wrapper component which triggers haptics and scrolls to the alert where appropriate.

Locations changed:

  • src/components/EncourageUpdate.tsx
  • src/components/MessageAlert.tsx
  • src/components/WaygateWrapper.tsx
  • src/components/WhatsNew.tsx
  • src/components/CommonErrorComponents/CallHelpCenter.tsx
  • src/components/CommonErrorComponents/CustomError.tsx
  • src/components/CommonErrorComponents/DowntimeError.tsx
  • src/components/CommonErrorComponents/ErrorAlert.tsx
  • src/screens/auth/LoginScreen/LoginScreen.tsx
  • src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.tsx
  • src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimFileUpload/SelectFile/SelectFile.tsx
  • src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimFileUpload/TakePhotos/TakePhotos.tsx
  • src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimFileUpload/TakePhotos/UploadOrAddPhotos/UploadOrAddPhotos.tsx
  • src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.tsx
  • src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/EstimatedDecisionDate/EstimatedDecisionDate.tsx
  • src/screens/BenefitsScreen/ClaimsScreen/ClaimsHistoryScreen/ClaimsHistoryScreen.tsx
  • src/screens/BenefitsScreen/Letters/GenericLetter/GenericLetter.tsx
  • src/screens/HealthScreen/Appointments/Appointments.tsx
  • src/screens/HealthScreen/CernerAlert/CernerAlert.tsx
  • src/screens/HealthScreen/Pharmacy/PrescriptionDetails/PrescriptionsDetailsBanner.tsx
  • src/screens/HealthScreen/Pharmacy/PrescriptionHistory/PrescriptionHistory.tsx
  • src/screens/HealthScreen/Pharmacy/PrescriptionHistory/PrescriptionHistoryNoPrescriptions.tsx
  • src/screens/HealthScreen/Pharmacy/PrescriptionHistory/PrescriptionHistoryNotAuthorized.tsx
  • src/screens/HealthScreen/Pharmacy/RefillScreens/RefillRequestSummary.tsx
  • src/screens/HealthScreen/Pharmacy/RefillScreens/RefillScreen.tsx
  • src/screens/HealthScreen/SecureMessaging/CernerAlertSM/CernerAlertSM.tsx
  • src/screens/HealthScreen/SecureMessaging/EditDraft/EditDraft.tsx
  • src/screens/HealthScreen/SecureMessaging/ReplyMessage/ReplyMessage.tsx
  • src/screens/HealthScreen/SecureMessaging/StartNewMessage/StartNewMessage.tsx
  • src/screens/HealthScreen/SecureMessaging/StartNewMessage/Attachments/Attachments.tsx
  • src/screens/HealthScreen/SecureMessaging/ViewMessage/IndividualMessageErrorComponent.tsx
  • src/screens/HealthScreen/SecureMessaging/ViewMessage/ViewMessageScreen.tsx
  • src/screens/HealthScreen/Vaccines/NoVaccineRecords/NoVaccineRecords.tsx
  • src/screens/HomeScreen/ProfileScreen/ContactInformationScreen/AddressValidation/AddressValidation.tsx
  • src/screens/HomeScreen/ProfileScreen/ContactInformationScreen/EditAddressScreen/EditAddressScreen.tsx
  • src/screens/HomeScreen/ProfileScreen/ContactInformationScreen/EditEmailScreen/EditEmailScreen.tsx
  • src/screens/HomeScreen/ProfileScreen/ContactInformationScreen/EditPhoneNumberScreen/EditPhoneNumberScreen.tsx
  • src/screens/HomeScreen/ProfileScreen/SettingsScreen/NotificationsSettingsScreen/NotificationsSettingsScreen.tsx
  • src/screens/PaymentsScreen/DirectDepositScreen/EditDirectDepositScreen/EditDirectDepositScreen.tsx
  • src/screens/PaymentsScreen/DirectDepositScreen/HowToUpdateDirectDepositScreen/HowToUpdateDirectDepositScreen.tsx
  • src/screens/PaymentsScreen/PaymentHistory/NoPayments/NoPaymentsScreen.tsx

Screenshots/Video

Example before/after comparisons:

  

  

  

Testing

  • Tested on iOS
  • Tested on Android

Reviewer Validations

  • Update @department-of-veterans-affairs/mobile-component-library package to latest version
  • Update @department-of-veterans-affairs/mobile-tokens package to latest version
  • Alertbox and CollapsibleAlert components are removed and replaced with AlertWithHaptics component

PR Checklist

Reviewer: Confirm the items below as you review

  • PR is connected to issue(s)
  • Tests are included to cover this change (when possible)
  • No magic strings (All string unions follow the Union -> Constant type pattern)
  • No secrets or API keys are checked in
  • All imports are absolute (no relative imports)
  • New functions and Redux work have proper TSDoc annotations

For QA

Run a build for this branch

theodur
theodur previously approved these changes Jul 10, 2024
Copy link
Contributor

@theodur theodur left a comment

Choose a reason for hiding this comment

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

Approved with some minor comments about unneeded headerA11yLabel props that already existed before these changes, they just caught my eye

Comment on lines 55 to 56
header={t('downtime.title')}
headerA11yLabel={t('downtime.title')}
Copy link
Contributor

Choose a reason for hiding this comment

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

Even though this is migrated from what was already used, I don't think we need the headerA11yLabel prop here

Comment on lines 101 to 102
header={t('whatsNew.title')}
headerA11yLabel={t('whatsNew.title')}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, the headerA11yLabel prop isn't needed

Comment on lines 90 to 91
header={t('fileUpload.accessibilityAlert.title')}
headerA11yLabel={t('fileUpload.accessibilityAlert.title')}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, the headerA11yLabel prop isn't needed

Comment on lines 72 to 73
header={t('prescription.details.banner.title')}
headerA11yLabel={t('prescription.details.banner.title')}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, the headerA11yLabel prop isn't needed

Comment on lines 412 to 413
header={t('prescription.history.transferred.title')}
headerA11yLabel={t('prescription.history.transferred.title')}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, the headerA11yLabel prop isn't needed

Comment on lines 84 to 85
header={headerText}
headerA11yLabel={headerText}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, the headerA11yLabel prop isn't needed

Comment on lines 26 to 27
header={t('secureMessaging.viewMessage.errorTitle')}
headerA11yLabel={t('secureMessaging.viewMessage.errorTitle')}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, the headerA11yLabel prop isn't needed

Comment on lines 234 to 235
header={t('editAddress.validation.verifyAddress.title')}
headerA11yLabel={t('editAddress.validation.verifyAddress.title')}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, the headerA11yLabel prop isn't needed

Comment on lines 88 to 89
expandable={true}
focusOnError={false}
Copy link
Contributor

Choose a reason for hiding this comment

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

At first, I was going to suggest adding logic to the AlertWithHaptics component that sets focusOnError to false by default when exxpandable is true since the CollapsibleAlert didn't ever focus on error, but I actually like having the flexibility to be able to set focusOnError even for expandable alerts. We don't do this anywhere yet, but it's nice to be able to do that if we need to

@github-actions github-actions bot added FE-With QA A PR waiting for QA Activity and removed FE-Needs Review labels Jul 10, 2024
@@ -91,7 +91,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",
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you want to bump this to be issuing linting warnings for Loading indicator? Not sure if that had been prioritized yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, I moved this back to 0.15.0

@@ -405,11 +405,11 @@ function ViewMessageScreen({ route, navigation }: ViewMessageScreenProps) {
)}
{replyExpired && (
<Box my={theme.dimensions.standardMarginBetween}>
<AlertBox border={'warning'} title={t('secureMessaging.reply.youCanNoLonger')}>
<AlertWithHaptics variant="warning" header={t('secureMessaging.reply.youCanNoLonger')}>
<TextView mt={theme.dimensions.standardMarginBetween} variant="MobileBody">
{t('secureMessaging.reply.olderThan45Days')}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could potentially be simplified moving this to the description prop to AlertWithHaptics.

@@ -511,26 +511,26 @@ function EditDraft({ navigation, route }: EditDraftProps) {
function renderAlert() {
return (
<Box my={theme.dimensions.standardMarginBetween}>
<AlertBox border={'warning'} title={t('secureMessaging.reply.youCanNoLonger')}>
<AlertWithHaptics variant="warning" header={t('secureMessaging.reply.youCanNoLonger')}>
<TextView mt={theme.dimensions.standardMarginBetween} variant="MobileBody">
{t('secureMessaging.reply.olderThan45Days')}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could potentially be simplified moving this to the description prop to AlertWithHaptics.

@@ -51,7 +50,7 @@ function TakePhotos({ navigation, route }: TakePhotosProps) {
}

const collapsibleContent = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be further simplified adding the TextView stuff to description on the Alert and passing the LinkWithAnalytics directly as children.

<AlertWithHaptics
variant="error"
header={fixSpacingAndSpecialCharacters(titleText)}
headerA11yLabel={titleA11y}>
<Box>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could potentially be further simplified to using Alert component description/primaryButton props leaving only the ClickToCallPhoneNumber as children.

TimRoe
TimRoe previously approved these changes Aug 20, 2024
@github-actions github-actions bot added the FE-With QA A PR waiting for QA Activity label Aug 20, 2024
TimRoe
TimRoe previously approved these changes Aug 20, 2024
@Sparowhawk Sparowhawk self-requested a review August 21, 2024 15:17
Sparowhawk
Sparowhawk previously approved these changes Aug 21, 2024
@rbontrager rbontrager removed the FE-Changes Requested Requested changes from Eng or QA label Aug 21, 2024
rbontrager
rbontrager previously approved these changes Aug 22, 2024
@github-actions github-actions bot added FE-Ready to Merge and removed FE-With QA A PR waiting for QA Activity labels Aug 22, 2024
@alexandec alexandec dismissed stale reviews from rbontrager, Sparowhawk, and TimRoe via 8a7f9ec August 22, 2024 15:05
@alexandec
Copy link
Contributor Author

@rbontrager @Sparowhawk @TimRoe had to resolve a conflict, please reapprove when you get a chance

@github-actions github-actions bot added the FE-With QA A PR waiting for QA Activity label Aug 22, 2024
@github-actions github-actions bot removed the FE-With QA A PR waiting for QA Activity label Aug 22, 2024
@Sparowhawk Sparowhawk merged commit f6bb049 into develop Aug 22, 2024
23 of 27 checks passed
@Sparowhawk Sparowhawk deleted the feature/8467-UseDesignSystemAlertComponent branch August 22, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants