-
Notifications
You must be signed in to change notification settings - Fork 78
Description
Background
The current user management table implementation uses a fixed array-based approach for column composition (extraColumns?: BAIColumnType[]). This approach has limitations:
- Limited Flexibility: Can only prepend or append columns, cannot insert at specific positions
- Tight Coupling: Query logic and presentation are coupled in a single component
- Difficult Maintenance: Changes to column ordering require modifying the base component
Purpose
This enhancement introduces a function-based column composition pattern to address these limitations:
- Architectural Separation: Separate data fetching (query orchestrator) from presentation (fragment-based table component)
- Flexible Composition: Enable inserting, filtering, reordering columns at any position
- Better Developer Experience: Provide render-props pattern for maximum control over column composition
- Maintainability: Allow parent components to customize columns without modifying base component
Benefits
- Flexibility: Insert control columns at specific positions (e.g., after email column)
- Reusability: Base table component can be reused with different column compositions
- Type Safety: TypeScript ensures column customization is type-safe
- Clean Architecture: Follows separation of concerns principle (data fetching vs presentation)
Implementation Approach
Changed from:
extraColumns?: BAIColumnType<UserNodeInList>[]
To:
customizeColumns?: (baseColumns: BAIColumnType<UserNodeInList>[]) => BAIColumnType<UserNodeInList>[]
This allows flexible column manipulation:
customizeColumns={(baseColumns) => [
baseColumns[0], // Keep first column
customControlColumn, // Insert custom column
...baseColumns.slice(1) // Rest of columns
]}
Scope
- New
UserNodes.tsxcomponent with fragment-based pattern - Function-based
customizeColumnsprop for flexible composition - Translations for 21 languages
- Updated
UserManagement.tsxto use new pattern
JIRA Issue: FR-1804
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels