-
Notifications
You must be signed in to change notification settings - Fork 17
fix: initial params in useEffect #2321
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
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 adds mock node data generation, enables a mock mode in getStorageNodes based on URL parameters, and removes initial sort and entity initialization from the paginated table component.
- Introduce
generateNodesand related mock data helpers innodes.ts - Conditionally switch to mock data in
getStorageNodes.tswhen?mocksis present - Remove
initialSortParamsprop and its setup effect inPaginatedTable.tsx
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/containers/Storage/PaginatedStorageNodesTable/nodes.ts | Add functions to generate mock nodes, disks, and system stats |
| src/containers/Storage/PaginatedStorageNodesTable/getNodes.ts | Use URL flag ?mocks to return generated nodes instead of API call |
| src/components/PaginatedTable/PaginatedTable.tsx | Drop initialSortParams, remove initialization useEffect, update comments |
Comments suppressed due to low confidence (2)
src/containers/Storage/PaginatedStorageNodesTable/getNodes.ts:52
- [nitpick] The URL parameter name
pdisksdiffers from the optionmaxPdisks, which can cause confusion. Consider renaming the query parameter tomaxPdisksfor consistency.
const pdisks = parseInt(urlParams.get('pdisks') || '10', 10);
src/components/PaginatedTable/PaginatedTable.tsx:30
- Removing
initialSortParamsand its setup effect may break consumers that rely on an initial sort being applied. Ensure all parent components and documentation are updated accordingly or reintroduce an explicit initialization mechanism.
initialSortParams?: SortParams;
Closes #2315
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
😟 No changes in tests. 😕
Bundle Size: ✅
Current: 83.62 MB | Main: 83.62 MB
Diff: 0.76 KB (-0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information