Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 2 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3315,7 +3315,6 @@ 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 @@ -3361,7 +3360,6 @@ const CONST = {
LIMIT: 'Limit',
CARD_NAME: 'CardName',
CONFIRMATION: 'Confirmation',
INVITE_NEW_MEMBER: 'InviteNewMember',
},
CARD_TYPE: {
PHYSICAL: 'physical',
Expand Down
10 changes: 2 additions & 8 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1295,14 +1295,8 @@ const ROUTES = {
WORKSPACE_INVITE_MESSAGE_ROLE: {
route: 'workspaces/:policyID/invite-message/role',

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);
},
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
getRoute: (policyID: string, backTo?: string) => `${getUrlWithBackToParam(`workspaces/${policyID}/invite-message/role`, backTo)}` as const,
},
WORKSPACE_OVERVIEW: {
route: 'workspaces/:policyID/overview',
Expand Down
7 changes: 0 additions & 7 deletions src/components/InteractiveStepWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ 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 @@ -79,7 +74,6 @@ function InteractiveStepWrapper(
offlineIndicatorStyle,
shouldKeyboardOffsetBottomSafeAreaPadding,
enableEdgeToEdgeBottomSafeAreaPadding,
onEntryTransitionEnd,
}: InteractiveStepWrapperProps,
ref: React.ForwardedRef<View>,
) {
Expand All @@ -97,7 +91,6 @@ function InteractiveStepWrapper(
shouldShowOfflineIndicatorInWideScreen={shouldShowOfflineIndicatorInWideScreen}
offlineIndicatorStyle={offlineIndicatorStyle}
shouldKeyboardOffsetBottomSafeAreaPadding={shouldKeyboardOffsetBottomSafeAreaPadding}
onEntryTransitionEnd={onEntryTransitionEnd}
>
<HeaderWithBackButton
title={headerTitle}
Expand Down
1 change: 0 additions & 1 deletion src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5149,7 +5149,6 @@ ${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: 0 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5117,7 +5117,6 @@ 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: 0 additions & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5380,7 +5380,6 @@ ${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: 0 additions & 1 deletion src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5155,7 +5155,6 @@ ${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: 0 additions & 1 deletion src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5160,7 +5160,6 @@ ${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: 0 additions & 1 deletion src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5117,7 +5117,6 @@ ${date} - ${merchant}に${amount}`,
issueCard: 'カードを発行',
issueNewCard: {
whoNeedsCard: '誰がカードを必要としていますか?',
inviteNewMember: '新しいメンバーを招待',
findMember: 'メンバーを探す',
chooseCardType: 'カードタイプを選択',
physicalCard: '物理カード',
Expand Down
1 change: 0 additions & 1 deletion src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5154,7 +5154,6 @@ ${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: 0 additions & 1 deletion src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5144,7 +5144,6 @@ ${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: 0 additions & 1 deletion src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5144,7 +5144,6 @@ ${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: 0 additions & 1 deletion src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5049,7 +5049,6 @@ ${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 | undefined;
policyID: string;
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 @@ -907,7 +907,7 @@
returnEmptyIfNotFound?: boolean;
policy?: OnyxInputOrEntry<Policy> | SearchPolicy;
policies?: SearchPolicy[];
reports?: SearchReport[];

Check failure on line 910 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

`SearchReport` is deprecated. - Use Report instead
};

type GetReportNameParams = {
Expand All @@ -917,7 +917,7 @@
personalDetails?: Partial<PersonalDetailsList>;
invoiceReceiverPolicy?: OnyxEntry<Policy> | SearchPolicy;
transactions?: SearchTransaction[];
reports?: SearchReport[];

Check failure on line 920 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

`SearchReport` is deprecated. - Use Report instead
policies?: SearchPolicy[];
isReportArchived?: boolean;
};
Expand All @@ -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 @@ -1200,7 +1200,7 @@
/**
* Get the report or draft report given a reportID
*/
function getReportOrDraftReport(reportID: string | undefined, searchReports?: SearchReport[], fallbackReport?: Report): OnyxEntry<Report> | SearchReport {

Check failure on line 1203 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

`SearchReport` is deprecated. - Use Report instead

Check failure on line 1203 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

`SearchReport` is deprecated. - Use Report instead
const searchReport = searchReports?.find((report) => report.reportID === reportID);
const onyxReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
return searchReport ?? onyxReport ?? allReportsDraft?.[`${ONYXKEYS.COLLECTION.REPORT_DRAFT}${reportID}`] ?? fallbackReport;
Expand Down Expand Up @@ -1234,7 +1234,7 @@
/**
* @private
*/
function isSearchReportArray(object: SearchReport[] | OnyxCollection<Report>): object is SearchReport[] {

Check failure on line 1237 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

`SearchReport` is deprecated. - Use Report instead

Check failure on line 1237 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

`SearchReport` is deprecated. - Use Report instead
if (!Array.isArray(object)) {
return false;
}
Expand All @@ -1246,7 +1246,7 @@
* @private
* Returns the report
*/
function getReport(reportID: string, reports: SearchReport[] | OnyxCollection<Report>): OnyxEntry<Report> | SearchReport {

Check failure on line 1249 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

`SearchReport` is deprecated. - Use Report instead

Check failure on line 1249 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

`SearchReport` is deprecated. - Use Report instead
if (isSearchReportArray(reports)) {
reports?.find((report) => report.reportID === reportID);
} else {
Expand Down Expand Up @@ -1275,7 +1275,7 @@
visitedReportIDs = new Set<string>(),
}: {
report: OnyxEntry<Report>;
reports?: SearchReport[];

Check failure on line 1278 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

`SearchReport` is deprecated. - Use Report instead
visitedReportIDs?: Set<string>;
}): OnyxEntry<Report> {
if (!report) {
Expand Down Expand Up @@ -1363,7 +1363,7 @@
return report?.type === CONST.REPORT.TYPE.CHAT;
}

function isInvoiceReport(reportOrID: OnyxInputOrEntry<Report> | SearchReport | string): boolean {

Check failure on line 1366 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

`SearchReport` is deprecated. - Use Report instead
const report = typeof reportOrID === 'string' ? (getReport(reportOrID, allReports) ?? null) : reportOrID;
return report?.type === CONST.REPORT.TYPE.INVOICE;
}
Expand Down Expand Up @@ -8131,7 +8131,7 @@
};
}

function buildOptimisticAnnounceChat(policyID: string | undefined, accountIDs: number[]): OptimisticAnnounceChat {
function buildOptimisticAnnounceChat(policyID: string, 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 | undefined): OnyxEntry<Report> {
function getRoom(type: ValueOf<typeof CONST.REPORT.CHAT_TYPE>, policyID: string): OnyxEntry<Report> {
const room = Object.values(allReports ?? {}).find((report) => report?.policyID === policyID && report?.chatType === type && !isThread(report));
return room;
}
Expand Down
10 changes: 0 additions & 10 deletions src/libs/actions/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,6 @@ 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 @@ -1068,7 +1059,6 @@ 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 | undefined,
policyID: string,
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 | undefined,
policyID: string,
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 | undefined,
policyID: string,
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 | undefined) {
function clearWorkspaceInviteRoleDraft(policyID: string) {
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 | undefined,
policyID: string,
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 | undefined, message: string | null) {
function setWorkspaceInviteMessageDraft(policyID: string, message: string | null) {
Onyx.set(`${ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MESSAGE_DRAFT}${policyID}`, message);
}

Expand Down
Loading
Loading