-
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 a route for easy redirects to the start request flow #33303
Conversation
@arosiclair 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] |
Should we add a C+ for review? |
I'd be interested if requires C+ review |
Sure, go for it. |
@situchan do we think you'll have review done today? |
yes I'll |
@tgolen please merge main |
I can, but is it necessary to? |
just for safety. as 800 commits behind |
I think it's OK. There is nothing wrong with being 800 commits behind if there are no conflicts or changes to the areas being touched. |
nvm, I am pulling main locally since there was expo image PR merged in between, which requires full android re-build |
Please remove |
Thanks for reporting the issue with the RHP opening twice. It doesn't appear like you are following the test steps, where the intention is just to modify the URL to go to those links. I guess I can add a |
I think that should be fixed. We can try either dismissModal or navigation replace |
OK, fixed and updated. |
Can you also please check console error? I think the logic should be moved to component mount (useEffect with empty array dependency). It's not recommended to directly call function in render. |
Oh, sorry I forgot about that. I changed the component so that it doesn't redirect until the component has been mounted and this solves the console error. In order to prevent the "not found" page from briefly showing, I am just having the component return |
Console error when redirect https://dev.new.expensify.com:8082/start/request/other |
OK, I added some type checking in order to show the "not found" page when there is an invalid URL param. I tested with these URLs:
I think the console prop type error is fine in these cases. The only way to make the error go away would be to relax the propType definition to accept any string, and I'd rather keep it strict. |
@@ -0,0 +1,64 @@ | |||
import PropTypes from 'prop-types'; | |||
import React, {useEffect} from 'react'; | |||
import _ from 'underscore'; |
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 prefer lodash to underscore.
Btw not blocker since both will be deprecated during TS migration
const isIouTypeValid = _.values(CONST.IOU.TYPE).indexOf(iouType) > -1; | ||
const isIouRequestTypeValid = _.values(CONST.IOU.REQUEST_TYPE).indexOf(iouRequestType) > -1; |
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.
const isIouTypeValid = _.values(CONST.IOU.TYPE).indexOf(iouType) > -1; | |
const isIouRequestTypeValid = _.values(CONST.IOU.REQUEST_TYPE).indexOf(iouRequestType) > -1; | |
const isIouTypeValid = _.values(CONST.IOU.TYPE).includes(iouType); | |
const isIouRequestTypeValid = _.values(CONST.IOU.REQUEST_TYPE).includes(iouRequestType); |
}, []); | ||
|
||
if (!isIouTypeValid || !isIouRequestTypeValid) { | ||
return <FullPageNotFoundView shouldShow />; |
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.
OK, I've added the screenwrapper. I was not sure which options were necessary, but I think that since the only child is the "not found" page, then none of the settings for padding or max height are needed? |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb-deep.movweb-redirect.movMacOS: Desktop |
I think not needed. Also tested. If something is required even for this simple page, maybe better to update that prop as always required in propType. |
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, this is a good call. I was reading the comments for each of the prop types, and a lot of them left me in a very confused state. Such as:
Why should it have padding bottom or not??
How do I know if the functionality is necessary or not if the functionality is not explained?
How would I know which one I should use?
Finally! This one comes pretty close to giving a proper explanation. |
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!
✋ 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/Beamanator in version: 1.4.19-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.19-2 🚀
|
Details
This allows for easy URLs that can link straight to the request flows. These are used in promotional messages.
This is intended to only work with web and for people that are using mobile, we expect it to open on mobile web.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/352160
Tests
Offline tests
None, this doesn't really work offline.
QA Steps
NOTE: You only need to test web and mobile web. This isn't intended to work on other platforms.
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