Repository navigation
[Release 4] [Domain control] Add DomainGroupsPage
#79586
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
Merged
mountiny
merged 14 commits into
Expensify:main
from
software-mansion-labs:war-in/domains/add-domain-groups-page
Feb 15, 2026
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a50dbf9
feat: add `DomainGroupsPage`
war-in c133275
test: add groupsSelector tests
war-in 7c58762
Merge branch 'main' into war-in/domains/add-domain-groups-page
war-in d024fa2
chore: add spanish translations
war-in 8be33b5
chore: translations
war-in fc2318e
Merge branch 'main' into war-in/domains/add-domain-groups-page
war-in 43f895f
Merge branch 'main' into war-in/domains/add-domain-groups-page
jmusial 8d258b7
fix typecheck & languages
jmusial d11d6bc
update styling
jmusial 8efb480
update header font
jmusial 3347cdf
fix prettier
jmusial 21e0ec5
Merge branch 'main' into war-in/domains/add-domain-groups-page
jmusial c07497d
small fixes
jmusial cbbe85d
use CustomListHeader
jmusial File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| import type {DomainSecurityGroupWithID} from '@selectors/Domain'; | ||
| import {groupsSelector} from '@selectors/Domain'; | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import HeaderWithBackButton from '@components/HeaderWithBackButton'; | ||
| import ScreenWrapper from '@components/ScreenWrapper'; | ||
| import SelectionList from '@components/SelectionList'; | ||
| import TableListItem from '@components/SelectionList/ListItem/TableListItem'; | ||
| import CustomListHeader from '@components/SelectionListWithModal/CustomListHeader'; | ||
| import Text from '@components/Text'; | ||
| import {useMemoizedLazyIllustrations} from '@hooks/useLazyAsset'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useOnyx from '@hooks/useOnyx'; | ||
| import useResponsiveLayout from '@hooks/useResponsiveLayout'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import Navigation from '@navigation/Navigation'; | ||
| import type {PlatformStackScreenProps} from '@navigation/PlatformStackNavigation/types'; | ||
| import type {DomainSplitNavigatorParamList} from '@navigation/types'; | ||
| import DomainNotFoundPageWrapper from '@pages/domain/DomainNotFoundPageWrapper'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import type SCREENS from '@src/SCREENS'; | ||
| import getEmptyArray from '@src/types/utils/getEmptyArray'; | ||
|
|
||
| type DomainGroupsPageProps = PlatformStackScreenProps<DomainSplitNavigatorParamList, typeof SCREENS.DOMAIN.GROUPS>; | ||
|
|
||
| function DomainGroupsPage({route}: DomainGroupsPageProps) { | ||
| const {domainAccountID} = route.params; | ||
|
|
||
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
| const illustrations = useMemoizedLazyIllustrations(['Members']); | ||
| const {shouldUseNarrowLayout} = useResponsiveLayout(); | ||
|
|
||
| const [groups = getEmptyArray<DomainSecurityGroupWithID>()] = useOnyx(`${ONYXKEYS.COLLECTION.DOMAIN}${domainAccountID}`, {canBeMissing: false, selector: groupsSelector}); | ||
|
|
||
| const data = groups.map((group) => { | ||
| return { | ||
| keyForList: group.id, | ||
| text: group.details.name ?? '', | ||
| rightElement: ( | ||
| <View style={styles.flex1}> | ||
| <Text | ||
| numberOfLines={1} | ||
| style={styles.alignSelfStart} | ||
| > | ||
| {translate('domain.groups.memberCount', {count: Object.keys(group.details.shared).length})} | ||
|
mountiny marked this conversation as resolved.
Resolved
mountiny marked this conversation as resolved.
Resolved
|
||
| </Text> | ||
| </View> | ||
| ), | ||
| }; | ||
| }); | ||
|
|
||
| const getCustomListHeader = () => { | ||
| if (!data || data?.length === 0) { | ||
| return null; | ||
| } | ||
|
|
||
| return ( | ||
| <CustomListHeader | ||
| canSelectMultiple={false} | ||
| leftHeaderText={translate('common.name')} | ||
| rightHeaderText={translate('common.members')} | ||
| shouldDivideEqualWidth | ||
| /> | ||
| ); | ||
| }; | ||
|
|
||
| return ( | ||
| <DomainNotFoundPageWrapper domainAccountID={domainAccountID}> | ||
| <ScreenWrapper | ||
| enableEdgeToEdgeBottomSafeAreaPadding | ||
| shouldEnableMaxHeight | ||
| shouldShowOfflineIndicatorInWideScreen | ||
| testID="DomainGroupsPage" | ||
| > | ||
| <HeaderWithBackButton | ||
| title={translate('domain.groups.title')} | ||
| onBackButtonPress={Navigation.popToSidebar} | ||
| icon={illustrations.Members} | ||
| shouldShowBackButton={shouldUseNarrowLayout} | ||
| shouldUseHeadlineHeader | ||
| /> | ||
| <SelectionList | ||
| data={data} | ||
| ListItem={TableListItem} | ||
| onSelectRow={() => null} | ||
| customListHeader={getCustomListHeader()} | ||
| /> | ||
| </ScreenWrapper> | ||
| </DomainNotFoundPageWrapper> | ||
| ); | ||
| } | ||
|
|
||
| export default DomainGroupsPage; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.