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

Feat: implement accounting page #38283

Closed
wants to merge 91 commits into from
Closed
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
7d89088
add initial english strings
teneeto Mar 14, 2024
3492e28
add initial spanish strings
teneeto Mar 14, 2024
6edddee
add accounting navigation param type
teneeto Mar 14, 2024
917451c
add accounting to workspace screens
teneeto Mar 14, 2024
7f529e5
add workspace acoounting route
teneeto Mar 14, 2024
e4ba2b0
add workspace accounting to workspace setting navigator
teneeto Mar 14, 2024
4bfc371
add workspace accounting to link to screens
teneeto Mar 14, 2024
e05a0b0
add workspace accounting Page
teneeto Mar 14, 2024
24c6143
add workspace accounting Page LHN navigation button
teneeto Mar 14, 2024
6490bdc
fix lint
teneeto Mar 14, 2024
03a3c76
add qbo round icon
teneeto Mar 14, 2024
8b24bb5
export qbo round icon
teneeto Mar 14, 2024
683af46
use qbo round icon
teneeto Mar 14, 2024
1b377df
connection list item should not be interactive
teneeto Mar 14, 2024
3576204
add default Avatar size for menu item icons
teneeto Mar 14, 2024
4bb0dab
add xero round icon
teneeto Mar 14, 2024
cdb0a00
export xero round icon
teneeto Mar 14, 2024
89759ea
add xero english strings
teneeto Mar 14, 2024
1e3be49
add xero spanish strings
teneeto Mar 14, 2024
0b0be1b
use xero round icon
teneeto Mar 14, 2024
a070d1d
fix lint
teneeto Mar 14, 2024
919fb8d
add more english and spanish strings
teneeto Mar 14, 2024
ff4c890
add menu options to setup QBO
teneeto Mar 14, 2024
dd57fd6
add more english and spanish strings
teneeto Mar 14, 2024
3937f69
break up qboConnectionMenuItems
teneeto Mar 14, 2024
e9cc581
add threeDotsMenu
teneeto Mar 14, 2024
6f368ac
cleanup and add more menu options
teneeto Mar 14, 2024
6b51aa0
add more english and spanish strings
teneeto Mar 14, 2024
bdd33e3
add disconnect integration confirm modal
teneeto Mar 14, 2024
1ef2bb1
add more english and spanish strings
teneeto Mar 14, 2024
21e9323
add activity indiccator while importing
teneeto Mar 14, 2024
f6d656a
update accounting navigation
teneeto Mar 14, 2024
b908d1d
update integration icons structure
teneeto Mar 14, 2024
98530c3
add more english and spanish strings
teneeto Mar 15, 2024
9d29a4e
add iconRight props to PopoverMenu
teneeto Mar 15, 2024
b139d28
add three-line bar to Header
teneeto Mar 15, 2024
17faa54
merge conflict
teneeto Mar 15, 2024
f213517
add temp. fake qbo connection sync
teneeto Mar 15, 2024
85b168d
revert accounting navigation
teneeto Mar 15, 2024
aeb72c6
fix lint
teneeto Mar 15, 2024
c275788
fix dep warning
teneeto Mar 15, 2024
9fe235d
Merge branch 'main' into feat/37706/implement-accounting-page
narefyev91 Mar 20, 2024
961221e
resolve comments
narefyev91 Mar 20, 2024
c0ab3eb
fix lint
narefyev91 Mar 20, 2024
916e7a2
Merge branch 'main' of github.com:teneeto/Expensify into feat/37706/i…
teneeto Mar 21, 2024
9ae94cb
Merge branch 'feat/37706/implement-accounting-page' of github.com:ten…
teneeto Mar 21, 2024
ee6f957
fix review comments
teneeto Mar 21, 2024
a2167a6
resolve more comments
teneeto Mar 21, 2024
a6385a0
add key to other integrations
teneeto Mar 22, 2024
b6ecfe6
remove shouldOverlay prop
teneeto Mar 22, 2024
2ee9b3a
fix menuItem blank title on mobile
teneeto Mar 22, 2024
0e0cfc4
fix blank avatar icon on mobile
teneeto Mar 22, 2024
f4a79b1
fix lint
teneeto Mar 22, 2024
1e2f9f4
fix menuItem large screens wwrapping
teneeto Mar 22, 2024
cb98220
add threeDotsMenu to qboMenuItems
teneeto Mar 22, 2024
63e4053
fix lint
teneeto Mar 22, 2024
5fff74a
add onPress to pressable items
teneeto Mar 22, 2024
7a3d215
Merge branch 'main' of github.com:teneeto/Expensify into feat/37706/i…
teneeto Mar 25, 2024
8a99577
Merge branch 'main' of github.com:teneeto/Expensify into feat/37706/i…
teneeto Apr 2, 2024
ddceefa
add accounting to workspace settings stack navigator
teneeto Apr 2, 2024
82fcadf
remove disabled connection for Xero
teneeto Apr 2, 2024
4214307
add square icons for xero and qbo
teneeto Apr 2, 2024
9330471
export square icons for xero and qbo
teneeto Apr 2, 2024
7a7907a
use square icon for qbo options
teneeto Apr 2, 2024
9efcee5
threeDotsMenuItems should br renamed to overflowMenu
teneeto Apr 2, 2024
f18d9d0
remove styles.pl2
teneeto Apr 2, 2024
53e625e
add top margin to other integrations menu item
teneeto Apr 2, 2024
57b636d
fix lint
teneeto Apr 2, 2024
2eb02a7
Merge branch 'main' of github.com:teneeto/Expensify into feat/37706/i…
teneeto Apr 3, 2024
32fe9aa
remove xero and qbo round icons
teneeto Apr 3, 2024
ada272e
remove xero and qbo exports
teneeto Apr 3, 2024
0045693
use permissions for accounting routes
teneeto Apr 3, 2024
cdc533b
remove permissions for accounting routes
teneeto Apr 3, 2024
847e61c
add hasAccessToAccountingFeatures
teneeto Apr 3, 2024
57bc34d
use hasAccessToAccountingFeatures and FullPageNotFoundView
teneeto Apr 3, 2024
55cc8ab
add sync progress data
teneeto Apr 3, 2024
f85f652
add policy connection sync data types
teneeto Apr 3, 2024
b31bc36
export PolicyConnectionSyncProgress
teneeto Apr 3, 2024
69ed02c
map PolicyConnectionSyncProgress in onyx collections
teneeto Apr 3, 2024
125ff9d
add QuickBooksOnline connection lib
teneeto Apr 4, 2024
ce7fd8a
add QuickBooksOnline connection button
teneeto Apr 4, 2024
c4bd689
use qbo connection button
teneeto Apr 4, 2024
91fa03c
fix lint
teneeto Apr 4, 2024
bfbc944
remove hasAccessToAccountingFeatures
teneeto Apr 4, 2024
501485d
fix review comments
teneeto Apr 4, 2024
51fb585
remove fake url
teneeto Apr 4, 2024
7c41337
pass in environmentURL
teneeto Apr 4, 2024
5c063f7
update accounting spanish translations
teneeto Apr 4, 2024
5d2bf13
update accounting translations
teneeto Apr 4, 2024
8b439a3
add PolicyConnectionSyncStage types
teneeto Apr 4, 2024
12077e9
use new PolicyConnectionSyncStage translation
teneeto Apr 4, 2024
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
14 changes: 14 additions & 0 deletions assets/images/integrationicons/qbo-icon-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions assets/images/integrationicons/xero-icon-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/members',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/members` as const,
},
WORKSPACE_ACCOUNTING: {
route: 'settings/workspaces/:policyID/accounting',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting` as const,
},
WORKSPACE_CATEGORIES: {
route: 'settings/workspaces/:policyID/categories',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/categories` as const,
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ const SCREENS = {
INVOICES: 'Workspace_Invoices',
TRAVEL: 'Workspace_Travel',
MEMBERS: 'Workspace_Members',
ACCOUNTING: 'Workspace_Accounting',
INVITE: 'Workspace_Invite',
INVITE_MESSAGE: 'Workspace_Invite_Message',
CATEGORIES: 'Workspace_Categories',
Expand Down
3 changes: 2 additions & 1 deletion src/components/HeaderWithBackButton/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {ReactNode} from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import type {PopoverMenuItem} from '@components/PopoverMenu';
import type {Action} from '@hooks/useSingleExecution';
import type {StepCounterParams} from '@src/languages/types';
import type {AnchorPosition} from '@src/styles';
Expand Down Expand Up @@ -74,7 +75,7 @@ type HeaderWithBackButtonProps = Partial<ChildrenProps> & {
shouldSetModalVisibility?: boolean;

/** List of menu items for more(three dots) menu */
threeDotsMenuItems?: ThreeDotsMenuItem[];
teneeto marked this conversation as resolved.
Show resolved Hide resolved
threeDotsMenuItems?: PopoverMenuItem[];

/** The anchor position of the menu */
threeDotsAnchorPosition?: AnchorPosition;
Expand Down
4 changes: 4 additions & 0 deletions src/components/Icon/Expensicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ import Hourglass from '@assets/images/hourglass.svg';
import ImageCropCircleMask from '@assets/images/image-crop-circle-mask.svg';
import ImageCropSquareMask from '@assets/images/image-crop-square-mask.svg';
import Info from '@assets/images/info.svg';
import QBOSquare from '@assets/images/integrationicons/qbo-icon-square.svg';
import XeroSquare from '@assets/images/integrationicons/xero-icon-square.svg';
import Invoice from '@assets/images/invoice.svg';
import Key from '@assets/images/key.svg';
import Keyboard from '@assets/images/keyboard.svg';
Expand Down Expand Up @@ -280,6 +282,7 @@ export {
Plus,
Printer,
Profile,
QBOSquare,
QrCode,
QuestionMark,
Receipt,
Expand Down Expand Up @@ -308,6 +311,7 @@ export {
Wallet,
Workflows,
Workspace,
XeroSquare,
Zoom,
Twitter,
Youtube,
Expand Down
1 change: 1 addition & 0 deletions src/components/PopoverMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function PopoverMenu({
focused={focusedIndex === menuIndex}
displayInDefaultIconColor={item.displayInDefaultIconColor}
shouldShowRightIcon={item.shouldShowRightIcon}
iconRight={item.iconRight}
shouldPutLeftPaddingWhenNoIcon={item.shouldPutLeftPaddingWhenNoIcon}
label={item.label}
isLabelHoverable={item.isLabelHoverable}
Expand Down
42 changes: 1 addition & 41 deletions src/components/ThreeDotsMenu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, {useEffect, useRef, useState} from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import type {PopoverMenuItem} from '@components/PopoverMenu';
import PopoverMenu from '@components/PopoverMenu';
import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback';
import Tooltip from '@components/Tooltip/PopoverAnchorTooltip';
Expand All @@ -14,53 +12,15 @@ import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import * as Browser from '@libs/Browser';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import ONYXKEYS from '@src/ONYXKEYS';
import type {AnchorPosition} from '@src/styles';
import type {Modal} from '@src/types/onyx';
import type AnchorAlignment from '@src/types/utils/AnchorAlignment';
import type IconAsset from '@src/types/utils/IconAsset';
import type ThreeDotsMenuProps from './types';

type ThreeDotsMenuOnyxProps = {
/** Details about any modals being used */
modal: OnyxEntry<Modal>;
};

type ThreeDotsMenuProps = ThreeDotsMenuOnyxProps & {
/** Tooltip for the popup icon */
iconTooltip?: TranslationPaths;

/** icon for the popup trigger */
icon?: IconAsset;

/** Any additional styles to pass to the icon container. */
iconStyles?: StyleProp<ViewStyle>;

/** The fill color to pass into the icon. */
iconFill?: string;

/** Function to call on icon press */
onIconPress?: () => void;

/** menuItems that'll show up on toggle of the popup menu */
menuItems: PopoverMenuItem[];

/** The anchor position of the menu */
anchorPosition: AnchorPosition;

/** The anchor alignment of the menu */
anchorAlignment?: AnchorAlignment;

/** Whether the popover menu should overlay the current view */
shouldOverlay?: boolean;

/** Whether the menu is disabled */
disabled?: boolean;

/** Should we announce the Modal visibility changes? */
shouldSetModalVisibility?: boolean;
};

function ThreeDotsMenu({
iconTooltip = 'common.more',
icon = Expensicons.ThreeDots,
Expand Down
50 changes: 50 additions & 0 deletions src/components/ThreeDotsMenu/types.ts
teneeto marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import type {StyleProp, ViewStyle} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import type {PopoverMenuItem} from '@components/PopoverMenu';
import type {TranslationPaths} from '@src/languages/types';
import type {AnchorPosition} from '@src/styles';
import type {Modal} from '@src/types/onyx';
import type AnchorAlignment from '@src/types/utils/AnchorAlignment';
import type IconAsset from '@src/types/utils/IconAsset';

type ThreeDotsMenuOnyxProps = {
/** Details about any modals being used */
modal: OnyxEntry<Modal>;
};

type ThreeDotsMenuProps = ThreeDotsMenuOnyxProps & {
/** Tooltip for the popup icon */
iconTooltip?: TranslationPaths;

/** icon for the popup trigger */
icon?: IconAsset;

/** Any additional styles to pass to the icon container. */
iconStyles?: StyleProp<ViewStyle>;

/** The fill color to pass into the icon. */
iconFill?: string;

/** Function to call on icon press */
onIconPress?: () => void;

/** menuItems that'll show up on toggle of the popup menu */
menuItems: PopoverMenuItem[];

/** The anchor position of the menu */
anchorPosition: AnchorPosition;

/** The anchor alignment of the menu */
anchorAlignment?: AnchorAlignment;

/** Whether the popover menu should overlay the current view */
shouldOverlay?: boolean;

/** Whether the menu is disabled */
disabled?: boolean;

/** Should we announce the Modal visibility changes? */
shouldSetModalVisibility?: boolean;
};

export default ThreeDotsMenuProps;
19 changes: 19 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,7 @@ export default {
invoices: 'Invoices',
travel: 'Travel',
members: 'Members',
accounting: 'Accounting',
plan: 'Plan',
profile: 'Profile',
bankAccount: 'Bank account',
Expand Down Expand Up @@ -2014,6 +2015,24 @@ export default {
invalidRateError: 'Please enter a valid rate',
lowRateError: 'Rate must be greater than 0',
},
accounting: {
title: 'Connections',
subtitle: 'Connect to your accounting system to code transactions with your chart of accounts, auto-match payments and keep your finances in sync.',
qbo: 'Quickbooks Online',
xero: 'Xero',
setup: 'Set up',
lastSync: 'Last synced just now',
import: 'Import',
export: 'Export',
advanced: 'Advanced',
other: 'Other integrations',
syncNow: 'Sync now',
disconnect: 'Disconnect',
disconnectTitle: 'Disconnect integration',
disconnectPrompt: 'Are you sure you want to disconnect this integration?',
importing: 'Importing customers',
enterCredentials: 'Enter your credentials',
},
bills: {
manageYourBills: 'Manage your bills',
askYourVendorsBeforeEmail: 'Ask your vendors to forward their invoices to ',
Expand Down
19 changes: 19 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1821,6 +1821,7 @@ export default {
invoices: 'Enviar facturas',
travel: 'Viajes',
members: 'Miembros',
accounting: 'Accounting',
plan: 'Plan',
profile: 'Perfil',
bankAccount: 'Cuenta bancaria',
Expand Down Expand Up @@ -2009,6 +2010,24 @@ export default {
invitedBySecondaryLogin: ({secondaryLogin}) => `Agregado por nombre de usuario secundario ${secondaryLogin}.`,
membersListTitle: 'Directorio de todos los miembros del espacio de trabajo.',
},
accounting: {
teneeto marked this conversation as resolved.
Show resolved Hide resolved
title: 'Connections',
subtitle: 'Connect to your accounting system to code transactions with your chart of accounts, auto-match payments and keep your finances in sync.',
qbo: 'Quickbooks Online',
xero: 'Xero',
setup: 'Set up',
lastSync: 'Last synced just now',
import: 'Import',
export: 'Export',
advanced: 'Advanced',
other: 'Other integrations',
syncNow: 'Sync now',
disconnect: 'Disconnect',
disconnectTitle: 'Disconnect integration',
disconnectPrompt: 'Are you sure you want to disconnect this integration?',
importing: 'Importing customers',
enterCredentials: 'Enter your credentials',
},
card: {
header: 'Desbloquea Tarjetas Expensify gratis',
headerWithEcard: '¡Tus tarjetas están listas!',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ function WorkspaceSettingsModalStackNavigator() {
name={SCREENS.WORKSPACE.MEMBERS}
getComponent={() => require('@pages/workspace/WorkspaceMembersPage').default as React.ComponentType}
/>

<StackNavigator.Screen
key={SCREENS.WORKSPACE.ACCOUNTING}
name={SCREENS.WORKSPACE.ACCOUNTING}
getComponent={() => require('@pages/workspace/accounting/WorkspaceAccountingPage').default as React.ComponentType}
/>

<StackNavigator.Screen
key={SCREENS.WORKSPACE.CATEGORIES}
name={SCREENS.WORKSPACE.CATEGORIES}
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,9 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
[SCREENS.WORKSPACE.MEMBERS]: {
path: ROUTES.WORKSPACE_MEMBERS.route,
},
[SCREENS.WORKSPACE.ACCOUNTING]: {
path: ROUTES.WORKSPACE_ACCOUNTING.route,
},
[SCREENS.WORKSPACE.CATEGORIES]: {
path: ROUTES.WORKSPACE_CATEGORIES.route,
},
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ type WorkspacesCentralPaneNavigatorParamList = {
[SCREENS.WORKSPACE.MEMBERS]: {
policyID: string;
};
[SCREENS.WORKSPACE.ACCOUNTING]: {
policyID: string;
};
[SCREENS.WORKSPACE.CATEGORIES]: {
policyID: string;
};
Expand Down
5 changes: 5 additions & 0 deletions src/libs/WorkspacesSettingsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ function getOwnershipChecksDisplayText(
return {title, text, buttonText};
}

function hasAccessToAccountingFeatures(policy: Policy | null, canUseAccountingIntegrations?: boolean) {
return policy?.role === CONST.POLICY.ROLE.ADMIN && policy?.areConnectionsEnabled && canUseAccountingIntegrations;
}

export {
getBrickRoadForPolicy,
getWorkspacesBrickRoads,
Expand All @@ -297,5 +301,6 @@ export {
getChatTabBrickRoad,
getUnitTranslationKey,
getOwnershipChecksDisplayText,
hasAccessToAccountingFeatures,
};
export type {BrickRoad};
11 changes: 11 additions & 0 deletions src/pages/workspace/WorkspaceInitialPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,17 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, policyMembers, r
});
}

if (policy?.areAccountingEnabled) {
protectedCollectPolicyMenuItems.push({
translationKey: 'workspace.common.accounting',
icon: Expensicons.Sync,
action: singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_ACCOUNTING.getRoute(policyID)))),
// brickRoadIndicator should be set when API will be ready
brickRoadIndicator: undefined,
routeName: SCREENS.WORKSPACE.ACCOUNTING,
});
}

protectedCollectPolicyMenuItems.push({
translationKey: 'workspace.common.moreFeatures',
icon: Expensicons.Gear,
Expand Down
Loading
Loading