From 0c485fafcede875fc705ca63ae9ffa87f482a180 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Thu, 10 Aug 2023 09:13:19 +0530 Subject: [PATCH 1/4] navigate to correct user details --- src/libs/ReportUtils.js | 2 +- src/pages/ReportDetailsPage.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index e46f1b39971e..20416b535194 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1451,7 +1451,7 @@ function getReport(reportID) { function navigateToDetailsPage(report) { const participantAccountIDs = lodashGet(report, 'participantAccountIDs', []); - if (isChatRoom(report) || isPolicyExpenseChat(report) || isChatThread(report)) { + if (isChatRoom(report) || isPolicyExpenseChat(report) || isChatThread(report) || isTaskReport(report)) { Navigation.navigate(ROUTES.getReportDetailsRoute(report.reportID)); return; } diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 9e640d70c805..361f0198402e 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -61,7 +61,7 @@ function ReportDetailsPage(props) { const policy = useMemo(() => props.policies[`${ONYXKEYS.COLLECTION.POLICY}${props.report.policyID}`], [props.policies, props.report.policyID]); const isPolicyAdmin = useMemo(() => PolicyUtils.isPolicyAdmin(policy), [policy]); const shouldDisableSettings = useMemo(() => ReportUtils.shouldDisableSettings(props.report), [props.report]); - const shouldUseFullTitle = !shouldDisableSettings; + const shouldUseFullTitle = !shouldDisableSettings || ReportUtils.isTaskReport(props.report); const isChatRoom = useMemo(() => ReportUtils.isChatRoom(props.report), [props.report]); const isThread = useMemo(() => ReportUtils.isChatThread(props.report), [props.report]); const isUserCreatedPolicyRoom = useMemo(() => ReportUtils.isUserCreatedPolicyRoom(props.report), [props.report]); From 66a632989da8403864c90111a68535db0bd8e157 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Thu, 10 Aug 2023 19:53:41 +0530 Subject: [PATCH 2/4] change header title for members page and make header clickable --- src/pages/ReportParticipantsPage.js | 5 ++++- src/pages/home/HeaderView.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/ReportParticipantsPage.js b/src/pages/ReportParticipantsPage.js index 3a5a239f05e5..407176c19bb9 100755 --- a/src/pages/ReportParticipantsPage.js +++ b/src/pages/ReportParticipantsPage.js @@ -97,7 +97,10 @@ function ReportParticipantsPage(props) { ReportUtils.navigateToDetailsPage(props.report)} style={[styles.flexRow, styles.alignItemsCenter, styles.flex1]} - disabled={(isTaskReport && !ReportUtils.isOpenTaskReport(props.report)) || shouldDisableDetailPage} + disabled={shouldDisableDetailPage} accessibilityLabel={title} accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON} > From a79c313fac055f076caad29b977091350e691d6e Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Fri, 11 Aug 2023 00:45:13 +0530 Subject: [PATCH 3/4] add optimistic particpanAccountIDs and change setting disable value --- src/libs/ReportUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 20416b535194..3d50d880d179 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -459,7 +459,7 @@ function isConciergeChatReport(report) { function shouldDisableDetailPage(report) { const participantAccountIDs = lodashGet(report, 'participantAccountIDs', []); - if (isChatRoom(report) || isPolicyExpenseChat(report) || isChatThread(report)) { + if (isChatRoom(report) || isPolicyExpenseChat(report) || isChatThread(report) || isTaskReport(report)) { return false; } if (participantAccountIDs.length === 1) { @@ -2208,6 +2208,7 @@ function buildOptimisticTaskReport(ownerAccountID, assigneeAccountID = 0, parent reportName: title, description, ownerAccountID, + participantAccountIDs: ownerAccountID === assigneeAccountID ? [] : [assigneeAccountID], managerID: assigneeAccountID, type: CONST.REPORT.TYPE.TASK, parentReportID, From 96e2911bf00b98c437799c8875e8388619c6df05 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Fri, 11 Aug 2023 07:57:56 +0530 Subject: [PATCH 4/4] fix: adds check for non zero assigneAccounID --- src/libs/ReportUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 3d50d880d179..15266bf1d723 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -2208,7 +2208,7 @@ function buildOptimisticTaskReport(ownerAccountID, assigneeAccountID = 0, parent reportName: title, description, ownerAccountID, - participantAccountIDs: ownerAccountID === assigneeAccountID ? [] : [assigneeAccountID], + participantAccountIDs: assigneeAccountID && assigneeAccountID !== ownerAccountID ? [assigneeAccountID] : [], managerID: assigneeAccountID, type: CONST.REPORT.TYPE.TASK, parentReportID,