Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide three dot in header when request is deleted #28214

Merged
merged 4 commits into from
Oct 12, 2023
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
4 changes: 3 additions & 1 deletion src/components/MoneyRequestHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import ConfirmModal from './ConfirmModal';
import useLocalize from '../hooks/useLocalize';
import MoneyRequestHeaderStatusBar from './MoneyRequestHeaderStatusBar';
import * as TransactionUtils from '../libs/TransactionUtils';
import * as ReportActionsUtils from '../libs/ReportActionsUtils';
import * as HeaderUtils from '../libs/HeaderUtils';
import reportActionPropTypes from '../pages/home/report/reportActionPropTypes';
import transactionPropTypes from './transactionPropTypes';
Expand Down Expand Up @@ -81,7 +82,8 @@ function MoneyRequestHeader({session, parentReport, report, parentReportAction,
}, [parentReportAction, setIsDeleteModalVisible]);

const isScanning = TransactionUtils.hasReceipt(transaction) && TransactionUtils.isReceiptBeingScanned(transaction);
const canModifyRequest = isActionOwner && !isSettled && !isApproved;

const canModifyRequest = isActionOwner && !isSettled && !isApproved && !ReportActionsUtils.isDeletedAction(parentReportAction);

useEffect(() => {
if (canModifyRequest) {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ function getTransactionReportName(reportAction) {
return Localize.translateLocal('parentReportAction.reversedTransaction');
}

if (ReportActionsUtils.isDeletedParentAction(reportAction)) {
if (ReportActionsUtils.isDeletedAction(reportAction)) {
return Localize.translateLocal('parentReportAction.deletedRequest');
}

Expand Down
3 changes: 1 addition & 2 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ function ReportScreen({
const isLoading = !reportID || !isSidebarLoaded || _.isEmpty(personalDetails);

const parentReportAction = ReportActionsUtils.getParentReportAction(report);
const isDeletedParentAction = ReportActionsUtils.isDeletedParentAction(parentReportAction);
const isSingleTransactionView = ReportUtils.isMoneyRequest(report);

const policy = policies[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`] || {};
Expand All @@ -188,7 +187,7 @@ function ReportScreen({
/>
);

if (isSingleTransactionView && !isDeletedParentAction) {
if (isSingleTransactionView) {
headerView = (
<MoneyRequestHeader
report={report}
Expand Down
Loading