-
Notifications
You must be signed in to change notification settings - Fork 17
fix: 2dc format from backend #2733
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
|
bugbot run |
|
Claude finished @astandrik's task —— View job Code Review Results✅ Strengths
🔍 Observations & Suggestions
🎯 Minor Suggestions
✅ Compliance Check
SummaryThis is a well-implemented feature that follows all the project's coding standards and best practices. The bridge information display is properly integrated with the existing cluster overview, and the code is clean, performant, and maintainable. The PR successfully addresses the 2dc format from backend as described in issue #2721. |
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 updates the bridge pile state format from the backend, changing from separate boolean fields (IsPrimary, IsBeingPromoted) to a unified string-based state enum. The change simplifies the data model and improves state representation consistency.
- Introduces a
BridgePileStateenum with standardized state values - Removes deprecated boolean fields from the
TBridgePileinterface - Updates UI components to use the new unified state field with appropriate color themes
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/types/api/cluster.ts | Adds BridgePileState enum and removes deprecated boolean fields from TBridgePile interface |
| src/containers/Cluster/ClusterOverview/components/BridgeInfoTable.tsx | Updates UI to use new state field with color-coded labels instead of separate boolean status displays |
| tests/suites/bridge/mocks.ts | Updates test mocks to use new state format and adds comprehensive test data for all state values |
| tests/suites/bridge/bridge.test.ts | Updates test expectations to check for new state format |
| return 'unknown'; | ||
| } | ||
|
|
||
| switch (state.toUpperCase()) { |
Copilot
AI
Aug 19, 2025
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.
Consider using the BridgePileState enum values directly instead of converting to uppercase and comparing strings. This would be more type-safe and maintainable: switch (state as BridgePileState) {
| switch (state.toUpperCase()) { | |
| // Helper to map string to BridgePileState enum value | |
| function toBridgePileState(state?: string): BridgePileState | undefined { | |
| if (!state) { | |
| return undefined; | |
| } | |
| // Normalize and match to enum | |
| const normalized = state.trim().toUpperCase(); | |
| switch (normalized) { | |
| case BridgePileState.PRIMARY: | |
| return BridgePileState.PRIMARY; | |
| case BridgePileState.PROMOTE: | |
| return BridgePileState.PROMOTE; | |
| case BridgePileState.SYNCHRONIZED: | |
| return BridgePileState.SYNCHRONIZED; | |
| case BridgePileState.NOT_SYNCHRONIZED: | |
| return BridgePileState.NOT_SYNCHRONIZED; | |
| case BridgePileState.SUSPENDED: | |
| return BridgePileState.SUSPENDED; | |
| case BridgePileState.DISCONNECTED: | |
| return BridgePileState.DISCONNECTED; | |
| case BridgePileState.UNSPECIFIED: | |
| return BridgePileState.UNSPECIFIED; | |
| default: | |
| return undefined; | |
| } | |
| } | |
| function getBridgePileStateTheme(state?: string): NonNullable<LabelProps['theme']> { | |
| const pileState = toBridgePileState(state); | |
| if (!pileState) { | |
| return 'unknown'; | |
| } | |
| switch (pileState) { |
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.
Closes #2721
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Test Changes Summary ⏭️2
⏭️ Skipped Tests (2)
Bundle Size: ✅
Current: 85.37 MB | Main: 85.37 MB
Diff: 1.38 KB (-0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information