-
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
Display error messages for Xero Import page #41917
Display error messages for Xero Import page #41917
Conversation
@Expensify/design could you please review these error messages if they look good to you? |
Before we merge this, should we wait until @narefyev91's PR here is merged? That will give us the updated error style that we want. |
@trjExpensify this PR will add error messages to the main @SzymczakJ asked me if we should add error messages to the sub page of the Could we have your opinion on this? |
I think there's typically only one place the error message is and that's at the end of the brick road. So if that's on the Tracking Categories page because of a problem with the import toggle, it should only be there. The "red dots" of the red brick road lead to it. |
@trjExpensify so you suggest that we shouldn't show error messages on Xero Import Page and instead of that show error messages on Import Page subpages(and show only red dot on Import page). |
Yes exactly, because the end of the red brick road is one page deeper and the end of the road is where the error message appears. 👍 |
a86b6fb
to
2684a5d
Compare
I've addressed your review comments @Expensify/design, could you please review this? 🙏 |
Cool, I think that feels pretty good to me. |
import CONST from '@src/CONST'; | ||
|
||
function XeroTaxesConfigurationPage({policy}: WithPolicyProps) { | ||
const {translate} = useLocalize(); | ||
const styles = useThemeStyles(); | ||
const policyID = policy?.id ?? ''; | ||
const {importTaxRates, pendingFields} = policy?.connections?.xero?.config ?? {}; | ||
const xeroConfig = policy?.connections?.xero?.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.
const xeroConfig = policy?.connections?.xero?.config; | |
const xeroConfig = policy?.connections?.xero?.config ?? {}; |
And you don't have to add empty object in each place later
src/pages/workspace/accounting/xero/XeroTaxesConfigurationPage.tsx
Outdated
Show resolved
Hide resolved
<ToggleSettingOptionRow | ||
title={translate('workspace.accounting.import')} | ||
switchAccessibilityLabel={translate('workspace.xero.trackingCategories')} | ||
isActive={!!isSwitchOn} |
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 is no need to use !!
as it is Booelan already
const xeroConfig = policy?.connections?.xero?.config; | ||
const {importTrackingCategories} = policy?.connections?.xero?.config ?? {}; | ||
|
||
const isSwitchOn = Boolean(importTrackingCategories); |
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.
const isSwitchOn = Boolean(importTrackingCategories); | |
const isSwitchOn = !!importTrackingCategories; |
@@ -22,7 +21,10 @@ function XeroTrackingCategoryConfigurationPage({policy}: WithPolicyProps) { | |||
const {translate} = useLocalize(); | |||
const styles = useThemeStyles(); | |||
const policyID = policy?.id ?? ''; | |||
const {importTrackingCategories, pendingFields} = policy?.connections?.xero?.config ?? {}; | |||
const xeroConfig = policy?.connections?.xero?.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.
same suggestion as above
wrapperStyle={styles.sectionMenuItemTopDescription} | ||
/> | ||
} | ||
isActive={!!isSwitchOn} |
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 as above
@@ -23,6 +23,7 @@ function WorkspaceCategoriesSettingsPage({policy, route}: WorkspaceCategoriesSet | |||
const isConnectedToAccounting = Object.keys(policy?.connections ?? {}).length > 0; | |||
const policyID = route.params.policyID ?? ''; | |||
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`); | |||
const toggleSubtitle = isConnectedToAccounting ? `${translate('workspace.categories.needCategoryForExportToIntegration')} ${translate('workspace.accounting.qbo')}` : ''; |
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.
is it correct? We check here for any connection(may be xero) and display qbo text
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
Reviewer Checklist
Screenshots/Videos |
✋ 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/lakchote in version: 1.4.74-0 🚀
|
FYI, a bug was raised where the RBR error isn't always displayed. As this is a new feature I'm not marking it as a blocker though. |
@@ -44,7 +53,9 @@ function WorkspaceCategoriesSettingsPage({policy, route}: WorkspaceCategoriesSet | |||
<View style={styles.flexGrow1}> | |||
<ToggleSettingOptionRow | |||
title={translate('workspace.categories.requiresCategory')} | |||
subtitle={isConnectedToAccounting ? `${translate('workspace.categories.needCategoryForExportToIntegration')} ${translate('workspace.accounting.qbo')}` : ''} | |||
titleStyle={styles.textStrong} |
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.
@SzymczakJ, thank you for the PR 🙇 I have a question about a change you made in this PR: I realized that you introduced a new prop to This seems to have caused several texts becoming bold when they're not supposed to. I was wondering if there was a reason that you made this design change? 😄 |
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.4.74-6 🚀
|
@hayata-suenaga sorry for missing your message and causing design regressions 😅. I didn't mean to change anything in designs, I just wanted to refactor the |
that's fair I think the timing of removing the bold style and this PR probably coincided 😅 Anyway, thank you for your work @SzymczakJ! |
Details
This PR adds error messages for Xero Import page.
Fixed Issues
$ #41843
PROPOSAL: N/A
Tests
Offline 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 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.mov
Android: mWeb Chrome
androidweb.mov
iOS: Native
https://github.com/Expensify/App/assets/88395093/8d1066f0-b09d-46c6-99ea-98d698018efaiOS: mWeb Safari
iosweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov