-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add smart inventory add/edit forms and host filter lookup #7644
Add smart inventory add/edit forms and host filter lookup #7644
Conversation
f2146ba
to
92e5124
Compare
Build succeeded.
|
👍 on making this disabled until the user selects an Org. You may have already discussed this but should we add a tooltip to this field indicating that an Org needs to be selected? We could also hide the field while Org is empty but meh, idk if I like that better or not. I'm fine leaving it the way it is, just figured I'd ask. |
I'm a little bit concerned about including this field in the default search values: at first I thought that it was the key: |
It looks like these come straight from the OPTIONS response: but I'm wondering if we should update Inventory -> Inventory ID since it seems like that field requires a number. Also wondering if we have a pattern for boolean fields like This may be bleeding into a larger discussion about what fields we want to make available on the "basic" search level and what we want to make available in "advanced". |
Outside the scope of this particular PR (though related) is #3427 i.e. UI support for
I wouldn't expect any of this work to be included in this particular PR but it may impact UX decisions so I felt like it was worth bringing up. @wenottingham thoughts/opinions? |
This may be related to #7644 (comment) but a filter with multiple If I go in and check for matching hosts after saving there are 0 instead of 1 :( |
I think the plan is to display this using PatternFly LabelGroups and Labels similar to how we display it using ChipGroups and Chips. The PatternFly LabelGroup component is still in the design phase. |
Build succeeded.
|
Build succeeded.
|
@mabashian having a text input could work. How would we expose it? (I hate an 'advanced' checkbox, but not sure what else it would be.) |
@wenottingham yea I think this would be exposed in the advanced section. @jlmitch5 is working on that portion separately as far as I understand so we can talk more about it on his side of things. I do think there's a place for something like that in the UI but we'll have to make sure it's a last resort and not something we expect users to use frequently. |
spoke with @marshmalien about this. some notes:
|
fdb4d3c
to
ed6bddd
Compare
Build succeeded.
|
spoke with @marshmalien. We'll probably get into the ideas for expanded views in a future issue or as possible parts of #7850 |
ed6bddd
to
af218aa
Compare
Build succeeded.
|
Build succeeded (gate pipeline).
|
Related: #11017 |
SUMMARY
Issues: #7473 #7472
This PR adds the smart inventory add and edit forms, as well as the host filter lookup. A Smart Inventory is a collection of hosts defined by the host filter search. The host filter only applies to hosts of inventories that belong to the Smart Inventory's organization, therefore, the host filter lookup will remain disabled until the organization field is given a value. If a user does not have permission to POST a smart inventory, the form save button will remain disabled.
The smart host filter lookup works a little differently from our other lookups. Instead of selecting hosts from a list, you create a search tag that contains the hosts you want. I created a separate HostFilterUtils file with helper methods to handle converting the query string and host filter string to a searchParams object and back. The host filter lookup doesn't handle advanced search features such as conditional
or
, compound expressions()
, or relational queries usinghost_filter
. The lookup exposes the following filter keys: name, id, groups__name, inventory, instance_id, enabled, last_job, and insights_system_id.This issue #5513 mentions populating keys based on specific ansible fact names, but I'm not sure it is possible to search on
host_filter
with our current basic search toolbar. I may be wrong about that assumption, but I wasn't successful at finding a way to prependhost_filter
to a namespaced query string?smart_hosts.host_filter=ansible_facts__ansible_processor_vcpus=8
without breaking the search chip groups. My goal was to get as far as possible without editing the Search component.Smart inventory form
Host filter modal
ISSUE TYPE
COMPONENT NAME