From 89ff779684dc1c9cb4fb382761ff2c241673af92 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Thu, 2 Jun 2022 12:58:04 -0400 Subject: [PATCH 1/4] Decouple policyRoom and defaultRoom betas --- src/libs/OptionsListUtils.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 339dd2c6e259..5c62eb336ed5 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -365,7 +365,7 @@ function getOptions(reports, personalDetails, activeReportID, { selectedOptions = [], maxRecentReportsToShow = 0, excludeLogins = [], - excludeDefaultRooms = false, + excludeChatRooms = false, includeMultipleParticipantReports = false, includePersonalDetails = false, includeRecentReports = false, @@ -439,11 +439,11 @@ function getOptions(reports, personalDetails, activeReportID, { return; } - if (isChatRoom && (!Permissions.canUseDefaultRooms(betas) || excludeDefaultRooms)) { + if (isChatRoom && excludeChatRooms) { return; } - if (isPolicyExpenseChat && !Permissions.canUsePolicyExpenseChat(betas)) { + if (ReportUtils.isDefaultRoom(report) && !Permissions.canUseDefaultRooms(betas)) { return; } @@ -451,6 +451,10 @@ function getOptions(reports, personalDetails, activeReportID, { return; } + if (isPolicyExpenseChat && !Permissions.canUsePolicyExpenseChat(betas)) { + return; + } + // Save the report in the map if this is a single participant so we can associate the reportID with the // personal detail option later. Individuals should not be associated with single participant // policyExpenseChats or chatRooms since those are not people. @@ -703,7 +707,7 @@ function getNewChatOptions( betas, searchValue: searchValue.trim(), selectedOptions, - excludeDefaultRooms: true, + excludeChatRooms: true, includeRecentReports: true, includePersonalDetails: true, maxRecentReportsToShow: 5, From 50b7a26000a3d29f9c8e7d72e8db14570733ceb5 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Thu, 2 Jun 2022 13:13:55 -0400 Subject: [PATCH 2/4] Fix report screen for user created policy rooms beta --- src/pages/home/ReportScreen.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index e8ebd17d4110..ced4faa2bca6 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -159,7 +159,11 @@ class ReportScreen extends React.Component { return null; } - if (!Permissions.canUseDefaultRooms(this.props.betas) && ReportUtils.isChatRoom(this.props.report)) { + if (!Permissions.canUseDefaultRooms(this.props.betas) && ReportUtils.isDefaultRoom(this.props.report)) { + return null; + } + + if (!Permissions.canUsePolicyRooms(this.props.betas) && ReportUtils.isUserCreatedPolicyRoom(this.props.report)) { return null; } From 29cd284dec2a15301d12c71c80a5ae8c2a2bc463 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Thu, 2 Jun 2022 13:14:19 -0400 Subject: [PATCH 3/4] Fix new room page for user created policy room beta --- src/pages/workspace/WorkspaceNewRoomPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceNewRoomPage.js b/src/pages/workspace/WorkspaceNewRoomPage.js index 6aec1b883eb3..d1e3a23dd620 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.js +++ b/src/pages/workspace/WorkspaceNewRoomPage.js @@ -137,7 +137,7 @@ class WorkspaceNewRoomPage extends React.Component { } render() { - if (!Permissions.canUseDefaultRooms(this.props.betas)) { + if (!Permissions.canUsePolicyRooms(this.props.betas)) { Log.info('Not showing create Policy Room page since user is not on default rooms beta'); Navigation.dismissModal(); return null; From e22e97b19390820226c094d5a4f20d1aac1c07f1 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Thu, 2 Jun 2022 13:29:20 -0400 Subject: [PATCH 4/4] Fix log --- src/pages/workspace/WorkspaceNewRoomPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceNewRoomPage.js b/src/pages/workspace/WorkspaceNewRoomPage.js index d1e3a23dd620..5740c74ae2e4 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.js +++ b/src/pages/workspace/WorkspaceNewRoomPage.js @@ -138,7 +138,7 @@ class WorkspaceNewRoomPage extends React.Component { render() { if (!Permissions.canUsePolicyRooms(this.props.betas)) { - Log.info('Not showing create Policy Room page since user is not on default rooms beta'); + Log.info('Not showing create Policy Room page since user is not on policy rooms beta'); Navigation.dismissModal(); return null; }