Skip to content

Commit

Permalink
Merge pull request #49148 from koko57/feat/47377-multiple-card-feeds
Browse files Browse the repository at this point in the history
[No QA] Feat/47377 multiple card feeds
  • Loading branch information
robertjchen authored Sep 24, 2024
2 parents ae57639 + 90e396b commit a7a408f
Show file tree
Hide file tree
Showing 15 changed files with 227 additions and 29 deletions.
2 changes: 1 addition & 1 deletion assets/images/expensify-card.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 @@ -2452,6 +2452,7 @@ const CONST = {
},
},
EXPENSIFY_CARD: {
NAME: 'expensifyCard',
BANK: 'Expensify Card',
FRAUD_TYPES: {
DOMAIN: 'domain',
Expand Down
12 changes: 8 additions & 4 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,10 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/members/:accountID',
getRoute: (policyID: string, accountID: number) => `settings/workspaces/${policyID}/members/${accountID}` as const,
},
WORKSPACE_MEMBER_NEW_CARD: {
route: 'settings/workspaces/:policyID/members/:accountID/new-card',
getRoute: (policyID: string, accountID: number) => `settings/workspaces/${policyID}/members/${accountID}/new-card` as const,
},
WORKSPACE_MEMBER_ROLE_SELECTION: {
route: 'settings/workspaces/:policyID/members/:accountID/role-selection',
getRoute: (policyID: string, accountID: number) => `settings/workspaces/${policyID}/members/${accountID}/role-selection` as const,
Expand Down Expand Up @@ -960,10 +964,6 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/company-cards/select-feed',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/company-cards/select-feed` as const,
},
WORKSPACE_EXPENSIFY_CARD: {
route: 'settings/workspaces/:policyID/expensify-card',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/expensify-card` as const,
},
WORKSPACE_COMPANY_CARDS_ASSIGN_CARD: {
route: 'settings/workspaces/:policyID/company-cards/:feed/assign-card',
getRoute: (policyID: string, feed: string) => `settings/workspaces/${policyID}/company-cards/${feed}/assign-card` as const,
Expand All @@ -980,6 +980,10 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/company-cards/:bank/:cardID/edit/export',
getRoute: (policyID: string, cardID: string, bank: string) => `settings/workspaces/${policyID}/company-cards/${bank}/${cardID}/edit/export` as const,
},
WORKSPACE_EXPENSIFY_CARD: {
route: 'settings/workspaces/:policyID/expensify-card',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/expensify-card` as const,
},
WORKSPACE_EXPENSIFY_CARD_DETAILS: {
route: 'settings/workspaces/:policyID/expensify-card/:cardID',
getRoute: (policyID: string, cardID: string, backTo?: string) => getUrlWithBackToParam(`settings/workspaces/${policyID}/expensify-card/${cardID}`, backTo),
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ const SCREENS = {
CATEGORIES_IMPORTED: 'Categories_Imported',
MORE_FEATURES: 'Workspace_More_Features',
MEMBER_DETAILS: 'Workspace_Member_Details',
MEMBER_NEW_CARD: 'Workspace_Member_NewCard',
OWNER_CHANGE_CHECK: 'Workspace_Owner_Change_Check',
OWNER_CHANGE_SUCCESS: 'Workspace_Owner_Change_Success',
OWNER_CHANGE_ERROR: 'Workspace_Owner_Change_Error',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2881,6 +2881,7 @@ export default {
startTransactionDate: 'Start transaction date',
cardName: 'Card name',
assignedYouCard: (assigner: string) => `${assigner} assigned you a company card! Imported transactions will appear in this chat.`,
chooseCardFeed: 'Choose card feed',
},
expensifyCard: {
issueAndManageCards: 'Issue and manage your Expensify Cards',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2926,6 +2926,7 @@ export default {
startTransactionDate: 'Fecha de inicio de transacciones',
cardName: 'Nombre de la tarjeta',
assignedYouCard: (assigner: string) => ${assigner} te ha asignado una tarjeta de empresa! Las transacciones importadas aparecerán en este chat.`,
chooseCardFeed: 'Elige feed de tarjetas',
},
expensifyCard: {
issueAndManageCards: 'Emitir y gestionar Tarjetas Expensify',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
[SCREENS.WORKSPACE.CATEGORIES_IMPORTED]: () => require<ReactComponentModule>('../../../../pages/workspace/categories/ImportedCategoriesPage').default,
[SCREENS.WORKSPACE.UPGRADE]: () => require<ReactComponentModule>('../../../../pages/workspace/upgrade/WorkspaceUpgradePage').default,
[SCREENS.WORKSPACE.MEMBER_DETAILS]: () => require<ReactComponentModule>('../../../../pages/workspace/members/WorkspaceMemberDetailsPage').default,
[SCREENS.WORKSPACE.MEMBER_NEW_CARD]: () => require<ReactComponentModule>('../../../../pages/workspace/members/WorkspaceMemberNewCardPage').default,
[SCREENS.WORKSPACE.OWNER_CHANGE_CHECK]: () => require<ReactComponentModule>('@pages/workspace/members/WorkspaceOwnerChangeWrapperPage').default,
[SCREENS.WORKSPACE.OWNER_CHANGE_SUCCESS]: () => require<ReactComponentModule>('../../../../pages/workspace/members/WorkspaceOwnerChangeSuccessPage').default,
[SCREENS.WORKSPACE.OWNER_CHANGE_ERROR]: () => require<ReactComponentModule>('../../../../pages/workspace/members/WorkspaceOwnerChangeErrorPage').default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const FULL_SCREEN_TO_RHP_MAPPING: Partial<Record<FullScreenName, string[]>> = {
SCREENS.WORKSPACE.INVITE,
SCREENS.WORKSPACE.INVITE_MESSAGE,
SCREENS.WORKSPACE.MEMBER_DETAILS,
SCREENS.WORKSPACE.MEMBER_NEW_CARD,
SCREENS.WORKSPACE.OWNER_CHANGE_CHECK,
SCREENS.WORKSPACE.OWNER_CHANGE_SUCCESS,
SCREENS.WORKSPACE.OWNER_CHANGE_ERROR,
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 @@ -611,6 +611,9 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
[SCREENS.WORKSPACE.MEMBER_DETAILS]: {
path: ROUTES.WORKSPACE_MEMBER_DETAILS.route,
},
[SCREENS.WORKSPACE.MEMBER_NEW_CARD]: {
path: ROUTES.WORKSPACE_MEMBER_NEW_CARD.route,
},
[SCREENS.WORKSPACE.OWNER_CHANGE_SUCCESS]: {
path: ROUTES.WORKSPACE_OWNER_CHANGE_SUCCESS.route,
},
Expand Down
4 changes: 4 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ type SettingsNavigatorParamList = {
policyID: string;
accountID: string;
};
[SCREENS.WORKSPACE.MEMBER_NEW_CARD]: {
policyID: string;
accountID: string;
};
[SCREENS.WORKSPACE.OWNER_CHANGE_SUCCESS]: {
policyID: string;
accountID: number;
Expand Down
3 changes: 1 addition & 2 deletions src/pages/workspace/companyCards/assignCard/AssigneeStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import Navigation from '@navigation/Navigation';
import * as CompanyCards from '@userActions/CompanyCards';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type * as OnyxTypes from '@src/types/onyx';

const MINIMUM_MEMBER_TO_SHOW_SEARCH = 8;
Expand Down Expand Up @@ -68,7 +67,7 @@ function AssigneeStep({policy}: AssigneeStepProps) {
CompanyCards.setAssignCardStepAndData({currentStep: CONST.COMPANY_CARD.STEP.CONFIRMATION, isEditing: false});
return;
}
Navigation.navigate(ROUTES.WORKSPACE_COMPANY_CARDS.getRoute(policy?.id ?? '-1'));
Navigation.goBack();
};

const shouldShowSearchInput = policy?.employeeList && Object.keys(policy.employeeList).length >= MINIMUM_MEMBER_TO_SHOW_SEARCH;
Expand Down
Loading

0 comments on commit a7a408f

Please sign in to comment.