Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a3cf66c
introduce invitation for cards flow
twilight2294 Aug 13, 2025
07ca138
fix patch failure
twilight2294 Aug 13, 2025
5009d0a
fix lint
twilight2294 Aug 13, 2025
c714574
fix prettier
twilight2294 Aug 13, 2025
c85e35e
fix translations
twilight2294 Aug 13, 2025
fc22601
apply fixes
twilight2294 Aug 14, 2025
fa0d41c
Merge branch 'Expensify:main' into fix60905
twilight2294 Aug 20, 2025
7704c31
Merge branch 'main' into fix60905
twilight2294 Aug 28, 2025
628089d
fix typefailure
twilight2294 Aug 28, 2025
126e896
Merge branch 'Expensify:main' into fix60905
twilight2294 Sep 1, 2025
14b2533
Merge branch 'main' into fix60905
twilight2294 Sep 8, 2025
251280f
part 1: apply reviewers suggestions
twilight2294 Sep 8, 2025
90d612c
apply reviewers comments
twilight2294 Sep 8, 2025
99da388
Merge branch 'Expensify:main' into fix60905
twilight2294 Sep 8, 2025
efca7cd
extract useOptions
twilight2294 Sep 8, 2025
c9ac099
Merge branch 'fix60905' of https://github.com/twilight2294/App into f…
twilight2294 Sep 8, 2025
7ccd781
move isLoading in useEffect
twilight2294 Sep 8, 2025
beb87d7
Merge branch 'Expensify:main' into fix60905
twilight2294 Sep 17, 2025
fa0517a
Merge branch 'Expensify:main' into fix60905
twilight2294 Sep 29, 2025
c7f7e6a
Fix wrong input label
twilight2294 Sep 29, 2025
dbbe9e8
fix selection list in company cards page
twilight2294 Sep 29, 2025
18f38ae
fix existing users results
twilight2294 Sep 29, 2025
2bee03d
Merge branch 'Expensify:main' into fix60905
twilight2294 Sep 29, 2025
c0ed45f
Merge branch 'Expensify:main' into fix60905
twilight2294 Sep 30, 2025
92b646a
Merge branch 'main' into fix60905
twilight2294 Oct 1, 2025
f3f6962
Merge branch 'Expensify:main' into fix60905
twilight2294 Oct 3, 2025
c54cc09
Merge branch 'main' into fix60905
twilight2294 Oct 19, 2025
a6462c3
fix loading indicator issue on assignee step
twilight2294 Oct 19, 2025
1aef630
update component functions
twilight2294 Oct 19, 2025
54771ac
fix company cards
twilight2294 Oct 19, 2025
5104e5b
Merge branch 'Expensify:main' into fix60905
twilight2294 Oct 24, 2025
8658982
remove redundant results
twilight2294 Oct 24, 2025
9328d74
fix result not found text
twilight2294 Oct 24, 2025
220c728
Merge branch 'main' into fix60905
twilight2294 Oct 26, 2025
74a43d4
Merge branch 'Expensify:main' into fix60905
twilight2294 Oct 27, 2025
13e9918
Update UseOptionsUtils.ts
twilight2294 Oct 27, 2025
e20e2ce
Merge branch 'Expensify:main' into fix60905
twilight2294 Oct 30, 2025
a446ba1
fix errors on search
twilight2294 Oct 30, 2025
5028f29
fix spellcheck
twilight2294 Oct 30, 2025
7dbbcf3
Update AssignCardFeedPage.tsx
twilight2294 Oct 30, 2025
47ca603
Merge branch 'Expensify:main' into fix60905
twilight2294 Oct 30, 2025
657da26
Merge branch 'Expensify:main' into fix60905
twilight2294 Oct 31, 2025
df71924
Merge branch 'Expensify:main' into fix60905
twilight2294 Oct 31, 2025
6e3704a
Merge branch 'Expensify:main' into fix60905
twilight2294 Nov 3, 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
2 changes: 2 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3309,6 +3309,7 @@ const CONST = {
CARD_NAME: 'CardName',
TRANSACTION_START_DATE: 'TransactionStartDate',
CONFIRMATION: 'Confirmation',
INVITE_NEW_MEMBER: 'InviteNewMember',
},
TRANSACTION_START_DATE_OPTIONS: {
FROM_BEGINNING: 'fromBeginning',
Expand Down Expand Up @@ -3354,6 +3355,7 @@ const CONST = {
LIMIT: 'Limit',
CARD_NAME: 'CardName',
CONFIRMATION: 'Confirmation',
INVITE_NEW_MEMBER: 'InviteNewMember',
},
CARD_TYPE: {
PHYSICAL: 'physical',
Expand Down
10 changes: 8 additions & 2 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1268,8 +1268,14 @@ const ROUTES = {
WORKSPACE_INVITE_MESSAGE_ROLE: {
route: 'workspaces/:policyID/invite-message/role',

// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
getRoute: (policyID: string, backTo?: string) => `${getUrlWithBackToParam(`workspaces/${policyID}/invite-message/role`, backTo)}` as const,
getRoute: (policyID: string | undefined, backTo?: string) => {
if (!policyID) {
Log.warn('Invalid policyID is used to build the WORKSPACE_INVITE_MESSAGE_ROLE route');
}

// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
return getUrlWithBackToParam(`workspaces/${policyID}/invite-message/role` as const, backTo);
},
},
WORKSPACE_OVERVIEW: {
route: 'workspaces/:policyID/overview',
Expand Down
7 changes: 7 additions & 0 deletions src/components/InteractiveStepWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ type InteractiveStepWrapperProps = {
* This flag can be removed, once all components/screens have switched to edge-to-edge safe area handling.
*/
enableEdgeToEdgeBottomSafeAreaPadding?: boolean;

/**
* Callback to be called when the screen entry transition ends.
*/
onEntryTransitionEnd?: () => void;
};

function InteractiveStepWrapper(
Expand All @@ -74,6 +79,7 @@ function InteractiveStepWrapper(
offlineIndicatorStyle,
shouldKeyboardOffsetBottomSafeAreaPadding,
enableEdgeToEdgeBottomSafeAreaPadding,
onEntryTransitionEnd,
}: InteractiveStepWrapperProps,
ref: React.ForwardedRef<View>,
) {
Expand All @@ -91,6 +97,7 @@ function InteractiveStepWrapper(
shouldShowOfflineIndicatorInWideScreen={shouldShowOfflineIndicatorInWideScreen}
offlineIndicatorStyle={offlineIndicatorStyle}
shouldKeyboardOffsetBottomSafeAreaPadding={shouldKeyboardOffsetBottomSafeAreaPadding}
onEntryTransitionEnd={onEntryTransitionEnd}
>
<HeaderWithBackButton
title={headerTitle}
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5148,6 +5148,7 @@ ${amount} für ${merchant} - ${date}`,
issueCard: 'Karte ausstellen',
issueNewCard: {
whoNeedsCard: 'Wer braucht eine Karte?',
inviteNewMember: 'Neues Mitglied einladen',
findMember: 'Mitglied finden',
chooseCardType: 'Wählen Sie einen Kartentyp aus',
physicalCard: 'Physische Karte',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5116,6 +5116,7 @@ const translations = {
issueCard: 'Issue card',
issueNewCard: {
whoNeedsCard: 'Who needs a card?',
inviteNewMember: 'Invite new member',
findMember: 'Find member',
chooseCardType: 'Choose a card type',
physicalCard: 'Physical card',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5379,6 +5379,7 @@ ${amount} para ${merchant} - ${date}`,
getStartedIssuing: 'Empieza emitiendo tu primera tarjeta virtual o física.',
issueNewCard: {
whoNeedsCard: '¿Quién necesita una tarjeta?',
inviteNewMember: 'Invitar nuevo miembro',
findMember: 'Buscar miembro',
chooseCardType: 'Elegir un tipo de tarjeta',
physicalCard: 'Tarjeta física',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5154,6 +5154,7 @@ ${amount} pour ${merchant} - ${date}`,
issueCard: 'Émettre une carte',
issueNewCard: {
whoNeedsCard: "Qui a besoin d'une carte ?",
inviteNewMember: 'Inviter un nouveau membre',
findMember: 'Trouver un membre',
chooseCardType: 'Choisissez un type de carte',
physicalCard: 'Carte physique',
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5158,6 +5158,7 @@ ${amount} per ${merchant} - ${date}`,
issueCard: 'Emetti carta',
issueNewCard: {
whoNeedsCard: 'Chi ha bisogno di una carta?',
inviteNewMember: 'Invita nuovo membro',
findMember: 'Trova membro',
chooseCardType: 'Scegli un tipo di carta',
physicalCard: 'Carta fisica',
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5115,6 +5115,7 @@ ${date} - ${merchant}に${amount}`,
issueCard: 'カードを発行',
issueNewCard: {
whoNeedsCard: '誰がカードを必要としていますか?',
inviteNewMember: '新しいメンバーを招待',
findMember: 'メンバーを探す',
chooseCardType: 'カードタイプを選択',
physicalCard: '物理カード',
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5152,6 +5152,7 @@ ${amount} voor ${merchant} - ${date}`,
issueCard: 'Kaart uitgeven',
issueNewCard: {
whoNeedsCard: 'Wie heeft een kaart nodig?',
inviteNewMember: 'Nieuw lid uitnodigen',
findMember: 'Lid zoeken',
chooseCardType: 'Kies een kaarttype',
physicalCard: 'Fysieke kaart',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5142,6 +5142,7 @@ ${amount} dla ${merchant} - ${date}`,
issueCard: 'Wydaj kartę',
issueNewCard: {
whoNeedsCard: 'Kto potrzebuje karty?',
inviteNewMember: 'Zaproś nowego członka',
findMember: 'Znajdź członka',
chooseCardType: 'Wybierz typ karty',
physicalCard: 'Fizyczna karta',
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 @@ -5142,6 +5142,7 @@ ${amount} para ${merchant} - ${date}`,
issueCard: 'Emitir cartão',
issueNewCard: {
whoNeedsCard: 'Quem precisa de um cartão?',
inviteNewMember: 'Convide um novo membro',
findMember: 'Encontrar membro',
chooseCardType: 'Escolha um tipo de cartão',
physicalCard: 'Cartão físico',
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 @@ -5047,6 +5047,7 @@ ${merchant}的${amount} - ${date}`,
issueCard: '发卡',
issueNewCard: {
whoNeedsCard: '谁需要一张卡?',
inviteNewMember: '邀请新成员',
findMember: '查找成员',
chooseCardType: '选择卡类型',
physicalCard: '实体卡',
Expand Down
2 changes: 1 addition & 1 deletion src/libs/API/parameters/AddMembersToWorkspaceParams.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type AddMembersToWorkspaceParams = {
employees: string;
welcomeNote: string;
policyID: string;
policyID: string | undefined;
reportCreationData?: string;
announceChatReportID?: string;
announceCreatedReportActionID?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@
const parsedReportActionMessageCache: Record<string, string> = {};

let conciergeReportID: OnyxEntry<string>;
Onyx.connect({

Check warning on line 945 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.CONCIERGE_REPORT_ID,
callback: (value) => {
conciergeReportID = value;
Expand All @@ -950,7 +950,7 @@
});

const defaultAvatarBuildingIconTestID = 'SvgDefaultAvatarBuilding Icon';
Onyx.connect({

Check warning on line 953 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, val is undefined
Expand All @@ -968,7 +968,7 @@
let allPersonalDetails: OnyxEntry<PersonalDetailsList>;
let allPersonalDetailLogins: string[];
let currentUserPersonalDetails: OnyxEntry<PersonalDetails>;
Onyx.connect({

Check warning on line 971 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
if (currentUserAccountID) {
Expand All @@ -980,14 +980,14 @@
});

let allReportsDraft: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 983 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_DRAFT,
waitForCollectionCallback: true,
callback: (value) => (allReportsDraft = value),
});

let allPolicies: OnyxCollection<Policy>;
Onyx.connect({

Check warning on line 990 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => (allPolicies = value),
Expand All @@ -995,7 +995,7 @@

let allReports: OnyxCollection<Report>;
let reportsByPolicyID: ReportByPolicyMap;
Onyx.connect({

Check warning on line 998 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -1036,14 +1036,14 @@
});

let allBetas: OnyxEntry<Beta[]>;
Onyx.connect({

Check warning on line 1039 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.BETAS,
callback: (value) => (allBetas = value),
});

let allTransactions: OnyxCollection<Transaction> = {};
let reportsTransactions: Record<string, Transaction[]> = {};
Onyx.connect({

Check warning on line 1046 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -1069,7 +1069,7 @@
});

let allReportActions: OnyxCollection<ReportActions>;
Onyx.connect({

Check warning on line 1072 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand All @@ -1082,7 +1082,7 @@

let allReportMetadata: OnyxCollection<ReportMetadata>;
const allReportMetadataKeyValue: Record<string, ReportMetadata> = {};
Onyx.connect({

Check warning on line 1085 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_METADATA,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -8131,7 +8131,7 @@
};
}

function buildOptimisticAnnounceChat(policyID: string, accountIDs: number[]): OptimisticAnnounceChat {
function buildOptimisticAnnounceChat(policyID: string | undefined, accountIDs: number[]): OptimisticAnnounceChat {
const announceReport = getRoom(CONST.REPORT.CHAT_TYPE.POLICY_ANNOUNCE, policyID);
// This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850
// eslint-disable-next-line @typescript-eslint/no-deprecated
Expand Down Expand Up @@ -10152,7 +10152,7 @@
);
}

function getRoom(type: ValueOf<typeof CONST.REPORT.CHAT_TYPE>, policyID: string): OnyxEntry<Report> {
function getRoom(type: ValueOf<typeof CONST.REPORT.CHAT_TYPE>, policyID: string | undefined): OnyxEntry<Report> {
const room = Object.values(allReports ?? {}).find((report) => report?.policyID === policyID && report?.chatType === type && !isThread(report));
return room;
}
Expand Down
10 changes: 10 additions & 0 deletions src/libs/actions/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,15 @@ function setIssueNewCardStepAndData({data, isEditing, step, policyID, isChangeAs
});
}

function setDraftInviteAccountID(assigneeEmail: string | undefined, assigneeAccountID: number | undefined, policyID: string | undefined) {
if (!policyID) {
return;
}
Onyx.set(`${ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${policyID}`, {
[assigneeEmail ?? '']: assigneeAccountID,
});
}

function clearIssueNewCardFlow(policyID: string | undefined) {
Onyx.set(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {
currentStep: null,
Expand Down Expand Up @@ -1059,6 +1068,7 @@ export {
getCardDefaultName,
queueExpensifyCardForBilling,
clearIssueNewCardFormData,
setDraftInviteAccountID,
resolveFraudAlert,
};
export type {ReplacementReason};
8 changes: 4 additions & 4 deletions src/libs/actions/Policy/Member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function getPolicy(policyID: string | undefined): OnyxEntry<Policy> {
*/
function buildRoomMembersOnyxData(
roomType: typeof CONST.REPORT.CHAT_TYPE.POLICY_ANNOUNCE | typeof CONST.REPORT.CHAT_TYPE.POLICY_ADMINS,
policyID: string,
policyID: string | undefined,
accountIDs: number[],
): OnyxDataReturnType {
const report = ReportUtils.getRoom(roomType, policyID);
Expand Down Expand Up @@ -875,7 +875,7 @@ function clearWorkspaceOwnerChangeFlow(policyID: string | undefined) {

function buildAddMembersToWorkspaceOnyxData(
invitedEmailsToAccountIDs: InvitedEmailsToAccountIDs,
policyID: string,
policyID: string | undefined,
policyMemberAccountIDs: number[],
role: string,
formatPhoneNumber: LocaleContextProps['formatPhoneNumber'],
Expand Down Expand Up @@ -977,7 +977,7 @@ function buildAddMembersToWorkspaceOnyxData(
function addMembersToWorkspace(
invitedEmailsToAccountIDs: InvitedEmailsToAccountIDs,
welcomeNote: string,
policyID: string,
policyID: string | undefined,
policyMemberAccountIDs: number[],
role: string,
formatPhoneNumber: LocaleContextProps['formatPhoneNumber'],
Expand Down Expand Up @@ -1180,7 +1180,7 @@ function setWorkspaceInviteRoleDraft(policyID: string, role: ValueOf<typeof CONS
Onyx.set(`${ONYXKEYS.COLLECTION.WORKSPACE_INVITE_ROLE_DRAFT}${policyID}`, role);
}

function clearWorkspaceInviteRoleDraft(policyID: string) {
function clearWorkspaceInviteRoleDraft(policyID: string | undefined) {
Onyx.set(`${ONYXKEYS.COLLECTION.WORKSPACE_INVITE_ROLE_DRAFT}${policyID}`, null);
}

Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ function verifySetupIntentAndRequestPolicyOwnerChange(policyID: string) {
* @returns - object with onyxSuccessData, onyxOptimisticData, and optimisticReportIDs (map login to reportID)
*/
function createPolicyExpenseChats(
policyID: string,
policyID: string | undefined,
invitedEmailsToAccountIDs: InvitedEmailsToAccountIDs,
hasOutstandingChildRequest = false,
notificationPreference: NotificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
Expand Down Expand Up @@ -3358,7 +3358,7 @@ function updateMemberCustomField(policyID: string, login: string, customFieldTyp
API.write(WRITE_COMMANDS.UPDATE_POLICY_MEMBERS_CUSTOM_FIELDS, params, {optimisticData, successData, failureData});
}

function setWorkspaceInviteMessageDraft(policyID: string, message: string | null) {
function setWorkspaceInviteMessageDraft(policyID: string | undefined, message: string | null) {
Onyx.set(`${ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MESSAGE_DRAFT}${policyID}`, message);
}

Expand Down
Loading
Loading