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

[Simplified Collect][Workflows] Create main workflow page (App) #36345

Merged
merged 106 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
6a640fe
add workflows icon
lakchote Feb 12, 2024
32219ce
add workflow translation keys
lakchote Feb 12, 2024
c189537
add workflows route
lakchote Feb 12, 2024
ed7f4e3
add workflows screen
lakchote Feb 12, 2024
6062cea
add workflows to central pane
lakchote Feb 12, 2024
ab54b30
add workflows to menu items
lakchote Feb 12, 2024
e4b2d68
add translations for workflows page
lakchote Feb 12, 2024
67ce9fa
add styles for workflows
lakchote Feb 12, 2024
4b84186
add workflows related icons
lakchote Feb 12, 2024
657f637
add workflows
lakchote Feb 12, 2024
b62413f
create workspace workflows main page
lakchote Feb 12, 2024
4c41b30
use workspace workflows main page
lakchote Feb 12, 2024
6cc2a08
create ToggleSettingsOptionRow component
lakchote Feb 13, 2024
c3120df
add new workflows styles
lakchote Feb 13, 2024
1adba7e
use a <FlatList>
lakchote Feb 13, 2024
685f730
Merge branch 'main' into lucien/wave8-workflows-page
lakchote Feb 14, 2024
f137598
add workflows icon
lakchote Feb 14, 2024
6de537f
remove unneeded imports
lakchote Feb 14, 2024
763c8ff
add icon property
lakchote Feb 14, 2024
8335949
use workflows icon
lakchote Feb 14, 2024
92d0ce7
add new workflows translation keys
lakchote Feb 14, 2024
93dc063
update workflows styles
lakchote Feb 14, 2024
343c2de
render sub items correctly
lakchote Feb 14, 2024
23727e2
use correct subitems component
lakchote Feb 14, 2024
18624a8
update workflows translations
lakchote Feb 15, 2024
906dbdd
update svg so it takes less space on the left x axis
lakchote Feb 15, 2024
7224a43
add new workflows styles
lakchote Feb 15, 2024
c3c3b4b
take into account vertical timeline below icons
lakchote Feb 15, 2024
79a20fe
take into account timeline edge case
lakchote Feb 15, 2024
f7ccbc3
add approval keys
lakchote Feb 16, 2024
00dec05
add method to check if it's a collect policy
lakchote Feb 16, 2024
c594e29
restrict workflows to collect policy
lakchote Feb 16, 2024
8df6c6a
add workspace workflows related api commands
lakchote Feb 16, 2024
78b608d
add workspace workflows related api commands types
lakchote Feb 16, 2024
7d35834
handle workspace auto reporting and approval mode
lakchote Feb 16, 2024
6ee9bbf
handle submission and approval api calls
lakchote Feb 16, 2024
5942299
update translation for workflows title
lakchote Feb 16, 2024
17b63b0
remove useless css property
lakchote Feb 16, 2024
167b35b
new style for workflows subitems hover
lakchote Feb 16, 2024
53e6b6c
use new style for hover on sub items
lakchote Feb 16, 2024
49f47e3
Merge branch 'main' into lucien/wave8-workflows-page
lakchote Feb 16, 2024
b6c720b
fix typo
lakchote Feb 16, 2024
d5a100d
fix lint
lakchote Feb 16, 2024
9530b17
fix typechecks
lakchote Feb 16, 2024
fe6cd8c
fix prettier
lakchote Feb 16, 2024
ddc7135
better naming for collect policy menu items
lakchote Feb 16, 2024
1b6b0e7
fix padding and positioning
lakchote Feb 16, 2024
127facc
use windowDimensions() and remove inline style
lakchote Feb 19, 2024
612548e
add a new property to keep track of previous toggle state
lakchote Feb 19, 2024
2cdcba8
handle toggle states on refresh
lakchote Feb 19, 2024
350dab4
use icon component
lakchote Feb 19, 2024
de670a4
remove unneeded style
lakchote Feb 19, 2024
e51a3ea
use existing classes for styling
lakchote Feb 19, 2024
6e6190f
fix style
lakchote Feb 19, 2024
890fcb0
add issues for todos
lakchote Feb 19, 2024
8602b32
use useMemo() for performance
lakchote Feb 19, 2024
64053f6
add helpers for policy types
lakchote Feb 19, 2024
b4e67d5
change display logic for control/collect policies (more features menu…
lakchote Feb 19, 2024
395faf2
fix import
lakchote Feb 19, 2024
1fd4e70
use styleUtils
lakchote Feb 19, 2024
6e66ace
fix spanish translations
lakchote Feb 19, 2024
9e60d50
fix typo
lakchote Feb 19, 2024
3051a27
create workflows style utils
lakchote Feb 19, 2024
c2a7544
use workflows style utils
lakchote Feb 19, 2024
007d538
use correct naming for props
lakchote Feb 19, 2024
f87ab42
use paid group policy check
lakchote Feb 20, 2024
7ccb580
clean up paid group policy check
lakchote Feb 20, 2024
f83b9c1
fix ios console error
lakchote Feb 20, 2024
505d7ea
fix icons display
lakchote Feb 20, 2024
9795e5f
working workflows dots for react native
lakchote Feb 20, 2024
c674033
fix lint
lakchote Feb 20, 2024
f437719
fix subtitle display
lakchote Feb 21, 2024
7648bfe
increase icon size
lakchote Feb 21, 2024
3224dca
remove dots
lakchote Feb 21, 2024
195cc80
clean up styles
lakchote Feb 21, 2024
587772c
handle user theme preference
lakchote Feb 21, 2024
4dfeae8
help readability
lakchote Feb 21, 2024
e95d775
fix workflows policy actions
lakchote Feb 21, 2024
3ca09f6
fix lint
lakchote Feb 21, 2024
c57b1dd
fix icon display
lakchote Feb 21, 2024
1a61957
add margin as in figma
lakchote Feb 21, 2024
7c1e9cc
Merge branch 'main' into lucien/wave8-workflows-page
lakchote Feb 21, 2024
f0aab68
fix default approver display name
lakchote Feb 21, 2024
5b49147
fix prettier
lakchote Feb 21, 2024
8b5e067
use app styles
lakchote Feb 22, 2024
69e823e
fix prettier
lakchote Feb 22, 2024
b7069fb
use useMemo
lakchote Feb 22, 2024
2980a92
fix prettier
lakchote Feb 22, 2024
cd548b5
add additional style for offline styling use case
lakchote Feb 22, 2024
b52a759
handle offline workflows
lakchote Feb 22, 2024
804a68f
lint and prettier
lakchote Feb 22, 2024
8ecb888
Merge branch 'main' into lucien/wave8-workflows-page
lakchote Feb 22, 2024
4e1a7a8
remove old code
lakchote Feb 22, 2024
adb4c63
fixes offline behaviour
ishpaul777 Feb 22, 2024
d476c63
fixes lint and type issues
ishpaul777 Feb 22, 2024
03481e3
put back the paid group policy check
lakchote Feb 23, 2024
884d00e
rename hasBeenToggled to clearer name
lakchote Feb 23, 2024
e612ec3
use consts for workspace approval mode
lakchote Feb 23, 2024
ba73d0d
remove unneeded prop
lakchote Feb 23, 2024
fae8db3
remove useless type
lakchote Feb 23, 2024
6f83c0b
use const
lakchote Feb 23, 2024
be01e31
fix typo
lakchote Feb 23, 2024
b4dab19
add jsdoc
lakchote Feb 23, 2024
fc0aa46
add todo comment
lakchote Feb 23, 2024
6b58105
add policy admin check for not found page
lakchote Feb 23, 2024
54e2585
fix prettier
lakchote Feb 23, 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
lakchote marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
lakchote marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/images/workflows.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,7 @@ const CONST = {
WORKSPACE_INVOICES: 'WorkspaceSendInvoices',
WORKSPACE_TRAVEL: 'WorkspaceBookTravel',
WORKSPACE_MEMBERS: 'WorkspaceManageMembers',
WORKSPACE_WORKFLOWS: 'WorkspaceWorkflows',
WORKSPACE_BANK_ACCOUNT: 'WorkspaceBankAccount',
},
get EXPENSIFY_EMAILS() {
Expand Down
4 changes: 4 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ const ROUTES = {
route: 'workspace/:policyID/settings/currency',
getRoute: (policyID: string) => `workspace/${policyID}/settings/currency` as const,
},
WORKSPACE_WORKFLOWS: {
route: 'workspace/:policyID/workflows',
getRoute: (policyID: string) => `workspace/${policyID}/workflows` as const,
},
WORKSPACE_CARD: {
route: 'workspace/:policyID/card',
getRoute: (policyID: string) => `workspace/${policyID}/card` 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 = {
INVITE: 'Workspace_Invite',
INVITE_MESSAGE: 'Workspace_Invite_Message',
CURRENCY: 'Workspace_Profile_Currency',
WORKFLOWS: 'Workspace_Workflows',
DESCRIPTION: 'Workspace_Profile_Description',
NAME: 'Workspace_Profile_Name',
},
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Expensicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ import VolumeHigh from '@assets/images/volume-high.svg';
import VolumeLow from '@assets/images/volume-low.svg';
import Wallet from '@assets/images/wallet.svg';
import Workspace from '@assets/images/workspace-default-avatar.svg';
import Workflows from '@assets/images/workflows.svg';
import Wrench from '@assets/images/wrench.svg';
import Zoom from '@assets/images/zoom.svg';
import LoungeAccess from './svgs/LoungeAccessIcon';
Expand Down Expand Up @@ -285,6 +286,7 @@ export {
VolumeHigh,
VolumeLow,
Wallet,
Workflows,
Workspace,
Zoom,
Twitter,
Expand Down
8 changes: 8 additions & 0 deletions src/components/Icon/Illustrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ import ThumbsUpStars from '@assets/images/simple-illustrations/simple-illustrati
import TrackShoe from '@assets/images/simple-illustrations/simple-illustration__track-shoe.svg';
import TrashCan from '@assets/images/simple-illustrations/simple-illustration__trashcan.svg';
import TreasureChest from '@assets/images/simple-illustrations/simple-illustration__treasurechest.svg';
import Approval from '@assets/images/simple-illustrations/simple-illustration__approval.svg';
import ReceiptEnvelope from '@assets/images/simple-illustrations/simple-illustration__receipt-envelope.svg';
import WalletAlt from '@assets/images/simple-illustrations/simple-illustration__wallet-alt.svg';
import Workflows from '@assets/images/simple-illustrations/simple-illustration__workflows.svg';

export {
Abracadabra,
Expand Down Expand Up @@ -131,5 +135,9 @@ export {
LockClosed,
Gears,
QRCode,
ReceiptEnvelope,
Approval,
WalletAlt,
Workflows,
House,
};
21 changes: 21 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,26 @@ export default {
},
cardDetailsLoadingFailure: 'An error occurred while loading the card details. Please check your internet connection and try again.',
},
workflowsPage:
{
workflowTitle: 'Spend',
workflowDescription: 'Configure a workflow from the moment spend occurs, including approval and payment.',
delaySubmissionTitle: 'Delay submissions',
delaySubmissionDescription: 'Expenses are shared right away for better spend visibility. Set a slower cadence if needed.',
submissionFrequency: 'Submission frequency',
weeklyFrequency: 'Weekly',
monthlyFrequency: 'Monthly',
twiceAMonthFrequency: 'Twice a month',
byTripFrequency: 'By trip',
manuallyFrequency: 'Manually',
dailyFrequency: 'Daily',
addApprovalsTitle: 'Add approvals',
approver: 'Approver',
connectBankAccount: 'Connect bank account',
addApprovalsDescription: 'Require additional approval before authorizing a payment.',
makeOrTrackPaymentsTitle: 'Make or track payments',
makeOrTrackPaymentsDescription: 'Add an authorized payer for payments made in Expensify, or simply track payments made elsewhere.',
},
reportFraudPage: {
title: 'Report virtual card fraud',
description: 'If your virtual card details have been stolen or compromised, we’ll permanently deactivate your existing card and provide you with a new virtual card and number.',
Expand Down Expand Up @@ -1669,6 +1689,7 @@ export default {
workspace: {
common: {
card: 'Cards',
workflows: 'Workflows',
workspace: 'Workspace',
edit: 'Edit workspace',
delete: 'Delete workspace',
Expand Down
22 changes: 22 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,26 @@ export default {
},
cardDetailsLoadingFailure: 'Se ha producido un error al cargar los datos de la tarjeta. Comprueba tu conexión a Internet e inténtalo de nuevo.',
},
workflowsPage:
{
workflowTitle: 'Gasto',
workflowDescription: 'Configure un flujo de trabajo desde el momento en que se produce el gasto, incluida la aprobación y el pago.',
delaySubmissionTitle: 'Retrasar las presentaciones',
delaySubmissionDescription: 'Los gastos se comparten de inmediato para una mejor visibilidad del gasto. Establece una cadencia más lenta si es necesario.',
addApprovalsTitle: 'Añadir aprobacións',
approver: 'Aprobador',
submissionFrequency: 'Frecuencia de envío',
weeklyFrequency: 'Semanal',
monthlyFrequency: 'Mensual',
twiceAMonthFrequency: 'Dos veces al mes',
byTripFrequency: 'Por viaje',
manuallyFrequency: 'Manualmente',
dailyFrequency: 'Diario',
connectBankAccount: 'Conectar cuenta bancaria',
addApprovalsDescription: 'Requiere una aprobación adicional antes de autorizar un pago.',
makeOrTrackPaymentsTitle: 'Realizar o seguir pagos',
makeOrTrackPaymentsDescription: 'Añada un pagador autorizado para los pagos realizados en Expensify, o simplemente realice un seguimiento de los pagos realizados en otro lugar.',
},
lakchote marked this conversation as resolved.
Show resolved Hide resolved
reportFraudPage: {
title: 'Reportar fraude con la tarjeta virtual',
description:
Expand Down Expand Up @@ -1693,6 +1713,8 @@ export default {
workspace: {
common: {
card: 'Tarjetas',
workflows: 'Flujos de trabajo',
spendWorkflow: 'Flujo de trabajo de gastos',
workspace: 'Espacio de trabajo',
edit: 'Editar espacio de trabajo',
delete: 'Eliminar espacio de trabajo',
Expand Down
6 changes: 6 additions & 0 deletions src/libs/API/parameters/SetWorkspaceApprovalModeParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type SetWorkspaceApprovalModeParams = {
policyID: string
value: string,
};

export default SetWorkspaceApprovalModeParams;
6 changes: 6 additions & 0 deletions src/libs/API/parameters/SetWorkspaceAutoReportingParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type SetWorkspaceAutoReportingParams = {
policyID: string;
enabled: boolean;
};

export default SetWorkspaceAutoReportingParams;
2 changes: 2 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import type UpdateBeneficialOwnersForBankAccountParams from './parameters/Update
type ApiRequest = ValueOf<typeof CONST.API_REQUEST_TYPE>;

const WRITE_COMMANDS = {
SET_WORKSPACE_AUTO_REPORTING: 'SetWorkspaceAutoReporting',
SET_WORKSPACE_APPROVAL_MODE: 'SetWorkspaceApprovalMode',
DISMISS_REFERRAL_BANNER: 'DismissReferralBanner',
UPDATE_PREFERRED_LOCALE: 'UpdatePreferredLocale',
RECONNECT_APP: 'ReconnectApp',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const workspaceSettingsScreens = {
[SCREENS.SETTINGS.WORKSPACES]: () => require('../../../../../pages/workspace/WorkspacesListPage').default as React.ComponentType,
[SCREENS.WORKSPACE.PROFILE]: () => require('../../../../../pages/workspace/WorkspaceProfilePage').default as React.ComponentType,
[SCREENS.WORKSPACE.CARD]: () => require('../../../../../pages/workspace/card/WorkspaceCardPage').default as React.ComponentType,
[SCREENS.WORKSPACE.WORKFLOWS]: () => require('../../../../../pages/workspace/workflows/WorkspaceWorkflowsPage').default as React.ComponentType,
[SCREENS.WORKSPACE.REIMBURSE]: () => require('../../../../../pages/workspace/reimburse/WorkspaceReimbursePage').default as React.ComponentType,
[SCREENS.WORKSPACE.BILLS]: () => require('../../../../../pages/workspace/bills/WorkspaceBillsPage').default as React.ComponentType,
[SCREENS.WORKSPACE.INVOICES]: () => require('../../../../../pages/workspace/invoices/WorkspaceInvoicesPage').default as React.ComponentType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const TAB_TO_CENTRAL_PANE_MAPPING: Record<BottomTabName, CentralPaneName[]> = {
[SCREENS.WORKSPACE.INITIAL]: [
SCREENS.WORKSPACE.PROFILE,
SCREENS.WORKSPACE.CARD,
SCREENS.WORKSPACE.WORKFLOWS,
SCREENS.WORKSPACE.REIMBURSE,
SCREENS.WORKSPACE.BILLS,
SCREENS.WORKSPACE.INVOICES,
Expand Down
Loading
Loading