-
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
Create v1 Collect workspace Bottom Up flow #30582
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.
Looking good! Just some minor feedback.
I 100% did this. I was very careful to save the file given that this was the 3rd test. Maybe there is another line that I need to comment out? |
@mountiny Test results with staging server enabled. Video showing fresh accounts (left: admin, right: employee) included. Requesting (employee) user
Requestee (admin) user
30582-web-3.mp4 |
Oh, I guess the admin's own workspace chat doesn't seem to have been added. But the employee's does for both. |
Yeah, I assumed we're looking for the workspace's chat room which is different from those. I opened all the reports in the video just to make sure. |
It was added optimistically but then disappeared, I think this might be something to do with the Collect policy settings. This would require a change in the backend I have created a follow up to investigate so we do not forget about this #31754 Both users have workspace chat and seems like everything worked so I am going to go ahead with merge. Thanks everyone fore testing and reviewing 🚀 |
✋ 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/mountiny in version: 1.4.3-0 🚀
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.3-0 🚀
|
{ | ||
text: translate('common.businessBankAccount'), | ||
icon: Expensicons.Building, | ||
onSelected: () => onItemSelected(CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT), |
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 caused crash - #31797 as it fallback to throw here:
throw new Error('Invalid payment method type selected'); |
Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute('', policyID)); | ||
return; | ||
} | ||
Navigation.navigate(this.props.addBankAccountRoute); |
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 think this default might be incorrect. I think this defaults to a personal bank account since we pass it here
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 think this should be correct because we pass it to the SettlementButton in both cases using this method which checks if the parent report is workspace chat or DM
App/src/components/MoneyReportHeader.js
Line 94 in e909316
const bankAccountRoute = ReportUtils.getBankAccountRoute(chatReport); |
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.3-11 🚀
|
if (isExpenseReport) { | ||
buttonOptions.push(paymentMethods[CONST.IOU.PAYMENT_TYPE.VBBA]); | ||
} | ||
buttonOptions.push(paymentMethods[CONST.IOU.PAYMENT_TYPE.VBBA]); |
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 change caused duplicated "Pay with Expensify" option
}, | ||
}, | ||
...(Permissions.canUseWallet(props.betas) | ||
...(ReportUtils.isIOUReport(iouReport) |
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.
Send money case was missing in this condition, which caused #32228
onSelected: () => { | ||
props.onItemSelected(CONST.PAYMENT_METHODS.BANK_ACCOUNT); | ||
}, | ||
}, |
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 also removed personal bank account option in Wallet page. Issue: #32079
|
||
const optimisticData = [ | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, |
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.
Coming from #31836.
As there isn't a better way at the moment to update data immediately before navigation, we have fallen back to using the SET
method.
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.
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.
😢 This is multiple times I've seen this used and I think it is a hack and that we should really try to find some other real solution to the problem.
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 did raise that concern in the linked issue, however, no other viable solution has been found in couple of weeks. Then given we already use the SET
for classic policy creation (so not part of the bottom up flow), I agree to proceed with using SET
.
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.
Would you be OK with creating a GH issue with a solid problem statement and start getting some proposals for fixing it? I'd like to not just let this one fade away with others continuing to copy the same hack. I have some ideas like:
- If there was just a
merge()
then the data should be immediately (and synchronously) available in the Onyx cache. Let's find a way to use it faster - Is the problem because subscribers aren't notified until the next-tick? If so, maybe we can add an option to Onyx to bypass for some scenarios (since it was only added as an optimization)
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 have this saved, but I still did not get around to do this focusing on Ideal nav and waves in general. Noting previous comment from another PR for future.
Details
In this PR we are implementing a basic v1 bottom up flow in which users can:
Fixed Issues
$ #30702
Tests
For testing purposes as Expensify Engineer locally set the
skipGuidesAssignent
to true on this line as most likely the guide assignment might not be working well for you locally and it could cause the call to fail.Pay With Expensify
Offline tests
Same as tests
QA Steps
Same as tests
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
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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari