-
Notifications
You must be signed in to change notification settings - Fork 2k
[Web] Implement Instance Inventory UI #62027
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
base: yassine/inventory-init-cache
Are you sure you want to change the base?
Conversation
|
@rudream - this PR will require admin approval to merge due to its size. Consider breaking it up into a series smaller changes. |
1 similar comment
|
@rudream - this PR will require admin approval to merge due to its size. Consider breaking it up into a series smaller changes. |
884f7a8 to
b9f9ff1
Compare
| // fully initialized. | ||
| func (ic *InventoryCache) ListUnifiedInstances(ctx context.Context, req *inventoryv1.ListUnifiedInstancesRequest) (*inventoryv1.ListUnifiedInstancesResponse, error) { | ||
| if !ic.IsHealthy() { | ||
| // Keep this error message in sync with web/Instances.tsx(isCacheInitializing) |
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 we use the HTTP status code instead of the specific error message text to identify this case?
| Bots ResourceAccess `json:"bots"` | ||
| // BotInstances defines access to manage bot instances | ||
| BotInstances ResourceAccess `json:"botInstances"` | ||
| // Instances defines access to manage instances |
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.
| // Instances defines access to manage instances | |
| // Instances defines access to view instance inventory. |
| const location = useLocation(); | ||
| const queryParams = new URLSearchParams(location.search); | ||
| const query = queryParams.get('query') ?? ''; | ||
| const isAdvancedQuery = queryParams.get('is_advanced') ?? ''; |
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.
Nit: "is advanced" makes it sound like this is a boolean field, and we do treat it like a boolean, but it looks like it actually holds a string.
| <Alert kind="info" mt={3} mb={3}> | ||
| You do not have permission to view instances. This list will only | ||
| show bot instances. Missing permissions: <code>instance.list</code>{' '} | ||
| and/or <code>instance.read</code>. |
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.
and/or is confusing.
Do they need both list and read or just one of them?
| export function getMajorVersion(version: string): string { | ||
| const parts = version.split('.'); | ||
| return `${parts[0]}.0.0`; | ||
| } | ||
|
|
||
| export function getMinorVersion(version: string): string { | ||
| const parts = version.split('.'); | ||
| return `${parts[0]}.${parts[1]}.0`; | ||
| } | ||
|
|
||
| export function getPreviousMajorVersion(version: string): string { | ||
| const parts = version.split('.'); | ||
| const major = parseInt(parts[0]); | ||
| return `${major - 1}.0.0`; | ||
| } | ||
|
|
||
| export function getNextMajorVersion(version: string): string { | ||
| const parts = version.split('.'); | ||
| const major = parseInt(parts[0]); | ||
| return `${major + 1}.0.0`; | ||
| } |
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.
Is there anything in shared/utils/semver that helps with this?
Purpose
This PR is part of #60528
This PR adds the new "Instance Inventory" page to the Web UI, which allows users to list instances and bot instances with support for search, sorting, and filtering by various criteria.
Figma mockups
Required merges
Implementation
A new type of filter component was created for filtering by versions, this contains some preset version filters based on common use-cases as well as the option for a custom filter where the user can enter their own. This filter control works under the hood by appending a predicate query for that given filter selection to the request, it will combine with any other search/predicate query entered by the user, however it will not populate the advanced search bar.
For bot instances, the services column contains a deeplink button which takes the user to the Bot Instances dashboard with that bot instance in view.
The language for the upgraders differs slightly from those shown in the Figma mockup, as the ones used there are not very accurate and the autoupdate team suggested to use different labels.
Demo
Example default view
Multiple filters and search active
Filter controls