-
Notifications
You must be signed in to change notification settings - Fork 78
feat(FR-1804): enhance user management table with flexible column composition #4863
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
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟡 | Statements | 60.7% | 227/374 |
| 🔴 | Branches | 33.33% | 104/312 |
| 🔴 | Functions | 48.31% | 43/89 |
| 🟡 | Lines | 62.42% | 206/330 |
Test suite run success
146 tests passing in 8 suites.
Report generated by 🧪jest coverage report action from bc71618
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 4.23% (+0% 🔼) |
496/11724 |
| 🔴 | Branches | 3.65% | 298/8159 |
| 🔴 | Functions | 2.55% (+0.01% 🔼) |
92/3604 |
| 🔴 | Lines | 4.2% (+0% 🔼) |
482/11466 |
Show new covered files 🐣
St.❔ |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🔴 | ... / UserManagement.tsx |
0% | 0% | 0% | 0% |
Test suite run success
144 tests passing in 13 suites.
Report generated by 🧪jest coverage report action from bc71618
f8c5eb7 to
9f7bd5d
Compare
6d4a523 to
a250d0d
Compare
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.
Pull request overview
This PR refactors the user management table to introduce a flexible column composition pattern, improving architectural separation and maintainability. The changes replace UserNodeList with two components: UserManagement (query orchestrator) and UserNodes (fragment-based presentation), moving from array-based (extraColumns) to function-based (customizeColumns) column composition.
Key Changes:
- Introduces flexible function-based column composition API for better control over column positioning
- Separates data fetching concerns (UserManagement) from presentation logic (UserNodes)
- Adds comprehensive translations for
comp:UserNodesacross 21 languages - Migrates from
use-query-paramsto modernnuqslibrary for better query parameter handling - Adds user-friendly button titles for improved accessibility
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| react/src/pages/UserCredentialsPage.tsx | Updates import from UserNodeList to UserManagement component |
| react/src/components/UserNodeList.tsx | Deleted legacy component with monolithic query+presentation logic |
| react/src/components/UserManagement.tsx | New query orchestrator component that manages data fetching and passes fragment data to UserNodes via customizeColumns pattern |
| packages/backend.ai-ui/src/components/UserNodes.tsx | New fragment-based presentation component with customizable column composition API |
| packages/backend.ai-ui/src/components/index.ts | Exports new UserNodes component and related types |
| packages/backend.ai-ui/src/locale/*.json (21 files) | Adds comp:UserNodes translation keys across all supported languages |
| packages/backend.ai-ui/src/components/Table/BAITableSettingModal.tsx | Adds requiredMark={false} for cleaner UI in table settings modal |
a250d0d to
ecaa4c3
Compare
9310377 to
e541dde
Compare
fd2ce6c to
49fc675
Compare
8d8f0ae to
e2c26aa
Compare
49fc675 to
99d7387
Compare
6f5f969 to
7a76095
Compare
nowgnuesLee
left a comment
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.
sorting by created_at isn't working.
e2c26aa to
dcd45f1
Compare
cacaf68 to
842515c
Compare
nowgnuesLee
left a comment
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.
LGTM
842515c to
b185122
Compare
dcd45f1 to
eb24ea2
Compare
ironAiken2
left a comment
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.
b185122 to
f45d1dd
Compare
eb24ea2 to
562b663
Compare
f45d1dd to
7b90a82
Compare
ironAiken2
left a comment
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.
LGTM
Merge activity
|
…position (#4863) Resolves #4862 ([FR-1804](https://lablup.atlassian.net/browse/FR-1804)) ## Background The current user management table implementation uses a fixed array-based approach for column composition (`extraColumns?: BAIColumnType[]`). This approach has limitations: 1. **Limited Flexibility**: Can only prepend or append columns, cannot insert at specific positions 2. **Tight Coupling**: Query logic and presentation are coupled in a single component 3. **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: 1. **Architectural Separation**: Separate data fetching (query orchestrator) from presentation (fragment-based table component) 2. **Flexible Composition**: Enable inserting, filtering, reordering columns at any position 3. **Better Developer Experience**: Provide render-props pattern for maximum control over column composition 4. **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 Details ### Changed API **Before:** ```typescript extraColumns?: BAIColumnType<UserNodeInList>[] ``` **After:** ```typescript customizeColumns?: (baseColumns: BAIColumnType<UserNodeInList>[]) => BAIColumnType<UserNodeInList>[] ``` ### Usage Example ```typescript <UserNodes usersFrgmt={users} customizeColumns={(baseColumns) => [ baseColumns[0], // Keep email column first controlColumn, // Insert control column ...baseColumns.slice(1) // Rest of base columns ]} /> ``` ## Changes - New `UserNodes.tsx` component with fragment-based GraphQL pattern - Function-based `customizeColumns` prop for flexible composition - Updated `UserManagement.tsx` to use new composition pattern - Added translations for 21 languages - Removed `UserNodeList.tsx` (replaced by UserNodes) ## Test Plan **Checklist:** - [ ] Verify user list displays correctly with all columns - [ ] Check control column is inserted at correct position (after email) - [ ] Test column sorting functionality - [ ] Verify status filter (active/inactive) works - [ ] Test search and filtering - [ ] Confirm user actions (edit, enable/disable) work correctly - [ ] Check all 21 language translations display properly [FR-1804]: https://lablup.atlassian.net/browse/FR-1804?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
562b663 to
a70f8f8
Compare
7b90a82 to
bc71618
Compare


Resolves #4862 (FR-1804)
Background
The current user management table implementation uses a fixed array-based approach for column composition (
extraColumns?: BAIColumnType[]). This approach has limitations:Purpose
This enhancement introduces a function-based column composition pattern to address these limitations:
Benefits
Implementation Details
Changed API
Before:
After:
Usage Example
Changes
UserNodes.tsxcomponent with fragment-based GraphQL patterncustomizeColumnsprop for flexible compositionUserManagement.tsxto use new composition patternUserNodeList.tsx(replaced by UserNodes)Test Plan
Checklist: