-
Notifications
You must be signed in to change notification settings - Fork 15
fix(Tenants): format state from Pending_resources to Pending #2825
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
…pending_resources' Co-authored-by: adameat <[email protected]>
src/containers/Tenants/Tenants.tsx
Outdated
@@ -65,6 +65,21 @@ const b = cn('tenants'); | |||
|
|||
const DATABASES_COLUMNS_WIDTH_LS_KEY = 'databasesTableColumnsWidth'; | |||
|
|||
function formatDatabaseState(state?: string): string { |
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.
Use State
enum as type, transform STATE_UNSPECIFIED
to Unspecified
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.
Updated the function to use State
enum as the type parameter and added transformation for STATE_UNSPECIFIED
to "Unspecified"
. The function now provides better type safety and handles all enum values properly. (15f3f8e)
Change PR title so it passes Verify Title PR check |
Co-authored-by: artemmufazalov <[email protected]>
The current PR title violates two requirements: it contains uppercase letters in the subject and exceeds the 72 character limit. Changed from: To: This follows the conventional commit format with lowercase subjects and stays within the character limit. |
src/containers/Tenants/Tenants.tsx
Outdated
case State.STATE_UNSPECIFIED: | ||
return 'Unspecified'; | ||
case State.PENDING_RESOURCES: | ||
return i18n('value_pending'); |
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.
@copilot use the same approach for both values - do not use i18n
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.
Updated to use consistent approach for both values without i18n. Both STATE_UNSPECIFIED
and PENDING_RESOURCES
now return hardcoded strings: "Unspecified"
and "Pending"
respectively. Removed the i18n entry from en.json. (b7c1234)
…proach Co-authored-by: artemmufazalov <[email protected]>
The database list was displaying the raw API state value "Pending_resources" in the State column, which is not user-friendly. This change improves the user experience by formatting database states properly.
Changes Made
formatDatabaseState()
function: Maps specific state values to user-friendly display names:STATE_UNSPECIFIED
→"Unspecified"
PENDING_RESOURCES
→"Pending"
RUNNING
→"Running"
)State
enum type instead of string for better type checkingtextTransform: 'capitalize'
since formatting is now handled in JavaScriptBefore vs After
STATE_UNSPECIFIED
"state_unspecified"
"Unspecified"
PENDING_RESOURCES
"pending_resources"
"Pending"
RUNNING
"running"
"Running"
CREATING
"creating"
"Creating"
The change provides consistent formatting for all database states using a uniform approach without internationalization overhead for these specific values.
Fixes #2824.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Test Changes Summary ⏭️2
⏭️ Skipped Tests (2)
Bundle Size: ✅
Current: 85.43 MB | Main: 85.43 MB
Diff: +1.29 KB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information