From c4181128e0a363e52476bba18d31bf908c316d83 Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 11 Sep 2023 14:41:46 +0700 Subject: [PATCH 1/6] fix: leave thread navigates to concierge --- src/libs/actions/Report.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 85552fa14a56..32f6d4e83cc7 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1819,11 +1819,7 @@ function leaveRoom(reportID) { ], }, ); - Navigation.dismissModal(); - if (Navigation.getTopmostReportId() === reportID) { - Navigation.goBack(); - } - navigateToConciergeChat(); + Navigation.navigate(ROUTES.getReportRoute(report.parentReportID)); } /** From cf3bc061907d3f96e4d44dfea51f38dde7a54811 Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 11 Sep 2023 16:14:33 +0700 Subject: [PATCH 2/6] dismiss modal --- src/libs/actions/Report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 32f6d4e83cc7..1b9f03cbf58e 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1819,7 +1819,7 @@ function leaveRoom(reportID) { ], }, ); - Navigation.navigate(ROUTES.getReportRoute(report.parentReportID)); + Navigation.dismissModal(report.parentReportID); } /** From 61ed38fafc7eea58314015c39ab096fbcc53a189 Mon Sep 17 00:00:00 2001 From: tienifr Date: Tue, 12 Sep 2023 12:09:07 +0700 Subject: [PATCH 3/6] navigate to concierge for rooms --- src/libs/actions/Report.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 1b9f03cbf58e..63430e23049f 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1819,7 +1819,12 @@ function leaveRoom(reportID) { ], }, ); - Navigation.dismissModal(report.parentReportID); + Navigation.dismissModal(); + if (report.parentReportID) { + Navigation.navigate(ROUTES.getReportRoute(report.parentReportID), CONST.NAVIGATION.TYPE.UP); + return; + } + navigateToConciergeChat(); } /** From 1164b3427860336210c5ef1319cce368e1bd56cd Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 13 Sep 2023 00:30:41 +0700 Subject: [PATCH 4/6] navigate back to lhn --- src/libs/actions/Report.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 63430e23049f..2b0b57c53fd5 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1820,8 +1820,11 @@ function leaveRoom(reportID) { }, ); Navigation.dismissModal(); + if (Navigation.getTopmostReportId() === reportID) { + Navigation.goBack(); + } if (report.parentReportID) { - Navigation.navigate(ROUTES.getReportRoute(report.parentReportID), CONST.NAVIGATION.TYPE.UP); + Navigation.navigate(ROUTES.getReportRoute(report.parentReportID), CONST.NAVIGATION.TYPE.FORCED_UP); return; } navigateToConciergeChat(); From 30e7690e44aeef60001f53b0570b4c4d66e7ae27 Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 13 Sep 2023 02:04:41 +0700 Subject: [PATCH 5/6] fix: cannot edit money request transaction in offline --- src/libs/ReportUtils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 8b84555ca2a9..a9be504a6d1d 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -21,6 +21,7 @@ import isReportMessageAttachment from './isReportMessageAttachment'; import * as defaultWorkspaceAvatars from '../components/Icon/WorkspaceDefaultAvatars'; import * as CurrencyUtils from './CurrencyUtils'; import * as UserUtils from './UserUtils'; +import {isDeletedAction} from './ReportActionsUtils'; let currentUserEmail; let currentUserAccountID; @@ -1314,7 +1315,7 @@ function canEditMoneyRequest(reportAction) { const isReportSettled = isSettled(moneyRequestReport.reportID); const isAdmin = isExpenseReport(moneyRequestReport) && lodashGet(getPolicy(moneyRequestReport.policyID), 'role', '') === CONST.POLICY.ROLE.ADMIN; const isRequestor = currentUserAccountID === reportAction.actorAccountID; - return !isReportSettled && (isAdmin || isRequestor); + return !isReportSettled && !isDeletedAction(reportAction) && (isAdmin || isRequestor); } /** @@ -2622,7 +2623,7 @@ function buildTransactionThread(reportAction, moneyRequestReportID) { participantAccountIDs, getTransactionReportName(reportAction), '', - lodashGet(getReport(reportAction.reportID), 'policyID', CONST.POLICY.OWNER_EMAIL_FAKE), + lodashGet(getReport(moneyRequestReportID), 'policyID', CONST.POLICY.OWNER_EMAIL_FAKE), CONST.POLICY.OWNER_ACCOUNT_ID_FAKE, false, '', From 486e1a39560210e76f1b6bdd07745bf2623ce716 Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 13 Sep 2023 02:05:35 +0700 Subject: [PATCH 6/6] Revert "fix: cannot edit money request transaction in offline" This reverts commit 30e7690e44aeef60001f53b0570b4c4d66e7ae27. --- src/libs/ReportUtils.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index a9be504a6d1d..8b84555ca2a9 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -21,7 +21,6 @@ import isReportMessageAttachment from './isReportMessageAttachment'; import * as defaultWorkspaceAvatars from '../components/Icon/WorkspaceDefaultAvatars'; import * as CurrencyUtils from './CurrencyUtils'; import * as UserUtils from './UserUtils'; -import {isDeletedAction} from './ReportActionsUtils'; let currentUserEmail; let currentUserAccountID; @@ -1315,7 +1314,7 @@ function canEditMoneyRequest(reportAction) { const isReportSettled = isSettled(moneyRequestReport.reportID); const isAdmin = isExpenseReport(moneyRequestReport) && lodashGet(getPolicy(moneyRequestReport.policyID), 'role', '') === CONST.POLICY.ROLE.ADMIN; const isRequestor = currentUserAccountID === reportAction.actorAccountID; - return !isReportSettled && !isDeletedAction(reportAction) && (isAdmin || isRequestor); + return !isReportSettled && (isAdmin || isRequestor); } /** @@ -2623,7 +2622,7 @@ function buildTransactionThread(reportAction, moneyRequestReportID) { participantAccountIDs, getTransactionReportName(reportAction), '', - lodashGet(getReport(moneyRequestReportID), 'policyID', CONST.POLICY.OWNER_EMAIL_FAKE), + lodashGet(getReport(reportAction.reportID), 'policyID', CONST.POLICY.OWNER_EMAIL_FAKE), CONST.POLICY.OWNER_ACCOUNT_ID_FAKE, false, '',