fix: enable report fields when impoing xero tracking categories - #65332
Conversation
|
@ahmedGaber93 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppa.mp4Android: mWeb Chromeaw.mp4iOS: HybridAppi.mp4iOS: mWeb Safariiw.mp4MacOS: Chrome / Safariw.mp4w2.mp4MacOS: Desktopd.mp4 |
|
@daledah could you please check this?
I think on both cases: toggle should be ON and imported option should be displayed. 20250708122634947.mp4 |
|
@daledah any updates? |
|
@ahmedGaber93 I'm taking a look right now, will update soon 👀. |
|
@ahmedGaber93 The issue you mentioned is pretty complicated if we continue with current solution, as such I suggest we swap to my alternative solution 1 with some modifications and also include a BE fix. This way we can reduce an unnecessary API call while make the app more responsive (also fixes the tag not enabled as well) |
@daledah, can you explain it? |
|
With current solution, we only check for current option, if it's report field, then we enable report field and vice versa. I didn't account for other fields available as I'm not aware of this case is even possible. For it to work well we'll need to check for all tracking category fields if there's any report fields, then perform toggling, which IMO is excessive and a bit overkill for a single API call. For my alternative solution, we can remove |
I think the issue is the video is different from the issue you talk about. And related to the issue you talk about, I don't get how the new ONYX data will help, we already have |
|
@daledah Bump ^ |
|
I'll update soon 👀 |
|
@ahmedGaber93 I updated. |
| getRoute: (policyID: string) => `workspaces/${policyID}/accounting/xero/import/tracking-categories` as const, | ||
| getRoute: (policyID?: string) => { | ||
| if (!policyID) { | ||
| Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_XERO_TRACKING_CATEGORIES route'); | ||
| } | ||
| return `settings/workspaces/${policyID}/accounting/xero/import/tracking-categories` as const; | ||
| }, |
There was a problem hiding this comment.
@daledah Could you please explain why this change? It looks to me, it was added by mistake.
There was a problem hiding this comment.
This change is to handle undefined policyID, the implementation is pretty common in ROUTE.
There was a problem hiding this comment.
Why do you add settings/ prefix to the route?
Line 2125 in 73e2b18
There was a problem hiding this comment.
@daledah we only need this point to get this done, let me know WDYT when you have a chance? thanks!
There was a problem hiding this comment.
I see it now, we recently refactored navigation logics so I missed this. I updated.
|
@daledah are you face the same issue here #65332 (comment)? |
|
@ahmedGaber93 The latest update fixed the issue you mentioned. |
| const reportFieldTrackingCategories = Object.entries(mappings ?? {}).filter( | ||
| ([key, value]) => key.startsWith(CONST.XERO_CONFIG.TRACKING_CATEGORY_PREFIX) && value === CONST.XERO_CONFIG.TRACKING_CATEGORY_OPTIONS.REPORT_FIELD, |
There was a problem hiding this comment.
| const reportFieldTrackingCategories = Object.entries(mappings ?? {}).filter( | |
| ([key, value]) => key.startsWith(CONST.XERO_CONFIG.TRACKING_CATEGORY_PREFIX) && value === CONST.XERO_CONFIG.TRACKING_CATEGORY_OPTIONS.REPORT_FIELD, | |
| const reportFieldTrackingCategories = Object.entries(mappings ?? {}).filter( | |
| ([key, value]) => key.startsWith(CONST.XERO_CONFIG.TRACKING_CATEGORY_PREFIX) && value === CONST.XERO_CONFIG.TRACKING_CATEGORY_OPTIONS.REPORT_FIELD |
There was a problem hiding this comment.
This comma looks added by mistake
There was a problem hiding this comment.
@ahmedGaber93 I removed the comma, run prettier and it's added again, so maybe it's conventional? Not sure about this.
There was a problem hiding this comment.
Interesting, It also looks like that in many places.
CC @srikarparsi if you're familiar with this.
There was a problem hiding this comment.
yeah it looks like it's for style, going to merge this
|
✋ 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/srikarparsi in version: 9.1.83-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.1.83-5 🚀
|
Explanation of Change
Fixed Issues
$ #64288
PROPOSAL: #64288 (comment)
Tests
Precondition: WS connected to Xero with Tracking Categories
Offline tests
QA Steps
Precondition: WS connected to Xero with Tracking Categories
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)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
Screen.Recording.2025-07-03.at.00.11.15.mov
Android: mWeb Chrome
Screen.Recording.2025-07-03.at.00.11.42.mov
iOS: Native
Screen.Recording.2025-07-03.at.00.12.30.mov
iOS: mWeb Safari
Screen.Recording.2025-07-03.at.00.13.10.mov
MacOS: Chrome / Safari
Screen.Recording.2025-07-03.at.00.15.03.mov
MacOS: Desktop
Screen.Recording.2025-07-03.at.00.15.40.mov