Skip to content

Commit 37e0699

Browse files
committed
feat: remove beta checks for newDotMultiFilesDragAndDrop
1 parent 4668539 commit 37e0699

10 files changed

Lines changed: 38 additions & 88 deletions

File tree

src/CONST/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ const CONST = {
642642
CUSTOM_RULES: 'customRules',
643643
GLOBAL_REIMBURSEMENTS_ON_ND: 'globalReimbursementsOnND',
644644
IS_TRAVEL_VERIFIED: 'isTravelVerified',
645-
NEWDOT_MULTI_FILES_DRAG_AND_DROP: 'newDotMultiFilesDragAndDrop',
646645
NEWDOT_MULTI_SCAN: 'newDotMultiScan',
647646
PLAID_COMPANY_CARDS: 'plaidCompanyCards',
648647
TRACK_FLOWS: 'trackFlows',

src/pages/Search/SearchPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ function SearchPage({route}: SearchPageProps) {
500500
if (shouldUseNarrowLayout) {
501501
return (
502502
<>
503-
<DragAndDropProvider isDisabled={!isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP)}>
503+
<DragAndDropProvider>
504504
{PDFValidationComponent}
505505
<SearchPageNarrow
506506
queryJSON={queryJSON}
@@ -577,7 +577,7 @@ function SearchPage({route}: SearchPageProps) {
577577
shouldShowOfflineIndicatorInWideScreen={!!shouldShowOfflineIndicator}
578578
offlineIndicatorStyle={styles.mtAuto}
579579
>
580-
<DragAndDropProvider isDisabled={!isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP)}>
580+
<DragAndDropProvider>
581581
{PDFValidationComponent}
582582
<SearchPageHeader
583583
queryJSON={queryJSON}

src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -311,19 +311,12 @@ function AttachmentPickerWithMenuItems({
311311
// 4. And the Create button is at the bottom.
312312
const createButtonContainerStyles = [styles.flexGrow0, styles.flexShrink0];
313313

314-
const isMultipleDragAndDropEnabled = isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP);
315-
316314
return (
317315
<AttachmentPicker
318-
allowMultiple={isMultipleDragAndDropEnabled}
319-
onOpenPicker={() => {
320-
if (!isMultipleDragAndDropEnabled) {
321-
return;
322-
}
323-
setIsLoaderVisible(true);
324-
}}
325-
fileLimit={isMultipleDragAndDropEnabled ? CONST.API_ATTACHMENT_VALIDATIONS.MAX_FILE_LIMIT : 1}
326-
shouldValidateImage={!isMultipleDragAndDropEnabled}
316+
allowMultiple
317+
onOpenPicker={() => setIsLoaderVisible(true)}
318+
fileLimit={CONST.API_ATTACHMENT_VALIDATIONS.MAX_FILE_LIMIT}
319+
shouldValidateImage={false}
327320
>
328321
{({openPicker}) => {
329322
const triggerAttachmentPicker = () => {

src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ function ReportActionCompose({
591591
if (isAttachmentPreviewActive) {
592592
return;
593593
}
594-
if (isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP) && event.dataTransfer?.files.length && event.dataTransfer?.files.length > 1) {
594+
if (event.dataTransfer?.files.length && event.dataTransfer?.files.length > 1) {
595595
const files = Array.from(event.dataTransfer?.files).map((file) => {
596596
// eslint-disable-next-line no-param-reassign
597597
file.uri = URL.createObjectURL(file);
@@ -668,16 +668,15 @@ function ReportActionCompose({
668668
onValueChange={onValueChange}
669669
didHideComposerInput={didHideComposerInput}
670670
/>
671-
{/* TODO: remove beta check after the feature is enabled */}
672-
{isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP) && shouldDisplayDualDropZone && (
671+
{shouldDisplayDualDropZone && (
673672
<DualDropZone
674673
isEditing={shouldAddOrReplaceReceipt && hasReceipt}
675674
onAttachmentDrop={handleAttachmentDrop}
676675
onReceiptDrop={handleAddingReceipt}
677676
shouldAcceptSingleReceipt={shouldAddOrReplaceReceipt}
678677
/>
679678
)}
680-
{isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP) && !shouldDisplayDualDropZone && (
679+
{!shouldDisplayDualDropZone && (
681680
<DragAndDropConsumer onDrop={handleAttachmentDrop}>
682681
<DropZoneUI
683682
icon={Expensicons.MessageInABottle}
@@ -688,20 +687,6 @@ function ReportActionCompose({
688687
/>
689688
</DragAndDropConsumer>
690689
)}
691-
{!isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP) && (
692-
<ReportDropUI
693-
onDrop={(event: DragEvent) => {
694-
if (isAttachmentPreviewActive) {
695-
return;
696-
}
697-
const data = event.dataTransfer?.files[0];
698-
if (data) {
699-
data.uri = URL.createObjectURL(data);
700-
displayFilesInModal([data]);
701-
}
702-
}}
703-
/>
704-
)}
705690
</>
706691
);
707692
}}

src/pages/iou/request/IOURequestStartPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function IOURequestStartPage({
176176
<ScreenWrapper
177177
shouldEnableKeyboardAvoidingView={false}
178178
shouldEnableMinHeight={canUseTouchScreen()}
179-
headerGapStyles={isDraggingOver ? [isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP) ? styles.dropWrapper : styles.receiptDropHeaderGap] : []}
179+
headerGapStyles={isDraggingOver ? styles.dropWrapper : []}
180180
testID={IOURequestStartPage.displayName}
181181
focusTrapSettings={{containerElements: focusTrapContainerElements}}
182182
>

src/pages/iou/request/step/IOURequestStepConfirmation.tsx

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ function IOURequestStepConfirmation({
318318
// If the participants weren't automatically added to the transaction, then we should go back to the IOURequestStepParticipants.
319319
if (!transaction?.participantsAutoAssigned && participantsAutoAssignedFromRoute !== 'true') {
320320
// TODO: temporary fix for multi-files dnd; check if other flow can use reportID instead of transaction?.reportID
321-
const shouldUseNewScanFlow = isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP) && (iouType === CONST.IOU.TYPE.TRACK || iouType === CONST.IOU.TYPE.SUBMIT);
321+
const shouldUseNewScanFlow = iouType === CONST.IOU.TYPE.TRACK || iouType === CONST.IOU.TYPE.SUBMIT;
322322
const backToReportID =
323323
shouldUseNewScanFlow && !transaction?.participants?.at(0)?.isPolicyExpenseChat
324324
? reportID
@@ -1002,7 +1002,7 @@ function IOURequestStepConfirmation({
10021002
<ScreenWrapper
10031003
shouldEnableMaxHeight={canUseTouchScreen()}
10041004
testID={IOURequestStepConfirmation.displayName}
1005-
headerGapStyles={isDraggingOver ? [isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP) ? styles.dropWrapper : styles.isDraggingOver] : []}
1005+
headerGapStyles={isDraggingOver ? [styles.dropWrapper] : []}
10061006
>
10071007
<DragAndDropProvider
10081008
setIsDraggingOver={setIsDraggingOver}
@@ -1035,20 +1035,15 @@ function IOURequestStepConfirmation({
10351035
</HeaderWithBackButton>
10361036
{(isLoading || (isScanRequest(transaction) && !Object.values(receiptFiles).length)) && <FullScreenLoadingIndicator />}
10371037
{PDFValidationComponent}
1038-
{/* TODO: remove beta check after the feature is enabled */}
1039-
{isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP) ? (
1040-
<DragAndDropConsumer onDrop={handleDroppingReceipt}>
1041-
<DropZoneUI
1042-
icon={isEditingReceipt ? Expensicons.ReplaceReceipt : Expensicons.SmartScan}
1043-
dropStyles={styles.receiptDropOverlay(true)}
1044-
dropTitle={translate(isEditingReceipt ? 'dropzone.replaceReceipt' : 'quickAction.scanReceipt')}
1045-
dropTextStyles={styles.receiptDropText}
1046-
dropInnerWrapperStyles={styles.receiptDropInnerWrapper(true)}
1047-
/>
1048-
</DragAndDropConsumer>
1049-
) : (
1050-
<ReceiptDropUI onDrop={handleDroppingReceipt} />
1051-
)}
1038+
<DragAndDropConsumer onDrop={handleDroppingReceipt}>
1039+
<DropZoneUI
1040+
icon={isEditingReceipt ? Expensicons.ReplaceReceipt : Expensicons.SmartScan}
1041+
dropStyles={styles.receiptDropOverlay(true)}
1042+
dropTitle={translate(isEditingReceipt ? 'dropzone.replaceReceipt' : 'quickAction.scanReceipt')}
1043+
dropTextStyles={styles.receiptDropText}
1044+
dropInnerWrapperStyles={styles.receiptDropInnerWrapper(true)}
1045+
/>
1046+
</DragAndDropConsumer>
10521047
{ErrorModal}
10531048
{!!gpsRequired && (
10541049
<LocationPermissionModal

src/pages/iou/request/step/IOURequestStepParticipants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function IOURequestStepParticipants({
160160
const rateID = DistanceRequestUtils.getCustomUnitRateID(selfDMReportID);
161161
transactions.forEach((transaction) => {
162162
setCustomUnitRateID(transaction.transactionID, rateID);
163-
const shouldSetParticipantAutoAssignment = isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP) && iouType === CONST.IOU.TYPE.CREATE;
163+
const shouldSetParticipantAutoAssignment = iouType === CONST.IOU.TYPE.CREATE;
164164
setMoneyRequestParticipantsFromReport(transaction.transactionID, selfDMReport, shouldSetParticipantAutoAssignment ? isActivePolicyRequest : true);
165165
});
166166
const iouConfirmationPageRoute = ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(action, CONST.IOU.TYPE.TRACK, initialTransactionID, selfDMReportID);

src/pages/iou/request/step/IOURequestStepScan/index.native.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function IOURequestStepScan({
132132
return allTransactions.filter((transaction): transaction is Transaction => !!transaction);
133133
}, [initialTransaction, initialTransactionID, optimisticTransactions]);
134134

135-
const shouldAcceptMultipleFiles = isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP) && !isEditing && !backTo;
135+
const shouldAcceptMultipleFiles = !isEditing && !backTo;
136136

137137
const selfDMReportID = useMemo(() => findSelfDMReportID(), []);
138138

src/pages/iou/request/step/IOURequestStepScan/index.tsx

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {useIsFocused} from '@react-navigation/native';
22
import React, {useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState} from 'react';
3-
import {ActivityIndicator, InteractionManager, PanResponder, PixelRatio, StyleSheet, View} from 'react-native';
3+
import {ActivityIndicator, InteractionManager, PanResponder, StyleSheet, View} from 'react-native';
44
import type {OnyxEntry} from 'react-native-onyx';
55
import {RESULTS} from 'react-native-permissions';
66
import Animated, {useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated';
@@ -47,7 +47,6 @@ import {isPaidGroupPolicy} from '@libs/PolicyUtils';
4747
import {findSelfDMReportID, generateReportID, getPolicyExpenseChat, isArchivedReport, isPolicyExpenseChat} from '@libs/ReportUtils';
4848
import {shouldRestrictUserBillableActions} from '@libs/SubscriptionUtils';
4949
import {getDefaultTaxCode, hasReceipt} from '@libs/TransactionUtils';
50-
import ReceiptDropUI from '@pages/iou/ReceiptDropUI';
5150
import StepScreenDragAndDropWrapper from '@pages/iou/request/step/StepScreenDragAndDropWrapper';
5251
import withFullTransactionOrNotFound from '@pages/iou/request/step/withFullTransactionOrNotFound';
5352
import withWritableReportOrNotFound from '@pages/iou/request/step/withWritableReportOrNotFound';
@@ -98,7 +97,6 @@ function IOURequestStepScan({
9897

9998
const [startLocationPermissionFlow, setStartLocationPermissionFlow] = useState(false);
10099
const [receiptFiles, setReceiptFiles] = useState<ReceiptFile[]>([]);
101-
const [receiptImageTopPosition, setReceiptImageTopPosition] = useState(0);
102100
// we need to use isSmallScreenWidth instead of shouldUseNarrowLayout because drag and drop is not supported on mobile
103101
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
104102
const {isSmallScreenWidth} = useResponsiveLayout();
@@ -140,8 +138,7 @@ function IOURequestStepScan({
140138
const transactionTaxCode = (initialTransaction?.taxCode ? initialTransaction?.taxCode : defaultTaxCode) ?? '';
141139
const transactionTaxAmount = initialTransaction?.taxAmount ?? 0;
142140

143-
const canUseMultiDragAndDrop = isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP);
144-
const shouldAcceptMultipleFiles = canUseMultiDragAndDrop && !isEditing && !backTo;
141+
const shouldAcceptMultipleFiles = !isEditing && !backTo;
145142

146143
const selfDMReportID = useMemo(() => findSelfDMReportID(), []);
147144

@@ -974,13 +971,10 @@ function IOURequestStepScan({
974971
const desktopUploadView = () => (
975972
<>
976973
{PDFValidationComponent}
977-
<View onLayout={({nativeEvent}) => setReceiptImageTopPosition(PixelRatio.roundToNearestPixel((nativeEvent.layout as DOMRect).top))}>
978-
<ReceiptUpload
979-
width={CONST.RECEIPT.ICON_SIZE}
980-
height={CONST.RECEIPT.ICON_SIZE}
981-
/>
982-
</View>
983-
974+
<ReceiptUpload
975+
width={CONST.RECEIPT.ICON_SIZE}
976+
height={CONST.RECEIPT.ICON_SIZE}
977+
/>
984978
<View
985979
style={[styles.uploadFileViewTextContainer, styles.userSelectNone]}
986980
// eslint-disable-next-line react/jsx-props-no-spreading
@@ -1037,31 +1031,15 @@ function IOURequestStepScan({
10371031
<View style={[styles.flex1, !isMobile() && styles.alignItemsCenter, styles.justifyContentCenter]}>
10381032
{!(isDraggingOver ?? isDraggingOverWrapper) && (isMobile() ? mobileCameraView() : desktopUploadView())}
10391033
</View>
1040-
{/* TODO: remove beta check after the feature is enabled */}
1041-
{canUseMultiDragAndDrop ? (
1042-
<DragAndDropConsumer onDrop={handleDropReceipt}>
1043-
<DropZoneUI
1044-
icon={isReplacingReceipt ? Expensicons.ReplaceReceipt : Expensicons.SmartScan}
1045-
dropStyles={styles.receiptDropOverlay(true)}
1046-
dropTitle={
1047-
isReplacingReceipt ? translate('dropzone.replaceReceipt') : translate(shouldAcceptMultipleFiles ? 'dropzone.scanReceipts' : 'quickAction.scanReceipt')
1048-
}
1049-
dropTextStyles={styles.receiptDropText}
1050-
dropInnerWrapperStyles={styles.receiptDropInnerWrapper(true)}
1051-
/>
1052-
</DragAndDropConsumer>
1053-
) : (
1054-
<ReceiptDropUI
1055-
onDrop={(e) => {
1056-
const file = e?.dataTransfer?.files[0];
1057-
if (file) {
1058-
file.uri = URL.createObjectURL(file);
1059-
validateFiles([file]);
1060-
}
1061-
}}
1062-
receiptImageTopPosition={receiptImageTopPosition}
1034+
<DragAndDropConsumer onDrop={handleDropReceipt}>
1035+
<DropZoneUI
1036+
icon={isReplacingReceipt ? Expensicons.ReplaceReceipt : Expensicons.SmartScan}
1037+
dropStyles={styles.receiptDropOverlay(true)}
1038+
dropTitle={isReplacingReceipt ? translate('dropzone.replaceReceipt') : translate(shouldAcceptMultipleFiles ? 'dropzone.scanReceipts' : 'quickAction.scanReceipt')}
1039+
dropTextStyles={styles.receiptDropText}
1040+
dropInnerWrapperStyles={styles.receiptDropInnerWrapper(true)}
10631041
/>
1064-
)}
1042+
</DragAndDropConsumer>
10651043
{/* We use isMobile() here to explicitly hide DownloadAppBanner component on both mobile web and native apps */}
10661044
{!isMobile() && <DownloadAppBanner />}
10671045
{ErrorModal}

src/pages/iou/request/step/StepScreenDragAndDropWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function StepScreenDragAndDropWrapper({testID, headerTitle, onBackButtonPress, o
4949
onEntryTransitionEnd={onEntryTransitionEnd}
5050
testID={testID}
5151
shouldEnableMaxHeight={canUseTouchScreen()}
52-
headerGapStyles={isDraggingOver ? [isBetaEnabled(CONST.BETAS.NEWDOT_MULTI_FILES_DRAG_AND_DROP) ? styles.dropWrapper : styles.isDraggingOver] : []}
52+
headerGapStyles={isDraggingOver ? styles.dropWrapper : []}
5353
>
5454
{({safeAreaPaddingBottomStyle}) => (
5555
<DragAndDropProvider setIsDraggingOver={setIsDraggingOver}>

0 commit comments

Comments
 (0)