Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9624ed2
allow admin to create report on behald of employee
s77rt Nov 25, 2025
2f31cbd
Merge branch 'main' into report-transaction-new-report
s77rt Nov 26, 2025
a2a4db8
lint
s77rt Nov 26, 2025
a8c2633
pass accountID to CreateAppReport
s77rt Nov 26, 2025
9123cb9
pass owner personal details on report creation
s77rt Nov 26, 2025
e390506
get owner from selected report
s77rt Nov 26, 2025
84983e5
allow editing unreported managed card transaction
s77rt Nov 27, 2025
23e156f
make changeTransactionsReport accept transactions
s77rt Nov 28, 2025
b790fdb
add transaction to SelectedTransactionInfo
s77rt Nov 29, 2025
1dcfb45
pass transactions to changeTransactionsReport
s77rt Nov 29, 2025
2b2077f
update CreateAppReportParams to use reportCreateEmail
s77rt Nov 29, 2025
1692887
lint
s77rt Nov 29, 2025
7dbb1be
merge main
s77rt Jan 13, 2026
7efe983
handle unreported expenses
s77rt Jan 13, 2026
8a12936
add comment
s77rt Jan 13, 2026
a5225d7
rename param reportCreatorEmail to ownerEmail
s77rt Jan 13, 2026
f49d612
rename variable
s77rt Jan 13, 2026
607b09d
lint
s77rt Jan 13, 2026
e1727f0
lint
s77rt Jan 13, 2026
0eb413b
lint
s77rt Jan 14, 2026
6ad170f
merge main
s77rt Jan 14, 2026
30e9927
remove transaction from SelectedTransactionInfo
s77rt Jan 14, 2026
ffc3100
Merge branch 'main' into report-transaction-new-report
s77rt Jan 14, 2026
f4aaced
more robust condition
s77rt Jan 14, 2026
260ea01
merge main
s77rt Jan 16, 2026
8f0b167
merge main
s77rt Jan 21, 2026
60ebd76
Merge branch 'main' into report-transaction-new-report
s77rt Jan 21, 2026
24b9b01
get transactions from SelectedTransactions object
s77rt Jan 21, 2026
1d3e080
lint
s77rt Jan 21, 2026
6659725
merge main
s77rt Jan 22, 2026
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
4 changes: 4 additions & 0 deletions src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ function mapTransactionItemToSelectedEntry(
return [
item.keyForList,
{
transaction: item,
isSelected: true,
canReject: canRejectRequest,
canHold: canHoldRequest,
Expand Down Expand Up @@ -157,6 +158,7 @@ function prepareTransactionsList(
return {
...selectedTransactions,
[item.keyForList]: {
transaction: item,
isSelected: true,
canReject: canRejectRequest,
canHold: canHoldRequest,
Expand Down Expand Up @@ -539,6 +541,7 @@ function Search({
const originalItemTransaction = searchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${itemTransaction?.comment?.originalTransactionID}`];

newTransactionList[transactionItem.transactionID] = {
transaction: transactionItem,
action: transactionItem.action,
canHold: canHoldRequest,
isHeld: isOnHold(transactionItem),
Expand Down Expand Up @@ -593,6 +596,7 @@ function Search({
const originalItemTransaction = searchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${itemTransaction?.comment?.originalTransactionID}`];

newTransactionList[transactionItem.transactionID] = {
transaction: transactionItem,
action: transactionItem.action,
canHold: canHoldRequest,
isHeld: isOnHold(transactionItem),
Expand Down
5 changes: 4 additions & 1 deletion src/components/Search/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import type {PaymentMethod} from '@components/KYCWall/types';
import type {ReportActionListItemType, TaskListItemType, TransactionGroupListItemType, TransactionListItemType} from '@components/SelectionListWithSections/types';
import type {SearchKey} from '@libs/SearchUIUtils';
import type CONST from '@src/CONST';
import type {ReportAction, SearchResults} from '@src/types/onyx';
import type {ReportAction, SearchResults, Transaction} from '@src/types/onyx';
import type {SearchDataTypes} from '@src/types/onyx/SearchResults';
import type IconAsset from '@src/types/utils/IconAsset';

/** Model of the selected transaction */
type SelectedTransactionInfo = {
/** The transaction itself */
transaction: Transaction;

/** Whether the transaction is selected */
isSelected: boolean;

Expand Down
1 change: 1 addition & 0 deletions src/libs/API/parameters/CreateAppReportParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ type CreateAppReportParams = {
reportID: string;
reportActionID: string;
reportPreviewReportActionID: string;
ownerEmail?: string;
shouldDismissEmptyReportsConfirmation?: boolean;
};
export default CreateAppReportParams;
6 changes: 6 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ import {
isDistanceRequest,
isExpensifyCardTransaction,
isFetchingWaypointsFromServer,
isManagedCardTransaction,
isManualDistanceRequest as isManualDistanceRequestTransactionUtils,
isMapDistanceRequest,
isOnHold as isOnHoldTransactionUtils,
Expand Down Expand Up @@ -4553,6 +4554,11 @@ function canEditMoneyRequest(
return false;
}

// Domain admins can report unreported managed card transactions
if (transaction.reportID === CONST.REPORT.UNREPORTED_REPORT_ID && isManagedCardTransaction(transaction)) {
return true;
Comment on lines +4557 to +4559

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add admin check before allowing edits on managed cards

This early return grants edit permission for any unreported managed card transaction without verifying the current user is a policy admin or manager. That bypasses all of the existing role checks below, so any user who can see an unreported managed card transaction would be allowed to edit it, which contradicts the comment and widens access. Consider gating this on policy admin/manager status (or reuse existing permission helpers) before returning true.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the domain admin would have higher access than a policy admin, so the current code change seems correct.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s77rt Should we restrict report creation to only admins or owners? Currently this still works fine since transactions are only visible to the report's admin and owner.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is fine. As you pointed out, unreported transactions won't show up unless you can act on them. Also I don't have a solution in mind to check for domain admin.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you pointed out, unreported transactions won't show up unless you can act on them

I'm not 100% confident this is correct, so I'm a bit worried it might introduce fragile code. @luacmartins could you give your thoughts on this matter?

}
Comment thread
s77rt marked this conversation as resolved.

const moneyRequestReportID = originalMessage?.IOUReportID;
const isRequestor = currentUserAccountID === reportAction?.actorAccountID;

Expand Down
13 changes: 7 additions & 6 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
/** @deprecated This value is deprecated and will be removed soon after migration. Use the email from useCurrentUserPersonalDetails hook instead. */
let deprecatedCurrentUserLogin: string | undefined;

Onyx.connect({

Check warning on line 286 in src/libs/actions/Report.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 @@ -297,7 +297,7 @@
},
});

Onyx.connect({

Check warning on line 300 in src/libs/actions/Report.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 @@ -305,7 +305,7 @@
// map of reportID to all reportActions for that report
const allReportActions: OnyxCollection<ReportActions> = {};

Onyx.connect({

Check warning on line 308 in src/libs/actions/Report.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,
callback: (actions, key) => {
if (!key || !actions) {
Expand All @@ -317,7 +317,7 @@
});

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

Check warning on line 320 in src/libs/actions/Report.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 All @@ -326,7 +326,7 @@
});

let allPersonalDetails: OnyxEntry<PersonalDetailsList> = {};
Onyx.connect({

Check warning on line 329 in src/libs/actions/Report.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) => {
allPersonalDetails = value ?? {};
Expand All @@ -341,7 +341,7 @@
});

let onboarding: OnyxEntry<Onboarding>;
Onyx.connect({

Check warning on line 344 in src/libs/actions/Report.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.NVP_ONBOARDING,
callback: (val) => {
if (Array.isArray(val)) {
Expand All @@ -352,13 +352,13 @@
});

let introSelected: OnyxEntry<IntroSelected> = {};
Onyx.connect({

Check warning on line 355 in src/libs/actions/Report.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.NVP_INTRO_SELECTED,
callback: (val) => (introSelected = val),
});

let allReportDraftComments: Record<string, string | undefined> = {};
Onyx.connect({

Check warning on line 361 in src/libs/actions/Report.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_COMMENT,
waitForCollectionCallback: true,
callback: (value) => (allReportDraftComments = value),
Expand Down Expand Up @@ -2878,12 +2878,12 @@
policy: OnyxEntry<Policy>,
reportID: string,
reportActionID: string,
creatorPersonalDetails: CurrentUserPersonalDetails,
ownerPersonalDetails: CurrentUserPersonalDetails,
reportPreviewReportActionID: string,
hasViolationsParam: boolean,
isASAPSubmitBetaEnabled: boolean,
) {
const {accountID, login, email} = creatorPersonalDetails;
const {accountID, login, email} = ownerPersonalDetails;
const timeOfCreation = DateUtils.getDBTime();
const parentReport = getPolicyExpenseChat(accountID, policy?.id);
const optimisticReportData = buildOptimisticEmptyReport(reportID, accountID, parentReport, reportPreviewReportActionID, policy, timeOfCreation);
Expand Down Expand Up @@ -2935,7 +2935,7 @@
shouldShow: true,
childOwnerAccountID: accountID,
automatic: false,
avatar: creatorPersonalDetails.avatar,
avatar: ownerPersonalDetails.avatar,
isAttachmentOnly: false,
reportActionID: reportPreviewReportActionID,
message: createReportActionMessage,
Expand Down Expand Up @@ -3106,7 +3106,7 @@
}

function createNewReport(
creatorPersonalDetails: CurrentUserPersonalDetails,
ownerPersonalDetails: CurrentUserPersonalDetails,
hasViolationsParam: boolean,
isASAPSubmitBetaEnabled: boolean,
policy: OnyxEntry<Policy>,
Expand All @@ -3121,7 +3121,7 @@
policy,
optimisticReportID,
reportActionID,
creatorPersonalDetails,
ownerPersonalDetails,
reportPreviewReportActionID,
hasViolationsParam,
isASAPSubmitBetaEnabled,
Expand All @@ -3139,12 +3139,13 @@
reportID: optimisticReportID,
reportActionID,
reportPreviewReportActionID,
ownerEmail: ownerPersonalDetails.login,
...(shouldDismissEmptyReportsConfirmation ? {shouldDismissEmptyReportsConfirmation} : {}),
},
{optimisticData, successData, failureData},
);
if (shouldNotifyNewAction) {
notifyNewAction(parentReportID, creatorPersonalDetails.accountID, reportPreviewAction);
notifyNewAction(parentReportID, ownerPersonalDetails.accountID, reportPreviewAction);
}

return optimisticReportData;
Expand Down
32 changes: 22 additions & 10 deletions src/pages/Search/SearchTransactionsChangeReport.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, {useMemo} from 'react';
import {InteractionManager} from 'react-native';
import {useSession} from '@components/OnyxListItemProvider';
import type {OnyxCollection} from 'react-native-onyx';
import {usePersonalDetails, useSession} from '@components/OnyxListItemProvider';
import {useSearchContext} from '@components/Search/SearchContext';
import type {ListItem} from '@components/SelectionListWithSections/types';
import useConditionalCreateEmptyReportConfirmation from '@hooks/useConditionalCreateEmptyReportConfirmation';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useHasPerDiemTransactions from '@hooks/useHasPerDiemTransactions';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
Expand All @@ -13,12 +13,13 @@ import {createNewReport} from '@libs/actions/Report';
import {changeTransactionsReport} from '@libs/actions/Transaction';
import setNavigationActionToMicrotaskQueue from '@libs/Navigation/helpers/setNavigationActionToMicrotaskQueue';
import Navigation from '@libs/Navigation/Navigation';
import {getReportOrDraftReport, hasViolations as hasViolationsReportUtils} from '@libs/ReportUtils';
import {getPersonalDetailsForAccountID, getReportOrDraftReport, hasViolations as hasViolationsReportUtils} from '@libs/ReportUtils';
import {shouldRestrictUserBillableActions} from '@libs/SubscriptionUtils';
import IOURequestEditReportCommon from '@pages/iou/request/step/IOURequestEditReportCommon';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {PersonalDetails, Transaction} from '@src/types/onyx';

type TransactionGroupListItem = ListItem & {
/** reportID of the report */
Expand All @@ -28,19 +29,30 @@ type TransactionGroupListItem = ListItem & {
function SearchTransactionsChangeReport() {
const {selectedTransactions, clearSelectedTransactions} = useSearchContext();
const selectedTransactionsKeys = useMemo(() => Object.keys(selectedTransactions), [selectedTransactions]);
const transactions = useMemo(
() =>
Object.values(selectedTransactions).reduce(
(transactionsCollection, transactionItem) => {
// eslint-disable-next-line no-param-reassign
transactionsCollection[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionItem.transaction.transactionID}`] = transactionItem.transaction;
return transactionsCollection;
},
{} as NonNullable<OnyxCollection<Transaction>>,
),
[selectedTransactions],
);
const [allReportNextSteps] = useOnyx(ONYXKEYS.COLLECTION.NEXT_STEP, {canBeMissing: true});
const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: false});
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: true});
const [allPolicyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}`, {canBeMissing: true});
const hasPerDiemTransactions = useHasPerDiemTransactions(selectedTransactionsKeys);
const {policyForMovingExpensesID, shouldSelectPolicy} = usePolicyForMovingExpenses(hasPerDiemTransactions);
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: true});
const [allTransactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: true});
const {isBetaEnabled} = usePermissions();
const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT);
const session = useSession();
const personalDetails = usePersonalDetails();
const hasViolations = hasViolationsReportUtils(undefined, transactionViolations, session?.accountID ?? CONST.DEFAULT_NUMBER_ID, session?.email ?? '');
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const policyForMovingExpenses = policyForMovingExpensesID ? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyForMovingExpensesID}`] : undefined;
const firstTransactionKey = selectedTransactionsKeys.at(0);
const firstTransactionReportID = firstTransactionKey ? selectedTransactions[firstTransactionKey]?.reportID : undefined;
Expand Down Expand Up @@ -72,9 +84,9 @@ function SearchTransactionsChangeReport() {
const report = getReportOrDraftReport(reportIDWithOwner);
return report?.ownerAccountID;
}, [selectedTransactions, selectedTransactionsKeys]);

const targetOwnerPersonalDetails = useMemo(() => getPersonalDetailsForAccountID(targetOwnerAccountID, personalDetails) as PersonalDetails, [personalDetails, targetOwnerAccountID]);
const createReportForPolicy = (shouldDismissEmptyReportsConfirmation?: boolean) => {
const optimisticReport = createNewReport(currentUserPersonalDetails, hasViolations, isASAPSubmitBetaEnabled, policyForMovingExpenses, false, shouldDismissEmptyReportsConfirmation);
const optimisticReport = createNewReport(targetOwnerPersonalDetails, hasViolations, isASAPSubmitBetaEnabled, policyForMovingExpenses, false, shouldDismissEmptyReportsConfirmation);
const reportNextStep = allReportNextSteps?.[`${ONYXKEYS.COLLECTION.NEXT_STEP}${optimisticReport.reportID}`];
setNavigationActionToMicrotaskQueue(() => {
changeTransactionsReport({
Expand All @@ -86,7 +98,7 @@ function SearchTransactionsChangeReport() {
policy: policyForMovingExpenses,
reportNextStep,
policyCategories: allPolicyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyForMovingExpensesID}`],
allTransactions,
allTransactions: transactions,
});
clearSelectedTransactions();
});
Expand Down Expand Up @@ -128,7 +140,7 @@ function SearchTransactionsChangeReport() {
policy: allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${item.policyID}`],
reportNextStep,
policyCategories: allPolicyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${item.policyID}`],
allTransactions,
allTransactions: transactions,
});
// eslint-disable-next-line @typescript-eslint/no-deprecated
InteractionManager.runAfterInteractions(() => {
Expand All @@ -147,7 +159,7 @@ function SearchTransactionsChangeReport() {
isASAPSubmitBetaEnabled,
accountID: session?.accountID ?? CONST.DEFAULT_NUMBER_ID,
email: session?.email ?? '',
allTransactions,
allTransactions: transactions,
});
clearSelectedTransactions();
Navigation.goBack();
Expand Down
17 changes: 10 additions & 7 deletions src/pages/iou/request/step/IOURequestEditReport.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react';
import React, {useMemo} from 'react';
import type {OnyxEntry} from 'react-native-onyx';
import {useSession} from '@components/OnyxListItemProvider';
import {usePersonalDetails, useSession} from '@components/OnyxListItemProvider';
import {useSearchContext} from '@components/Search/SearchContext';
import type {ListItem} from '@components/SelectionListWithSections/types';
import useConditionalCreateEmptyReportConfirmation from '@hooks/useConditionalCreateEmptyReportConfirmation';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useHasPerDiemTransactions from '@hooks/useHasPerDiemTransactions';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
Expand All @@ -13,14 +12,14 @@ import {turnOffMobileSelectionMode} from '@libs/actions/MobileSelectionMode';
import {changeTransactionsReport} from '@libs/actions/Transaction';
import setNavigationActionToMicrotaskQueue from '@libs/Navigation/helpers/setNavigationActionToMicrotaskQueue';
import Navigation from '@libs/Navigation/Navigation';
import {hasViolations as hasViolationsReportUtils} from '@libs/ReportUtils';
import {getPersonalDetailsForAccountID, hasViolations as hasViolationsReportUtils} from '@libs/ReportUtils';
import {shouldRestrictUserBillableActions} from '@libs/SubscriptionUtils';
import {createNewReport} from '@userActions/Report';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import type {Report} from '@src/types/onyx';
import type {PersonalDetails, Report} from '@src/types/onyx';
import IOURequestEditReportCommon from './IOURequestEditReportCommon';
import withWritableReportOrNotFound from './withWritableReportOrNotFound';
import type {WithWritableReportOrNotFoundProps} from './withWritableReportOrNotFound';
Expand All @@ -44,7 +43,11 @@ function IOURequestEditReport({route}: IOURequestEditReportProps) {
const session = useSession();
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: true});
const [allPolicyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}`, {canBeMissing: true});
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const personalDetails = usePersonalDetails();
const ownerPersonalDetails = useMemo(
() => getPersonalDetailsForAccountID(selectedReport?.ownerAccountID, personalDetails) as PersonalDetails,
[personalDetails, selectedReport?.ownerAccountID],
);
const selectedReportPolicy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${selectedReport?.policyID}`];

const hasPerDiemTransactions = useHasPerDiemTransactions(selectedTransactionIDs);
Expand Down Expand Up @@ -106,7 +109,7 @@ function IOURequestEditReport({route}: IOURequestEditReportProps) {
}

const policyForNewReport = hasPerDiemTransactions ? selectedReportPolicy : policyForMovingExpenses;
const optimisticReport = createNewReport(currentUserPersonalDetails, hasViolations, isASAPSubmitBetaEnabled, policyForNewReport, false, shouldDismissEmptyReportsConfirmation);
const optimisticReport = createNewReport(ownerPersonalDetails, hasViolations, isASAPSubmitBetaEnabled, policyForNewReport, false, shouldDismissEmptyReportsConfirmation);
selectReport({value: optimisticReport.reportID}, optimisticReport);
};

Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/request/step/IOURequestEditReportCommon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function IOURequestEditReportCommon({
const headerMessage = useMemo(() => (searchValue && !reportOptions.length ? translate('common.noResultsFound') : ''), [searchValue, reportOptions.length, translate]);

const createReportOption = useMemo(() => {
if (!createReport || (isEditing && !isOwner)) {
if (!createReport) {
return undefined;
}

Expand All @@ -230,7 +230,7 @@ function IOURequestEditReportCommon({
icon={icons.Document}
/>
);
}, [icons.Document, createReport, isEditing, isOwner, translate, policyForMovingExpenses?.name, handleCreateReport]);
}, [icons.Document, createReport, translate, policyForMovingExpenses?.name, handleCreateReport]);

// eslint-disable-next-line rulesdir/no-negated-variables
const shouldShowNotFoundPage = useMemo(() => {
Expand Down
Loading
Loading