-
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
Prevent invalid configuration between location and JE selection #41638
Changes from all commits
faa4eb7
43d57ac
102c2bf
056c362
e74a7ae
d3be0c3
add3daf
c771c51
21aef13
01d10e5
286980f
a9f76f4
b9cf433
3c1b841
bcecada
30cfcac
dd891b7
4774590
9b08271
6ba9dc4
14943e7
ac3e90b
023c313
cdb176a
0688088
f5e4c04
a0845eb
805b67e
a313d7a
427ca57
5925a85
948b665
911d494
a421cdd
15452e6
7cd358e
f769502
5d5d2cd
5ffc623
52a8ac0
362167d
c97ffd3
da6232d
715f3da
f8a9176
a3729d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,12 @@ function QuickbooksLocationsPage({policy}: WithPolicyProps) { | |
const {translate} = useLocalize(); | ||
const styles = useThemeStyles(); | ||
const policyID = policy?.id ?? ''; | ||
const {syncLocations, pendingFields} = policy?.connections?.quickbooksOnline?.config ?? {}; | ||
const {syncLocations, pendingFields, reimbursableExpensesExportDestination, nonReimbursableExpensesExportDestination} = policy?.connections?.quickbooksOnline?.config ?? {}; | ||
const isSwitchOn = Boolean(syncLocations && syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); | ||
const canImportLocation = | ||
reimbursableExpensesExportDestination === CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY && | ||
nonReimbursableExpensesExportDestination !== CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.VENDOR_BILL; | ||
Comment on lines
+25
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NAB. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I agree that's NAB. We can improve it later to something like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. ^^ that's the old copy.
aldo-expensify marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const shouldBeDisabled = !canImportLocation && !isSwitchOn; | ||
const isReportFieldsSelected = syncLocations === CONST.INTEGRATION_ENTITY_MAP_TYPES.REPORT_FIELD; | ||
|
||
return ( | ||
|
@@ -55,6 +59,7 @@ function QuickbooksLocationsPage({policy}: WithPolicyProps) { | |
isSwitchOn ? CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE : CONST.INTEGRATION_ENTITY_MAP_TYPES.TAG, | ||
) | ||
} | ||
disabled={shouldBeDisabled} | ||
/> | ||
</View> | ||
</OfflineWithFeedback> | ||
|
@@ -69,9 +74,11 @@ function QuickbooksLocationsPage({policy}: WithPolicyProps) { | |
/> | ||
</OfflineWithFeedback> | ||
)} | ||
<View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.gap2, styles.mt1]}> | ||
<Text style={styles.mutedTextLabel}>{translate('workspace.qbo.locationsAdditionalDescription')}</Text> | ||
</View> | ||
{shouldBeDisabled && ( | ||
hayata-suenaga marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.gap2, styles.mt1]}> | ||
<Text style={styles.mutedTextLabel}>{translate('workspace.qbo.locationsAdditionalDescription')}</Text> | ||
</View> | ||
)} | ||
</ScrollView> | ||
</ScreenWrapper> | ||
</AccessOrNotFoundWrapper> | ||
|
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.
NAB. We could have just used
useMemo
for the footer