Skip to content

Commit c19843b

Browse files
committed
Merge branch 'main' of github.com:callstack-internal/Expensify-App into perf-send-message-phase-3
2 parents d1a8c21 + 0c68091 commit c19843b

12 files changed

Lines changed: 406 additions & 278 deletions

File tree

src/components/PromotedActionsBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const PromotedActions = {
8585
return;
8686
}
8787
if (accountID) {
88-
navigateToAndOpenReportWithAccountIDs([accountID], currentUserAccountID, introSelected, betas);
88+
navigateToAndOpenReportWithAccountIDs([accountID], currentUserAccountID, introSelected, isSelfTourViewed, betas);
8989
}
9090
},
9191
}),

src/components/ReportActionItem/TaskView.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {delegateEmailSelector} from '@selectors/Account';
2+
import {hasSeenTourSelector} from '@selectors/Onboarding';
23
import React, {useEffect, useMemo} from 'react';
34
import {View} from 'react-native';
45
import type {OnyxEntry} from 'react-native-onyx';
@@ -58,6 +59,7 @@ function TaskView({report, parentReport, action}: TaskViewProps) {
5859
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
5960
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
6061
const [betas] = useOnyx(ONYXKEYS.BETAS);
62+
const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector});
6163
const [delegateEmail] = useOnyx(ONYXKEYS.ACCOUNT, {selector: delegateEmailSelector});
6264

6365
useEffect(() => {
@@ -116,7 +118,7 @@ function TaskView({report, parentReport, action}: TaskViewProps) {
116118
<OfflineWithFeedback
117119
shouldShowErrorMessages
118120
errors={report?.errorFields?.editTask ?? report?.errorFields?.createTask}
119-
onClose={() => clearTaskErrors(report, conciergeReportID, accountID, introSelected, betas)}
121+
onClose={() => clearTaskErrors(report, conciergeReportID, accountID, introSelected, betas, isSelfTourViewed)}
120122
errorRowStyles={styles.ph5}
121123
>
122124
<Hoverable>

src/libs/actions/Report/index.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,7 +2031,13 @@ function navigateToAndCreateGroupChat(
20312031
*
20322032
* @param participantAccountIDs of user logins to start a chat report with.
20332033
*/
2034-
function navigateToAndOpenReportWithAccountIDs(participantAccountIDs: number[], currentUserAccountID: number, introSelected: OnyxEntry<IntroSelected>, betas: OnyxEntry<Beta[]>) {
2034+
function navigateToAndOpenReportWithAccountIDs(
2035+
participantAccountIDs: number[],
2036+
currentUserAccountID: number,
2037+
introSelected: OnyxEntry<IntroSelected>,
2038+
isSelfTourViewed: boolean | undefined,
2039+
betas: OnyxEntry<Beta[]>,
2040+
) {
20352041
let newChat: OptimisticChatReport | undefined;
20362042
const chat = getChatByParticipants([...participantAccountIDs, currentUserAccountID]);
20372043
if (!chat) {
@@ -2043,6 +2049,7 @@ function navigateToAndOpenReportWithAccountIDs(participantAccountIDs: number[],
20432049
openReport({
20442050
reportID: newChat?.reportID,
20452051
introSelected,
2052+
isSelfTourViewed,
20462053
newReportObject: newChat,
20472054
parentReportActionID: '0',
20482055
participantAccountIDList: participantAccountIDs,
@@ -3937,6 +3944,7 @@ function clearCreateChatError(
39373944
introSelected: OnyxEntry<IntroSelected>,
39383945
currentUserAccountID: number,
39393946
betas: OnyxEntry<Beta[]>,
3947+
isSelfTourViewed: boolean | undefined,
39403948
) {
39413949
const metaData = getReportMetadata(report?.reportID);
39423950
const isOptimisticReport = metaData?.isOptimisticReport;
@@ -3945,8 +3953,7 @@ function clearCreateChatError(
39453953
return;
39463954
}
39473955

3948-
// TODO: We'll pass isSelfTourViewed in the next PR. Refactor issue: https://github.com/Expensify/App/issues/66424
3949-
navigateToConciergeChatAndDeleteReport(report?.reportID, conciergeReportID, currentUserAccountID, introSelected, undefined, betas, undefined, true);
3956+
navigateToConciergeChatAndDeleteReport(report?.reportID, conciergeReportID, currentUserAccountID, introSelected, isSelfTourViewed, betas, undefined, true);
39503957
}
39513958

39523959
/**

src/libs/actions/Task.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,7 @@ function clearTaskErrors(
14151415
currentUserAccountID: number,
14161416
introSelected: OnyxEntry<OnyxTypes.IntroSelected>,
14171417
betas: OnyxEntry<OnyxTypes.Beta[]>,
1418+
isSelfTourViewed: boolean | undefined,
14181419
) {
14191420
const reportID = report?.reportID;
14201421
if (!reportID) {
@@ -1425,8 +1426,7 @@ function clearTaskErrors(
14251426
if (report?.pendingFields?.createChat === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {
14261427
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`, report.parentReportActionID ? {[report.parentReportActionID]: null} : {});
14271428

1428-
// TODO: We'll pass isSelfTourViewed in the next PR. Refactor issue: https://github.com/Expensify/App/issues/66424
1429-
navigateToConciergeChatAndDeleteReport(reportID, conciergeReportID, currentUserAccountID, introSelected, undefined, betas);
1429+
navigateToConciergeChatAndDeleteReport(reportID, conciergeReportID, currentUserAccountID, introSelected, isSelfTourViewed, betas);
14301430
return;
14311431
}
14321432

src/pages/ReportParticipantsPage.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ function ReportParticipantsPage({report, route}: ReportParticipantsPageProps) {
8686
const isCurrentUserAdmin = isGroupChatAdmin(report, currentUserAccountID);
8787
const isGroupChat = isGroupChatUtils(report);
8888
const isCurrentUserGroupChatAdmin = isGroupChat && isCurrentUserAdmin;
89+
const shouldShowInviteButton = isGroupChat || isMoneyRequestReport(report);
8990
const isFocused = useIsFocused();
9091
const {isOffline} = useNetwork();
9192
const canSelectMultiple = isGroupChat && isCurrentUserAdmin && (isSmallScreenWidth ? isMobileSelectionModeEnabled : true);
@@ -353,7 +354,7 @@ function ReportParticipantsPage({report, route}: ReportParticipantsPageProps) {
353354
subtitle={StringUtils.lineBreaksToSpaces(getReportName(report, reportAttributes))}
354355
/>
355356
<View style={[styles.pl5, styles.pr5]}>
356-
{isGroupChat && (
357+
{shouldShowInviteButton && (
357358
<View style={styles.w100}>
358359
{(isSmallScreenWidth ? canSelectMultiple : selectedMembers.length > 0) ? (
359360
<ButtonWithDropdownMenu<WorkspaceMemberBulkActionType>
@@ -380,7 +381,7 @@ function ReportParticipantsPage({report, route}: ReportParticipantsPageProps) {
380381
</View>
381382
)}
382383
</View>
383-
<View style={[styles.w100, isGroupChat ? styles.mt3 : styles.mt0, styles.flex1]}>
384+
<View style={[styles.w100, shouldShowInviteButton ? styles.mt3 : styles.mt0, styles.flex1]}>
384385
<SelectionListWithModal
385386
data={participants}
386387
ref={selectionListRef}

0 commit comments

Comments
 (0)