-
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
Add “Reveal details” for the digital card #26778
Conversation
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.
Left comments.
ebf11c5
to
400fa0c
Compare
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.
Left a few comments.
157d190
to
8adb129
Compare
@jasperhuangg Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Assigning @eVoloshchak for C+ review from issue |
@eVoloshchak are you able to prioritize this PR? |
usePrivatePersonalDetails(); | ||
const {translate} = useLocalize(); | ||
|
||
const handleCopyToClipboard = () => { |
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 can use CopyTextToClipboard instead
It will also add a hover effect to the copy icon and a tooltip, so it's consistent with the rest of the app
Screen.Recording.2023-10-02.at.11.13.49.mov
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.
Unfortunately it won't work for this UI, because CopyTextToClipboard
displays a text component that we don't need as it's already displayed by MenuItemWithTopDescription
. However, I found out that this would work:
<MenuItemWithTopDescription
...
shouldShowRightComponent
rightComponent={
<PressableWithDelayToggle
tooltipText={translate('reportActionContextMenu.copyToClipboard')}
tooltipTextChecked={translate('reportActionContextMenu.copied')}
icon={Expensicons.Copy}
onPress={handleCopyToClipboard}
/>
}
...
/>
So basically, a part of CopyTextToClipboard
that displays the icon, what do you think?
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.
Awesome, let's do that instead!
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.
Done 😄
src/libs/CardUtils.ts
Outdated
|
||
const formatted = addressItems.join(', '); | ||
|
||
// Remove the last comma of the address |
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.
Correct me if I'm wrong, but I don't think this is needed. join()
doesn't add a separator string after the last element, I don't see a difference when commenting out this line
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.
I am not sure I understand, you are saying we don't need join()
? If we remove it, it will be an array
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.
I changed the implementation a lot, so I guess that comment might be outdated
src/libs/CardUtils.ts
Outdated
function getFormattedAddress(privatePersonalDetails: OnyxTypes.PrivatePersonalDetails): string | null { | ||
const {address} = privatePersonalDetails; | ||
const [street1, street2] = (address?.street ?? '').split('\n'); | ||
const addressItems = [street1, street2, address?.city, address?.state, address?.zip, address?.country]; |
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.
If we don't have Address Line 2 populated, it just shows a blank space instead of filtering it out
Could we just re-use getFormattedAddress? Seems like both methods are supposed to be doing the same thing, we could move it to addressUtils (or similar) and use one method for both pages
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.
I changed it a little bit and moved it to PersonalDetailsUtils
, let me know what you think!
@eVoloshchak |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-10-02.at.16.38.45.movMobile Web - Chromescreen-20231002-164043.mp4Mobile Web - SafariScreen.Recording.2023-10-02.at.16.41.17.movDesktopScreen.Recording.2023-10-02.at.16.36.38.moviOSScreen.Recording.2023-10-02.at.16.43.06.movAndroidscreen-20231002-164014.mp4 |
Tests well on all the platforms, only a couple of things left
cc: @JKobrynski |
@eVoloshchak icon aligned, should be fine now 😄 |
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.
LGTM
🎯 @eVoloshchak, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #28704. |
pan="1234123412341234" | ||
expiration="11/02/2024" | ||
cvv="321" |
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.
looks great, but could you add a quick comment that these will be replaced in this issue: https://github.com/orgs/Expensify/projects/58?pane=issue&itemId=33286617
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.
Done!
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.
🎉 Fantastic work getting this done, thanks!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To Duration
Show details
Meaningless Changes To DurationShow entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
🚀 Deployed to staging by https://github.com/grgia in version: 1.3.78-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.78-4 🚀
|
🚀 Deployed to staging by https://github.com/grgia in version: 1.3.79-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀
|
Details
Fixed Issues
$ #22874
PROPOSAL: N/A
Tests
InitialSettingsPage.js
:Offline tests
QA Steps
As of now it's not possible to test it without editing the code.
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
web.mov
Mobile Web - Chrome
chrome.webm
Mobile Web - Safari
safari.mp4
Desktop
desktop.mov
iOS
ios.mp4
Android
android.webm