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
1 change: 0 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,6 @@ const CONST = {
PER_DIEM: 'newDotPerDiem',
NEWDOT_MERGE_ACCOUNTS: 'newDotMergeAccounts',
NEWDOT_MANAGER_MCTEST: 'newDotManagerMcTest',
NEWDOT_PDF_EXPORT: 'newDotPDFExport',
NEW_DOT_TALK_TO_AI_SALES: 'newDotTalkToAISales',
CUSTOM_RULES: 'customRules',
TABLE_REPORT_VIEW: 'tableReportView',
Expand Down
5 changes: 0 additions & 5 deletions src/libs/Permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ function canUseMergeAccounts(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.NEWDOT_MERGE_ACCOUNTS) || canUseAllBetas(betas);
}

function canUsePDFExport(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.NEWDOT_PDF_EXPORT) || canUseAllBetas(betas);
}

function canUseManagerMcTest(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.NEWDOT_MANAGER_MCTEST) || canUseAllBetas(betas);
}
Expand Down Expand Up @@ -76,7 +72,6 @@ export default {
canUseSpotnanaTravel,
isBlockedFromSpotnanaTravel,
canUseNetSuiteUSATax,
canUsePDFExport,
canUseMergeAccounts,
canUseManagerMcTest,
canUseCustomRules,
Expand Down
34 changes: 15 additions & 19 deletions src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import useDelegateUserDetails from '@hooks/useDelegateUserDetails';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import usePaginatedReportActions from '@hooks/usePaginatedReportActions';
import usePermissions from '@hooks/usePermissions';

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.

Aw shoot - we need this still, I missed it.

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.

import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
Expand Down Expand Up @@ -164,7 +163,7 @@ type CaseID = ValueOf<typeof CASES>;
function ReportDetailsPage({policies, report, route, reportMetadata}: ReportDetailsPageProps) {
const {translate} = useLocalize();
const {isOffline} = useNetwork();
const {canUsePDFExport, canUseTableReportView} = usePermissions();
const {canUseTableReportView} = usePermissions();
const theme = useTheme();
const styles = useThemeStyles();
const backTo = route.params.backTo;
Expand Down Expand Up @@ -574,22 +573,19 @@ function ReportDetailsPage({policies, report, route, reportMetadata}: ReportDeta
});
},
});

if (canUsePDFExport) {
items.push({
key: CONST.REPORT_DETAILS_MENU_ITEM.DOWNLOAD_PDF,
translationKey: 'common.downloadAsPDF',
icon: Expensicons.Document,
isAnonymousAction: false,
action: () => {
if (isOffline) {
setOfflineModalVisible(true);
} else {
beginPDFExport();
}
},
});
}
items.push({
key: CONST.REPORT_DETAILS_MENU_ITEM.DOWNLOAD_PDF,
translationKey: 'common.downloadAsPDF',
icon: Expensicons.Document,
isAnonymousAction: false,
action: () => {
if (isOffline) {
setOfflineModalVisible(true);
} else {
beginPDFExport();
}
},
});
}

if (policy && connectedIntegration && isPolicyAdmin && !isSingleTransactionView && isExpenseReport) {
Expand Down Expand Up @@ -660,6 +656,7 @@ function ReportDetailsPage({policies, report, route, reportMetadata}: ReportDeta

return items;
}, [
beginPDFExport,

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.

Is adding this intentional or is it a merge conflict issue?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems needed there, so all good 👍

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.

This is here twice, argh - #60964

isSelfDM,
isArchivedRoom,
isGroupChat,
Expand Down Expand Up @@ -698,7 +695,6 @@ function ReportDetailsPage({policies, report, route, reportMetadata}: ReportDeta
session,
canModifyTask,
canActionTask,
canUsePDFExport,
isOffline,
transactionIDList,
beginPDFExport,
Expand Down