Merge pull request #10606 from nixocio/ui_issue_10595

Display full keys advanced search smart inventory

Display full keys advanced search smart inventory

closes: #10595

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
This commit is contained in:
softwarefactory-project-zuul[bot] 2021-07-15 20:42:27 +00:00 committed by GitHub
commit d01cd5517d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,6 +129,13 @@ function HostFilterLookup({
const { isModalOpen, toggleModal, closeModal } = useModal();
const searchColumns = buildSearchColumns();
const parseRelatedSearchFields = searchFields => {
if (searchFields.indexOf('__search') !== -1) {
return searchFields.slice(0, -8);
}
return searchFields;
};
const {
result: { count, hosts, relatedSearchableKeys, searchableKeys },
error: contentError,
@ -147,9 +154,9 @@ function HostFilterLookup({
return {
count: data.count,
hosts: data.results,
relatedSearchableKeys: (
actions?.related_search_fields || []
).map(val => val.slice(0, -8)),
relatedSearchableKeys: (actions?.related_search_fields || []).map(
parseRelatedSearchFields
),
searchableKeys: Object.keys(actions?.actions.GET || {}).filter(
key => actions.actions?.GET[key].filterable
),