Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
e1385cb
Simplified actions on report header
jnowakow Mar 10, 2025
79174fa
Merge branch 'main' into jnowakow/simplified-report-actions-header-ui
jnowakow Mar 10, 2025
659a350
Correct display
jnowakow Mar 10, 2025
4cacc2f
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 11, 2025
bb6abaf
Remove options from details page and add actions to report header
jnowakow Mar 11, 2025
79a5efd
Do not alter existing translation
jnowakow Mar 11, 2025
45e55fa
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 11, 2025
1372965
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 12, 2025
7256b28
Fix linter
jnowakow Mar 12, 2025
9810fd2
Translation
jnowakow Mar 12, 2025
e452ae5
Fix linter and prettier
jnowakow Mar 12, 2025
96315d0
Add delegate gaurd to unapprove action
jnowakow Mar 12, 2025
d1d32a5
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 14, 2025
8db6c58
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 17, 2025
10658b0
Merge branch 'main' into jnowakow/simplified-report-actions-header-ui
jnowakow Mar 17, 2025
b8e932b
Improve logic
jnowakow Mar 17, 2025
9028cd4
Merge branch 'main' into jnowakow/simplified-report-actions-header-ui
jnowakow Mar 18, 2025
02c114b
Invoice pay logic
jnowakow Mar 18, 2025
0583e47
Primary actions tests
jnowakow Mar 19, 2025
718443f
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 19, 2025
c10b124
UI hopefully ready
jnowakow Mar 19, 2025
f2fcb83
fix tests
jnowakow Mar 19, 2025
a30537a
Fix linter
jnowakow Mar 19, 2025
991bab8
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 20, 2025
f2b5417
Further improvments
jnowakow Mar 20, 2025
4b7007a
Tests for transactions primary actions
jnowakow Mar 20, 2025
4d12774
fix tests
jnowakow Mar 20, 2025
9c4a9f8
Fix TS
jnowakow Mar 20, 2025
0290a74
add use memo
jnowakow Mar 21, 2025
c5e0659
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 21, 2025
191524e
fixed unverified commits
borys3kk Mar 18, 2025
ea087ea
pr review fixes
borys3kk Mar 18, 2025
f77c9c7
more updates
borys3kk Mar 18, 2025
0ab0fa9
refactor by jnow
borys3kk Mar 18, 2025
64658ee
final fix
borys3kk Mar 18, 2025
0f943a6
npm run prettier
borys3kk Mar 18, 2025
260dda3
review changes
borys3kk Mar 19, 2025
1075c57
submitReport change
borys3kk Mar 19, 2025
00ba9c9
gh checks
borys3kk Mar 19, 2025
1c6ee89
fixes in tests / removed unused vars
borys3kk Mar 20, 2025
132d09f
tests updated/ prettier check
borys3kk Mar 21, 2025
12eee44
Show delete option only for single transaction report
jnowakow Mar 21, 2025
5e509c3
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 24, 2025
30c6b93
Apply review suggestions
jnowakow Mar 24, 2025
49acfcb
fixed bug with approving empty report, change of order in reportprevi…
borys3kk Mar 24, 2025
ac87670
remove unused imports
borys3kk Mar 24, 2025
bdf6178
eslint test fix
borys3kk Mar 24, 2025
0642d15
tests fixed
borys3kk Mar 24, 2025
7516703
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 25, 2025
b9ff937
Merge branch 'main' into jnowakow/simplified-report-actions-header-ui
jnowakow Mar 26, 2025
fc378f3
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 26, 2025
f7f6537
Fixes after review
jnowakow Mar 26, 2025
658f87a
Hide modal on confirmation
jnowakow Mar 27, 2025
6f4582b
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 28, 2025
4bc73e6
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Mar 31, 2025
d7f07c1
merge main
borys3kk Mar 31, 2025
0b6d10f
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Apr 1, 2025
17344cd
order fix
borys3kk Apr 1, 2025
eacf762
Remove carret from track expense header
jnowakow Apr 1, 2025
bb98e87
Show submit for non empty reports
jnowakow Apr 1, 2025
c20edc9
beautiful hack
borys3kk Apr 1, 2025
1ff3b70
back to original order
borys3kk Apr 1, 2025
cee0621
fixed tests
borys3kk Apr 1, 2025
ad35860
eslint changed
borys3kk Apr 1, 2025
0410eb1
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Apr 2, 2025
237b695
Consider transactions lenght instead of total
jnowakow Apr 2, 2025
0d76ef7
update copy
jnowakow Apr 2, 2025
0a67fe3
race condition fix
borys3kk Apr 2, 2025
f1e68c6
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Apr 2, 2025
e3a9efc
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Apr 3, 2025
3474259
Apply review suggestions
jnowakow Apr 3, 2025
f1c1f05
Merge branch 'jnowakow/simplified-report-actions-header-ui' into @bor…
borys3kk Apr 3, 2025
5e03cb3
fixed tests, removed unused imports
borys3kk Apr 3, 2025
d54b72f
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Apr 4, 2025
2ac40dc
Do not go back on cancel payment
jnowakow Apr 4, 2025
e7415ee
Merge pull request #216 from software-mansion-labs/@borys3kk-feat-get…
jnowakow Apr 4, 2025
2eb39a2
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Apr 7, 2025
93c5c0e
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Apr 7, 2025
3a6ae95
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Apr 7, 2025
dbe6246
restore animation
jnowakow Apr 7, 2025
80d2a6c
Merge branch 'main' of github.com:Expensify/App into jnowakow/simplif…
jnowakow Apr 8, 2025
3725a74
Fix settlement button animation when payment is cancelled
jnowakow Apr 8, 2025
d5957c0
better fix for settlement button animation
jnowakow Apr 8, 2025
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
17 changes: 17 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1157,10 +1157,27 @@ const CONST = {
APPROVE: 'approve',
PAY: 'pay',
EXPORT_TO_ACCOUNTING: 'exportToAccounting',
REMOVE_HOLD: 'removeHold',
MARK_AS_CASH: 'markAsCash',
},
TRANSACTION_PRIMARY_ACTIONS: {
REMOVE_HOLD: 'removeHold',
REVIEW_DUPLICATES: 'reviewDuplicates',
MARK_AS_CASH: 'markAsCash',
},
REPORT_PREVIEW_ACTIONS: {
VIEW: 'view',
REVIEW: 'review',
SUBMIT: 'submit',
APPROVE: 'approve',
PAY: 'pay',
EXPORT_TO_ACCOUNTING: 'exportToAccounting',
},
TRANSACTION_SECONDARY_ACTIONS: {
HOLD: 'hold',
VIEW_DETAILS: 'viewDetails',
DELETE: 'delete',
},
ACTIONS: {
LIMIT: 50,
// OldDot Actions render getMessage from Web-Expensify/lib/Report/Action PHP files via getMessageOfOldDotReportAction in ReportActionsUtils.ts
Expand Down
19 changes: 8 additions & 11 deletions src/components/AvatarWithDisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import ROUTES from '@src/ROUTES';
import type {Policy, Report} from '@src/types/onyx';
import type {Icon} from '@src/types/onyx/OnyxCommon';
import {getButtonRole} from './Button/utils';
import CaretWrapper from './CaretWrapper';
import DisplayNames from './DisplayNames';
import {FallbackAvatar} from './Icon/Expensicons';
import MultipleAvatars from './MultipleAvatars';
Expand Down Expand Up @@ -155,16 +154,14 @@ function AvatarWithDisplayName({policy, report, isAnonymous = false, size = CONS
</View>
</PressableWithoutFeedback>
<View style={[styles.flex1, styles.flexColumn]}>
<CaretWrapper>
<DisplayNames
fullTitle={title}
displayNamesWithTooltips={displayNamesWithTooltips}
tooltipEnabled
numberOfLines={1}
textStyles={[isAnonymous ? styles.headerAnonymousFooter : styles.headerText, styles.pre]}
shouldUseFullTitle={isMoneyRequestOrReport || isAnonymous}
/>
</CaretWrapper>
<DisplayNames
fullTitle={title}
displayNamesWithTooltips={displayNamesWithTooltips}
tooltipEnabled
numberOfLines={1}
textStyles={[isAnonymous ? styles.headerAnonymousFooter : styles.headerText, styles.pre]}
shouldUseFullTitle={isMoneyRequestOrReport || isAnonymous}
/>
{Object.keys(parentNavigationSubtitleData).length > 0 && (
<ParentNavigationSubtitle
parentNavigationSubtitleData={parentNavigationSubtitleData}
Expand Down
583 changes: 355 additions & 228 deletions src/components/MoneyReportHeader.tsx

Large diffs are not rendered by default.

198 changes: 151 additions & 47 deletions src/components/MoneyRequestHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import {useRoute} from '@react-navigation/native';
import type {ReactNode} from 'react';
import React, {useCallback, useEffect} from 'react';
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import {useOnyx} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useTransactionViolations from '@hooks/useTransactionViolations';
import {deleteMoneyRequest, getNavigationUrlOnMoneyRequestDelete} from '@libs/actions/IOU';
import Navigation from '@libs/Navigation/Navigation';
import {getOriginalMessage, isMoneyRequestAction} from '@libs/ReportActionsUtils';
import {getTransactionThreadPrimaryAction} from '@libs/ReportPrimaryActionUtils';
import {getSecondaryTransactionThreadActions} from '@libs/ReportSecondaryActionUtils';
import {changeMoneyRequestHoldStatus, navigateToDetailsPage} from '@libs/ReportUtils';
import {
checkIfShouldShowMarkAsCashButton,
hasPendingRTERViolation as hasPendingRTERViolationTransactionUtils,
hasReceipt,
isDuplicate as isDuplicateTransactionUtils,
Expand All @@ -33,6 +37,10 @@ import type IconAsset from '@src/types/utils/IconAsset';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
import BrokenConnectionDescription from './BrokenConnectionDescription';
import Button from './Button';
import ButtonWithDropdownMenu from './ButtonWithDropdownMenu';
import type {DropdownOption} from './ButtonWithDropdownMenu/types';
import ConfirmModal from './ConfirmModal';
import DecisionModal from './DecisionModal';
import HeaderWithBackButton from './HeaderWithBackButton';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
Expand Down Expand Up @@ -68,6 +76,8 @@ function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPre
);
const transactionViolations = useTransactionViolations(transaction?.transactionID);

const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false);
const [downloadErrorModalVisible, setDownloadErrorModalVisible] = useState(false);
const [dismissedHoldUseExplanation, dismissedHoldUseExplanationResult] = useOnyx(ONYXKEYS.NVP_DISMISSED_HOLD_USE_EXPLANATION, {initialValue: true});
const [isLoadingReportData] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA);
const isLoadingHoldUseExplained = isLoadingOnyxValue(dismissedHoldUseExplanationResult);
Expand All @@ -85,7 +95,6 @@ function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPre
const hasPendingRTERViolation = hasPendingRTERViolationTransactionUtils(transactionViolations);

const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationTransactionUtils(parentReport, policy, transactionViolations);
const shouldShowMarkAsCashButton = checkIfShouldShowMarkAsCashButton(hasPendingRTERViolation, shouldShowBrokenConnectionViolation, parentReport, policy);

const markAsCash = useCallback(() => {
markAsCashAction(transaction?.transactionID, reportID);
Expand Down Expand Up @@ -144,12 +153,89 @@ function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPre
Navigation.navigate(ROUTES.PROCESS_MONEY_REQUEST_HOLD.getRoute(Navigation.getReportRHPActiveRoute()));
}, [dismissedHoldUseExplanation, isLoadingHoldUseExplained, isOnHold]);

const primaryAction = useMemo(() => {
if (!report || !parentReport || !transaction) {
return '';
}
return getTransactionThreadPrimaryAction(report, parentReport, transaction, transactionViolations, policy);
}, [parentReport, policy, report, transaction, transactionViolations]);

const primaryActionImplementation = {
[CONST.REPORT.TRANSACTION_PRIMARY_ACTIONS.REMOVE_HOLD]: (
<Button
success
text={translate('iou.unhold')}
onPress={() => {
changeMoneyRequestHoldStatus(parentReportAction);
}}
/>
),
[CONST.REPORT.TRANSACTION_PRIMARY_ACTIONS.REVIEW_DUPLICATES]: (
<Button
success
text={translate('iou.reviewDuplicates')}
onPress={() => {
if (!reportID) {
return;
}
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_PAGE.getRoute(reportID, Navigation.getReportRHPActiveRoute()));
}}
/>
),
[CONST.REPORT.TRANSACTION_PRIMARY_ACTIONS.MARK_AS_CASH]: (
<Button
success
text={translate('iou.markAsCash')}
onPress={markAsCash}
/>
),
};

const secondaryActions = useMemo(() => {
if (!parentReport || !transaction) {
return [];
}
return getSecondaryTransactionThreadActions(parentReport, transaction);
}, [parentReport, transaction]);

const secondaryActionsImplementation: Record<ValueOf<typeof CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS>, DropdownOption<ValueOf<typeof CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS>>> = {
[CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.HOLD]: {
text: translate('iou.hold'),
icon: Expensicons.Stopwatch,
value: CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.HOLD,
onSelected: () => {
if (!parentReportAction) {
throw new Error('Parent action does not exist');
}

changeMoneyRequestHoldStatus(parentReportAction);
},
},
[CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.VIEW_DETAILS]: {
value: CONST.REPORT.SECONDARY_ACTIONS.VIEW_DETAILS,
text: translate('iou.viewDetails'),
icon: Expensicons.Info,
onSelected: () => {
navigateToDetailsPage(report, Navigation.getReportRHPActiveRoute());
},
},
[CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.DELETE]: {
text: translate('common.delete'),
icon: Expensicons.Trashcan,
value: CONST.REPORT.SECONDARY_ACTIONS.DELETE,
onSelected: () => {
setIsDeleteModalVisible(true);
},
},
};

const applicableSecondaryActions = secondaryActions.map((action) => secondaryActionsImplementation[action]);

return (
<View style={[styles.pl0, styles.borderBottom]}>
<HeaderWithBackButton
shouldShowBorderBottom={false}
shouldShowReportAvatarWithDisplay
shouldEnableDetailPageNavigation
shouldShowPinButton={false}
report={
reportID
Expand All @@ -164,53 +250,39 @@ function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPre
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplaySearchRouter={shouldDisplaySearchRouter}
onBackButtonPress={onBackButtonPress}
shouldEnableDetailPageNavigation
>
{shouldShowMarkAsCashButton && !shouldUseNarrowLayout && (
<Button
success
text={translate('iou.markAsCash')}
style={[styles.p0]}
onPress={markAsCash}
/>
)}
{isDuplicate && !shouldUseNarrowLayout && (
<Button
success
text={translate('iou.reviewDuplicates')}
style={[styles.p0, styles.ml2]}
onPress={() => {
if (!reportID) {
return;
}
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_PAGE.getRoute(reportID, Navigation.getReportRHPActiveRoute()));
}}
/>
{!shouldUseNarrowLayout && (
<View style={[styles.flexRow, styles.gap2]}>
{!!primaryAction && primaryActionImplementation[primaryAction]}
{!!applicableSecondaryActions.length && (
<ButtonWithDropdownMenu
success={false}
onPress={() => {}}
Comment thread
luacmartins marked this conversation as resolved.
shouldAlwaysShowDropdownMenu
customText={translate('common.more')}
options={applicableSecondaryActions}
isSplitButton={false}
/>
)}
</View>
)}
{shouldDisplayTransactionNavigation && <MoneyRequestReportTransactionsNavigation currentReportID={reportID} />}
</HeaderWithBackButton>
{shouldShowMarkAsCashButton && shouldUseNarrowLayout && (
<View style={[styles.ph5, styles.pb3]}>
<Button
success
text={translate('iou.markAsCash')}
style={[styles.w100, styles.pr0]}
onPress={markAsCash}
/>
</View>
)}
{isDuplicate && shouldUseNarrowLayout && (
<View style={[styles.ph5, styles.pb3]}>
<Button
success
text={translate('iou.reviewDuplicates')}
style={[styles.w100, styles.pr0]}
onPress={() => {
if (!reportID) {
return;
}
Navigation.navigate(ROUTES.TRANSACTION_DUPLICATE_REVIEW_PAGE.getRoute(reportID, Navigation.getReportRHPActiveRoute()));
}}
/>
{shouldUseNarrowLayout && (
<View style={[styles.flexRow, styles.gap2, styles.pb3, styles.ph5, styles.w100, styles.alignItemsCenter, styles.justifyContentCenter]}>
{!!primaryAction && <View style={[styles.flexGrow4]}>{primaryActionImplementation[primaryAction]}</View>}
{!!applicableSecondaryActions.length && (
<ButtonWithDropdownMenu
success={false}
onPress={() => {}}
Comment thread
luacmartins marked this conversation as resolved.
shouldAlwaysShowDropdownMenu
customText={translate('common.more')}
options={applicableSecondaryActions}
isSplitButton={false}
wrapperStyle={[!primaryAction && styles.flexGrow4]}
/>
)}
</View>
)}
{!!statusBarProps && (
Expand All @@ -222,6 +294,38 @@ function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPre
</View>
)}
<LoadingBar shouldShow={(isLoadingReportData && shouldUseNarrowLayout) ?? false} />
<DecisionModal
title={translate('common.downloadFailedTitle')}
prompt={translate('common.downloadFailedDescription')}
isSmallScreenWidth={isSmallScreenWidth}
onSecondOptionSubmit={() => setDownloadErrorModalVisible(false)}
secondOptionText={translate('common.buttonConfirm')}
isVisible={downloadErrorModalVisible}
onClose={() => setDownloadErrorModalVisible(false)}
/>
<ConfirmModal
title={translate('iou.deleteExpense', {count: 1})}
isVisible={isDeleteModalVisible}
onConfirm={() => {
setIsDeleteModalVisible(false);
if (!parentReportAction || !transaction) {
throw new Error('Data missing');
}

deleteMoneyRequest(transaction?.transactionID, parentReportAction);

const goBackRoute = getNavigationUrlOnMoneyRequestDelete(transaction.transactionID, parentReportAction, true);
if (goBackRoute) {
Navigation.navigate(goBackRoute);
}
}}
onCancel={() => setIsDeleteModalVisible(false)}
prompt={translate('iou.deleteConfirmation', {count: 1})}
confirmText={translate('common.delete')}
cancelText={translate('common.cancel')}
danger
shouldEnableNewFocusManagement
/>
</View>
);
}
Expand Down
28 changes: 14 additions & 14 deletions src/components/ReportActionItem/ExportWithDropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import ConfirmModal from '@components/ConfirmModal';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import * as PolicyActions from '@libs/actions/Policy/Policy';
import * as ReportActions from '@libs/actions/Report';
import * as PolicyUtils from '@libs/PolicyUtils';
import * as ReportUtils from '@libs/ReportUtils';
import {savePreferredExportMethod as savePreferredExportMethodUtils} from '@libs/actions/Policy/Policy';
import {exportToIntegration, markAsManuallyExported} from '@libs/actions/Report';
import {hasIntegrationAutoSync as hasIntegrationAutoSyncUtils} from '@libs/PolicyUtils';
import {canBeExported as canBeExportedUtils, getIntegrationIcon, isExported as isExportedUtils} from '@libs/ReportUtils';
import type {ExportType} from '@pages/home/report/ReportDetailsExportPage';
import variables from '@styles/variables';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -51,10 +51,10 @@ function ExportWithDropdownMenu({
const [exportMethods] = useOnyx(ONYXKEYS.LAST_EXPORT_METHOD);
const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`);

const iconToDisplay = ReportUtils.getIntegrationIcon(connectionName);
const canBeExported = ReportUtils.canBeExported(report);
const isExported = ReportUtils.isExported(reportActions);
const hasIntegrationAutoSync = PolicyUtils.hasIntegrationAutoSync(policy, connectionName);
const iconToDisplay = getIntegrationIcon(connectionName);
const canBeExported = canBeExportedUtils(report);
const isExported = isExportedUtils(reportActions);
const hasIntegrationAutoSync = hasIntegrationAutoSyncUtils(policy, connectionName);
const flattenedWrapperStyle = StyleSheet.flatten([styles.flex1, wrapperStyle]);

const dropdownOptions: Array<DropdownOption<ReportExportType>> = useMemo(() => {
Expand All @@ -74,7 +74,7 @@ function ExportWithDropdownMenu({
},
{
value: CONST.REPORT.EXPORT_OPTIONS.MARK_AS_EXPORTED,
text: translate('workspace.common.markAsExported'),
text: translate('workspace.common.markAsEntered'),
Comment thread
jnowakow marked this conversation as resolved.
...optionTemplate,
},
];
Expand All @@ -93,17 +93,17 @@ function ExportWithDropdownMenu({
return;
}
if (modalStatus === CONST.REPORT.EXPORT_OPTIONS.EXPORT_TO_INTEGRATION) {
ReportActions.exportToIntegration(reportID, connectionName);
exportToIntegration(reportID, connectionName);
} else if (modalStatus === CONST.REPORT.EXPORT_OPTIONS.MARK_AS_EXPORTED) {
ReportActions.markAsManuallyExported(reportID, connectionName);
markAsManuallyExported(reportID, connectionName);
}
}, [connectionName, modalStatus, reportID]);

const savePreferredExportMethod = (value: ReportExportType) => {
if (!report?.policyID) {
return;
}
PolicyActions.savePreferredExportMethod(report?.policyID, value);
savePreferredExportMethodUtils(report?.policyID, value);
};

return (
Expand All @@ -122,9 +122,9 @@ function ExportWithDropdownMenu({
return;
}
if (value === CONST.REPORT.EXPORT_OPTIONS.EXPORT_TO_INTEGRATION) {
ReportActions.exportToIntegration(reportID, connectionName);
exportToIntegration(reportID, connectionName);
} else if (value === CONST.REPORT.EXPORT_OPTIONS.MARK_AS_EXPORTED) {
ReportActions.markAsManuallyExported(reportID, connectionName);
markAsManuallyExported(reportID, connectionName);
}
}}
onOptionSelected={({value}) => savePreferredExportMethod(value)}
Expand Down
Loading