-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Login via deeplink should open modal in request money #31529
Login via deeplink should open modal in request money #31529
Conversation
@abdulrahuman5196 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] |
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.
@dukenv0307 Kindly check on the comments
src/pages/EditRequestPage.js
Outdated
@@ -104,18 +123,34 @@ function EditRequestPage({report, route, parentReport, policyCategories, policyT | |||
// A flag for showing the tags page | |||
const shouldShowTags = isPolicyExpenseChat && (transactionTag || OptionsListUtils.hasEnabledOptions(lodashValues(policyTagList))); | |||
|
|||
const reportAction = ReportActionsUtils.getReportAction(parentReportID, parentReportActionID); | |||
|
|||
// For small screen, we don't call openReport API when we go to a sub report page by deeplink |
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.
- Where are we calling openReport API separately for big screens?
- If the said is true for small screen devices, shouldn't other types of reports be affected by the same? Like Task and edit Task?
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 are calling
openReport
API in report screen but when we open a page by deeplink in small screen, LHN is displayed and we don't have access to report screen soopenReport
API isn't called. -
Here we need
transation
data which is returned inOpenReport
API but inEdit Task
page we only usereport
data which is returned inOpenApp
API.
src/pages/EditRequestPage.js
Outdated
const isTransactionLoadingRoute = lodashGet(transaction, 'comment.isLoading', false); | ||
const isTransactionLoading = lodashGet(transaction, 'isLoading', false); | ||
|
||
const isDataLoading = isLoadingReportData || isTransactionLoading || isTransactionLoadingRoute || _.isEmpty(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.
For checking if reportData is loaded, is it possible to use WithReportOrNotFound
? So that we re-use existing functions?
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 use WithReportOrNotFound
, we will show two loading pages one in HOC, and one on this page when OpenReport
API is called that will make this page is flickered briefly.
@dukenv0307 Any update on the above? |
Update today. |
@abdulrahuman5196 I responded in the review thread. |
@dukenv0307 The changes doesn't seem to work properly in my testing. Screen.Recording.2023-12-07.at.11.09.29.PM.movScreen.Recording.2023-12-07.at.11.11.22.PM.mov |
@abdulrahuman5196 I believe the bug mentioned here is not related to my code change. Please check the video attached below for more details. deeplink-resize.movI think we'd better put this on hold to find the PR or issue that caused this new bug |
Will take a review today |
@abdulrahuman5196 Friendly bump. |
@dukenv0307 I doubt if the route is returned wrongly. I just wrapped the Code change I Made. diff --git a/src/ROUTES.ts b/src/ROUTES.ts
index 49067d1c7b..f292a636b8 100644
--- a/src/ROUTES.ts
+++ b/src/ROUTES.ts
@@ -156,8 +156,8 @@ const ROUTES = {
getRoute: (reportID: string) => `r/${reportID}` as const,
},
EDIT_REQUEST: {
- route: 'r/:threadReportID/edit/:field',
- getRoute: (threadReportID: string, field: ValueOf<typeof CONST.EDIT_REQUEST_FIELD>) => `r/${threadReportID}/edit/${field}` as const,
+ route: 'r/:reportID/edit/:field',
+ getRoute: (reportID: string, field: ValueOf<typeof CONST.EDIT_REQUEST_FIELD>) => `r/${reportID}/edit/${field}` as const,
},
EDIT_CURRENCY_REQUEST: {
route: 'r/:threadReportID/edit/currency',
diff --git a/src/pages/EditRequestPage.js b/src/pages/EditRequestPage.js
index e41f30779f..855f39be4b 100644
--- a/src/pages/EditRequestPage.js
+++ b/src/pages/EditRequestPage.js
@@ -29,6 +29,7 @@ import EditRequestReceiptPage from './EditRequestReceiptPage';
import EditRequestTagPage from './EditRequestTagPage';
import reportActionPropTypes from './home/report/reportActionPropTypes';
import reportPropTypes from './reportPropTypes';
+import withReportOrNotFound from './home/report/withReportOrNotFound';
const propTypes = {
/** Route from navigation */
@@ -285,6 +286,7 @@ EditRequestPage.displayName = 'EditRequestPage';
EditRequestPage.propTypes = propTypes;
EditRequestPage.defaultProps = defaultProps;
export default compose(
+ withReportOrNotFound(),
withOnyx({
report: {
key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${route.params.threadReportID}`,
diff --git a/src/pages/home/report/withReportOrNotFound.tsx b/src/pages/home/report/withReportOrNotFound.tsx
index cf2c0d5aca..5c10e6cb81 100644
--- a/src/pages/home/report/withReportOrNotFound.tsx
+++ b/src/pages/home/report/withReportOrNotFound.tsx
@@ -73,7 +73,10 @@ export default function (
return withOnyx<TProps & RefAttributes<TRef>, OnyxProps>({
report: {
- key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`,
+ key: ({route}) => {
+ console.log("Abdul Test" + JSON.stringify(route))
+ return `${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID || route.params.threadReportID}`
+ },
},
isLoadingReportData: {
Video of testing: Screen.Recording.2024-01-03.at.9.01.51.PM.mov |
@abdulrahuman5196 Updated. I fixed this issue in the past here #28641 but it was removed when we migrate |
@abdulrahuman5196 Any update here. |
Will check tomorrow. @dukenv0307 Meanwhile could you kindly fix the merge conflicts. |
@abdulrahuman5196 resolved conflict. |
@abdulrahuman5196 I think we should hold this until |
@abdulrahuman5196 Updated the PR to add a new solution after refactor by adding the logic to show the loading page in |
@abdulrahuman5196 Friendly bump. |
Checking now |
@@ -225,8 +225,8 @@ const IOURequestStepDescriptionWithOnyx = withOnyx<IOURequestStepDescriptionProp | |||
})(IOURequestStepDescription); | |||
|
|||
// eslint-disable-next-line rulesdir/no-negated-variables | |||
const IOURequestStepDescriptionWithWritableReportOrNotFound = withWritableReportOrNotFound(IOURequestStepDescriptionWithOnyx); | |||
const IOURequestStepDescriptionWithFullTransactionOrNotFound = withFullTransactionOrNotFound(IOURequestStepDescriptionWithOnyx); |
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.
@dukenv0307 I am not entirely sure on what changes we are making here since this PR is very old and the new changes are different than the accepted proposal.
Could you let me know the changes and why we need to do this and how will it fix the issue?
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.
Could you let me know the changes and why we need to do this and how will it fix the issue?
@abdulrahuman5196 The bug still happens after we refactor the edit flow. The RCA is we don't have the logic to display the loading page when the report is loading. My solution is we will handle this in withWritableReportOrNotFound
HOC so all pages of money request flow can display a loading page when the report is loading. That's why we have to wrap that HOC on the outside.
@abdulrahuman5196 Any update here. |
Checking now |
Checking again |
Whenever I pick this issue I am not getting OTPs 😪 due to site issues I think. |
I can get OTP to login. |
@abdulrahuman5196 Is this issue resolved? |
Checking now |
Checking now again |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-05-30.at.11.40.51.PM.mp4Android: mWeb ChromeScreen.Recording.2024-05-30.at.11.46.18.PM.mp4iOS: NativeScreen.Recording.2024-05-30.at.11.15.34.PM.mp4iOS: mWeb SafariScreen.Recording.2024-05-30.at.11.28.52.PM.mp4MacOS: Chrome / SafariScreen.Recording.2024-05-30.at.11.00.08.PM.mp4MacOS: DesktopScreen.Recording.2024-05-30.at.11.10.41.PM.mp4 |
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.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @robertjchen
🎀 👀 🎀
C+ Reviewed
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, 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. |
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.79-11 🚀
|
Details
Login via deep link should open the modal in Request money
Fixed Issues
$ #29115
PROPOSAL: #29115 (comment)
Tests
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)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
chrome-resize.mov
iOS: Native
ios-resize.mov
iOS: mWeb Safari
safari-resize.mov
MacOS: Chrome / Safari
web-resize.mov
MacOS: Desktop
desktop-resize.mov