-
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
Feat: Share QR Code #18636
Feat: Share QR Code #18636
Conversation
@robertjchen Updated the screenshots in "iOS" and "Web" |
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.
Perfect, thanks!! 🙇
@robertjchen looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
🚀 Deployed to staging by https://github.com/robertjchen in version: 1.3.14-1 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.3.14-14 🚀
|
style={{ | ||
alignSelf: 'stretch', | ||
height: 27, | ||
marginBottom: 20, | ||
}} |
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.
Hi everyone, coming from a follow-up PR for this component. Just wanted to note that as per our styling guidelines, let's remember to avoid inline styles. 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.
got it, thanks for the feedback! 👍
render() { | ||
const isReport = this.props.report != null && this.props.report.reportID != null; | ||
|
||
const url = isReport ? `${CONST.NEW_EXPENSIFY_URL}r/${this.props.report.reportID}` : `${CONST.NEW_EXPENSIFY_URL}details?login=${this.props.session.email}`; |
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 used a fixed CONST.NEW_EXPENSIFY_URL
here, which caused an issue as it didn't set the URL based on the environment.
<Text | ||
family="EXP_NEW_KANSAS_MEDIUM" | ||
fontSize={22} | ||
style={{marginTop: 15}} | ||
> | ||
{this.props.title} | ||
</Text> |
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.
This PR caused a regression here
We expect menu item along with the icon to turn white when hovered. But we missed to implement it for Share Code. Issue: #19067 |
url={url} | ||
title={isReport ? this.props.report.reportName : this.props.currentUserPersonalDetails.displayName} | ||
subtitle={isReport ? ReportUtils.getPolicyName(this.props.report) : this.props.session.email} | ||
logo={isReport ? roomAvatar : this.props.currentUserPersonalDetails.avatar} |
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.
This line caused a regression in #19211. When we delete the avatar, the optimistic avatar is set to the oldDot default avatar. After a second, the avatar is updated to the newDot default avatar. We fixed this issue by using a utility function that always returns the newDot default avatar.
{this.props.title} | ||
</Text> | ||
|
||
{this.props.subtitle && ( |
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.
@chrispader @robertjchen Because we didn't use boolean for conditional render, it caused a regression (although dev), here. It is essential for conditional render to use boolean expressions to avoid console errors.
I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && .
We also have an item in the checklist which was marked but we missed highlighting this one.
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.
Got it, thanks for the feedback! 🙇
While adding this feature of sharing QR code, we missed to handle the case where an user might not have access to the page. This issue was reported #21157. Issue: Web - random QR code is generated on opening share code of room using URL |
const url = isReport ? `${CONST.NEW_EXPENSIFY_URL}r/${this.props.report.reportID}` : `${CONST.NEW_EXPENSIFY_URL}details?login=${this.props.session.email}`; | ||
|
||
const platform = getPlatform(); | ||
const isNative = platform === CONST.PLATFORM.IOS || platform === CONST.PLATFORM.ANDROID; |
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.
@chrispader This is against our guide on how to do platform code. Please refer to https://github.com/Expensify/App#platform-specific-file-extensions and submit a PR that refactors this appropriately.
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.
This is actually just a temporary solution until QR code downloads are also available on web. We're currently working on that here.
Once this is possible, the platform-specific code will be removed.
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.
Yep, we unfortunately had to push this out in time for EC3- but, we're cleaning it up as soon as possible once we figure out the CORs issue.
Details
Fixed Issues
$ #18630
PROPOSAL: GH_LINK_ISSUE(COMMENT)
Tests
QR Code in Personal Settings
Sharing QR Code from Personal Settings
Offline 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
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android