-
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
Remove outdated conditions #42883
Remove outdated conditions #42883
Conversation
Screen.Recording.2024-05-31.at.1.00.56.AM.mov |
const {syncLocations, reimbursableExpensesAccount, reimbursableExpensesExportDestination, errorFields, syncTax, pendingFields} = policy?.connections?.quickbooksOnline?.config ?? {}; | ||
const isLocationEnabled = Boolean(syncLocations && syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); | ||
const isTaxesEnabled = Boolean(syncTax); | ||
const shouldShowTaxError = isTaxesEnabled && reimbursableExpensesExportDestination === CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY; |
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 will never be true.
- If taxes are enabled you can't select journal entity
- if journal entity is selected you can't enable taxes
const isLocationEnabled = Boolean(syncLocations && syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); | ||
const isTaxesEnabled = Boolean(syncTax); | ||
const shouldShowTaxError = isTaxesEnabled && reimbursableExpensesExportDestination === CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY; | ||
const shouldShowLocationError = isLocationEnabled && reimbursableExpensesExportDestination !== CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY; |
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.
Same reasoning ^
@@ -47,24 +43,22 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne | |||
brickRoadIndicator={hasErrors ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined} | |||
shouldShowRightIcon | |||
hintText={ | |||
reimbursableExpensesExportDestination === CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.VENDOR_BILL && !isLocationEnabled |
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.
Same ^
{!isLocationEnabled && ( | ||
<OfflineWithFeedback pendingAction={pendingFields?.reimbursableExpensesAccount}> | ||
<MenuItemWithTopDescription |
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 render condition was used so we don't show the account row if the selected entity value is invalid/unsupported (e.g. vendor bill with location enabled).
This is all outdated as the user won't fall into a case where the selected value is invalid.
Nice, thanks for helping out! I'll checkout the build as well when it finishing running. |
@hayata-suenaga You probably want to take a look to make sure all is good! |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
Looks good to me. The 2024-05-31_02-04-37.mp4(I'm still ignoring the labels for |
Thank you for the PR @s77rt 🙇 The part where you removed However, I don't think we should remove
and
These errors can happen (these misconfigurations are not prevented on the API level (just front end safeguard that only exists on New Expensify) There is an internal issue that implements these safeguards on the backend side, but that is a polish, low-priority issue. Meantime, we have to make sure that if these misconfiguration exits on the front end and display errors accordingly I'll go ahead and merge this PR into my PR and fix this there 😄 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
15452e6
into
Expensify:hayata-do-not-allow-invalid-location-account-combo
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.79-11 🚀
|
Details
Removed logic that no longer make sense
Fixed Issues
$ #41638 (comment)
PROPOSAL:
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop