-
Notifications
You must be signed in to change notification settings - Fork 3
Fix incorrect ProviderConfig usage counter #219
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 fixes the incorrect source for the ProviderConfig usage counter by updating the data field from which usage information is extracted and adding the corresponding type definition.
- Updates the usage counter to read from
config.status.usersinstead ofconfig.metadata.usage - Adds the
usersfield to the ProviderConfig type definition to support the new usage source
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/lib/shared/types.ts | Adds users field to the ProviderConfig status type definition |
| src/components/ControlPlane/ProvidersConfig.tsx | Updates usage counter to read from config.status.users instead of config.metadata.usage |
| }; | ||
| status: { | ||
| count: string; | ||
| users: 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.
Did you check that this is a string? With the provider that I checked, it looks like to come through as a number. I’m not sure if each provider could define this differently.
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.
Can also keep it like this and tackle proper typings with the move to gql
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.
Yes, with generated types it won't be an issue anymore. And here we don't do any math but only display it.
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.
Works for me 👍
| }; | ||
| status: { | ||
| count: string; | ||
| users: 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.
Can also keep it like this and tackle proper typings with the move to gql
What this PR does / why we need it:
Fixes incorrect ProviderConfig usage counter