-
Notifications
You must be signed in to change notification settings - Fork 4k
[Under Beta] Add RHP to workspace room list page #92096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4a2bef1
544e962
6725df2
2a3d1b9
026eae4
e49b795
618ad3a
942cdef
568502a
e3b800b
1e85b03
664c011
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,16 +19,18 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout'; | |
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import useWorkspaceDocumentTitle from '@hooks/useWorkspaceDocumentTitle'; | ||
| import {openPolicyRoomsPage} from '@libs/actions/Policy/Room'; | ||
| import createDynamicRoute from '@libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types'; | ||
| import {getDisplayNameOrDefault} from '@libs/PersonalDetailsUtils'; | ||
| import {isPolicyAdmin} from '@libs/PolicyUtils'; | ||
| import {getReportName} from '@libs/ReportNameUtils'; | ||
| import {getParticipantsAccountIDsForDisplay} from '@libs/ReportUtils'; | ||
| import type {WorkspaceSplitNavigatorParamList} from '@navigation/types'; | ||
| import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper'; | ||
| import CONST from '@src/CONST'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import ROUTES, {DYNAMIC_ROUTES} from '@src/ROUTES'; | ||
| import type SCREENS from '@src/SCREENS'; | ||
|
|
||
| type WorkspaceRoomsPageProps = PlatformStackScreenProps<WorkspaceSplitNavigatorParamList, typeof SCREENS.WORKSPACE.ROOMS>; | ||
|
|
@@ -42,6 +44,7 @@ function WorkspaceRoomsPage({route}: WorkspaceRoomsPageProps) { | |
| const illustrations = useMemoizedLazyIllustrations(['Hashtag']); | ||
| const policyID = route.params.policyID; | ||
| const policy = usePolicy(policyID); | ||
| const isAdmin = isPolicyAdmin(policy); | ||
| useWorkspaceDocumentTitle(policy?.name, 'workspace.common.rooms'); | ||
|
|
||
| const reportAttributes = useReportAttributes(); | ||
|
|
@@ -70,7 +73,10 @@ function WorkspaceRoomsPage({route}: WorkspaceRoomsPageProps) { | |
| ownerAvatar: ownerDetails?.avatar, | ||
| ownerDisplayName: ownerDetails ? getDisplayNameOrDefault(ownerDetails) : '', | ||
| memberCount: getParticipantsAccountIDsForDisplay(report, true, false, false, undefined, personalDetails).length, | ||
| action: () => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID)), | ||
| action: () => { | ||
| const targetRoute = isAdmin ? createDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS.getRoute(report.reportID)) : ROUTES.REPORT_WITH_ID.getRoute(report.reportID); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an admin has one room details panel open on the workspace Rooms page and selects another visible room row without closing it, Useful? React with 👍 / 👎. |
||
| Navigation.navigate(targetRoute); | ||
| }, | ||
| }; | ||
| }); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coming from #93257
isRoomCurrentlyOpenreads live navigation state during render. When "Go to room" is tapped,getTopmostReportId()updates before the RHP closes, so the row flips to "Go to workspace" briefly.Fixed in #93296 by snapshotting this on focus instead of reading it reactively during the transition.