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
8 changes: 6 additions & 2 deletions src/libs/actions/Report/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2145,10 +2145,11 @@ function navigateToAndOpenChildReport(
currentUserAccountID: number,
introSelected: OnyxEntry<IntroSelected>,
betas: OnyxEntry<Beta[]>,
isSelfTourViewed: boolean | undefined,
// TODO: personalDetails should be a required field in follow-up PRs https://github.com/Expensify/App/issues/73656
personalDetails?: OnyxEntry<PersonalDetailsList>,
) {
const report = childReport ?? createChildReport(childReport, parentReportAction, parentReport, currentUserAccountID, introSelected, betas, personalDetails);
const report = childReport ?? createChildReport(childReport, parentReportAction, parentReport, currentUserAccountID, introSelected, betas, isSelfTourViewed, personalDetails);

Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID, undefined, undefined, Navigation.getActiveRoute()));
}
Expand All @@ -2165,6 +2166,7 @@ function createChildReport(
currentUserAccountID: number,
introSelected: OnyxEntry<IntroSelected>,
betas: OnyxEntry<Beta[]>,
isSelfTourViewed: boolean | undefined,
// TODO: personalDetails should be a required field in follow-up PRs https://github.com/Expensify/App/issues/73656
personalDetails?: OnyxEntry<PersonalDetailsList>,
): Report {
Expand Down Expand Up @@ -2210,6 +2212,7 @@ function createChildReport(
parentReportActionID: parentReportAction.reportActionID,
isNewThread: true,
betas,
isSelfTourViewed,
});
} else {
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${childReportID}`, newChat);
Expand All @@ -2230,6 +2233,7 @@ function explain(
currentUserAccountID: number,
introSelected: OnyxEntry<IntroSelected>,
betas: OnyxEntry<Beta[]>,
isSelfTourViewed: boolean | undefined,
delegateAccountID: number | undefined,
timezone: Timezone = CONST.DEFAULT_TIME_ZONE,
) {
Expand All @@ -2238,7 +2242,7 @@ function explain(
}

// Check if explanation thread report already exists
const report = childReport ?? createChildReport(childReport, reportAction, originalReport, currentUserAccountID, introSelected, betas);
const report = childReport ?? createChildReport(childReport, reportAction, originalReport, currentUserAccountID, introSelected, betas, isSelfTourViewed);

Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID, undefined, undefined, Navigation.getActiveRoute()));
// Schedule adding the explanation comment on the next animation frame
Expand Down
10 changes: 6 additions & 4 deletions src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -445,16 +445,16 @@ const ContextMenuActions: ContextMenuAction[] = [
}
return !shouldDisableThread(reportAction, isThreadReportParentAction, isArchivedRoom);
},
onPress: (closePopover, {reportAction, childReport, originalReport, currentUserAccountID, introSelected, betas}) => {
onPress: (closePopover, {reportAction, childReport, originalReport, currentUserAccountID, introSelected, isSelfTourViewed, betas}) => {
if (closePopover) {
hideContextMenu(false, () => {
KeyboardUtils.dismiss().then(() => {
navigateToAndOpenChildReport(childReport, reportAction, originalReport, currentUserAccountID, introSelected, betas);
navigateToAndOpenChildReport(childReport, reportAction, originalReport, currentUserAccountID, introSelected, betas, isSelfTourViewed);
});
});
return;
}
navigateToAndOpenChildReport(childReport, reportAction, originalReport, currentUserAccountID, introSelected, betas);
navigateToAndOpenChildReport(childReport, reportAction, originalReport, currentUserAccountID, introSelected, betas, isSelfTourViewed);
},
getDescription: () => {},
sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.REPLY_IN_THREAD,
Expand Down Expand Up @@ -488,7 +488,7 @@ const ContextMenuActions: ContextMenuAction[] = [

return hasReasoning(reportAction);
},
onPress: (closePopover, {reportAction, childReport, originalReport, translate, currentUserPersonalDetails, introSelected, betas, delegateAccountID}) => {
onPress: (closePopover, {reportAction, childReport, originalReport, translate, currentUserPersonalDetails, introSelected, betas, isSelfTourViewed, delegateAccountID}) => {
if (!originalReport?.reportID) {
return;
}
Expand All @@ -504,6 +504,7 @@ const ContextMenuActions: ContextMenuAction[] = [
currentUserPersonalDetails.accountID,
introSelected,
betas,
isSelfTourViewed,
delegateAccountID,
currentUserPersonalDetails?.timezone,
);
Expand All @@ -520,6 +521,7 @@ const ContextMenuActions: ContextMenuAction[] = [
currentUserPersonalDetails.accountID,
introSelected,
betas,
isSelfTourViewed,
delegateAccountID,
currentUserPersonalDetails?.timezone,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {hasSeenTourSelector} from '@selectors/Onboarding';
import React from 'react';
import type {GestureResponderEvent} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
Expand Down Expand Up @@ -38,6 +39,7 @@ function ReportActionItemMessageWithExplain({message, action, childReport, origi
const personalDetail = useCurrentUserPersonalDetails();
const {environmentURL} = useEnvironment();
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector});
const [betas] = useOnyx(ONYXKEYS.BETAS);
const delegateAccountID = useDelegateAccountID();

Expand All @@ -47,7 +49,7 @@ function ReportActionItemMessageWithExplain({message, action, childReport, origi
const handleLinkPress = (event: GestureResponderEvent | KeyboardEvent, href: string) => {
// Handle the special "Explain" link
if (href.endsWith(CONST.CONCIERGE_EXPLAIN_LINK_PATH)) {
explain(childReport, originalReport, action, translate, personalDetail.accountID, introSelected, betas, delegateAccountID, personalDetail?.timezone);
explain(childReport, originalReport, action, translate, personalDetail.accountID, introSelected, betas, isSelfTourViewed, delegateAccountID, personalDetail?.timezone);
return;
}

Expand Down
4 changes: 3 additions & 1 deletion src/pages/inbox/report/ReportActionItemThread.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {hasSeenTourSelector} from '@selectors/Onboarding';
import React from 'react';
import type {GestureResponderEvent} from 'react-native';
import {View} from 'react-native';
Expand Down Expand Up @@ -46,6 +47,7 @@ function ReportActionItemThread({numberOfReplies, accountIDs, mostRecentReply, r
const {translate, datetimeToCalendarTime} = useLocalize();
const [childReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportAction.childReportID}`);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector});
const [betas] = useOnyx(ONYXKEYS.BETAS);

const numberOfRepliesText = numberOfReplies > CONST.MAX_THREAD_REPLIES_PREVIEW ? `${CONST.MAX_THREAD_REPLIES_PREVIEW}+` : `${numberOfReplies}`;
Expand All @@ -57,7 +59,7 @@ function ReportActionItemThread({numberOfReplies, accountIDs, mostRecentReply, r
<View style={[styles.chatItemMessage]}>
<PressableWithSecondaryInteraction
onPress={() => {
navigateToAndOpenChildReport(childReport, reportAction, report, currentUserAccountID, introSelected, betas);
navigateToAndOpenChildReport(childReport, reportAction, report, currentUserAccountID, introSelected, betas, isSelfTourViewed);
}}
role={CONST.ROLE.BUTTON}
accessibilityLabel={`${numberOfReplies} ${replyText}`}
Expand Down
Loading
Loading