-
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
Fix Sage Intacct entity is not shown on Connections card #46487
Fix Sage Intacct entity is not shown on Connections card #46487
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this line now? 🤔
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.
+1 @SzymczakJ do you have a reason for this one?
src/languages/es.ts
Outdated
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.
Should we also update the syncStageName
here?
@@ -276,7 +276,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { | |||
: { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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 🚀
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 @SzymczakJ do you have a reason for this one?
@@ -3204,9 +3205,12 @@ export default { | |||
return 'Marking NetSuite bills and invoices as paid'; | |||
case 'intacctCheckConnection': | |||
return 'Checking Sage Intacct connection'; | |||
case 'intacctImportDimensions': |
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.
This looks like it's missing a corresponding change in es.ts
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.
I checked es.ts and this key already existed
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Thanks for fixing that!
src/libs/PolicyUtils.ts
Outdated
@@ -756,8 +756,11 @@ function getIntegrationLastSuccessfulDate(connection?: Connections[keyof Connect | |||
return (connection as ConnectionWithLastSyncData)?.lastSync?.successfulDate; | |||
} | |||
|
|||
function getCurrentSageIntacctEntityName(policy?: Policy): string | undefined { | |||
function getCurrentSageIntacctEntityName(policy: Policy | undefined, translate: LocaleContextProps['translate']): string | undefined { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we can do somethings like this:
getCurrentSageIntacctEntityName(policy) ?? translate("topLevel")
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -3204,9 +3205,12 @@ export default { | |||
return 'Marking NetSuite bills and invoices as paid'; | |||
case 'intacctCheckConnection': | |||
return 'Checking Sage Intacct connection'; | |||
case 'intacctImportDimensions': |
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.
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 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
andoirweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
iosweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov