-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
activate physical card #28313
activate physical card #28313
Conversation
… feat-22878-activate-physical-card
…ch/Expensify-app into feat-22878-activate-physical-card
…ch/Expensify-app into feat-22878-activate-physical-card
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a bug with numberpad on the mobile web (safari and Chrome) , the number button doesn’t work after the input loses focus
CleanShot.2023-09-29.at.12.37.05.mp4
On IOS, the submit button is not docked at the bottom :
List page | validate page |
---|---|
On IOS Safari, the validate button is initially hidden, this may not be a bug , seems like a limitation with the design,
CleanShot.2023-09-29.at.12.36.27.mp4
On mobile, when an error occurs the design expands, is that expected? cc @shawnborton
CleanShot.2023-09-29.at.12.59.05.mp4
* @param {String} text | ||
*/ | ||
const onCodeInput = (text) => { | ||
setFormError(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setFormError(''); | |
setFormError(''); | |
if(cardError){ | |
CardSettings.clearCardListErrors(cardID); | |
} |
We should reset onyx error when input change.
value={lastFourDigits} | ||
lastPressedDigit={lastPressedDigit} | ||
onChangeText={onCodeInput} | ||
errorText={formError} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errorText={formError} | |
errorText={formError || cardError} |
We pass onyx error with local validation error.
src/languages/en.ts
Outdated
pleaseEnterLastFour: 'Please enter the last four digits of your card.', | ||
activatePhysicalCard: 'Activate physical card', | ||
error: { | ||
notEnoughDigits: 'Not enough digits.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we ask for a copy of this error in the linked issue ? it should be approved by marketing.
and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will do.
The specs for this issue state:
The errors returned here are basically just “not enough digits” (must be 4) and “incorrect last four digits”.
Thought that it's fine for me to put it in there without asking any1 for confirmation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shawnborton And that should be approach for all platforms? |
Screen.Recording.2023-10-06.at.11.10.51.movScreen.Recording.2023-10-06.at.11.11.43.movScreen.Recording.2023-10-06.at.11.12.07.movScreen.Recording.2023-10-06.at.11.12.29.movScreen.Recording.2023-10-06.at.11.15.29.movScreen.Recording.2023-10-06.at.11.18.58.mov@fedirjh I've updated the layout according to the latest guidelines. Submit button should be only docked at the bottom if there is an empty space above it. I've uploaded the videos to showcase how it looks like now. PR is ready for the final review |
@MrMuzyk the app crashes when we deep link to the activate page without having any card in Onyx : |
@fedirjh
This page will not work properly without a physicalCard object provided from onyx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything else I can do apart from this check which is already in codebase?
Apparently, using cardList[cardID]
is causing this crash, I see using physicalCard
should fix the crash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
Updated the inputs @fedirjh |
Awesome, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me and tests well.
…hange in onyxkeys for cardlist
@grgia removed new const I've added and swapped to the one you've proposed. On top of that I've spotted that the type in ONYXKEYS was unnecessarily changed by me so I've reverted that. Rebased with latest main as well :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/grgia in version: 1.3.81-0 🚀
|
🚀 Deployed to staging by https://github.com/grgia in version: 1.3.83-0 🚀
|
return; | ||
} | ||
|
||
CardSettings.activatePhysicalExpensifyCard(Number(lastFourDigits), cardID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not convert the digits to numbers. It will remove starting 000s. This caused #31540
return ( | ||
<IllustratedHeaderPageLayout | ||
title={translate('activateCardPage.activateCard')} | ||
onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS_WALLET_DOMAINCARDS.getRoute(domain))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have used Navigation.goBack
to navigate, it caused #35530
Details
Fixed Issues
$ #22878
PROPOSAL:
Tests
InitialSettingsPage
In order to test happy path
Card.js
toActivate physical card
button shouldn't be visibleOffline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Happy path
https://github.com/Expensify/App/assets/23487612/99fff72f-218c-4f96-8f36-808fa0a9385d
Error path
https://github.com/Expensify/App/assets/23487612/f043c39c-18dc-41c3-983c-dcc6533f4002
Mobile Web - Chrome
Happy path
https://github.com/Expensify/App/assets/23487612/2c00585e-3e24-4f96-b3e6-ab7f0cfa2f7e
Error path
https://github.com/Expensify/App/assets/23487612/033e7634-0bb2-4b4f-aa4f-00474ea2e640
Mobile Web - Safari
Happy path
https://github.com/Expensify/App/assets/23487612/3218c1fc-fce1-48c1-b36b-c69b12aabad3
Error path
https://github.com/Expensify/App/assets/23487612/4037e721-0440-462f-aa1f-d049467b0eaa
Desktop
Happy path
https://github.com/Expensify/App/assets/23487612/0fc7d45a-814f-44a3-b234-1a30e3dbc278
Error path
https://github.com/Expensify/App/assets/23487612/aa59912b-ac69-4537-9706-d7075c3cf362
iOS
Happy path
https://github.com/Expensify/App/assets/23487612/ce997f17-f882-4b0e-880d-1f2bb1a55bea
Error path
https://github.com/Expensify/App/assets/23487612/dc581a4c-086f-4ba7-bc64-2fcdc069caed
Android
Happy path
https://github.com/Expensify/App/assets/23487612/6761aca1-79a0-4f68-bb54-4ca4b099e239
Error path
https://github.com/Expensify/App/assets/23487612/437debbd-7b47-4691-902c-ad0431b6f8e9