Fix account type name constants#41155
Conversation
This reverts commit d6739e0.
This comment was marked as resolved.
This comment was marked as resolved.
|
This could cause a crash for old QA testers since they may have |
xxxRexxxxviewer Checklist (Aldo: changed title to make the checklist check ignore this comment)
Screenshots/VideosAndroid: NativeStill experiencing build errors - Not a blocker Android: mWeb Chromemweb-chrome.moviOS: Nativeios.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
s77rt
left a comment
There was a problem hiding this comment.
Tests well. We just need to use the translation maps in the remaining places where ts is complaining about
| const AccountTypeTranslationKeyMapping = { | ||
| [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.VENDOR_BILL]: 'vendorBill', | ||
| [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.CREDIT_CARD]: 'creditCard', | ||
| [CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE.DEBIT_CARD]: 'debitCard', | ||
| } as const; |
There was a problem hiding this comment.
Is this to avoid adding keys with underscore in en/es.ts? so we use debitCard instead of debit_card?
If that is the reason, are we sure we prefer this extra layer? it looks like it is messing up the types too. Shouldn't we just add debit_card in en/es.ts instead?
There was a problem hiding this comment.
I think ES Lint is going to complain about it. The type issue you were seeing is from another page for which I forgot to create the mapping. I just pushed a commit to fix it.
But let me know if you still prefer introducing a key with underscores in the es/en files 😄
There was a problem hiding this comment.
Maybe if you use constants like this:
Lines 2907 to 2911 in 0ab5b8b
eslint won't complain? I think it is better to now have this extra layer that we have to keep up to date. Something like this:
|
@s77rt, this is ready for another review 😄 |
|
We're duplicating |
|
okay I'll change the translation keys to those using undersores |
…o export expenses on company card
…suppress ts errors
This comment has been minimized.
This comment has been minimized.
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
|
I tested locally. Just in case needed, I'm also building ad hoc with the latest code |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
| exportEntity?: ValueOf<typeof CONST.QUICKBOOKS_OUT_OF_POCKET_EXPENSE_ACCOUNT_TYPE>; | ||
| exportCompanyCard: ValueOf<typeof CONST.QUICKBOOKS_EXPORT_COMPANY_CARD_ACCOUNT_TYPE>; |
There was a problem hiding this comment.
NAB: I don't think these keys exportEntity or exportCompanyCard really exist, shouldn't they be reimbursableExpensesExportDestination and nonReimbursableExpensesExportDestination?
This is causing the inputs to start empty because we read the data from non-existing properties
I put this as NAB because this was already wrong and we can fix it in another PR if you prefer.
There was a problem hiding this comment.
Ugh, these bad setting names made it to the backend in Auth already because I didn't check if they were correct: https://github.com/Expensify/Auth/blob/3bebe7873f058bdc4f1df5c926f4a3d64f94171a/auth/lib/Policy.h#L111-L140
There was a problem hiding this comment.
There was a problem hiding this comment.
ahhh, so that explains why they are empty
| @@ -21,7 +21,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections | |||
| const styles = useThemeStyles(); | |||
| const policyID = policy?.id ?? ''; | |||
| const {exportCompanyCardAccount, exportAccountPayable, autoCreateVendor, errorFields, pendingFields, exportCompanyCard} = policy?.connections?.quickbooksOnline?.config ?? {}; | |||
There was a problem hiding this comment.
NAB: I don't think exportCompanyCardAccount, exportAccountPayable or exportCompanyCard really exists in the backend
There was a problem hiding this comment.
these were also added by Nikolay in another PR 😨
aldo-expensify
left a comment
There was a problem hiding this comment.
I'll approve and merge this because it fixes some bad values for constants we have. There is still more work to do, but we can do it in a separate pr.
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ 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 production by https://github.com/marcaaron in version: 1.4.70-5 🚀
|



Details
This PR:
accountsFixed Issues
$ #41154
PROPOSAL: N/A
Tests / QA Steps
Make sure that you haven't enabled tax tracking on the workspace you're testing with
You might experience the error like the one captured below. These errors are being addressed in other PRs

Offline tests
N/A
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2024-05-01.at.11.05.24.AM.mov
MacOS: Desktop