Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Expensify/App into attachme…
Browse files Browse the repository at this point in the history
…nt-fix
  • Loading branch information
ShridharGoel committed Apr 10, 2024
2 parents d1fd4e4 + aed0bf0 commit 685f6d5
Show file tree
Hide file tree
Showing 53 changed files with 1,347 additions and 610 deletions.
1 change: 1 addition & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ <h1 class="title">
</div>

<!-- Concierge button at the bottom of the page -->
{% include CONST.html %}
<div class="get-help">
<h2 class="title with-margin">Didn't find what you were looking for?</h2>
<p class="description">Concierge is here to answer all your questions.</p>
Expand Down
18 changes: 18 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,24 @@ const CONST = {
EXPENSIFY_EMAIL_DOMAIN: '@expensify.com',
},

INTEGRATION_ENTITY_MAP_TYPES: {
DEFAULT: 'DEFAULT',
NONE: 'NONE',
TAG: 'TAG',
REPORT_FIELD: 'REPORT_FIELD',
NOT_IMPORTED: 'NOT_IMPORTED',
IMPORTED: 'IMPORTED',
},
QUICK_BOOKS_ONLINE: 'quickbooksOnline',

QUICK_BOOKS_IMPORTS: {
SYNC_CLASSES: 'syncClasses',
ENABLE_NEW_CATEGORIES: 'enableNewCategories',
SYNC_CUSTOMERS: 'syncCustomers',
SYNC_LOCATIONS: 'syncLocations',
SYNC_TAXES: 'syncTaxes',
},

ACCOUNT_ID: {
ACCOUNTING: Number(Config?.EXPENSIFY_ACCOUNT_ID_ACCOUNTING ?? 9645353),
ADMIN: Number(Config?.EXPENSIFY_ACCOUNT_ID_ADMIN ?? -1),
Expand Down
27 changes: 26 additions & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type {IsEqual, ValueOf} from 'type-fest';
import type CONST from './CONST';
import type {IOURequestType} from './libs/actions/IOU';

// This is a file containing constants for all the routes we want to be able to go to

Expand Down Expand Up @@ -396,7 +397,7 @@ const ROUTES = {
// straight to those flows without needing to have optimistic transaction and report IDs.
MONEY_REQUEST_START: {
route: 'start/:iouType/:iouRequestType',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, iouRequestType: ValueOf<typeof CONST.IOU.REQUEST_TYPE>) => `start/${iouType}/${iouRequestType}` as const,
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, iouRequestType: IOURequestType) => `start/${iouType}/${iouRequestType}` as const,
},
MONEY_REQUEST_CREATE_TAB_DISTANCE: {
route: ':action/:iouType/start/:transactionID/:reportID/distance',
Expand Down Expand Up @@ -697,6 +698,30 @@ const ROUTES = {
route: 'r/:reportID/transaction/:transactionID/receipt',
getRoute: (reportID: string, transactionID: string) => `r/${reportID}/transaction/${transactionID}/receipt` as const,
},
WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_IMPORT: {
route: 'settings/workspaces/:policyID/accounting/quickbooks-online/import',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-online/import` as const,
},
WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_CHART_OF_ACCOUNTS: {
route: 'settings/workspaces/:policyID/accounting/quickbooks-online/import/accounts',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-online/import/accounts` as const,
},
WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_CLASSES: {
route: 'settings/workspaces/:policyID/accounting/quickbooks-online/import/classes',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-online/import/classes` as const,
},
WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_CUSTOMERS: {
route: 'settings/workspaces/:policyID/accounting/quickbooks-online/import/customers',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-online/import/customers` as const,
},
WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_LOCATIONS: {
route: 'settings/workspaces/:policyID/accounting/quickbooks-online/import/locations',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-online/import/locations` as const,
},
WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_TAXES: {
route: 'settings/workspaces/:policyID/accounting/quickbooks-online/import/taxes',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-online/import/taxes` as const,
},
} as const;

/**
Expand Down
6 changes: 6 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ const SCREENS = {
DISTANCE_RATES: 'Distance_Rates',
CREATE_DISTANCE_RATE: 'Create_Distance_Rate',
DISTANCE_RATES_SETTINGS: 'Distance_Rates_Settings',
QUICKBOOKS_ONLINE_IMPORT: 'Workspace_Accounting_Quickbooks_Online_Import',
QUICKBOOKS_ONLINE_CHART_OF_ACCOUNTS: 'Workspace_Accounting_Quickbooks_Online_Import_Chart_Of_Accounts',
QUICKBOOKS_ONLINE_CLASSES: 'Workspace_Accounting_Quickbooks_Online_Import_Classes',
QUICKBOOKS_ONLINE_CUSTOMERS: 'Workspace_Accounting_Quickbooks_Online_Import_Customers',
QUICKBOOKS_ONLINE_LOCATIONS: 'Workspace_Accounting_Quickbooks_Online_Import_Locations',
QUICKBOOKS_ONLINE_TAXES: 'Workspace_Accounting_Quickbooks_Online_Import_Taxes',
DISTANCE_RATE_DETAILS: 'Distance_Rate_Details',
DISTANCE_RATE_EDIT: 'Distance_Rate_Edit',
},
Expand Down
1 change: 1 addition & 0 deletions src/components/AvatarWithDisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ function AvatarWithDisplayName({
<ParentNavigationSubtitle
parentNavigationSubtitleData={parentNavigationSubtitleData}
parentReportID={report?.parentReportID}
parentReportActionID={report?.parentReportActionID}
pressableStyles={[styles.alignSelfStart, styles.mw100]}
/>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/components/CategoryPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type CategoryPickerProps = CategoryPickerOnyxProps & {
/** It's used by withOnyx HOC */
// eslint-disable-next-line react/no-unused-prop-types
policyID: string;
selectedCategory: string;
selectedCategory?: string;
onSubmit: (item: ListItem) => void;
};

Expand All @@ -38,7 +38,7 @@ function CategoryPicker({selectedCategory, policyCategories, policyRecentlyUsedC
{
name: selectedCategory,
enabled: true,
accountID: null,
accountID: undefined,
isSelected: true,
},
];
Expand Down
31 changes: 17 additions & 14 deletions src/components/OnboardingWelcomeVideo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {VideoReadyForDisplayEvent} from 'expo-av';
import React, {useCallback, useEffect, useState} from 'react';
import {View} from 'react-native';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useOnboardingLayout from '@hooks/useOnboardingLayout';
Expand Down Expand Up @@ -134,22 +135,24 @@ function OnboardingWelcomeVideo() {
: {}),
}}
>
<View style={[styles.mh100, shouldUseNarrowLayout && styles.welcomeVideoNarrowLayout, safeAreaPaddingBottomStyle]}>
<View style={shouldUseNarrowLayout ? {padding: MODAL_PADDING} : {paddingHorizontal: MODAL_PADDING}}>{getWelcomeVideo()}</View>
<View style={[shouldUseNarrowLayout ? [styles.mt5, styles.mh8] : [styles.mt5, styles.mh5]]}>
<View style={[shouldUseNarrowLayout ? [styles.gap1, styles.mb8] : [styles.mb10]]}>
<Text style={[styles.textHeadlineH1, styles.textXXLarge]}>{translate('onboarding.welcomeVideo.title')}</Text>
<Text style={styles.textSupporting}>{translate('onboarding.welcomeVideo.description')}</Text>
<GestureHandlerRootView>
<View style={[styles.mh100, shouldUseNarrowLayout && styles.welcomeVideoNarrowLayout, safeAreaPaddingBottomStyle]}>
<View style={shouldUseNarrowLayout ? {padding: MODAL_PADDING} : {paddingHorizontal: MODAL_PADDING}}>{getWelcomeVideo()}</View>
<View style={[shouldUseNarrowLayout ? [styles.mt5, styles.mh8] : [styles.mt5, styles.mh5]]}>
<View style={[shouldUseNarrowLayout ? [styles.gap1, styles.mb8] : [styles.mb10]]}>
<Text style={[styles.textHeadlineH1, styles.textXXLarge]}>{translate('onboarding.welcomeVideo.title')}</Text>
<Text style={styles.textSupporting}>{translate('onboarding.welcomeVideo.description')}</Text>
</View>
<Button
large
success
pressOnEnter
onPress={closeModal}
text={translate('onboarding.welcomeVideo.button')}
/>
</View>
<Button
large
success
pressOnEnter
onPress={closeModal}
text={translate('onboarding.welcomeVideo.button')}
/>
</View>
</View>
</GestureHandlerRootView>
</Modal>
)}
</SafeAreaConsumer>
Expand Down
13 changes: 10 additions & 3 deletions src/components/ParentNavigationSubtitle.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
import CONST from '@src/CONST';
import type {ParentNavigationSummaryParams} from '@src/languages/types';
import ROUTES from '@src/ROUTES';
Expand All @@ -15,20 +17,25 @@ type ParentNavigationSubtitleProps = {
/** parent Report ID */
parentReportID?: string;

/** parent Report Action ID */
parentReportActionID?: string;

/** PressableWithoutFeedack additional styles */
pressableStyles?: StyleProp<ViewStyle>;
};

function ParentNavigationSubtitle({parentNavigationSubtitleData, parentReportID = '', pressableStyles}: ParentNavigationSubtitleProps) {
function ParentNavigationSubtitle({parentNavigationSubtitleData, parentReportActionID, parentReportID = '', pressableStyles}: ParentNavigationSubtitleProps) {
const styles = useThemeStyles();
const {workspaceName, reportName} = parentNavigationSubtitleData;

const {isOffline} = useNetwork();
const {translate} = useLocalize();

return (
<PressableWithoutFeedback
onPress={() => {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID));
const parentAction = ReportActionsUtils.getReportAction(parentReportID, parentReportActionID ?? '');
const isVisibleAction = ReportActionsUtils.shouldReportActionBeVisible(parentAction, parentAction?.reportActionID ?? '');
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, isVisibleAction && !isOffline ? parentReportActionID : undefined));
}}
accessibilityLabel={translate('threads.parentNavigationSummary', {reportName, workspaceName})}
role={CONST.ROLE.LINK}
Expand Down
4 changes: 2 additions & 2 deletions src/components/TagPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {PolicyTag, PolicyTagList, PolicyTags, RecentlyUsedTags} from '@src/
type SelectedTagOption = {
name: string;
enabled: boolean;
accountID: number | null;
accountID: number | undefined;
};

type TagPickerOnyxProps = {
Expand Down Expand Up @@ -68,7 +68,7 @@ function TagPicker({selectedTag, tagListName, policyTags, tagListIndex, policyRe
{
name: selectedTag,
enabled: true,
accountID: null,
accountID: undefined,
},
];
}, [selectedTag]);
Expand Down
24 changes: 24 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,7 @@ export default {
reimburse: 'Reimbursements',
categories: 'Categories',
tags: 'Tags',
reportFields: 'Report Fields',
taxes: 'Taxes',
bills: 'Bills',
invoices: 'Invoices',
Expand Down Expand Up @@ -1849,6 +1850,29 @@ export default {
welcomeNote: ({workspaceName}: WelcomeNoteParams) =>
`You have been invited to ${workspaceName || 'a workspace'}! Download the Expensify mobile app at use.expensify.com/download to start tracking your expenses.`,
},
qbo: {
import: 'Import',
importDescription: 'Choose which coding configurations are imported from QuickBooks Online to Expensify.',
classes: 'Classes',
accounts: 'Chart of accounts',
locations: 'Locations',
taxes: 'Taxes',
customers: 'Customers/Projects',
imported: 'Imported',
displayedAs: 'Displayed as',
notImported: 'Not imported',
importedAsTags: 'Imported, displayed as tags',
importedAsReportFields: 'Imported, displayed as report fields',
accountsDescription: 'Chart of Accounts import as categories when connected to an accounting integration, this cannot be disabled.',
accountsSwitchTitle: 'Enable newly imported Chart of Accounts.',
accountsSwitchDescription: 'New categories imported from QuickBooks Online to Expensify will be either enabled or disabled by default.',
classesDescription: 'Choose whether to import classes, and see where classes are displayed.',
customersDescription: 'Choose whether to import customers/projects and see where customers/projects are displayed.',
locationsDescription: 'Choose whether to import locations, and see where locations are displayed.',
taxesDescription: 'Choose whether to import tax rates and tax defaults from your accounting integration.',
locationsAdditionalDescription:
'Locations are imported as Tags. This limits exporting expense reports as Vendor Bills or Checks to QuickBooks Online. To unlock these export options, either disable Locations import or upgrade to the Control Plan to export Locations encoded as a Report Field.',
},
type: {
free: 'Free',
control: 'Control',
Expand Down
24 changes: 24 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,7 @@ export default {
reimburse: 'Reembolsos',
categories: 'Categorías',
tags: 'Etiquetas',
reportFields: 'Campos de informe',
taxes: 'Impuestos',
bills: 'Pagar facturas',
invoices: 'Enviar facturas',
Expand Down Expand Up @@ -1876,6 +1877,29 @@ export default {
welcomeNote: ({workspaceName}: WelcomeNoteParams) =>
`¡Has sido invitado a ${workspaceName}! Descargue la aplicación móvil Expensify en use.expensify.com/download para comenzar a rastrear sus gastos.`,
},
qbo: {
import: 'Importación',
importDescription: 'Elige que configuraciónes de codificación son importadas desde QuickBooks Online a Expensify.',
classes: 'Clases',
accounts: 'Plan de cuentas',
locations: 'Lugares',
taxes: 'Impuestos',
customers: 'Clientes/Proyectos',
imported: 'Importado',
displayedAs: 'Mostrado como',
notImported: 'No importado',
importedAsTags: 'Importado, mostrado como etiqueta',
importedAsReportFields: 'Importado, mostrado como campo de informe',
accountsDescription: 'Los planes de cuentas se importan como categorías cuando está conectado con una integración de contaduría, esto no se puede desactivar.',
accountsSwitchTitle: 'Habilita el plan de cuentas recien importado',
accountsSwitchDescription: 'Las nuevas categorías importadas desde QuickBooks Online a Expensify serán activadas o desactivadas por defecto.',
classesDescription: 'Elige si quieres importar las clases y donde las clases son mostradas.',
customersDescription: 'Elige si queres importar clientes/proyectos y donde los clientes/proyectos son mostrados.',
locationsDescription: 'Elige si quieres importar lugares y donde los lugares son mostrados.',
taxesDescription: 'Elige si quires importar las tasas de impuestos y los impuestos por defecto de tu integración de contaduría.',
locationsAdditionalDescription:
'Los lugares son importados como Etiquegas. Esto limita a exportar los informes de gastos como Factura del Proveedor o Cheques a Quicbooks Online. Para desbloquear estas opciones de exportación desactiva la importación de Lugares o cambia al Plan Control para exportar Lugares como Campos de Informes.',
},
type: {
free: 'Gratis',
control: 'Control',
Expand Down
2 changes: 1 addition & 1 deletion src/libs/API/parameters/RequestMoneyParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type RequestMoneyParams = {
createdChatReportActionID: string;
createdIOUReportActionID: string;
reportPreviewReportActionID: string;
receipt: Receipt;
receipt?: Receipt;
receiptState?: ValueOf<typeof CONST.IOU.RECEIPT_STATE>;
category?: string;
tag?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/API/parameters/TrackExpenseParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type TrackExpenseParams = {
createdChatReportActionID: string;
createdIOUReportActionID?: string;
reportPreviewReportActionID?: string;
receipt: Receipt;
receipt?: Receipt;
receiptState?: ValueOf<typeof CONST.IOU.RECEIPT_STATE>;
category?: string;
tag?: string;
Expand Down
12 changes: 12 additions & 0 deletions src/libs/API/parameters/UpdatePolicyConnectionConfigParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type {ValueOf} from 'type-fest';
import type CONST from '@src/CONST';

type UpdatePolicyConnectionConfigParams = {
policyID: string;
connectionName: string;
settingName: ValueOf<typeof CONST.QUICK_BOOKS_IMPORTS>;
settingValue: ValueOf<typeof CONST.INTEGRATION_ENTITY_MAP_TYPES>;
idempotencyKey: string;
};

export default UpdatePolicyConnectionConfigParams;
1 change: 1 addition & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,5 @@ export type {default as DeletePolicyTagsParams} from './DeletePolicyTagsParams';
export type {default as SetPolicyCustomTaxNameParams} from './SetPolicyCustomTaxNameParams';
export type {default as SetPolicyForeignCurrencyDefaultParams} from './SetPolicyForeignCurrencyDefaultParams';
export type {default as SetPolicyCurrencyDefaultParams} from './SetPolicyCurrencyDefaultParams';
export type {default as UpdatePolicyConnectionConfigParams} from './UpdatePolicyConnectionConfigParams';
export type {default as RenamePolicyTaxParams} from './RenamePolicyTaxParams';
2 changes: 2 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const WRITE_COMMANDS = {
ACCEPT_JOIN_REQUEST: 'AcceptJoinRequest',
DECLINE_JOIN_REQUEST: 'DeclineJoinRequest',
CREATE_POLICY_TAX: 'CreatePolicyTax',
UPDATE_POLICY_CONNECTION_CONFIG: 'UpdatePolicyConnectionConfig',
SET_POLICY_TAXES_ENABLED: 'SetPolicyTaxesEnabled',
DELETE_POLICY_TAXES: 'DeletePolicyTaxes',
UPDATE_POLICY_TAX_VALUE: 'UpdatePolicyTaxValue',
Expand Down Expand Up @@ -389,6 +390,7 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.RENAME_POLICY_TAX]: Parameters.RenamePolicyTaxParams;
[WRITE_COMMANDS.SET_POLICY_DISTANCE_RATES_UNIT]: Parameters.SetPolicyDistanceRatesUnitParams;
[WRITE_COMMANDS.SET_POLICY_DISTANCE_RATES_DEFAULT_CATEGORY]: Parameters.SetPolicyDistanceRatesDefaultCategoryParams;
[WRITE_COMMANDS.UPDATE_POLICY_CONNECTION_CONFIG]: Parameters.UpdatePolicyConnectionConfigParams;
[WRITE_COMMANDS.UPDATE_POLICY_DISTANCE_RATE_VALUE]: Parameters.UpdatePolicyDistanceRateValueParams;
[WRITE_COMMANDS.SET_POLICY_DISTANCE_RATES_ENABLED]: Parameters.SetPolicyDistanceRatesEnabledParams;
[WRITE_COMMANDS.DELETE_POLICY_DISTANCE_RATES]: Parameters.DeletePolicyDistanceRatesParams;
Expand Down
Loading

0 comments on commit 685f6d5

Please sign in to comment.