-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Domain Control] [Release 4] Add Strictly Enforce Workspace Rules Toggle to DomainGroupDetailsPage #88699
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 19 commits into
Expensify:main
from
software-mansion-labs:jakubstec/domains/security-group-details-page-group-permissions
May 4, 2026
Merged
[Domain Control] [Release 4] Add Strictly Enforce Workspace Rules Toggle to DomainGroupDetailsPage #88699
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b04fbdf
feat: Add Strictly enforce workspace rules toggle
jakubstec 0b5b677
fix: add margin between toggle description and error in group settings
jakubstec 585789f
Revert "fix: add margin between toggle description and error in group…
jakubstec 22a49c1
fix: change styling to match design doc (section dividier, html error…
jakubstec 0c3a786
chore: revert accidental ios folder changes
jakubstec 89527f6
Merge branch 'war-in/domains/security-group-details-page' into jakubs…
jakubstec 2db1ec3
Merge remote-tracking branch 'origin/war-in/domains/security-group-de…
jakubstec 0ca7f42
minor fix after merge commit
jakubstec 8ad3faf
Merge remote-tracking branch 'origin/main' into jakubstec/domains/sec…
jakubstec bea28b2
fix: prettier
jakubstec 824ac9e
fix: typecheck
jakubstec 6e7c6f6
fix: add offline feedback to security group row
jakubstec 81c5fb2
fix: add missing translations
jakubstec 0c44cd8
fix: remove claude file
jakubstec 89897be
fix: add null fallback to failureData rollback
jakubstec b4c4704
fix: change onToggle fallback
jakubstec d18ea6b
Merge remote-tracking branch 'origin/main' into jakubstec/domains/sec…
jakubstec 032918e
Merge remote-tracking branch 'origin/main' into jakubstec/domains/sec…
jakubstec 171e02b
fix: prettier
jakubstec 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
56 changes: 56 additions & 0 deletions
56
src/pages/domain/Groups/StrictlyEnforceWorkspaceRulesToggle.tsx
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,56 @@ | ||
| import {domainSecurityGroupSettingErrorsSelector, domainSecurityGroupSettingPendingActionSelector, selectGroupByID} from '@selectors/Domain'; | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useOnyx from '@hooks/useOnyx'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import ToggleSettingOptionRow from '@pages/workspace/workflows/ToggleSettingsOptionRow'; | ||
| import {clearDomainSecurityGroupSettingError, updateDomainSecurityGroup} from '@userActions/Domain'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
|
|
||
| type StrictlyEnforceWorkspaceRulesToggleProps = { | ||
| domainAccountID: number; | ||
| groupID: string; | ||
|
Comment on lines
+12
to
+13
Contributor
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. all these types should have docs |
||
| }; | ||
|
|
||
| function StrictlyEnforceWorkspaceRulesToggle({domainAccountID, groupID}: StrictlyEnforceWorkspaceRulesToggleProps) { | ||
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
|
|
||
| const [group] = useOnyx(`${ONYXKEYS.COLLECTION.DOMAIN}${domainAccountID}`, { | ||
| selector: selectGroupByID(groupID), | ||
| }); | ||
|
|
||
| const [enableStrictPolicyRulesPendingAction] = useOnyx(`${ONYXKEYS.COLLECTION.DOMAIN_PENDING_ACTIONS}${domainAccountID}`, { | ||
| selector: domainSecurityGroupSettingPendingActionSelector('enableStrictPolicyRules', groupID), | ||
| }); | ||
| const [enableStrictPolicyRulesErrors] = useOnyx(`${ONYXKEYS.COLLECTION.DOMAIN_ERRORS}${domainAccountID}`, { | ||
| selector: domainSecurityGroupSettingErrorsSelector('enableStrictPolicyRulesErrors', groupID), | ||
| }); | ||
|
|
||
| const isEnabled = !!group?.enableStrictPolicyRules; | ||
|
|
||
| return ( | ||
| <View style={styles.mv3}> | ||
| <ToggleSettingOptionRow | ||
| title={translate('domain.groups.StrictlyEnforceWorkspaceRules')} | ||
| subtitle={translate('domain.groups.StrictlyEnforceWorkspaceRulesDescription')} | ||
| switchAccessibilityLabel={translate('domain.groups.StrictlyEnforceWorkspaceRules')} | ||
| shouldPlaceSubtitleBelowSwitch | ||
| isActive={isEnabled} | ||
| onToggle={(enabled) => { | ||
| if (!group) { | ||
| return; | ||
| } | ||
| updateDomainSecurityGroup(domainAccountID, groupID, group, {enableStrictPolicyRules: enabled}, 'enableStrictPolicyRules'); | ||
| }} | ||
| wrapperStyle={[styles.ph5]} | ||
| pendingAction={enableStrictPolicyRulesPendingAction} | ||
| errors={enableStrictPolicyRulesErrors} | ||
| onCloseError={() => clearDomainSecurityGroupSettingError(domainAccountID, groupID, 'enableStrictPolicyRulesErrors')} | ||
| /> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| export default StrictlyEnforceWorkspaceRulesToggle; | ||
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.
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.
You can change this in future pr, but I agree the keys should start lowecase