Sub-Pages — Category Toggle Sections¶
Part of: Sub-Pages guide See also: Settings Patterns | Membership Tabs
Overview¶
The Category Toggle Section pattern combines:
A toggle group to switch between “Anyone” (all) and “Specified” (specific members)
Tabbed tables showing membership entries for different member types
Add/Remove operations for managing members
Components Involved¶
CategoryToggleSection—src/components/CategoryToggleSection/CategoryToggleSection.tsxuseCategoryMembershipOperations—src/hooks/useCategoryMembershipOperations.ts
Documentation Structure¶
File |
Contents |
|---|---|
RPC mutations, hook config, UI component setup |
|
Clearing members on “Anyone”, API naming conventions |
Quick Reference¶
API Method Naming¶
Entity |
Users/Groups API |
Hosts API |
|---|---|---|
SELinux User Maps |
|
|
Sudo Rules |
|
|
HBAC Rules |
|
|
Critical: Clearing Members¶
When switching to “Anyone” (*category = "all"), you must remove all existing members before saving. The API does NOT automatically clear members.
See 15b-category-toggle-advanced.md for implementation.
Checklist¶
[ ] Membership fields typed as
string[]inglobalDataTypes.ts[ ] Fields NOT in
simpleValuesin entity utils[ ] Fields initialized as
[]increateEmpty<Entity>()[ ] Fields filtered out in save mutation
[ ] Separate RPC mutations for add/remove
[ ]
onSavehandles category change to “all”
Reference Implementations¶
src/pages/SELinuxUserMaps/SELinuxUserMapsSettings.tsxsrc/pages/SudoRules/SudoRulesSettings.tsxsrc/components/SudoRuleSections/SudoRulesWho.tsx