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
5 changes: 4 additions & 1 deletion src/pages/ReportDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ function ReportDetailsPage(props) {
return items;
}

if ((!isUserCreatedPolicyRoom && participants.length) || (isUserCreatedPolicyRoom && (!ReportUtils.isPublicRoom(props.report) || isPolicyMember))) {
// The Members page is only shown when:
// - The report is not a user created room with participants to show i.e. DM, Group Chat, etc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A tiny thing, but shouldn't it be "etc." instead of "etc"?

@jakub-trzebiatowski jakub-trzebiatowski Dec 12, 2023 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okey, not necessarily I guess: https://en.wikipedia.org/wiki/Et_cetera

// - The report is a user created room and the room and the current user is a workspace member i.e. non-workspace members should not see this option.
if ((!isUserCreatedPolicyRoom && participants.length) || (isUserCreatedPolicyRoom && isPolicyMember)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB but should we create a helper function that better describes these checks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the extra documentation here now it should be easier to understand the intended logic. In this case, it's nice to have the explanation on the report "details" page vs. abstracted somewhere.

items.push({
key: CONST.REPORT_DETAILS_MENU_ITEM.MEMBERS,
translationKey: 'common.members',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/RoomMembersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function RoomMembersPage(props) {
testID={RoomMembersPage.displayName}
>
<FullPageNotFoundView
shouldShow={_.isEmpty(props.report) || (ReportUtils.isPublicRoom(props.report) && !isPolicyMember)}
shouldShow={_.isEmpty(props.report) || !isPolicyMember}
subtitleKey={_.isEmpty(props.report) ? undefined : 'roomMembersPage.notAuthorized'}
onBackButtonPress={() => Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(props.report.reportID))}
>
Expand Down