Skip to content
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

Add translations for QBO Sync job #41060

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1681,6 +1681,12 @@ const CONST = {
QBO_SYNC_PAYMENTS: 'quickbooksOnlineSyncBillPayments',
QBO_IMPORT_TAX_CODES: 'quickbooksOnlineSyncTaxCodes',
QBO_CHECK_CONNECTION: 'quickbooksOnlineCheckConnection',
QBO_SYNC_TITLE: 'quickbooksOnlineSyncTitle',
QBO_SYNC_LOAD_DATA: 'quickbooksOnlineSyncLoadData',
QBO_SYNC_APPLY_CATEGORIES: 'quickbooksOnlineSyncApplyCategories',
QBO_SYNC_APPLY_CUSTOMERS: 'quickbooksOnlineSyncApplyCustomers',
QBO_SYNC_APPLY_PEOPLE: 'quickbooksOnlineSyncApplyEmployees',
QBO_SYNC_APPLY_CLASSES_LOCATIONS: 'quickbooksOnlineSyncApplyClassesLocations',
JOB_DONE: 'jobDone',
},
},
Expand Down
12 changes: 12 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2196,6 +2196,18 @@ export default {
return 'Importing your QuickBooks Online data';
case 'startingImport':
return 'Importing your QuickBooks Online data';
case 'quickbooksOnlineSyncTitle':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're planning to use the constant defined in CONST.ts here?

Copy link
Contributor Author

@aldo-expensify aldo-expensify Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't planing to refactor, for some reason we haven't been using CONST 🤷 , so I'm just keeping it consistent

return 'Synchronizing QuickBooks Online data';
case 'quickbooksOnlineSyncLoadData':
return 'Loading data';
case 'quickbooksOnlineSyncApplyCategories':
return 'Updating categories';
case 'quickbooksOnlineSyncApplyCustomers':
return 'Updating Customers/Projects';
case 'quickbooksOnlineSyncApplyEmployees':
return 'Updating people list';
case 'quickbooksOnlineSyncApplyClassesLocations':
return 'Updating report fields';
default: {
return `Translation missing for stage: ${stage}`;
}
Expand Down
12 changes: 12 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2191,6 +2191,18 @@ export default {
return 'Importando datos desde QuickBooks Online';
case 'startingImport':
return 'Importando datos desde QuickBooks Online';
case 'quickbooksOnlineSyncTitle':
return 'Sincronizando datos desde QuickBooks Online';
case 'quickbooksOnlineSyncLoadData':
return 'Cargando datos';
case 'quickbooksOnlineSyncApplyCategories':
return 'Actualizando categorías';
case 'quickbooksOnlineSyncApplyCustomers':
return 'Actualizando Clientes/Proyectos';
case 'quickbooksOnlineSyncApplyEmployees':
return 'Actualizando empleados';
case 'quickbooksOnlineSyncApplyClassesLocations':
return 'Actualizando clases';
default: {
return `Translation missing for stage: ${stage}`;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/WorkspaceMoreFeaturesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro
titleTranslationKey: 'workspace.moreFeatures.taxes.title',
subtitleTranslationKey: 'workspace.moreFeatures.taxes.subtitle',
isActive: (policy?.tax?.trackingEnabled ?? false) || isSyncTaxEnabled,
disabled: isSyncTaxEnabled || policy?.connections?.quickbooksOnline.data.country === CONST.COUNTRY.US,
disabled: isSyncTaxEnabled || policy?.connections?.quickbooksOnline?.data?.country === CONST.COUNTRY.US,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was crashing because data was undefined.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yep because we're not yet fetching the connections data when the More Features page is opened 👍

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the same crash seen here: #41129

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, OpenPolicyMoreFeaturesPage is already returning the connections data:

image https://github.com/Expensify/Auth/blob/e25307a1e009e36672f08f88d5b911694261dc62/auth/lib/Policy.cpp#L3544-L3546

pendingAction: policy?.pendingFields?.tax,
action: (isEnabled: boolean) => {
Policy.enablePolicyTaxes(policy?.id ?? '', isEnabled);
Expand Down
Loading