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/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,6 @@ const CONST = {
EUR_BILLING: 'eurBilling',
NO_OPTIMISTIC_TRANSACTION_THREADS: 'noOptimisticTransactionThreads',
UBER_FOR_BUSINESS: 'uberForBusiness',
NEW_DOT_DEW: 'newDotDEW',
ODOMETER_EXPENSES: 'odometerExpenses',
PAY_INVOICE_VIA_EXPENSIFY: 'payInvoiceViaExpensify',
PERSONAL_CARD_IMPORT: 'personalCardImport',
Expand Down
34 changes: 3 additions & 31 deletions src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,7 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
const [cardList] = useOnyx(ONYXKEYS.CARD_LIST);
const {isBetaEnabled} = usePermissions();
const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT);
const isDEWBetaEnabled = isBetaEnabled(CONST.BETAS.NEW_DOT_DEW);
const isDEWPolicy = isDEWBetaEnabled && hasDynamicExternalWorkflow(policy);
const isDEWPolicy = hasDynamicExternalWorkflow(policy);
const hasViolations = hasViolationsReportUtils(moneyRequestReport?.reportID, allTransactionViolations, accountID, email ?? '');
const hasCustomUnitOutOfPolicyViolation = hasCustomUnitOutOfPolicyViolationTransactionUtils(transactionViolations);
const isPerDiemRequestOnNonDefaultWorkspace = isPerDiemRequest(transaction) && defaultExpensePolicy?.id !== policy?.id;
Expand Down Expand Up @@ -817,25 +816,8 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
isSelectionModePaymentRef.current = false;
}, [selectedTransactionIDs.length]);

const showDWEModal = useCallback(async () => {
const result = await showConfirmModal({
confirmText: translate('customApprovalWorkflow.goToExpensifyClassic'),
title: translate('customApprovalWorkflow.title'),
prompt: translate('customApprovalWorkflow.description'),
shouldShowCancelButton: false,
});

if (result.action === ModalActions.CONFIRM) {
openOldDotLink(CONST.OLDDOT_URLS.INBOX);
}
}, [showConfirmModal, translate]);

const confirmApproval = useCallback(
(skipAnimation = false) => {
if (hasDynamicExternalWorkflow(policy) && !isDEWBetaEnabled) {
showDWEModal();
return;
}
setRequestType(CONST.IOU.REPORT_ACTION_TYPE.APPROVE);
if (isDelegateAccessRestricted) {
showDelegateNoAccessModal();
Expand Down Expand Up @@ -872,8 +854,6 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
},
[
policy,
isDEWBetaEnabled,
showDWEModal,
isDelegateAccessRestricted,
showDelegateNoAccessModal,
isAnyTransactionOnHold,
Expand Down Expand Up @@ -903,10 +883,7 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
if (!moneyRequestReport || shouldBlockSubmit) {
return;
}
if (hasDynamicExternalWorkflow(policy) && !isDEWBetaEnabled) {
showDWEModal();
return;
}

const doSubmit = () => {
submitReport({
expenseReport: moneyRequestReport,
Expand Down Expand Up @@ -946,8 +923,6 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
moneyRequestReport,
shouldBlockSubmit,
policy,
isDEWBetaEnabled,
showDWEModal,
startSubmittingAnimation,
accountID,
email,
Expand Down Expand Up @@ -1763,10 +1738,7 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
if (!moneyRequestReport) {
return;
}
if (hasDynamicExternalWorkflow(policy) && !isDEWBetaEnabled) {
showDWEModal();
return;
}

confirmPendingRTERAndProceed(() => {
submitReport({
expenseReport: moneyRequestReport,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {getButtonRole} from '@components/Button/utils';
import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu';
import {useDelegateNoAccessActions, useDelegateNoAccessState} from '@components/DelegateNoAccessModalProvider';
import Icon from '@components/Icon';
import {ModalActions} from '@components/Modal/Global/ModalContext';
import MoneyReportHeaderStatusBarSkeleton from '@components/MoneyReportHeaderStatusBarSkeleton';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import {PressableWithFeedback} from '@components/Pressable';
Expand All @@ -27,7 +26,6 @@ import type {PaymentActionParams} from '@components/SettlementButton/types';
import {showContextMenuForReport} from '@components/ShowContextMenuContext';
import StatusBadge from '@components/StatusBadge';
import Text from '@components/Text';
import useConfirmModal from '@hooks/useConfirmModal';
import useConfirmPendingRTERAndProceed from '@hooks/useConfirmPendingRTERAndProceed';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
Expand Down Expand Up @@ -83,7 +81,6 @@ import {hasAnyPendingRTERViolation as hasAnyPendingRTERViolationTransactionUtils
import colors from '@styles/theme/colors';
import variables from '@styles/variables';
import {approveMoneyRequest, canIOUBePaid as canIOUBePaidIOUActions, payInvoice, payMoneyRequest, submitReport} from '@userActions/IOU';
import {openOldDotLink} from '@userActions/Link';
import {markPendingRTERTransactionsAsCash} from '@userActions/Transaction';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
Expand Down Expand Up @@ -190,7 +187,6 @@ function MoneyRequestReportPreviewContent({

const {isPaidAnimationRunning, isApprovedAnimationRunning, isSubmittingAnimationRunning, stopAnimation, startAnimation, startApprovedAnimation, startSubmittingAnimation} =
usePaymentAnimations();
const {showConfirmModal} = useConfirmModal();
const [isHoldMenuVisible, setIsHoldMenuVisible] = useState(false);
const [requestType, setRequestType] = useState<ActionHandledType>();
const [paymentType, setPaymentType] = useState<PaymentMethodType>();
Expand All @@ -203,7 +199,6 @@ function MoneyRequestReportPreviewContent({
const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector});
const isDEWBetaEnabled = isBetaEnabled(CONST.BETAS.NEW_DOT_DEW);
const hasViolations = hasViolationsReportUtils(iouReport?.reportID, transactionViolations, currentUserAccountID, currentUserEmail);
const hasAnyPendingRTERViolation = useMemo(
() => hasAnyPendingRTERViolationTransactionUtils(transactions, transactionViolations, currentUserEmail, currentUserAccountID, iouReport, policy),
Expand Down Expand Up @@ -351,25 +346,7 @@ function MoneyRequestReportPreviewContent({
],
);

const showDEWModal = useCallback(() => {
showConfirmModal({
title: translate('customApprovalWorkflow.title'),
prompt: translate('customApprovalWorkflow.description'),
confirmText: translate('customApprovalWorkflow.goToExpensifyClassic'),
shouldShowCancelButton: false,
}).then((result) => {
if (result.action !== ModalActions.CONFIRM) {
return;
}
openOldDotLink(CONST.OLDDOT_URLS.INBOX);
});
}, [showConfirmModal, translate]);

const confirmApproval = () => {
if (hasDynamicExternalWorkflow(policy) && !isDEWBetaEnabled) {
showDEWModal();
return;
}
setRequestType(CONST.IOU.REPORT_ACTION_TYPE.APPROVE);
if (isDelegateAccessRestricted) {
showDelegateNoAccessModal();
Expand Down Expand Up @@ -774,10 +751,6 @@ function MoneyRequestReportPreviewContent({
success={isWaitingForSubmissionFromCurrentUser}
text={translate('common.submit')}
onPress={() => {
if (hasDynamicExternalWorkflow(policy) && !isDEWBetaEnabled) {
showDEWModal();
return;
}
confirmPendingRTERAndProceed(() => {
submitReport({
expenseReport: iouReport,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ function ExpenseReportListItem<TItem extends ListItem>({
onLongPressRow,
shouldSyncFocus,
onCheckboxPress,
onDEWModalOpen,
isDEWBetaEnabled,
lastPaymentMethod,
personalPolicyID,
}: ExpenseReportListItemProps<TItem>) {
Expand Down Expand Up @@ -133,8 +131,6 @@ function ExpenseReportListItem<TItem extends ListItem>({
lastPaymentMethod,
userBillingGraceEndPeriods,
currentSearchKey,
onDEWModalOpen,
isDEWBetaEnabled,
isDelegateAccessRestricted,
onDelegateAccessRestricted: showDelegateNoAccessModal,
personalPolicyID,
Expand All @@ -149,8 +145,6 @@ function ExpenseReportListItem<TItem extends ListItem>({
userBillingGraceEndPeriods,
personalPolicyID,
currentSearchKey,
onDEWModalOpen,
isDEWBetaEnabled,
isDelegateAccessRestricted,
showDelegateNoAccessModal,
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ type ReportListItemHeaderProps<TItem extends ListItem> = {
/** Whether the item is hovered */
isHovered?: boolean;

/** Callback to fire when DEW modal should be opened */
onDEWModalOpen?: () => void;

/** Whether the DEW beta flag is enabled */
isDEWBetaEnabled?: boolean;

/** The last payment method used per policy */
lastPaymentMethod?: OnyxEntry<LastPaymentMethod>;

Expand Down Expand Up @@ -214,8 +208,6 @@ function ReportListItemHeader<TItem extends ListItem>({
onDownArrowClick,
isExpanded,
isHovered,
onDEWModalOpen,
isDEWBetaEnabled,
lastPaymentMethod,
personalPolicyID,
}: ReportListItemHeaderProps<TItem>) {
Expand Down Expand Up @@ -249,8 +241,6 @@ function ReportListItemHeader<TItem extends ListItem>({
lastPaymentMethod,
userBillingGraceEndPeriods,
currentSearchKey,
onDEWModalOpen,
isDEWBetaEnabled,
isDelegateAccessRestricted,
onDelegateAccessRestricted: showDelegateNoAccessModal,
personalPolicyID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ function TransactionGroupListItem<TItem extends ListItem>({
searchType,
isOffline,
newTransactionID,
onDEWModalOpen,
isDEWBetaEnabled,
lastPaymentMethod,
personalPolicyID,
}: TransactionGroupListItemProps<TItem>) {
Expand Down Expand Up @@ -387,8 +385,6 @@ function TransactionGroupListItem<TItem extends ListItem>({
isSelectAllChecked={isSelectAllChecked}
isIndeterminate={isIndeterminate}
isHovered={hovered}
onDEWModalOpen={onDEWModalOpen}
isDEWBetaEnabled={isDEWBetaEnabled}
lastPaymentMethod={lastPaymentMethod}
personalPolicyID={personalPolicyID}
onDownArrowClick={onExpandIconPress}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ function TransactionListItem<TItem extends ListItem>({
isLoading,
violations,
customCardNames,
onDEWModalOpen,
isDEWBetaEnabled,
lastPaymentMethod,
personalPolicyID,
}: TransactionListItemProps<TItem>) {
Expand Down Expand Up @@ -162,8 +160,6 @@ function TransactionListItem<TItem extends ListItem>({
lastPaymentMethod,
userBillingGraceEndPeriods,
currentSearchKey,
onDEWModalOpen,
isDEWBetaEnabled,
isDelegateAccessRestricted,
onDelegateAccessRestricted: showDelegateNoAccessModal,
personalPolicyID,
Expand Down
14 changes: 0 additions & 14 deletions src/components/Search/SearchList/ListItem/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ type ExpenseReportListItemProps<TItem extends ListItem> = ListItemProps<TItem> &
/** Whether the item's action is loading */
isLoading?: boolean;

/** Callback to fire when DEW modal should be opened */
onDEWModalOpen?: () => void;

/** Whether the DEW beta flag is enabled */
isDEWBetaEnabled?: boolean;

/** The last payment method used per policy */
lastPaymentMethod?: OnyxEntry<LastPaymentMethod>;

Expand Down Expand Up @@ -403,10 +397,6 @@ type TransactionListItemProps<TItem extends ListItem> = ListItemProps<TItem> & {
columns?: SearchColumnType[];
violations?: Record<string, TransactionViolations | undefined> | undefined;
customCardNames?: Record<number, string>;
/** Callback to fire when DEW modal should be opened */
onDEWModalOpen?: () => void;
/** Whether the DEW beta flag is enabled */
isDEWBetaEnabled?: boolean;
/** The last payment method used per policy */
lastPaymentMethod?: OnyxEntry<LastPaymentMethod>;
/** The user's personal policy ID */
Expand All @@ -421,10 +411,6 @@ type TransactionGroupListItemProps<TItem extends ListItem> = ListItemProps<TItem
columns?: SearchColumnType[];
newTransactionID?: string;
violations?: Record<string, TransactionViolations | undefined> | undefined;
/** Callback to fire when DEW modal should be opened */
onDEWModalOpen?: () => void;
/** Whether the DEW beta flag is enabled */
isDEWBetaEnabled?: boolean;
/** The last payment method used per policy */
lastPaymentMethod?: OnyxEntry<LastPaymentMethod>;
/** The user's personal policy ID */
Expand Down
12 changes: 0 additions & 12 deletions src/components/Search/SearchList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ type SearchListProps = Pick<FlashListProps<SearchListItem>, 'onScroll' | 'conten
/** Custom card names */
customCardNames?: Record<number, string>;

/** Callback to fire when DEW modal should be opened */
onDEWModalOpen?: () => void;

/** Whether the DEW beta flag is enabled */
isDEWBetaEnabled?: boolean;

/** Selected transactions for determining isSelected state */
selectedTransactions: SelectedTransactions;

Expand Down Expand Up @@ -220,8 +214,6 @@ function SearchList({
newTransactions = [],
violations,
customCardNames,
onDEWModalOpen,
isDEWBetaEnabled,
selectedTransactions,
hasLoadedAllTransactions,
ref,
Expand Down Expand Up @@ -447,8 +439,6 @@ function SearchList({
isDisabled={isDisabled}
groupBy={groupBy}
searchType={type}
onDEWModalOpen={onDEWModalOpen}
isDEWBetaEnabled={isDEWBetaEnabled}
lastPaymentMethod={lastPaymentMethod}
personalPolicyID={personalPolicyID}
userWalletTierName={userWalletTierName}
Expand Down Expand Up @@ -488,8 +478,6 @@ function SearchList({
userBillingFundID,
isOffline,
violations,
onDEWModalOpen,
isDEWBetaEnabled,
lastPaymentMethod,
personalPolicyID,
customCardNames,
Expand Down
Loading
Loading