Skip to content

Commit a2970b8

Browse files
authored
Merge pull request Expensify#64681 from Expensify/dangrous-removeretractbeta
Remove BETA_RETRACT_NEWDOT
2 parents 6d120bf + 9a44fba commit a2970b8

4 files changed

Lines changed: 8 additions & 15 deletions

File tree

src/CONST/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,6 @@ const CONST = {
824824
CUSTOM_RULES: 'customRules',
825825
WALLET: 'newdotWallet',
826826
GLOBAL_REIMBURSEMENTS_ON_ND: 'globalReimbursementsOnND',
827-
RETRACT_NEWDOT: 'retractNewDot',
828827
IS_TRAVEL_VERIFIED: 'isTravelVerified',
829828
MULTI_LEVEL_TAGS: 'multiLevelTags',
830829
NEWDOT_MULTI_FILES_DRAG_AND_DROP: 'newDotMultiFilesDragAndDrop',

src/components/MoneyReportHeader.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import useMobileSelectionMode from '@hooks/useMobileSelectionMode';
99
import useNetwork from '@hooks/useNetwork';
1010
import usePaymentAnimations from '@hooks/usePaymentAnimations';
1111
import usePaymentOptions from '@hooks/usePaymentOptions';
12-
import usePermissions from '@hooks/usePermissions';
1312
import useReportIsArchived from '@hooks/useReportIsArchived';
1413
import useResponsiveLayout from '@hooks/useResponsiveLayout';
1514
import useSelectedTransactionsActions from '@hooks/useSelectedTransactionsActions';
@@ -615,7 +614,6 @@ function MoneyReportHeader({
615614
};
616615

617616
const [offlineModalVisible, setOfflineModalVisible] = useState(false);
618-
const {isBetaEnabled} = usePermissions();
619617

620618
const beginPDFExport = (reportID: string) => {
621619
setIsPDFModalVisible(true);
@@ -635,10 +633,9 @@ function MoneyReportHeader({
635633
reportNameValuePairs,
636634
reportActions,
637635
policies,
638-
canUseRetractNewDot: isBetaEnabled(CONST.BETAS.RETRACT_NEWDOT),
639636
isChatReportArchived,
640637
});
641-
}, [moneyRequestReport, transactions, violations, policy, reportNameValuePairs, reportActions, policies, isBetaEnabled, chatReport, isChatReportArchived]);
638+
}, [moneyRequestReport, transactions, violations, policy, reportNameValuePairs, reportActions, policies, chatReport, isChatReportArchived]);
642639

643640
const secondaryActionsImplementation: Record<
644641
ValueOf<typeof CONST.REPORT.SECONDARY_ACTIONS>,

src/libs/ReportSecondaryActionUtils.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ function getSecondaryReportActions({
493493
reportNameValuePairs,
494494
reportActions,
495495
policies,
496-
canUseRetractNewDot,
497496
isChatReportArchived = false,
498497
}: {
499498
report: Report;
@@ -504,7 +503,6 @@ function getSecondaryReportActions({
504503
reportNameValuePairs?: ReportNameValuePairs;
505504
reportActions?: ReportAction[];
506505
policies?: OnyxCollection<Policy>;
507-
canUseRetractNewDot?: boolean;
508506
canUseNewDotSplits?: boolean;
509507
isChatReportArchived?: boolean;
510508
}): Array<ValueOf<typeof CONST.REPORT.SECONDARY_ACTIONS>> {
@@ -542,11 +540,11 @@ function getSecondaryReportActions({
542540
options.push(CONST.REPORT.SECONDARY_ACTIONS.MARK_AS_EXPORTED);
543541
}
544542

545-
if (canUseRetractNewDot && isRetractAction(report, policy)) {
543+
if (isRetractAction(report, policy)) {
546544
options.push(CONST.REPORT.SECONDARY_ACTIONS.RETRACT);
547545
}
548546

549-
if (canUseRetractNewDot && isReopenAction(report, policy)) {
547+
if (isReopenAction(report, policy)) {
550548
options.push(CONST.REPORT.SECONDARY_ACTIONS.REOPEN);
551549
}
552550

tests/unit/ReportSecondaryActionUtilsTest.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('getSecondaryAction', () => {
7272
transactionID: TRANSACTION_ID,
7373
} as unknown as Transaction;
7474

75-
const result = getSecondaryReportActions({report, chatReport, reportTransactions: [transaction], violations: {}, policy, canUseRetractNewDot: true});
75+
const result = getSecondaryReportActions({report, chatReport, reportTransactions: [transaction], violations: {}, policy});
7676
expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.ADD_EXPENSE)).toBe(true);
7777
});
7878

@@ -491,7 +491,7 @@ describe('getSecondaryAction', () => {
491491
await Onyx.merge(ONYXKEYS.SESSION, {email: EMPLOYEE_EMAIL, accountID: EMPLOYEE_ACCOUNT_ID});
492492
await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails);
493493

494-
const result = getSecondaryReportActions({report, chatReport, reportTransactions: [], violations: {}, policy, policies, canUseRetractNewDot: true});
494+
const result = getSecondaryReportActions({report, chatReport, reportTransactions: [], violations: {}, policy, policies});
495495
expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE)).toBe(true);
496496
});
497497

@@ -524,7 +524,7 @@ describe('getSecondaryAction', () => {
524524
await Onyx.merge(ONYXKEYS.SESSION, {email: EMPLOYEE_EMAIL, accountID: EMPLOYEE_ACCOUNT_ID});
525525
await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails);
526526

527-
const result = getSecondaryReportActions({report, chatReport, reportTransactions: [], violations: {}, policy, policies, canUseRetractNewDot: true});
527+
const result = getSecondaryReportActions({report, chatReport, reportTransactions: [], violations: {}, policy, policies});
528528
expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE)).toBe(true);
529529
});
530530

@@ -577,7 +577,6 @@ describe('getSecondaryAction', () => {
577577
violations: {},
578578
policy: oldPolicy,
579579
policies,
580-
canUseRetractNewDot: true,
581580
});
582581
expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE)).toBe(true);
583582
});
@@ -624,7 +623,7 @@ describe('getSecondaryAction', () => {
624623
await Onyx.merge(ONYXKEYS.SESSION, {email: APPROVER_EMAIL, accountID: APPROVER_ACCOUNT_ID});
625624
await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails);
626625

627-
const result = getSecondaryReportActions({report, chatReport, reportTransactions: [], violations: {}, policy, policies, canUseRetractNewDot: true});
626+
const result = getSecondaryReportActions({report, chatReport, reportTransactions: [], violations: {}, policy, policies});
628627
expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE)).toBe(true);
629628
});
630629

@@ -672,7 +671,7 @@ describe('getSecondaryAction', () => {
672671
await Onyx.merge(ONYXKEYS.SESSION, {email: ADMIN_EMAIL, accountID: ADMIN_ACCOUNT_ID});
673672
await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails);
674673

675-
const result = getSecondaryReportActions({report, chatReport, reportTransactions: [], violations: {}, policy, policies, canUseRetractNewDot: true});
674+
const result = getSecondaryReportActions({report, chatReport, reportTransactions: [], violations: {}, policy, policies});
676675
expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE)).toBe(true);
677676
});
678677

0 commit comments

Comments
 (0)