Fix Sage Intacct entity is not shown on Connections card#46487
Fix Sage Intacct entity is not shown on Connections card#46487tgolen merged 7 commits intoExpensify:mainfrom
Conversation
| case 'intacctImportTitle': | ||
| return 'Importing Sage Intacct data'; | ||
| default: { | ||
| // eslint-disable-next-line @typescript-eslint/restrict-template-expressions |
There was a problem hiding this comment.
Why do we need this line now? 🤔
There was a problem hiding this comment.
+1 @SzymczakJ do you have a reason for this one?
There was a problem hiding this comment.
Should we also update the syncStageName here?
| description: translate('workspace.intacct.entity'), | ||
| iconRight: Expensicons.ArrowRight, | ||
| title: getCurrentSageIntacctEntityName(policy), | ||
| title: getCurrentSageIntacctEntityName(policy) ?? translate('workspace.common.topLevel'), |
There was a problem hiding this comment.
We should modify getCurrentSageIntacctEntityName function to return top level as a default
|
@hungvu193 since you have context, can you take a look? 🙏 |
|
Sure 👍 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-08-01.at.14.18.52.movAndroid: mWeb ChromeScreen.Recording.2024-08-01.at.14.16.03.moviOS: NativeScreen.Recording.2024-08-01.at.14.07.54.moviOS: mWeb SafariScreen.Recording.2024-08-01.at.14.09.26.movMacOS: Chrome / SafariChrome.movMacOS: DesktopScreen.Recording.2024-08-01.at.13.36.57.mov |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #45935 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
All yours @tgolen |
| case 'intacctImportTitle': | ||
| return 'Importing Sage Intacct data'; | ||
| default: { | ||
| // eslint-disable-next-line @typescript-eslint/restrict-template-expressions |
There was a problem hiding this comment.
+1 @SzymczakJ do you have a reason for this one?
| return 'Marking NetSuite bills and invoices as paid'; | ||
| case 'intacctCheckConnection': | ||
| return 'Checking Sage Intacct connection'; | ||
| case 'intacctImportDimensions': |
There was a problem hiding this comment.
This looks like it's missing a corresponding change in es.ts
There was a problem hiding this comment.
I checked es.ts and this key already existed
There was a problem hiding this comment.
Yeah, I noticed it when connecting to Sage Intacct. It showed "Translation missing for stage: intacctImportDimensions", so decided to fix it before somebody else notices this bug.
There was a problem hiding this comment.
Nice. Thanks for fixing that!
src/libs/PolicyUtils.ts
Outdated
| } | ||
|
|
||
| function getCurrentSageIntacctEntityName(policy?: Policy): string | undefined { | ||
| function getCurrentSageIntacctEntityName(policy: Policy | undefined, translate: LocaleContextProps['translate']): string | undefined { |
There was a problem hiding this comment.
I think it's really strange to be passing the translate function as a parameter. I'd prefer returning early in the method when there is no currentEntityID and having the calling function deal with the return value (maybe it should return null).
There was a problem hiding this comment.
Or my second suggestion would be to add a param to getCurrentSageIntacctEntityName() which is called defaultNameIfNoEntity and it would be called like:
getCurrentSageIntacctEntityName(policy, translate('workspace.common.topLevel'))
Yes, I think I like this approach the best.
There was a problem hiding this comment.
I have same thoughts with you initially, however after checking source code I see we also used "translate" as a function param in other places, so I think I'm fine with this current changes.
There was a problem hiding this comment.
Or we can do somethings like this:
getCurrentSageIntacctEntityName(policy) ?? translate("topLevel")
There was a problem hiding this comment.
Or we can do somethings like this:
getCurrentSageIntacctEntityName(policy) ?? translate("topLevel")
I thought about that too but we would have to repeat it every time we use getCurrentSageIntacctEntityName function. It'd be better to handle this case inside the function
There was a problem hiding this comment.
To be clear, I don't think we should be doing that in the other places either. I think that translations are just a concern of the display and so they should only be handled in display components. Let's not keep spreading that concern out all over the app.
It's because of typescript and a rule that requires a switch to have a |
| return 'Marking NetSuite bills and invoices as paid'; | ||
| case 'intacctCheckConnection': | ||
| return 'Checking Sage Intacct connection'; | ||
| case 'intacctImportDimensions': |
There was a problem hiding this comment.
Nice. Thanks for fixing that!
|
✋ 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/tgolen in version: 9.0.17-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.0.17-2 🚀
|
1 similar comment
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.0.17-2 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.0.17-2 🚀
|

Details
Fixed Issues
$ #45935
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
andoirweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
iosweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov