Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3799f5d
Update CTA and workspace chat copy for track-intent users
MelvinBot Mar 26, 2026
b9657d6
Fix: run Prettier to fix import ordering
MelvinBot Mar 26, 2026
c79e8ec
Fix: add missing translation keys to all non-English language files
MelvinBot Mar 26, 2026
e6a100e
Fix: replace Unicode smart quotes with straight quotes in fr.ts strin…
MelvinBot Mar 26, 2026
177b9ad
Fix: restore fr.ts from main and reapply changes without smart quote …
MelvinBot Mar 26, 2026
4bbb82c
Fix: update sidebar badge and search/reports CTA to show 'Mark as don…
MelvinBot Mar 27, 2026
4cbace3
Fix: run Prettier on OptionRowLHN.tsx
MelvinBot Mar 27, 2026
5b52d76
Fix: resolve nested ternary and add missing useMemo dependencies
MelvinBot Mar 27, 2026
d9aec65
Fix: show 'Marked as done' instead of 'Submitted' in animation for tr…
MelvinBot Mar 27, 2026
681b05d
Fix: use extraSmall button for 'Mark as done' in ActionCell to preven…
MelvinBot Mar 27, 2026
fe068f9
Merge remote-tracking branch 'origin/main' into claude-updateTrackInt…
MelvinBot Mar 30, 2026
fe98ba7
Fix: only use 'Mark as done' copy when workspace has approvals disabled
MelvinBot Mar 30, 2026
0413a9a
Fix: run prettier to fix import ordering
MelvinBot Mar 30, 2026
7396cc4
Fix: remove unused datetimeToCalendarTime destructuring
MelvinBot Mar 30, 2026
7716c0f
Fix: keep original button size for 'Mark as done' in ActionCell
MelvinBot Mar 30, 2026
f2cff70
Fix: reduce horizontal padding on 'Mark as done' button in ActionCell
MelvinBot Mar 30, 2026
dc09c57
Update beginningOfChatHistoryPolicyExpenseChatTrack copy across all l…
MelvinBot Mar 30, 2026
d678c25
Fix: apply proper translations for non-English language files
MelvinBot Mar 30, 2026
56e46bd
Merge remote-tracking branch 'origin/main' into claude-updateTrackInt…
MelvinBot Mar 30, 2026
9a72261
Fix: add missing betas argument to createTransactionThreadReport call
MelvinBot Mar 30, 2026
505694b
Revert unnecessary approve-related overrides for track-intent users
MelvinBot Mar 30, 2026
7954df8
Merge remote-tracking branch 'origin/claude-updateTrackIntentCopy' in…
MelvinBot Mar 30, 2026
ff4a429
Merge remote-tracking branch 'origin/main' into claude-updateTrackInt…
MelvinBot Mar 31, 2026
604fbeb
Revert innerStyles change and use 'Done' instead of 'Mark as done' in…
MelvinBot Mar 31, 2026
b2a11d4
Merge remote-tracking branch 'origin/main' into claude-updateTrackInt…
MelvinBot Apr 1, 2026
0f69e48
Fix: preserve policy description priority and guard empty selectedRep…
MelvinBot Apr 1, 2026
05f7ee1
Merge main into claude-updateTrackIntentCopy and resolve conflicts
MelvinBot Apr 1, 2026
d71c6b3
Fix: run prettier on ApprovePrimaryAction and SubmitPrimaryAction
MelvinBot Apr 1, 2026
1d2af42
Fix: define missing submitButtonText and approveButtonText in MoneyRe…
MelvinBot Apr 1, 2026
cbe6818
Fix: pass missing betas param to openReport in TestDriveDemo
MelvinBot Apr 1, 2026
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
13 changes: 11 additions & 2 deletions src/components/AnimatedSubmitButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import {isTrackIntentUserSelector} from '@selectors/Onboarding';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import type {View} from 'react-native';
import Animated, {Keyframe, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated';
import {scheduleOnRN} from 'react-native-worklets';
import Button from '@components/Button';
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import {isSubmitAndClose} from '@libs/PolicyUtils';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type WithSentryLabel from '@src/types/utils/SentryLabel';

type AnimatedSubmitButtonProps = WithSentryLabel & {
Expand All @@ -28,11 +32,16 @@ type AnimatedSubmitButtonProps = WithSentryLabel & {

// Whether the button should be disabled
isDisabled?: boolean;

// The policy ID for the report, used to check approval mode
policyID?: string;
};

function AnimatedSubmitButton({success, text, onPress, isSubmittingAnimationRunning, onAnimationFinish, isDisabled, sentryLabel}: AnimatedSubmitButtonProps) {
function AnimatedSubmitButton({success, text, onPress, isSubmittingAnimationRunning, onAnimationFinish, isDisabled, sentryLabel, policyID}: AnimatedSubmitButtonProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});
const [animationPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`);
const isAnimationRunning = isSubmittingAnimationRunning;
const buttonDuration = isSubmittingAnimationRunning ? CONST.ANIMATION_SUBMIT_DURATION : CONST.ANIMATION_SUBMITTED_DURATION;
const gap = styles.expenseAndReportPreviewTextButtonContainer.gap;
Expand Down Expand Up @@ -120,7 +129,7 @@ function AnimatedSubmitButton({success, text, onPress, isSubmittingAnimationRunn
>
<Button
success={success}
text={showLoading ? text : translate('common.submitted')}
text={showLoading ? text : translate(isTrackIntentUser && isSubmitAndClose(animationPolicy) ? 'common.markedAsDoneStatus' : 'common.submitted')}
isLoading={showLoading}
icon={!showLoading ? icon : undefined}
isDisabled
Expand Down
8 changes: 7 additions & 1 deletion src/components/LHNOptionsList/OptionRowLHN.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function OptionRowLHN({
isScreenFocused = false,
testID,
conciergeReportID,
isApprovalDisabledForReport,
}: OptionRowLHNProps) {
const {isProduction} = useEnvironment();
const theme = useTheme();
Expand Down Expand Up @@ -163,7 +164,12 @@ function OptionRowLHN({
}

const brickRoadIndicator = optionItem.brickRoadIndicator;
const actionBadgeText = !isProduction && optionItem.actionBadge ? translate(`common.actionBadge.${optionItem.actionBadge}`) : '';
const isTrackIntentUser = onboardingPurpose === CONST.ONBOARDING_CHOICES.TRACK_WORKSPACE || onboardingPurpose === CONST.ONBOARDING_CHOICES.PERSONAL_SPEND;
const shouldUseMarkAsDone = isTrackIntentUser && isApprovalDisabledForReport && optionItem.actionBadge === CONST.REPORT.ACTION_BADGE.SUBMIT;
let actionBadgeText = '';
if (!isProduction && optionItem.actionBadge) {
actionBadgeText = shouldUseMarkAsDone ? translate('common.markAsDone') : translate(`common.actionBadge.${optionItem.actionBadge}`);
}
let accessibilityLabelForBadge = '';
if (brickRoadIndicator) {
accessibilityLabelForBadge = [translate('common.yourReviewIsRequired'), actionBadgeText].filter(Boolean).join(', ');
Expand Down
2 changes: 2 additions & 0 deletions src/components/LHNOptionsList/OptionRowLHNData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'
import useGetExpensifyCardFromReportAction from '@hooks/useGetExpensifyCardFromReportAction';
import useOnyx from '@hooks/useOnyx';
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
import {isSubmitAndClose} from '@libs/PolicyUtils';
import {getLastVisibleActionIncludingTransactionThread, getOriginalMessage, isActionableTrackExpense, isInviteOrRemovedAction} from '@libs/ReportActionsUtils';
import {canUserPerformWriteAction as canUserPerformWriteActionUtil} from '@libs/ReportUtils';
import SidebarUtils from '@libs/SidebarUtils';
Expand Down Expand Up @@ -180,6 +181,7 @@ function OptionRowLHNData({
report={fullReport}
hasDraftComment={hasDraftComment}
conciergeReportID={conciergeReportID}
isApprovalDisabledForReport={isSubmitAndClose(policy)}
/>
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/LHNOptionsList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ type OptionRowLHNProps = {

/** The concierge report ID from Onyx */
conciergeReportID: OnyxEntry<string>;

/** Whether the report's policy has approvals disabled (submit and close) */
isApprovalDisabledForReport?: boolean;
};

type RenderItemProps = {item: Report; index: number};
Expand Down
18 changes: 12 additions & 6 deletions src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useRoute} from '@react-navigation/native';
import {isUserValidatedSelector} from '@selectors/Account';
import {shouldFailAllRequestsSelector} from '@selectors/Network';
import {hasSeenTourSelector} from '@selectors/Onboarding';
import {hasSeenTourSelector, isTrackIntentUserSelector} from '@selectors/Onboarding';
import passthroughPolicyTagListSelector from '@selectors/PolicyTagList';
import {validTransactionDraftsSelector} from '@selectors/TransactionDraft';
import truncate from 'lodash/truncate';
Expand Down Expand Up @@ -70,7 +70,7 @@ import {
} from '@libs/NextStepUtils';
import type {KYCFlowEvent, TriggerKYCFlow} from '@libs/PaymentUtils';
import {handleUnvalidatedAccount, selectPaymentType} from '@libs/PaymentUtils';
import {getConnectedIntegration, getValidConnectedIntegration, hasDynamicExternalWorkflow, isPolicyAccessible, sortPoliciesByName} from '@libs/PolicyUtils';
import {getConnectedIntegration, getValidConnectedIntegration, hasDynamicExternalWorkflow, isPolicyAccessible, isSubmitAndClose, sortPoliciesByName} from '@libs/PolicyUtils';
import {
getFilteredReportActionsForReportView,
getIOUActionForTransactionID,
Expand Down Expand Up @@ -366,6 +366,10 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
const [downloadErrorModalVisible, setDownloadErrorModalVisible] = useState(false);
const [isPDFModalVisible, setIsPDFModalVisible] = useState(false);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});
const shouldUseMarkAsDoneCopy = isTrackIntentUser && isSubmitAndClose(policy);
const submitButtonText = shouldUseMarkAsDoneCopy ? translate('common.markAsDone') : translate('common.submit');
const approveButtonText = shouldUseMarkAsDoneCopy ? translate('common.markAsDone') : translate('iou.approve');
const [outstandingReportsByPolicyID] = useOnyx(ONYXKEYS.DERIVED.OUTSTANDING_REPORTS_BY_POLICY_ID);
const currentTransaction = transactions.at(0);
const [originalIOUTransaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${getNonEmptyStringOnyxID(currentTransaction?.comment?.originalTransactionID)}`);
Expand Down Expand Up @@ -1340,15 +1344,15 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
const actions: Array<DropdownOption<string> & Pick<PopoverMenuItem, 'backButtonText' | 'rightIcon'>> = [];
if (hasSubmitAction && !shouldBlockSubmit) {
actions.push({
text: translate('common.submit'),
text: submitButtonText,
icon: expensifyIcons.Send,
value: CONST.REPORT.PRIMARY_ACTIONS.SUBMIT,
onSelected: () => handleSubmitReport(true),
});
}
if (hasApproveAction && !isBlockSubmitDueToPreventSelfApproval) {
actions.push({
text: translate('iou.approve'),
text: approveButtonText,
icon: expensifyIcons.ThumbsUp,
value: CONST.REPORT.PRIMARY_ACTIONS.APPROVE,
onSelected: () => {
Expand Down Expand Up @@ -1397,6 +1401,8 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
expensifyIcons.Send,
expensifyIcons.ThumbsUp,
kycWallRef,
approveButtonText,
submitButtonText,
]);

const connectedIntegrationName = connectedIntegration
Expand Down Expand Up @@ -1472,7 +1478,7 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
},
[CONST.REPORT.SECONDARY_ACTIONS.SUBMIT]: {
value: CONST.REPORT.SECONDARY_ACTIONS.SUBMIT,
text: translate('common.submit'),
text: submitButtonText,
icon: expensifyIcons.Send,
sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.SUBMIT,
onSelected: () => {
Expand All @@ -1497,7 +1503,7 @@ function MoneyReportHeader({reportID: reportIDProp, shouldDisplayBackButton = fa
},
},
[CONST.REPORT.SECONDARY_ACTIONS.APPROVE]: {
text: translate('iou.approve'),
text: approveButtonText,
icon: expensifyIcons.ThumbsUp,
value: CONST.REPORT.SECONDARY_ACTIONS.APPROVE,
sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.APPROVE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {isTrackIntentUserSelector} from '@selectors/Onboarding';
import React from 'react';
import Button from '@components/Button';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
import {isSubmitAndClose} from '@libs/PolicyUtils';
import {getNextApproverAccountID, isReportOwner} from '@libs/ReportUtils';
import ONYXKEYS from '@src/ONYXKEYS';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';
Expand All @@ -19,7 +21,9 @@ function ApprovePrimaryAction({reportID, startApprovedAnimation, onHoldMenuOpen}

const [moneyRequestReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(moneyRequestReport?.policyID)}`);
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});

const shouldUseMarkAsDoneCopy = isTrackIntentUser && isSubmitAndClose(policy);
const nextApproverAccountID = getNextApproverAccountID(moneyRequestReport);
const isSubmitterSameAsNextApprover =
isReportOwner(moneyRequestReport) && (nextApproverAccountID === moneyRequestReport?.ownerAccountID || moneyRequestReport?.managerID === moneyRequestReport?.ownerAccountID);
Expand All @@ -31,7 +35,7 @@ function ApprovePrimaryAction({reportID, startApprovedAnimation, onHoldMenuOpen}
<Button
success
onPress={confirmApproval}
text={translate('iou.approve')}
text={shouldUseMarkAsDoneCopy ? translate('common.markAsDone') : translate('iou.approve')}
isDisabled={isBlockSubmitDueToPreventSelfApproval}
/>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {isTrackIntentUserSelector} from '@selectors/Onboarding';
import React from 'react';
import AnimatedSubmitButton from '@components/AnimatedSubmitButton';
import {useSearchStateContext} from '@components/Search/SearchContext';
Expand All @@ -13,6 +14,7 @@ import useStrictPolicyRules from '@hooks/useStrictPolicyRules';
import useTransactionsAndViolationsForReport from '@hooks/useTransactionsAndViolationsForReport';
import {search} from '@libs/actions/Search';
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
import {isSubmitAndClose} from '@libs/PolicyUtils';
import {getFilteredReportActionsForReportView} from '@libs/ReportActionsUtils';
import {getNextApproverAccountID, hasViolations as hasViolationsReportUtils, isReportOwner, shouldBlockSubmitDueToStrictPolicyRules} from '@libs/ReportUtils';
import {hasAnyPendingRTERViolation as hasAnyPendingRTERViolationTransactionUtils} from '@libs/TransactionUtils';
Expand Down Expand Up @@ -42,6 +44,7 @@ function SubmitPrimaryAction({reportID, isSubmittingAnimationRunning, stopAnimat
const [amountOwed] = useOnyx(ONYXKEYS.NVP_PRIVATE_AMOUNT_OWED);
const [ownerBillingGracePeriodEnd] = useOnyx(ONYXKEYS.NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END);
const [allTransactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});

const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT);
const {reportActions: unfilteredReportActions} = usePaginatedReportActions(moneyRequestReport?.reportID);
Expand Down Expand Up @@ -69,6 +72,7 @@ function SubmitPrimaryAction({reportID, isSubmittingAnimationRunning, stopAnimat
transactions,
);
const shouldBlockSubmit = isBlockSubmitDueToStrictPolicyRules || isBlockSubmitDueToPreventSelfApproval;
const shouldUseMarkAsDoneCopy = isTrackIntentUser && isSubmitAndClose(policy);

const {currentSearchQueryJSON, currentSearchKey, currentSearchResults} = useSearchStateContext();
const shouldCalculateTotals = useSearchShouldCalculateTotals(currentSearchKey, currentSearchQueryJSON?.hash, true);
Expand Down Expand Up @@ -107,7 +111,7 @@ function SubmitPrimaryAction({reportID, isSubmittingAnimationRunning, stopAnimat
return (
<AnimatedSubmitButton
success
text={translate('common.submit')}
text={shouldUseMarkAsDoneCopy ? translate('common.markAsDone') : translate('common.submit')}
onPress={handleSubmit}
isSubmittingAnimationRunning={isSubmittingAnimationRunning}
onAnimationFinish={stopAnimation}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {isTrackIntentUserSelector} from '@selectors/Onboarding';
import React from 'react';
import AnimatedSubmitButton from '@components/AnimatedSubmitButton';
import useConfirmPendingRTERAndProceed from '@hooks/useConfirmPendingRTERAndProceed';
Expand All @@ -6,6 +7,7 @@ import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import {isSubmitAndClose} from '@libs/PolicyUtils';
import {canSubmitAndIsAwaitingForCurrentUser, getReportTransactions, hasViolations as hasViolationsReportUtils} from '@libs/ReportUtils';
import {hasAnyPendingRTERViolation as hasAnyPendingRTERViolationTransactionUtils} from '@libs/TransactionUtils';
import {submitReport} from '@userActions/IOU';
Expand Down Expand Up @@ -37,6 +39,7 @@ function SubmitActionButton({iouReportID, chatReportID, isSubmittingAnimationRun
const [ownerBillingGracePeriodEnd] = useOnyx(ONYXKEYS.NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END);
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReportID}`);
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});
const {isOffline} = useNetwork();
const transactions = getReportTransactions(iouReportID).filter((t) => isOffline || t.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);

Expand Down Expand Up @@ -64,7 +67,7 @@ function SubmitActionButton({iouReportID, chatReportID, isSubmittingAnimationRun
return (
<AnimatedSubmitButton
success={isWaitingForSubmissionFromCurrentUser}
text={translate('common.submit')}
text={isTrackIntentUser && isSubmitAndClose(policy) ? translate('common.markAsDone') : translate('common.submit')}
onPress={() => {
confirmPendingRTERAndProceed(() => {
submitReport({
Expand All @@ -85,6 +88,7 @@ function SubmitActionButton({iouReportID, chatReportID, isSubmittingAnimationRun
isSubmittingAnimationRunning={isSubmittingAnimationRunning}
onAnimationFinish={stopAnimation}
sentryLabel={CONST.SENTRY_LABEL.REPORT_PREVIEW.SUBMIT_BUTTON}
policyID={iouReport?.policyID}
/>
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/ReportWelcomeText.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {isTrackIntentUserSelector} from '@selectors/Onboarding';
import React from 'react';
import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
Expand Down Expand Up @@ -54,6 +55,7 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) {
const [invoiceReceiverPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${invoiceReceiverPolicyID}`);
const isReportArchived = useReportIsArchived(report?.reportID);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});
const isConciergeChat = isConciergeChatReport(report, conciergeReportID);
const isChatRoom = isChatRoomReportUtils(report);
const isSelfDM = isSelfDMReportUtils(report);
Expand Down Expand Up @@ -124,6 +126,7 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) {
reportDetailsLink,
shouldShowUsePlusButtonText,
additionalText,
isTrackIntentUser: !!isTrackIntentUser,
});

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import {isTrackIntentUserSelector} from '@selectors/Onboarding';
import React from 'react';
import Button from '@components/Button';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import {isSubmitAndClose} from '@libs/PolicyUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {SearchTransactionAction} from '@src/types/onyx/SearchResults';
import actionTranslationsMap from './actionTranslationsMap';
import PayActionCell from './PayActionCell';
Expand Down Expand Up @@ -38,6 +42,8 @@ function ActionCell({
const {translate} = useLocalize();
const styles = useThemeStyles();
const {isOffline} = useNetwork();
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});
const [actionCellPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`);

const shouldUseViewAction = action === CONST.SEARCH.ACTION_TYPES.VIEW || action === CONST.SEARCH.ACTION_TYPES.PAID || action === CONST.SEARCH.ACTION_TYPES.DONE;

Expand Down Expand Up @@ -78,7 +84,8 @@ function ActionCell({
);
}

const text = translate(actionTranslationsMap[action]);
const shouldUseMarkAsDone = isTrackIntentUser && isSubmitAndClose(actionCellPolicy) && action === CONST.SEARCH.ACTION_TYPES.SUBMIT;
const text = shouldUseMarkAsDone ? translate('common.done') : translate(actionTranslationsMap[action]);

return (
<Button
Expand Down
4 changes: 3 additions & 1 deletion src/components/TestDrive/TestDriveDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function TestDriveDemo() {
const [onboardingReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${onboarding?.chatReportID}`);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const {
taskReport: viewTourTaskReport,
taskParentReport: viewTourTaskParentReport,
Expand All @@ -56,7 +57,7 @@ function TestDriveDemo() {
if (!viewTourTaskReport) {
if (conciergeReportID && !hasCalledOpenReportRef.current) {
hasCalledOpenReportRef.current = true;
openReport({reportID: conciergeReportID, introSelected});
openReport({reportID: conciergeReportID, introSelected, betas});
}
return;
}
Expand All @@ -83,6 +84,7 @@ function TestDriveDemo() {
parentReportAction,
conciergeReportID,
introSelected,
betas,
]);

useEffect(() => {
Expand Down
Loading
Loading