Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 2 additions & 5 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/SidebarFilterTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down