Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
e2f9b82
feat: allow linking to specific card in ASSIGN_CARD flow
chrispader Dec 15, 2025
84951db
Merge branch 'byoc-bulk-card-assign-r1-table' into byoc-bulk-card-ass…
chrispader Dec 15, 2025
3c3f84c
feat: extract route options into param object type
chrispader Dec 15, 2025
077e486
update assignee step text
chrispader Dec 16, 2025
215c8f7
Update TransactionStartDateStep.tsx
chrispader Dec 16, 2025
fb10e3f
Update en.ts
chrispader Dec 16, 2025
2a6efbe
import isLoadingOnyxValue and cardListMetada
carlosmiceli Dec 16, 2025
92bd4cb
check card feeds
carlosmiceli Dec 16, 2025
f85990b
add isloadingCardsList
carlosmiceli Dec 16, 2025
c254b6b
import skeleton elements
carlosmiceli Dec 16, 2025
fafdcb4
implement skeleton when loading
carlosmiceli Dec 16, 2025
2562d10
polish skeleton loading
carlosmiceli Dec 16, 2025
a881e70
add cardID to route
carlosmiceli Dec 17, 2025
880dbe4
update navigation
carlosmiceli Dec 17, 2025
fd036d8
add plaid and commercial checks for urls
carlosmiceli Dec 17, 2025
98ac60f
open rhp if visiting card url directly
carlosmiceli Dec 17, 2025
c21c0fb
open member selection in rhp
carlosmiceli Dec 17, 2025
cd67fb3
remove filteredCardList logic
carlosmiceli Dec 17, 2025
99419cd
remove steps from confirmation screen
carlosmiceli Dec 17, 2025
056142e
update back navigation
carlosmiceli Dec 17, 2025
49ef4bf
UI updates to confirmation screen
carlosmiceli Dec 17, 2025
121d160
remove unused variables
carlosmiceli Dec 17, 2025
ad439c9
update card identifier menu item in confirmation screen
carlosmiceli Dec 17, 2025
9aa99af
add default date to confirmation screen
carlosmiceli Dec 17, 2025
a7da239
update cardholder menu item
carlosmiceli Dec 17, 2025
d60e4d1
add back navigation logic to start date
carlosmiceli Dec 17, 2025
04e686a
fix assignee step navigation when reselecting same member
carlosmiceli Dec 17, 2025
b6a00e8
react compiler fixes
carlosmiceli Dec 17, 2025
4d5cf53
react compiler fixes
carlosmiceli Dec 17, 2025
10962b1
lint errors
carlosmiceli Dec 17, 2025
eeb347b
lint errors
carlosmiceli Dec 17, 2025
8efe912
remove unusued feed prop
carlosmiceli Dec 17, 2025
9d9b7d4
prettier
carlosmiceli Dec 17, 2025
5ea1f49
translations and useMemoizedLazyExpensifyIcons
carlosmiceli Dec 17, 2025
ec9378b
fix warning
carlosmiceli Dec 17, 2025
8d93375
Merge remote-tracking branch 'origin/byoc-bulk-card-assign-r1' into b…
carlosmiceli Dec 17, 2025
c22604b
remove unused handleIssueNewCard
carlosmiceli Dec 17, 2025
cb8f62f
remove unused setIssueNewCardStepAndData
carlosmiceli Dec 17, 2025
d0a64e9
update button to say save
carlosmiceli Dec 18, 2025
b806ccb
Merge remote-tracking branch 'origin/byoc-bulk-card-assign-r1' into c…
carlosmiceli Dec 18, 2025
f8dcab1
add canBeMissing
carlosmiceli Dec 18, 2025
fc0cb04
move isLoadingCardsList to WorkspaceCompanyCardsList
carlosmiceli Dec 18, 2025
70717ff
prettier
carlosmiceli Dec 18, 2025
bb35bf7
fix lint
carlosmiceli Dec 18, 2025
1c0e23f
remove unused method
carlosmiceli Dec 18, 2025
a7bfe9d
remove setIssueNewCardStepAndData
carlosmiceli Dec 18, 2025
06ce70e
fix react compiler error
carlosmiceli Dec 18, 2025
cdedee6
more linting
carlosmiceli Dec 18, 2025
59c976b
final cleanup
carlosmiceli Dec 18, 2025
2296422
Update src/pages/workspace/companyCards/WorkspaceCompanyCardsList.tsx
carlosmiceli Dec 18, 2025
f5ce09c
fix flashing assign card screen
carlosmiceli Dec 18, 2025
799dfe6
Update src/ROUTES.ts
carlosmiceli Dec 18, 2025
e92856b
Merge pull request #77804 from Expensify/cm-company-cards-loading-ske…
carlosmiceli Dec 18, 2025
398330f
fix conflicts and integrate previous list changes into new table
carlosmiceli Dec 18, 2025
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
16 changes: 13 additions & 3 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ import type {ConnectionName, SageIntacctMappingName} from './types/onyx/Policy';
import type {CustomFieldType} from './types/onyx/PolicyEmployee';
import type AssertTypesNotEqual from './types/utils/AssertTypesNotEqual';

type WorkspaceCompanyCardsAssignCardParams = {
policyID: string;
feed: string;
cardID?: string;
};

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

/**
Expand Down Expand Up @@ -2171,10 +2177,14 @@ const ROUTES = {
getRoute: (policyID: string) => `workspaces/${policyID}/company-cards/select-feed` as const,
},
WORKSPACE_COMPANY_CARDS_ASSIGN_CARD: {
route: 'workspaces/:policyID/company-cards/:feed/assign-card',
route: 'workspaces/:policyID/company-cards/:feed/assign-card/:cardID',

// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
getRoute: (policyID: string, feed: string, backTo?: string) => getUrlWithBackToParam(`workspaces/${policyID}/company-cards/${encodeURIComponent(feed)}/assign-card`, backTo),
getRoute: (params: WorkspaceCompanyCardsAssignCardParams, backTo?: string) =>
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
getUrlWithBackToParam(
`workspaces/${params.policyID}/company-cards/${encodeURIComponent(params.feed)}/assign-card${params.cardID ? `/${encodeURIComponent(params.cardID)}` : ''}`,
backTo,
),
},
WORKSPACE_COMPANY_CARD_DETAILS: {
route: 'workspaces/:policyID/company-cards/:bank/:cardID',
Expand Down
16 changes: 13 additions & 3 deletions src/hooks/useAssignCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ function useAssignCard({selectedFeed, policyID, setShouldShowOfflineModal}: UseA

const isAssigningCardDisabled = !currentFeedData || !!currentFeedData?.pending || isSelectedFeedConnectionBroken || !isAllowedToIssueCompanyCard;

const assignCard = () => {
const assignCard = (cardID?: string) => {
if (isAssigningCardDisabled) {
return;
}

if (isActingAsDelegate) {
showDelegateNoAccessModal();
return;
Expand All @@ -97,6 +101,10 @@ function useAssignCard({selectedFeed, policyID, setShouldShowOfflineModal}: UseA
bankName: feed,
};

if (cardID) {
data.encryptedCardNumber = cardID;
}

let currentStep: AssignCardStep = CONST.COMPANY_CARD.STEP.ASSIGNEE;
const employeeList = Object.values(policy?.employeeList ?? {}).filter((employee) => !isDeletedPolicyEmployee(employee, isOffline));
const isFeedExpired = isSelectedFeedExpired(selectedFeedData);
Expand All @@ -108,7 +116,7 @@ function useAssignCard({selectedFeed, policyID, setShouldShowOfflineModal}: UseA
importPlaidAccounts('', selectedFeed, '', country, getDomainNameForPolicy(policyID), '', undefined, undefined, plaidAccessToken);
}

if (employeeList.length === 1) {
if (!cardID && employeeList.length === 1) {
const userEmail = Object.keys(policy?.employeeList ?? {}).at(0) ?? '';
data.email = userEmail;
const personalDetails = getPersonalDetailByEmail(userEmail);
Expand Down Expand Up @@ -138,7 +146,9 @@ function useAssignCard({selectedFeed, policyID, setShouldShowOfflineModal}: UseA

clearAddNewCardFlow();
setAssignCardStepAndData({data, currentStep});
Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.navigate(ROUTES.WORKSPACE_COMPANY_CARDS_ASSIGN_CARD.getRoute(policyID, selectedFeed)));
Navigation.setNavigationActionToMicrotaskQueue(() => {
Navigation.navigate(ROUTES.WORKSPACE_COMPANY_CARDS_ASSIGN_CARD.getRoute({policyID, feed: selectedFeed, cardID}));
});
};

return {
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4851,6 +4851,7 @@ _Für ausführlichere Anweisungen [besuchen Sie unsere Hilfeseite](${CONST.NETSU
feedName: (feedName: string) => `${feedName}-Karten`,
directFeed: 'Direkt-Feed',
whoNeedsCardAssigned: 'Wer braucht eine zugewiesene Karte?',
chooseTheCardholder: 'Wähle den Karteninhaber',
chooseCard: 'Wähle eine Karte',
chooseCardFor: (assignee: string) =>
`Wähle eine Karte für <strong>${assignee}</strong>. Du findest die Karte, die du suchst, nicht? <concierge-link>Teile es uns mit.</concierge-link>`,
Expand Down
4 changes: 3 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4736,13 +4736,15 @@ const translations = {
feedName: (feedName: string) => `${feedName} cards`,
directFeed: 'Direct feed',
whoNeedsCardAssigned: 'Who needs a card assigned?',
chooseTheCardholder: 'Choose the cardholder',
chooseCard: 'Choose a card',
chooseCardFor: (assignee: string) => `Choose a card for <strong>${assignee}</strong>. Can't find the card you're looking for? <concierge-link>Let us know.</concierge-link>`,
noActiveCards: 'No active cards on this feed',
somethingMightBeBroken:
'<muted-text><centered-text>Or something might be broken. Either way, if you have any questions, just <concierge-link>contact Concierge</concierge-link>.</centered-text></muted-text>',
chooseTransactionStartDate: 'Choose a transaction start date',
startDateDescription: "We'll import all transactions from this date onwards. If no date is specified, we’ll go as far back as your bank allows.",
startDateDescription: "Choose your import start date. We'll sync all transactions from this date onwards.",

fromTheBeginning: 'From the beginning',
customStartDate: 'Custom start date',
customCloseDate: 'Custom close date',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4420,6 +4420,7 @@ ${amount} para ${merchant} - ${date}`,
feedName: (feedName) => `Tarjetas ${feedName}`,
directFeed: 'Fuente directa',
whoNeedsCardAssigned: '¿Quién necesita una tarjeta?',
chooseTheCardholder: 'Elige el titular de la tarjeta',
chooseCard: 'Elige una tarjeta',
chooseCardFor: (assignee) => `Elige una tarjeta para <strong>${assignee}</strong>. ¿No encuentras la tarjeta que buscas? <concierge-link>Avísanos.</concierge-link>`,
noActiveCards: 'No hay tarjetas activas en este feed',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4856,6 +4856,7 @@ _Pour des instructions plus détaillées, [visitez notre site d’aide](${CONST.
feedName: (feedName: string) => `Cartes ${feedName}`,
directFeed: 'Flux direct',
whoNeedsCardAssigned: 'Qui a besoin d’une carte attribuée ?',
chooseTheCardholder: 'Choisissez le titulaire de la carte',
chooseCard: 'Choisissez une carte',
chooseCardFor: (assignee: string) =>
`Choisissez une carte pour <strong>${assignee}</strong>. Vous ne trouvez pas la carte que vous recherchez ? <concierge-link>Faites-le-nous savoir.</concierge-link>`,
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4834,6 +4834,7 @@ _Per istruzioni più dettagliate, [visita il nostro sito di assistenza](${CONST.
feedName: (feedName: string) => `Carte ${feedName}`,
directFeed: 'Feed diretto',
whoNeedsCardAssigned: 'Chi ha bisogno di una carta assegnata?',
chooseTheCardholder: 'Scegli il titolare della carta',
chooseCard: 'Scegli una carta',
chooseCardFor: (assignee: string) =>
`Scegli una carta per <strong>${assignee}</strong>. Non riesci a trovare la carta che stai cercando? <concierge-link>Facci sapere.</concierge-link>`,
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4809,6 +4809,7 @@ _より詳しい手順については、[ヘルプサイトをご覧ください
feedName: (feedName: string) => `${feedName} カード`,
directFeed: 'ダイレクトフィード',
whoNeedsCardAssigned: '誰にカードを割り当てる必要がありますか?',
chooseTheCardholder: 'カード所有者を選択',
chooseCard: 'カードを選択',
chooseCardFor: (assignee: string) =>
`<strong>${assignee}</strong> に使うカードを選択してください。お探しのカードが見つかりませんか?<concierge-link>お知らせください。</concierge-link>`,
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4829,6 +4829,7 @@ _Voor gedetailleerdere instructies, [bezoek onze helpsite](${CONST.NETSUITE_IMPO
feedName: (feedName: string) => `${feedName}-kaarten`,
directFeed: 'Directe feed',
whoNeedsCardAssigned: 'Wie heeft een kaart toegewezen nodig?',
chooseTheCardholder: 'Kies de kaarthouder',
chooseCard: 'Kies een kaart',
chooseCardFor: (assignee: string) =>
`Kies een kaart voor <strong>${assignee}</strong>. Kun je de kaart die je zoekt niet vinden? <concierge-link>Laat het ons weten.</concierge-link>`,
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4821,6 +4821,7 @@ _Aby uzyskać bardziej szczegółowe instrukcje, [odwiedź naszą stronę pomocy
feedName: (feedName: string) => `Karty ${feedName}`,
directFeed: 'Bezpośredni kanał',
whoNeedsCardAssigned: 'Kto potrzebuje przypisanej karty?',
chooseTheCardholder: 'Wybierz posiadacza karty',
chooseCard: 'Wybierz kartę',
chooseCardFor: (assignee: string) => `Wybierz kartę dla <strong>${assignee}</strong>. Nie możesz znaleźć karty, której szukasz? <concierge-link>Daj nam znać.</concierge-link>`,
noActiveCards: 'Brak aktywnych kart w tym kanale',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4821,6 +4821,7 @@ _Para instruções mais detalhadas, [visite nosso site de ajuda](${CONST.NETSUIT
feedName: (feedName: string) => `Cartões ${feedName}`,
directFeed: 'Conexão direta',
whoNeedsCardAssigned: 'Quem precisa de um cartão atribuído?',
chooseTheCardholder: 'Escolha o portador do cartão',
chooseCard: 'Escolha um cartão',
chooseCardFor: (assignee: string) =>
`Escolha um cartão para <strong>${assignee}</strong>. Não encontra o cartão que está procurando? <concierge-link>Avise-nos.</concierge-link>`,
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4739,6 +4739,7 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
feedName: (feedName: string) => `${feedName} 卡片`,
directFeed: '直接数据馈送',
whoNeedsCardAssigned: '谁需要被分配一张卡?',
chooseTheCardholder: '选择持卡人',
chooseCard: '选择一张卡片',
chooseCardFor: (assignee: string) => `为 <strong>${assignee}</strong> 选择一张卡片。找不到您要找的卡片?<concierge-link>请告诉我们。</concierge-link>`,
noActiveCards: '此信息流中没有有效的卡片',
Expand Down
2 changes: 2 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,8 @@ type SettingsNavigatorParamList = {
[SCREENS.WORKSPACE.COMPANY_CARDS_ASSIGN_CARD]: {
policyID: string;
feed: CompanyCardFeed;
cardID?: string;

// eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md
backTo?: Routes;
};
Expand Down
Loading
Loading