Conversation
Contributor
There was a problem hiding this comment.
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;
Raubzeug
approved these changes
May 26, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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