diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 408e3325bdc5..1b3740bea60c 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1940,10 +1940,6 @@ function shouldReportBeInOptionList(report, reportIDFromRoute, isInGSDMode, curr return false; } - if (isUserCreatedPolicyRoom(report) && !Permissions.canUsePolicyRooms(betas)) { - return false; - } - // Include the currently viewed report. If we excluded the currently viewed report, then there // would be no way to highlight it in the options list and it would be confusing to users because they lose // a sense of context. diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 223606dc30c3..7d9c363273ef 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -13,7 +13,6 @@ import Navigation from '../../libs/Navigation/Navigation'; import ROUTES from '../../ROUTES'; import * as Report from '../../libs/actions/Report'; import ONYXKEYS from '../../ONYXKEYS'; -import Permissions from '../../libs/Permissions'; import * as ReportUtils from '../../libs/ReportUtils'; import ReportActionsView from './report/ReportActionsView'; import CONST from '../../CONST'; @@ -231,10 +230,8 @@ class ReportScreen extends React.Component { // There are no reportActions at all to display and we are still in the process of loading the next set of actions. const isLoadingInitialReportActions = _.isEmpty(this.props.reportActions) && this.props.report.isLoadingReportActions; - // Users not in the Default Room or Policy Room Betas can't view the report - const shouldHideReport = - (ReportUtils.isDefaultRoom(this.props.report) && !ReportUtils.canSeeDefaultRoom(this.props.report, this.props.policies, this.props.betas)) || - (ReportUtils.isUserCreatedPolicyRoom(this.props.report) && !Permissions.canUsePolicyRooms(this.props.betas)); + // We hide default rooms (it's basically just domain rooms now) from people who aren't on the defaultRooms beta. + const shouldHideReport = ReportUtils.isDefaultRoom(this.props.report) && !ReportUtils.canSeeDefaultRoom(this.props.report, this.props.policies, this.props.betas); // When the ReportScreen is not open/in the viewport, we want to "freeze" it for performance reasons const shouldFreeze = this.props.isSmallScreenWidth && this.props.isDrawerOpen; diff --git a/tests/unit/SidebarFilterTest.js b/tests/unit/SidebarFilterTest.js index 46dc73d17320..0c6bc75f5e68 100644 --- a/tests/unit/SidebarFilterTest.js +++ b/tests/unit/SidebarFilterTest.js @@ -130,11 +130,11 @@ describe('Sidebar', () => { }), ) - // Then no reports are rendered in the LHN + // Then the report appears in the LHN .then(() => { const hintText = Localize.translateLocal('accessibilityHints.navigatesToChat'); const optionRows = screen.queryAllByAccessibilityHint(hintText); - expect(optionRows).toHaveLength(0); + expect(optionRows).toHaveLength(1); }) // When the user is added to the policy rooms beta and the sidebar re-renders @@ -144,7 +144,7 @@ describe('Sidebar', () => { }), ) - // Then there is one report rendered in the LHN + // Then the report is still rendered in the LHN .then(() => { const hintText = Localize.translateLocal('accessibilityHints.navigatesToChat'); const optionRows = screen.queryAllByAccessibilityHint(hintText);