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. |
| 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.
| 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.
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.
| const isSwitchOn = Boolean(importTrackingCategories); | |
| const isSwitchOn = !!importTrackingCategories; |
| 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.
same suggestion as above
| wrapperStyle={styles.sectionMenuItemTopDescription} | ||
| /> | ||
| } | ||
| isActive={!!isSwitchOn} |
| 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.
is it correct? We check here for any connection(may be xero) and display qbo text
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. |
| <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.
|
@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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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