-
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
[TS Migration] Migrate EReceiptThumbnail.js component to TypeScript #32913
[TS Migration] Migrate EReceiptThumbnail.js component to TypeScript #32913
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.
LGTM
LGTM! @JKobrynski |
@0xmiroslav 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] |
Author Checklist seems failing |
There are 3 checklist items added recently |
@0xmiroslav checklist fixed! |
Agree this is hard to test externally. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.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.
LGTM!
We did not find an internal engineer to review this PR, trying to assign a random engineer to #31956 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
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 learning a lot about TS through these migrations!
src/components/EReceiptThumbnail.tsx
Outdated
/** TransactionID of the transaction this EReceipt corresponds to | ||
* It's used by withOnyx HOC | ||
*/ |
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.
/** TransactionID of the transaction this EReceipt corresponds to | |
* It's used by withOnyx HOC | |
*/ | |
/** TransactionID used by withOnyx of the transaction this EReceipt corresponds to */ |
Prop comments are preferred to be single lines.
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/components/EReceiptThumbnail.tsx
Outdated
const onContainerLayout = (event) => { | ||
const backgroundImage = useMemo(() => backgroundImages[StyleUtils.getEReceiptColorCode(transaction)], [StyleUtils, transaction]); | ||
|
||
// Get receipt colorway, or default to Yellow. |
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.
// Get receipt colorway, or default to Yellow. |
I think this comment can be removed, it is not valuable and I don't think it's accurate anymore.
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.
Updated
const backgroundImage = useMemo(() => backgroundImages[StyleUtils.getEReceiptColorCode(transaction)], [StyleUtils, transaction]); | ||
|
||
// Get receipt colorway, or default to Yellow. | ||
const colorStyles = StyleUtils.getEReceiptColorStyles(StyleUtils.getEReceiptColorCode(transaction)); |
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.
Why don't these consts (and many others in this file) have type declarations?
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.
Oh, also, please do add QA tests. I would suggest looking through the git blame to find when the feature was implemented and see how it was originally QAed. That might give you some insight into how to test it. |
@JKobrynski Bump for once you are back 😄 |
Thanks for finding that. I am pretty worried that we have a flow that isn't covered by any QA tests or regression tests. There would be no way for us to know whether this is working or not until we hear about it from our customers. @grgia Could you please help write up some QA tests that Applause can perform for testing e-receipts? |
@tgolen As for production QA tests that cover the EReceiptThumbnail, |
Thanks, Georgia! @JKobrynski Can you work those into the QA tests, please? Also, it looks like you picked up a conflict. |
@tgolen updated, conflicts resolved! |
Thanks for adding the QA tests. Can you please clean them up a little?
|
@tgolen done! |
Lint failing |
✋ 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/tgolen in version: 1.4.24-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.4.24-3 🚀
|
Details
Fixed Issues
$ #31956
PROPOSAL: N/A
Tests
(By @grgia)
I think the best way to QA this in DEV is to test the component in the storybook build and look at the EReceiptThumbnail, EReceipt, and ReportPreview stories.
Offline tests
N/A
QA Steps
(by @grgia)
As for production QA tests that cover the EReceiptThumbnail,
We can:
1 . Create a report with 1 - 3 Expensify Card Transactions
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop