-
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
Update UpdatePolicyConnectionConfiguration to be 1:1:1 Part-3 #47628
Update UpdatePolicyConnectionConfiguration to be 1:1:1 Part-3 #47628
Conversation
@ishpaul777 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] |
@ishpaul777 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-08-27.at.10.17.19.PM.movAndroid: mWeb ChromeScreen.Recording.2024-08-27.at.10.09.07.PM.moviOS: NativeScreen.Recording.2024-08-27.at.9.30.04.PM.moviOS: mWeb SafariScreen.Recording.2024-08-27.at.9.26.33.PM.movMacOS: Chrome / SafariScreen.Recording.2024-08-27.at.9.18.05.PM-1.movMacOS: DesktopScreen.Recording.2024-08-27.at.10.45.10.PM-1.movScreen.Recording.2024-08-30.at.5.47.37.PM.mov |
@ZhenjaHorbach Do you have a free trial test account for QBO which you are comfortable sharing in DM? apparently QBO is discontinued in India |
I don't mind ! |
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!
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 looks good! Love the simplification of it. Do you want to go ahead and update the other ones to that format too? EnableNewCategories, AutoCreateVendor, ReimbursableExpensesAccount?
Also @aldo-expensify was AutoCreateVendor the one we needed to update into the new format with two params? I forget.
No problem ! |
Yep,
I think it should work like what we have here: App/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx Lines 73 to 87 in 1bb1131
|
oh yeah so let's update that ^^ call to Sorry to throw extra work on you @ZhenjaHorbach |
Done ! |
Oops sorry I phrased that poorly. I meant - can we change the previous call to And @aldo-expensify I believe you were saying that we needed to update where we call autoCreateVendor with only true/false to also send a |
oh so @ZhenjaHorbach I think you basically did the right thing, but instead of UpdateMany... we're using AutoCreateVendor but with two parameters. |
Actually At first I did just that using onyxData like for updateManyPolicyConnectionConfigs And then passed onyxData with this parameters
For this command
But unfortunately UPDATE_QUICKBOOKS_ONLINE_AUTO_CREATE_VENDOR does not support configUpdate where we pass object with new values As result I have 400 error |
oh got it yeah we have it as separate params - so instead of |
Done ! Only have issue with react-compiler Failed to compile src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx:113:25. Reason: (BuildHIR::lowerExpression) Expected Identifier, got MemberExpression key in ObjectExpression Because we use a constant as a key But I'm not sure what we should fix since this is normal practice Or at least I can do it this way |
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!
you have some "React Compiler" error:
There are some instructions on how to run it locally and find the cause of the problem: https://github.com/Expensify/App/blob/main/contributingGuides/REACT_COMPILER.md |
I thought we are ignoring this #47628 (comment) but yeah if we can fix that would be great |
ahh I wasn't aware 👍 |
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 looks good! One potential rename but otherwise works for me. @aldo-expensify do you want to give this one a review as well?
@@ -21,7 +22,11 @@ function getQuickbooksOnlineSetupLink(policyID: string) { | |||
return commandURL + new URLSearchParams(params).toString(); | |||
} | |||
|
|||
function updateQuickbooksOnlineEnableNewCategories(policyID: string, settingValue: boolean) { | |||
function updateManyQuickbooksOnyxData<TConfigUpdate extends Partial<Connections['quickbooksOnline']['config']>>( |
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.
function updateManyQuickbooksOnyxData<TConfigUpdate extends Partial<Connections['quickbooksOnline']['config']>>( | |
function buildOnyxDataForMultipleQuickbooksConfigurations<TConfigUpdate extends Partial<Connections['quickbooksOnline']['config']>>( |
NAB! This is also not a good name but is a little clearer?
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 like it !
In this case I think we need to rename this to buildOnyxDataForQuickbooksConfiguration or something like this
Sure, I'll review asap |
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.
Looks great, thanks!
@@ -21,7 +22,11 @@ function getQuickbooksOnlineSetupLink(policyID: string) { | |||
return commandURL + new URLSearchParams(params).toString(); | |||
} | |||
|
|||
function updateQuickbooksOnlineEnableNewCategories(policyID: string, settingValue: boolean) { | |||
function buildOnyxDataForMultipleQuickbooksConfigurations<TConfigUpdate extends Partial<Connections['quickbooksOnline']['config']>>( |
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.
Nice, I see you were able to avoid a lot of code repetition by creating this helper method
Anything left to do 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.
LGTM! @aldo-expensify do you know what we can do about ignoring that compiler check? Just merge anyway and call it out in a comment?
d63a8c5
Since we have a lot of similar issues on the project And following this comment |
Yes, that is my understanding. I think an "Emergency" label will be added and we have to remove it and comment why. |
@dangrous looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Removing label - react-compiler check is known and is not a blocker - see #47628 (comment) |
✋ 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/dangrous in version: 9.0.29-0 🚀
|
@@ -127,12 +123,12 @@ function updateQuickbooksOnlineAutoCreateVendor(policyID: string, settingValue: | |||
connections: { | |||
[CONST.POLICY.CONNECTIONS.NAME.QBO]: { | |||
config: { | |||
[CONST.QUICK_BOOKS_CONFIG.AUTO_CREATE_VENDOR]: settingValue ?? null, | |||
[settingName]: settingValue ?? null, |
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.
@ZhenjaHorbach Can you tell me why we should not revert to old value on failure?
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.
Actually I used code which we already had for QBO
But this proposal make sense to me to use old value on failure
I can create a little PR to update it !
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.
But just realized
We are updating errorFields but we don't use these values anywhere in case of failure
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.
@dangrous @aldo-expensify
What do you think
Should we just use the previous values in case of failure?
Or should we also add error texts ?
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.
@aldo-expensify you're working on QBO errors right? I'd defer to you for this one. My naive opinion is show the error text and revert to the previous value (so, both?).
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.
Hi guys 😊 The new strategy for errors that we were introducing is that after an error appears the value is reverting to the previous one.
If you want to, take a look into my PR where I adjusted already changed functions to this pattern. I hope it will be merged soon 😉
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 okay great! @ZhenjaHorbach can you take a look at that and update your update PR accordingly? Thank you!
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.
Hello 👋 FYI my PR was merged 😃
🚀 Deployed to production by https://github.com/roryabraham in version: 9.0.29-12 🚀
|
Details
Update UpdatePolicyConnectionConfiguration to be 1:1:1 - Part 3
Fixed Issues
$ #47521
PROPOSAL: NA
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 methodSTYLE.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 and/or tagged@Expensify/design
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
2024-08-27.10.52.53.mov
Android: mWeb Chrome
2024-08-27.10.56.55.mov
iOS: Native
2024-08-27.10.43.22.mov
iOS: mWeb Safari
2024-08-27.10.49.30.mov
MacOS: Chrome / Safari
web-vendors.mov
web-taxes.mov
web-locations.mov
web-customers.mov
web-classes.mov
web-reimbursableExpensesAccount.mov
web-enableNewCategories.mov
web-autoCreateVendor.mov
MacOS: Desktop
desktop.mov