From 53a9399d6289bf426711db65e922e15a06f6bdfb Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Wed, 19 Jun 2024 20:08:55 +0200
Subject: [PATCH 01/21] remove three dot menu from affected pages
---
src/components/MoneyReportHeader.tsx | 21 ---------------
src/components/MoneyRequestHeader.tsx | 33 ------------------------
src/pages/home/HeaderView.tsx | 37 ---------------------------
3 files changed, 91 deletions(-)
diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx
index 90952157f179..10765fcf9d83 100644
--- a/src/components/MoneyReportHeader.tsx
+++ b/src/components/MoneyReportHeader.tsx
@@ -178,24 +178,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
[chatReport?.isOwnPolicyExpenseChat, policy?.harvesting?.enabled],
);
- const threeDotsMenuItems = [HeaderUtils.getPinMenuItem(moneyRequestReport)];
- if (isPayer && isSettled && ReportUtils.isExpenseReport(moneyRequestReport)) {
- threeDotsMenuItems.push({
- icon: Expensicons.Trashcan,
- text: translate('iou.cancelPayment'),
- onSelected: () => setIsConfirmModalVisible(true),
- });
- }
-
- // If the report supports adding transactions to it, then it also supports deleting transactions from it.
- if (canDeleteRequest && !isEmptyObject(transactionThreadReport)) {
- threeDotsMenuItems.push({
- icon: Expensicons.Trashcan,
- text: translate('reportActionContextMenu.deleteAction', {action: requestParentReportAction}),
- onSelected: () => setIsDeleteRequestModalVisible(true),
- });
- }
-
useEffect(() => {
if (canDeleteRequest) {
return;
@@ -216,9 +198,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
onBackButtonPress={onBackButtonPress}
// Shows border if no buttons or next steps are showing below the header
shouldShowBorderBottom={!isMoreContentShown && !allHavePendingRTERViolation}
- shouldShowThreeDotsButton
- threeDotsMenuItems={threeDotsMenuItems}
- threeDotsAnchorPosition={styles.threeDotsPopoverOffsetNoCloseButton(windowWidth)}
>
{shouldShowSettlementButton && !shouldUseNarrowLayout && (
diff --git a/src/components/MoneyRequestHeader.tsx b/src/components/MoneyRequestHeader.tsx
index f14fe11f5d74..a32e11e92ff5 100644
--- a/src/components/MoneyRequestHeader.tsx
+++ b/src/components/MoneyRequestHeader.tsx
@@ -153,28 +153,6 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
setIsDeleteModalVisible(false);
}, [canDeleteRequest]);
- const threeDotsMenuItems = [HeaderUtils.getPinMenuItem(report)];
- if (canHoldOrUnholdRequest) {
- const isRequestIOU = parentReport?.type === 'iou';
- const isHoldCreator = ReportUtils.isHoldCreator(transaction, report?.reportID) && isRequestIOU;
- const isTrackExpenseReport = ReportUtils.isTrackExpenseReport(report);
- const canModifyStatus = !isTrackExpenseReport && (isPolicyAdmin || isActionOwner || isApprover);
- if (isOnHold && !isDuplicate && (isHoldCreator || (!isRequestIOU && canModifyStatus))) {
- threeDotsMenuItems.push({
- icon: Expensicons.Stopwatch,
- text: translate('iou.unholdExpense'),
- onSelected: () => changeMoneyRequestStatus(),
- });
- }
- if (!isOnHold && (isRequestIOU || canModifyStatus) && !isScanning) {
- threeDotsMenuItems.push({
- icon: Expensicons.Stopwatch,
- text: translate('iou.hold'),
- onSelected: () => changeMoneyRequestStatus(),
- });
- }
- }
-
useEffect(() => {
if (isLoadingHoldUseExplained) {
return;
@@ -200,14 +178,6 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
IOU.dismissHoldUseExplanation();
};
- if (canDeleteRequest) {
- threeDotsMenuItems.push({
- icon: Expensicons.Trashcan,
- text: translate('reportActionContextMenu.deleteAction', {action: parentReportAction}),
- onSelected: () => setIsDeleteModalVisible(true),
- });
- }
-
return (
<>
@@ -216,9 +186,6 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
shouldShowReportAvatarWithDisplay
shouldEnableDetailPageNavigation
shouldShowPinButton={false}
- shouldShowThreeDotsButton
- threeDotsMenuItems={threeDotsMenuItems}
- threeDotsAnchorPosition={styles.threeDotsPopoverOffsetNoCloseButton(windowWidth)}
report={{
...report,
ownerAccountID: parentReport?.ownerAccountID,
diff --git a/src/pages/home/HeaderView.tsx b/src/pages/home/HeaderView.tsx
index 699fbab345cb..ff6a7263f206 100644
--- a/src/pages/home/HeaderView.tsx
+++ b/src/pages/home/HeaderView.tsx
@@ -129,45 +129,10 @@ function HeaderView({
// We hide the button when we are chatting with an automated Expensify account since it's not possible to contact
// these users via alternative means. It is possible to request a call with Concierge so we leave the option for them.
const threeDotMenuItems: ThreeDotsMenuItem[] = [];
- if (isTaskReport && !isCanceledTaskReport) {
- const canModifyTask = Task.canModifyTask(report, session?.accountID ?? -1);
-
- // Task is marked as completed
- if (ReportUtils.isCompletedTaskReport(report) && canModifyTask) {
- threeDotMenuItems.push({
- icon: Expensicons.Checkmark,
- text: translate('task.markAsIncomplete'),
- onSelected: Session.checkIfActionIsAllowed(() => Task.reopenTask(report)),
- });
- }
-
- // Task is not closed
- if (ReportUtils.canWriteInReport(report) && report.stateNum !== CONST.REPORT.STATE_NUM.APPROVED && !ReportUtils.isClosedReport(report) && canModifyTask) {
- threeDotMenuItems.push({
- icon: Expensicons.Trashcan,
- text: translate('common.delete'),
- onSelected: Session.checkIfActionIsAllowed(() => setIsDeleteTaskConfirmModalVisible(true)),
- });
- }
- }
const join = Session.checkIfActionIsAllowed(() => Report.joinRoom(report));
const canJoin = ReportUtils.canJoinChat(report, parentReportAction, policy);
- if (canJoin) {
- threeDotMenuItems.push({
- icon: Expensicons.ChatBubbles,
- text: translate('common.join'),
- onSelected: join,
- });
- } else if (ReportUtils.canLeaveChat(report, policy)) {
- const isWorkspaceMemberLeavingWorkspaceRoom = !isChatThread && (report.visibility === CONST.REPORT.VISIBILITY.RESTRICTED || isPolicyExpenseChat) && isPolicyEmployee;
- threeDotMenuItems.push({
- icon: Expensicons.ChatBubbles,
- text: translate('common.leave'),
- onSelected: Session.checkIfActionIsAllowed(() => Report.leaveRoom(reportID, isWorkspaceMemberLeavingWorkspaceRoom)),
- });
- }
const joinButton = (
({
- guideCalendarLink: {
- key: ONYXKEYS.ACCOUNT,
- selector: (account) => account?.guideCalendarLink,
- },
parentReport: {
key: ({report}) => `${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID ?? report?.reportID}`,
},
@@ -354,4 +317,4 @@ export default memo(
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
},
})(HeaderView),
-);
+);
\ No newline at end of file
From 55711a5db2e8e18985786b277417cae95d7a89e1 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Mon, 1 Jul 2024 14:03:05 +0200
Subject: [PATCH 06/21] fix HeaderView prettier
---
src/pages/home/HeaderView.tsx | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/src/pages/home/HeaderView.tsx b/src/pages/home/HeaderView.tsx
index b3423ba6dd50..db4aed6afe82 100644
--- a/src/pages/home/HeaderView.tsx
+++ b/src/pages/home/HeaderView.tsx
@@ -60,16 +60,7 @@ type HeaderViewProps = HeaderViewOnyxProps & {
shouldUseNarrowLayout?: boolean;
};
-function HeaderView({
- report,
- personalDetails,
- parentReport,
- parentReportAction,
- policy,
- reportID,
- onNavigationMenuButtonClicked,
- shouldUseNarrowLayout = false,
-}: HeaderViewProps) {
+function HeaderView({report, personalDetails, parentReport, parentReportAction, policy, reportID, onNavigationMenuButtonClicked, shouldUseNarrowLayout = false}: HeaderViewProps) {
const [isDeleteTaskConfirmModalVisible, setIsDeleteTaskConfirmModalVisible] = React.useState(false);
const {translate} = useLocalize();
const theme = useTheme();
@@ -317,4 +308,4 @@ export default memo(
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
},
})(HeaderView),
-);
\ No newline at end of file
+);
From 93f1f4c74623858e233dda0d678d92fd55a8afc0 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Mon, 1 Jul 2024 14:20:28 +0200
Subject: [PATCH 07/21] remove code from MoneyReportHeader
---
src/components/MoneyReportHeader.tsx | 70 +---------------------------
1 file changed, 1 insertion(+), 69 deletions(-)
diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx
index ebc43835aaca..d834d52a6883 100644
--- a/src/components/MoneyReportHeader.tsx
+++ b/src/components/MoneyReportHeader.tsx
@@ -8,7 +8,6 @@ import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import * as CurrencyUtils from '@libs/CurrencyUtils';
-import * as HeaderUtils from '@libs/HeaderUtils';
import Navigation from '@libs/Navigation/Navigation';
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
import * as ReportUtils from '@libs/ReportUtils';
@@ -22,7 +21,6 @@ import ROUTES from '@src/ROUTES';
import type {Route} from '@src/ROUTES';
import type * as OnyxTypes from '@src/types/onyx';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';
-import {isEmptyObject} from '@src/types/utils/EmptyObject';
import type IconAsset from '@src/types/utils/IconAsset';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
import Button from './Button';
@@ -88,25 +86,18 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
const {isOffline} = useNetwork();
const {isSmallScreenWidth, windowWidth} = useWindowDimensions();
const {reimbursableSpend} = ReportUtils.getMoneyRequestSpendBreakdown(moneyRequestReport);
- const isSettled = ReportUtils.isSettled(moneyRequestReport.reportID);
- const isApproved = ReportUtils.isReportApproved(moneyRequestReport);
const isOnHold = TransactionUtils.isOnHold(transaction);
- const isScanning = TransactionUtils.hasReceipt(transaction) && TransactionUtils.isReceiptBeingScanned(transaction);
const isDeletedParentAction = !!requestParentReportAction && ReportActionsUtils.isDeletedAction(requestParentReportAction);
- const canHoldOrUnholdRequest = !isEmptyObject(transaction) && !isSettled && !isApproved && !isDeletedParentAction;
// Only the requestor can delete the request, admins can only edit it.
const isActionOwner =
typeof requestParentReportAction?.actorAccountID === 'number' && typeof session?.accountID === 'number' && requestParentReportAction.actorAccountID === session?.accountID;
const canDeleteRequest = isActionOwner && ReportUtils.canAddOrDeleteTransactions(moneyRequestReport) && !isDeletedParentAction;
- const isPolicyAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
- const isApprover = ReportUtils.isMoneyRequestReport(moneyRequestReport) && moneyRequestReport?.managerID !== null && session?.accountID === moneyRequestReport?.managerID;
const [isHoldMenuVisible, setIsHoldMenuVisible] = useState(false);
const [paymentType, setPaymentType] = useState();
const [requestType, setRequestType] = useState();
const canAllowSettlement = ReportUtils.hasUpdatedTotal(moneyRequestReport, policy);
const policyType = policy?.type;
- const isPayer = ReportUtils.isPayer(session, moneyRequestReport);
const isDraft = ReportUtils.isOpenExpenseReport(moneyRequestReport);
const [isConfirmModalVisible, setIsConfirmModalVisible] = useState(false);
@@ -197,22 +188,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
TransactionActions.markAsCash(iouTransactionID, reportID);
}, [requestParentReportAction, transactionThreadReport?.reportID]);
- const changeMoneyRequestStatus = () => {
- if (!transactionThreadReport) {
- return;
- }
- const iouTransactionID = ReportActionsUtils.isMoneyRequestAction(requestParentReportAction)
- ? ReportActionsUtils.getOriginalMessage(requestParentReportAction)?.IOUTransactionID ?? '-1'
- : '-1';
-
- if (isOnHold) {
- IOU.unholdRequest(iouTransactionID, transactionThreadReport.reportID);
- } else {
- const activeRoute = encodeURIComponent(Navigation.getActiveRouteWithoutParams());
- Navigation.navigate(ROUTES.MONEY_REQUEST_HOLD_REASON.getRoute(policy?.type ?? CONST.POLICY.TYPE.PERSONAL, iouTransactionID, transactionThreadReport.reportID, activeRoute));
- }
- };
-
const getStatusIcon: (src: IconAsset) => React.ReactNode = (src) => (
changeMoneyRequestStatus(),
- });
- }
- if (!isOnHold && (isRequestIOU || canModifyStatus) && !isScanning && !isInvoiceReport) {
- threeDotsMenuItems.push({
- icon: Expensicons.Stopwatch,
- text: translate('iou.hold'),
- onSelected: () => changeMoneyRequestStatus(),
- });
- }
- }
-
useEffect(() => {
if (isLoadingHoldUseExplained) {
return;
@@ -290,23 +242,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
IOU.dismissHoldUseExplanation();
};
- if (isPayer && isSettled && ReportUtils.isExpenseReport(moneyRequestReport)) {
- threeDotsMenuItems.push({
- icon: Expensicons.Trashcan,
- text: translate('iou.cancelPayment'),
- onSelected: () => setIsConfirmModalVisible(true),
- });
- }
-
- // If the report supports adding transactions to it, then it also supports deleting transactions from it.
- if (canDeleteRequest && !isEmptyObject(transactionThreadReport)) {
- threeDotsMenuItems.push({
- icon: Expensicons.Trashcan,
- text: translate('reportActionContextMenu.deleteAction', {action: requestParentReportAction}),
- onSelected: () => setIsDeleteRequestModalVisible(true),
- });
- }
-
useEffect(() => {
if (canDeleteRequest) {
return;
@@ -327,9 +262,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
onBackButtonPress={onBackButtonPress}
// Shows border if no buttons or banners are showing below the header
shouldShowBorderBottom={!isMoreContentShown}
- shouldShowThreeDotsButton
- threeDotsMenuItems={threeDotsMenuItems}
- threeDotsAnchorPosition={styles.threeDotsPopoverOffsetNoCloseButton(windowWidth)}
>
{shouldShowSettlementButton && !shouldUseNarrowLayout && (
@@ -474,4 +406,4 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
MoneyReportHeader.displayName = 'MoneyReportHeader';
-export default MoneyReportHeader;
\ No newline at end of file
+export default MoneyReportHeader;
From d1ff414c7a7565ce521d842478757062d745bfe2 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Mon, 1 Jul 2024 15:56:32 +0200
Subject: [PATCH 08/21] fix lint errors
---
src/components/MoneyReportHeader.tsx | 2 +-
src/components/MoneyRequestHeader.tsx | 136 +++++++++++++-------------
src/pages/ReportDetailsPage.tsx | 2 +
3 files changed, 70 insertions(+), 70 deletions(-)
diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx
index d834d52a6883..28c72472f8ce 100644
--- a/src/components/MoneyReportHeader.tsx
+++ b/src/components/MoneyReportHeader.tsx
@@ -84,7 +84,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
const [shouldShowHoldMenu, setShouldShowHoldMenu] = useState(false);
const {translate} = useLocalize();
const {isOffline} = useNetwork();
- const {isSmallScreenWidth, windowWidth} = useWindowDimensions();
+ const {isSmallScreenWidth} = useWindowDimensions();
const {reimbursableSpend} = ReportUtils.getMoneyRequestSpendBreakdown(moneyRequestReport);
const isOnHold = TransactionUtils.isOnHold(transaction);
const isDeletedParentAction = !!requestParentReportAction && ReportActionsUtils.isDeletedAction(requestParentReportAction);
diff --git a/src/components/MoneyRequestHeader.tsx b/src/components/MoneyRequestHeader.tsx
index 80421c5967b3..5ddb781ff2cc 100644
--- a/src/components/MoneyRequestHeader.tsx
+++ b/src/components/MoneyRequestHeader.tsx
@@ -94,77 +94,75 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
const statusBarProps = getStatusBarProps();
return (
- <>
-
-
- {shouldShowMarkAsCashButton && !shouldUseNarrowLayout && (
-
- )}
- {isDuplicate && !shouldUseNarrowLayout && (
-
- {shouldShowMarkAsCashButton && shouldUseNarrowLayout && (
-
-
-
+
+
+ {shouldShowMarkAsCashButton && !shouldUseNarrowLayout && (
+
)}
- {isDuplicate && shouldUseNarrowLayout && (
-
-
+ {isDuplicate && !shouldUseNarrowLayout && (
+
- >
+
+ {shouldShowMarkAsCashButton && shouldUseNarrowLayout && (
+
+
+
+ )}
+ {isDuplicate && shouldUseNarrowLayout && (
+
+
+ )}
+ {statusBarProps && (
+
+
+
+ )}
+
);
}
diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx
index 02df0e9d279b..f42dbc49795d 100644
--- a/src/pages/ReportDetailsPage.tsx
+++ b/src/pages/ReportDetailsPage.tsx
@@ -383,6 +383,8 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
shouldShowLeaveButton,
activeChatMembers.length,
isPolicyAdmin,
+ isConcierge,
+ guideCalendarLink,
session,
leaveChat,
]);
From af0d2a0e91976376415577deec54cab73c672265 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Mon, 1 Jul 2024 16:46:38 +0200
Subject: [PATCH 09/21] fix prettier
---
src/pages/ReportDetailsPage.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx
index f42dbc49795d..48e52a33c802 100644
--- a/src/pages/ReportDetailsPage.tsx
+++ b/src/pages/ReportDetailsPage.tsx
@@ -20,7 +20,6 @@ import PromotedActionsBar, {PromotedActions} from '@components/PromotedActionsBa
import RoomHeaderAvatars from '@components/RoomHeaderAvatars';
import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';
-import * as Link from '@userActions/Link';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import usePaginatedReportActions from '@hooks/usePaginatedReportActions';
@@ -32,6 +31,7 @@ import * as PolicyUtils from '@libs/PolicyUtils';
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
import * as ReportUtils from '@libs/ReportUtils';
import * as IOU from '@userActions/IOU';
+import * as Link from '@userActions/Link';
import * as Report from '@userActions/Report';
import * as Session from '@userActions/Session';
import * as Task from '@userActions/Task';
From 46e7f6dd64a3b795a1b6b38fac963cc3814823f2 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Tue, 2 Jul 2024 15:10:45 +0200
Subject: [PATCH 10/21] move Book a call from ReportDeailsPage into ProfilePage
---
src/pages/ProfilePage.tsx | 17 +++++++++++++++++
src/pages/ReportDetailsPage.tsx | 19 -------------------
2 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx
index f088de064cc7..4112eb931629 100755
--- a/src/pages/ProfilePage.tsx
+++ b/src/pages/ProfilePage.tsx
@@ -34,6 +34,8 @@ import * as PersonalDetailsActions from '@userActions/PersonalDetails';
import * as ReportActions from '@userActions/Report';
import * as SessionActions from '@userActions/Session';
import CONST from '@src/CONST';
+import * as Link from '@userActions/Link';
+import * as Session from '@userActions/Session';
import type {TranslationPaths} from '@src/languages/types';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
@@ -79,6 +81,9 @@ function ProfilePage({route}: ProfilePageProps) {
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST);
const [personalDetailsMetadata] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_METADATA);
const [session] = useOnyx(ONYXKEYS.SESSION);
+ const [guideCalendarLink] = useOnyx(ONYXKEYS.ACCOUNT, {
+ selector: (account) => account?.guideCalendarLink,
+ });
const reportKey = useMemo(() => {
const accountID = Number(route.params?.accountID ?? -1);
@@ -175,6 +180,8 @@ function ProfilePage({route}: ProfilePageProps) {
return result;
}, [accountID, isCurrentUser, loginParams, report]);
+ const isConcierge = ReportUtils.isConciergeChatReport(report);
+
return (
@@ -276,6 +283,16 @@ function ProfilePage({route}: ProfilePageProps) {
brickRoadIndicator={ReportActions.hasErrorInPrivateNotes(report) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
/>
)}
+ {isConcierge && guideCalendarLink && (
+
diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx
index 195eec5ea42a..dc977518bbe0 100644
--- a/src/pages/ReportDetailsPage.tsx
+++ b/src/pages/ReportDetailsPage.tsx
@@ -88,9 +88,6 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
canEvict: false,
selector: (allReportActions: OnyxEntry) => ReportActionsUtils.getSortedReportActionsForDisplay(allReportActions, true),
});
- const [guideCalendarLink] = useOnyx(ONYXKEYS.ACCOUNT, {
- selector: (account) => account?.guideCalendarLink,
- });
const reportActions = useMemo(() => {
if (!sortedAllReportActions.length) {
@@ -248,8 +245,6 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
const shouldShowWriteCapability = !isMoneyRequestReport;
const shouldShowMenuItem = shouldShowNotificationPref || shouldShowWriteCapability || (!!report?.visibility && report.chatType !== CONST.REPORT.CHAT_TYPE.INVOICE);
- const isConcierge = ReportUtils.isConciergeChatReport(report);
-
const menuItems: ReportDetailsPageMenuItem[] = useMemo(() => {
const items: ReportDetailsPageMenuItem[] = [];
@@ -343,18 +338,6 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
}
}
- if (isConcierge && guideCalendarLink) {
- items.push({
- key: CONST.REPORT_DETAILS_MENU_ITEM.BOOK_A_CALL,
- icon: Expensicons.Phone,
- translationKey: 'videoChatButtonAndMenu.tooltip',
- isAnonymousAction: false,
- action: Session.checkIfActionIsAllowed(() => {
- Link.openExternalLink(guideCalendarLink);
- }),
- });
- }
-
if (shouldShowLeaveButton) {
items.push({
key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM,
@@ -393,8 +376,6 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
shouldShowLeaveButton,
activeChatMembers.length,
isPolicyAdmin,
- isConcierge,
- guideCalendarLink,
session,
leaveChat,
]);
From 13c146239bafae7d815fa90f5769232aca0a60a2 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Tue, 2 Jul 2024 15:11:48 +0200
Subject: [PATCH 11/21] fix prettier
---
src/pages/ProfilePage.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx
index 4112eb931629..b2032dec16e2 100755
--- a/src/pages/ProfilePage.tsx
+++ b/src/pages/ProfilePage.tsx
@@ -30,12 +30,12 @@ import * as ReportUtils from '@libs/ReportUtils';
import * as UserUtils from '@libs/UserUtils';
import * as ValidationUtils from '@libs/ValidationUtils';
import type {ProfileNavigatorParamList} from '@navigation/types';
+import * as Link from '@userActions/Link';
import * as PersonalDetailsActions from '@userActions/PersonalDetails';
import * as ReportActions from '@userActions/Report';
import * as SessionActions from '@userActions/Session';
-import CONST from '@src/CONST';
-import * as Link from '@userActions/Link';
import * as Session from '@userActions/Session';
+import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
From 96d5a64a49418d0471e46afb86c349e653e5cc29 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Tue, 2 Jul 2024 17:12:39 +0200
Subject: [PATCH 12/21] remove import issues and fix lint
---
src/pages/ProfilePage.tsx | 7 +++----
src/pages/ReportDetailsPage.tsx | 1 -
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx
index b2032dec16e2..240f3307d158 100755
--- a/src/pages/ProfilePage.tsx
+++ b/src/pages/ProfilePage.tsx
@@ -30,11 +30,10 @@ import * as ReportUtils from '@libs/ReportUtils';
import * as UserUtils from '@libs/UserUtils';
import * as ValidationUtils from '@libs/ValidationUtils';
import type {ProfileNavigatorParamList} from '@navigation/types';
-import * as Link from '@userActions/Link';
+import * as LinkActions from '@userActions/Link';
import * as PersonalDetailsActions from '@userActions/PersonalDetails';
import * as ReportActions from '@userActions/Report';
import * as SessionActions from '@userActions/Session';
-import * as Session from '@userActions/Session';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import ONYXKEYS from '@src/ONYXKEYS';
@@ -288,8 +287,8 @@ function ProfilePage({route}: ProfilePageProps) {
title={translate('videoChatButtonAndMenu.tooltip')}
icon={Expensicons.Phone}
isAnonymousAction={false}
- onPress={Session.checkIfActionIsAllowed(() => {
- Link.openExternalLink(guideCalendarLink);
+ onPress={SessionActions.checkIfActionIsAllowed(() => {
+ LinkActions.openExternalLink(guideCalendarLink);
})}
/>
)}
diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx
index dc977518bbe0..dcbad36d1eda 100644
--- a/src/pages/ReportDetailsPage.tsx
+++ b/src/pages/ReportDetailsPage.tsx
@@ -30,7 +30,6 @@ import * as PolicyUtils from '@libs/PolicyUtils';
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
import * as ReportUtils from '@libs/ReportUtils';
import * as IOU from '@userActions/IOU';
-import * as Link from '@userActions/Link';
import * as Report from '@userActions/Report';
import * as Session from '@userActions/Session';
import * as Task from '@userActions/Task';
From 2528eac0ae335a5ef2a52e16ed40f197b2bf2e61 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Tue, 2 Jul 2024 17:22:59 +0200
Subject: [PATCH 13/21] revert hold menu removal from MoneyRequestHeader
---
src/components/MoneyRequestHeader.tsx | 182 ++++++++++++++++----------
1 file changed, 112 insertions(+), 70 deletions(-)
diff --git a/src/components/MoneyRequestHeader.tsx b/src/components/MoneyRequestHeader.tsx
index 5ddb781ff2cc..69abf8f2c882 100644
--- a/src/components/MoneyRequestHeader.tsx
+++ b/src/components/MoneyRequestHeader.tsx
@@ -1,27 +1,31 @@
import type {ReactNode} from 'react';
-import React, {useCallback} from 'react';
+import React, {useCallback, useEffect, useState} from 'react';
import {View} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import type {OnyxEntry} from 'react-native-onyx';
import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
+import useWindowDimensions from '@hooks/useWindowDimensions';
import Navigation from '@libs/Navigation/Navigation';
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
import * as ReportUtils from '@libs/ReportUtils';
import * as TransactionUtils from '@libs/TransactionUtils';
import variables from '@styles/variables';
+import * as IOU from '@userActions/IOU';
import * as TransactionActions from '@userActions/Transaction';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {Policy, Report, ReportAction} from '@src/types/onyx';
import type IconAsset from '@src/types/utils/IconAsset';
+import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
import Button from './Button';
import HeaderWithBackButton from './HeaderWithBackButton';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
import type {MoneyRequestHeaderStatusBarProps} from './MoneyRequestHeaderStatusBar';
import MoneyRequestHeaderStatusBar from './MoneyRequestHeaderStatusBar';
+import ProcessMoneyRequestHoldMenu from './ProcessMoneyRequestHoldMenu';
type MoneyRequestHeaderProps = {
/** The report currently being looked at */
@@ -48,15 +52,19 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
}`,
);
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
+ const [dismissedHoldUseExplanation, dismissedHoldUseExplanationResult] = useOnyx(ONYXKEYS.NVP_DISMISSED_HOLD_USE_EXPLANATION, {initialValue: true});
+ const isLoadingHoldUseExplained = isLoadingOnyxValue(dismissedHoldUseExplanationResult);
const styles = useThemeStyles();
const theme = useTheme();
const {translate} = useLocalize();
- const moneyRequestReport = parentReport;
+ const [shouldShowHoldMenu, setShouldShowHoldMenu] = useState(false);
+ const isSelfDMTrackExpenseReport = ReportUtils.isTrackExpenseReport(report) && ReportUtils.isSelfDM(parentReport);
+ const moneyRequestReport = !isSelfDMTrackExpenseReport ? parentReport : undefined;
const isDraft = ReportUtils.isOpenExpenseReport(moneyRequestReport);
const isOnHold = TransactionUtils.isOnHold(transaction);
const isDuplicate = TransactionUtils.isDuplicate(transaction?.transactionID ?? '');
+ const {isSmallScreenWidth} = useWindowDimensions();
- // Only the requestor can take delete the request, admins can only edit it.
const hasAllPendingRTERViolations = TransactionUtils.allHavePendingRTERViolation([transaction?.transactionID ?? '-1']);
const shouldShowMarkAsCashButton = isDraft && hasAllPendingRTERViolations;
@@ -93,79 +101,113 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
const statusBarProps = getStatusBarProps();
+ useEffect(() => {
+ if (isLoadingHoldUseExplained) {
+ return;
+ }
+ setShouldShowHoldMenu(isOnHold && !dismissedHoldUseExplanation);
+ }, [dismissedHoldUseExplanation, isLoadingHoldUseExplained, isOnHold]);
+
+ useEffect(() => {
+ if (!shouldShowHoldMenu) {
+ return;
+ }
+
+ if (isSmallScreenWidth) {
+ if (Navigation.getActiveRoute().slice(1) === ROUTES.PROCESS_MONEY_REQUEST_HOLD) {
+ Navigation.goBack();
+ }
+ } else {
+ Navigation.navigate(ROUTES.PROCESS_MONEY_REQUEST_HOLD);
+ }
+ }, [isSmallScreenWidth, shouldShowHoldMenu]);
+
+ const handleHoldRequestClose = () => {
+ IOU.dismissHoldUseExplanation();
+ };
+
return (
-
-
- {shouldShowMarkAsCashButton && !shouldUseNarrowLayout && (
-
+ <>
+
+
+ {shouldShowMarkAsCashButton && !shouldUseNarrowLayout && (
+
+ )}
+ {isDuplicate && !shouldUseNarrowLayout && (
+
+ {shouldShowMarkAsCashButton && shouldUseNarrowLayout && (
+
+
+
)}
- {isDuplicate && !shouldUseNarrowLayout && (
-
- {shouldShowMarkAsCashButton && shouldUseNarrowLayout && (
-
-
-
- )}
- {isDuplicate && shouldUseNarrowLayout && (
-
- {
- Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_PAGE.getRoute(report.reportID));
- }}
- />
-
- )}
- {statusBarProps && (
-
-
-
+ {statusBarProps && (
+
+
+
+ )}
+
+ {isSmallScreenWidth && shouldShowHoldMenu && (
+
)}
-
+ >
);
}
MoneyRequestHeader.displayName = 'MoneyRequestHeader';
-export default MoneyRequestHeader;
+export default MoneyRequestHeader;
\ No newline at end of file
From 85166787ebf6a79c993b32ab01a0cb49e2393660 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Tue, 2 Jul 2024 17:33:20 +0200
Subject: [PATCH 14/21] fix prettier issues
---
src/components/MoneyRequestHeader.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/MoneyRequestHeader.tsx b/src/components/MoneyRequestHeader.tsx
index 69abf8f2c882..b30e9da50701 100644
--- a/src/components/MoneyRequestHeader.tsx
+++ b/src/components/MoneyRequestHeader.tsx
@@ -210,4 +210,4 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
MoneyRequestHeader.displayName = 'MoneyRequestHeader';
-export default MoneyRequestHeader;
\ No newline at end of file
+export default MoneyRequestHeader;
From 5e5684e3cb6628ddf4f851757561bac259c21a97 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Wed, 3 Jul 2024 11:21:32 +0200
Subject: [PATCH 15/21] remove unused const definition for BOOK_A_CALL
---
src/CONST.ts | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/CONST.ts b/src/CONST.ts
index 62a9acaa03be..d74474978c2b 100755
--- a/src/CONST.ts
+++ b/src/CONST.ts
@@ -2283,7 +2283,6 @@ const CONST = {
PRIVATE_NOTES: 'privateNotes',
DELETE: 'delete',
MARK_AS_INCOMPLETE: 'markAsIncomplete',
- BOOK_A_CALL: 'bookACall',
},
EDIT_REQUEST_FIELD: {
AMOUNT: 'amount',
From c1abbb763d53f078fd02ae70868474d62337bbe5 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Wed, 3 Jul 2024 13:21:37 +0200
Subject: [PATCH 16/21] add isClosedReport check for holding expenses
---
src/libs/ReportUtils.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts
index 8dfc05e911e5..62ee742b1ff7 100644
--- a/src/libs/ReportUtils.ts
+++ b/src/libs/ReportUtils.ts
@@ -2805,7 +2805,7 @@ function canHoldUnholdReportAction(reportAction: OnyxInputOrEntry)
const canModifyStatus = !isTrackExpenseMoneyReport && (isPolicyAdmin || isActionOwner || isApprover);
const isDeletedParentAction = isEmptyObject(parentReportAction) || ReportActionsUtils.isDeletedAction(parentReportAction);
- const canHoldOrUnholdRequest = !isRequestSettled && !isApproved && !isDeletedParentAction;
+ const canHoldOrUnholdRequest = !isRequestSettled && !isApproved && !isDeletedParentAction && !isClosedReport(moneyRequestReport);
const canHoldRequest = canHoldOrUnholdRequest && !isOnHold && (isRequestHoldCreator || (!isRequestIOU && canModifyStatus)) && !isScanning && !!transaction?.reimbursable;
const canUnholdRequest = !!(canHoldOrUnholdRequest && isOnHold && (isRequestHoldCreator || (!isRequestIOU && canModifyStatus))) && !!transaction?.reimbursable;
From 2f10c65dca68e3f055a6126f9d029bb258ce647e Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Wed, 3 Jul 2024 15:02:12 +0200
Subject: [PATCH 17/21] fix hold promoted action not showing in specific cases
---
src/pages/ReportDetailsPage.tsx | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx
index b04e56f288e9..9af5dceeee1b 100644
--- a/src/pages/ReportDetailsPage.tsx
+++ b/src/pages/ReportDetailsPage.tsx
@@ -165,7 +165,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
// 2. MoneyReport case
if (caseID === CASES.MONEY_REPORT) {
if (!reportActions || !transactionThreadReport?.parentReportActionID) {
- return null;
+ return undefined;
}
return reportActions.find((action) => action.reportActionID === transactionThreadReport.parentReportActionID);
}
@@ -446,9 +446,14 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
? ReportActionsUtils.getOriginalMessage(requestParentReportAction)?.IOUTransactionID ?? ''
: '';
- const canHoldUnholdReportAction = ReportUtils.canHoldUnholdReportAction(parentReportAction);
- const shouldShowHoldAction =
- caseID !== CASES.MONEY_REPORT && (canHoldUnholdReportAction.canHoldRequest || canHoldUnholdReportAction.canUnholdRequest) && !ReportUtils.isArchivedRoom(parentReport);
+ let holdReportAction: OnyxTypes.ReportAction | undefined;
+ if (caseID == CASES.MONEY_REQUEST) {
+ holdReportAction = parentReportAction;
+ } else if (caseID == CASES.MONEY_REPORT) {
+ holdReportAction = requestParentReportAction;
+ }
+ const canHoldUnholdReportAction = ReportUtils.canHoldUnholdReportAction(holdReportAction);
+ const shouldShowHoldAction = (canHoldUnholdReportAction.canHoldRequest || canHoldUnholdReportAction.canUnholdRequest) && !ReportUtils.isArchivedRoom(parentReport);
const canJoin = ReportUtils.canJoinChat(report, parentReportAction, policy);
@@ -460,7 +465,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
}
if (isExpenseReport && shouldShowHoldAction) {
- result.push(PromotedActions.hold({isTextHold: canHoldUnholdReportAction.canHoldRequest, reportAction: parentReportAction}));
+ result.push(PromotedActions.hold({isTextHold: canHoldUnholdReportAction.canHoldRequest, reportAction: holdReportAction}));
}
if (report) {
From 02a3470e75a1ee5c84097ed3881e224f6fee9891 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Wed, 3 Jul 2024 15:04:40 +0200
Subject: [PATCH 18/21] fix lint errors
---
src/pages/ReportDetailsPage.tsx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx
index 9af5dceeee1b..421856e55693 100644
--- a/src/pages/ReportDetailsPage.tsx
+++ b/src/pages/ReportDetailsPage.tsx
@@ -447,9 +447,9 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
: '';
let holdReportAction: OnyxTypes.ReportAction | undefined;
- if (caseID == CASES.MONEY_REQUEST) {
+ if (caseID === CASES.MONEY_REQUEST) {
holdReportAction = parentReportAction;
- } else if (caseID == CASES.MONEY_REPORT) {
+ } else if (caseID === CASES.MONEY_REPORT) {
holdReportAction = requestParentReportAction;
}
const canHoldUnholdReportAction = ReportUtils.canHoldUnholdReportAction(holdReportAction);
@@ -475,7 +475,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
result.push(PromotedActions.share(report));
return result;
- }, [report, parentReportAction, canJoin, isExpenseReport, shouldShowHoldAction, canHoldUnholdReportAction.canHoldRequest]);
+ }, [report, holdReportAction, canJoin, isExpenseReport, shouldShowHoldAction, canHoldUnholdReportAction.canHoldRequest]);
const nameSectionExpenseIOU = (
From 81e078384d66c5c5a23060a152f3a1a062e6c958 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Thu, 4 Jul 2024 22:11:41 +0200
Subject: [PATCH 19/21] Revert "fix lint errors"
This reverts commit 02a3470e75a1ee5c84097ed3881e224f6fee9891.
revert hold changes
---
src/pages/ReportDetailsPage.tsx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx
index 421856e55693..9af5dceeee1b 100644
--- a/src/pages/ReportDetailsPage.tsx
+++ b/src/pages/ReportDetailsPage.tsx
@@ -447,9 +447,9 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
: '';
let holdReportAction: OnyxTypes.ReportAction | undefined;
- if (caseID === CASES.MONEY_REQUEST) {
+ if (caseID == CASES.MONEY_REQUEST) {
holdReportAction = parentReportAction;
- } else if (caseID === CASES.MONEY_REPORT) {
+ } else if (caseID == CASES.MONEY_REPORT) {
holdReportAction = requestParentReportAction;
}
const canHoldUnholdReportAction = ReportUtils.canHoldUnholdReportAction(holdReportAction);
@@ -475,7 +475,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
result.push(PromotedActions.share(report));
return result;
- }, [report, holdReportAction, canJoin, isExpenseReport, shouldShowHoldAction, canHoldUnholdReportAction.canHoldRequest]);
+ }, [report, parentReportAction, canJoin, isExpenseReport, shouldShowHoldAction, canHoldUnholdReportAction.canHoldRequest]);
const nameSectionExpenseIOU = (
From b4a1a4084c2f54f67c1df77ebf2b4ebb831deab7 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Thu, 4 Jul 2024 22:18:30 +0200
Subject: [PATCH 20/21] Revert "fix hold promoted action not showing in
specific cases"
This reverts commit 2f10c65dca68e3f055a6126f9d029bb258ce647e.
revert hold changes
---
src/pages/ReportDetailsPage.tsx | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx
index 9af5dceeee1b..b04e56f288e9 100644
--- a/src/pages/ReportDetailsPage.tsx
+++ b/src/pages/ReportDetailsPage.tsx
@@ -165,7 +165,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
// 2. MoneyReport case
if (caseID === CASES.MONEY_REPORT) {
if (!reportActions || !transactionThreadReport?.parentReportActionID) {
- return undefined;
+ return null;
}
return reportActions.find((action) => action.reportActionID === transactionThreadReport.parentReportActionID);
}
@@ -446,14 +446,9 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
? ReportActionsUtils.getOriginalMessage(requestParentReportAction)?.IOUTransactionID ?? ''
: '';
- let holdReportAction: OnyxTypes.ReportAction | undefined;
- if (caseID == CASES.MONEY_REQUEST) {
- holdReportAction = parentReportAction;
- } else if (caseID == CASES.MONEY_REPORT) {
- holdReportAction = requestParentReportAction;
- }
- const canHoldUnholdReportAction = ReportUtils.canHoldUnholdReportAction(holdReportAction);
- const shouldShowHoldAction = (canHoldUnholdReportAction.canHoldRequest || canHoldUnholdReportAction.canUnholdRequest) && !ReportUtils.isArchivedRoom(parentReport);
+ const canHoldUnholdReportAction = ReportUtils.canHoldUnholdReportAction(parentReportAction);
+ const shouldShowHoldAction =
+ caseID !== CASES.MONEY_REPORT && (canHoldUnholdReportAction.canHoldRequest || canHoldUnholdReportAction.canUnholdRequest) && !ReportUtils.isArchivedRoom(parentReport);
const canJoin = ReportUtils.canJoinChat(report, parentReportAction, policy);
@@ -465,7 +460,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
}
if (isExpenseReport && shouldShowHoldAction) {
- result.push(PromotedActions.hold({isTextHold: canHoldUnholdReportAction.canHoldRequest, reportAction: holdReportAction}));
+ result.push(PromotedActions.hold({isTextHold: canHoldUnholdReportAction.canHoldRequest, reportAction: parentReportAction}));
}
if (report) {
From 767937c78f03aa8acb3fd4a31f97b4f190f76f22 Mon Sep 17 00:00:00 2001
From: cdOut <88325488+cdOut@users.noreply.github.com>
Date: Fri, 5 Jul 2024 11:31:16 +0200
Subject: [PATCH 21/21] Revert "add isClosedReport check for holding expenses"
This reverts commit c1abbb763d53f078fd02ae70868474d62337bbe5.
revert hold affecting commit
---
src/libs/ReportUtils.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts
index 62ee742b1ff7..8dfc05e911e5 100644
--- a/src/libs/ReportUtils.ts
+++ b/src/libs/ReportUtils.ts
@@ -2805,7 +2805,7 @@ function canHoldUnholdReportAction(reportAction: OnyxInputOrEntry)
const canModifyStatus = !isTrackExpenseMoneyReport && (isPolicyAdmin || isActionOwner || isApprover);
const isDeletedParentAction = isEmptyObject(parentReportAction) || ReportActionsUtils.isDeletedAction(parentReportAction);
- const canHoldOrUnholdRequest = !isRequestSettled && !isApproved && !isDeletedParentAction && !isClosedReport(moneyRequestReport);
+ const canHoldOrUnholdRequest = !isRequestSettled && !isApproved && !isDeletedParentAction;
const canHoldRequest = canHoldOrUnholdRequest && !isOnHold && (isRequestHoldCreator || (!isRequestIOU && canModifyStatus)) && !isScanning && !!transaction?.reimbursable;
const canUnholdRequest = !!(canHoldOrUnholdRequest && isOnHold && (isRequestHoldCreator || (!isRequestIOU && canModifyStatus))) && !!transaction?.reimbursable;