mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Add advanced search keys for InstanceGroup and CredentialType Lists
Add advanced search keys for `InstanceGroup` and `CredentialType` Lists. See: https://github.com/ansible/awx/pull/7895/files
This commit is contained in:
@@ -32,7 +32,13 @@ function CredentialTypeList({ i18n }) {
|
|||||||
error: contentError,
|
error: contentError,
|
||||||
isLoading,
|
isLoading,
|
||||||
request: fetchCredentialTypes,
|
request: fetchCredentialTypes,
|
||||||
result: { credentialTypes, credentialTypesCount, actions },
|
result: {
|
||||||
|
credentialTypes,
|
||||||
|
credentialTypesCount,
|
||||||
|
actions,
|
||||||
|
relatedSearchableKeys,
|
||||||
|
searchableKeys,
|
||||||
|
},
|
||||||
} = useRequest(
|
} = useRequest(
|
||||||
useCallback(async () => {
|
useCallback(async () => {
|
||||||
const params = parseQueryString(QS_CONFIG, location.search);
|
const params = parseQueryString(QS_CONFIG, location.search);
|
||||||
@@ -46,12 +52,20 @@ function CredentialTypeList({ i18n }) {
|
|||||||
credentialTypes: response.data.results,
|
credentialTypes: response.data.results,
|
||||||
credentialTypesCount: response.data.count,
|
credentialTypesCount: response.data.count,
|
||||||
actions: responseActions.data.actions,
|
actions: responseActions.data.actions,
|
||||||
|
relatedSearchableKeys: (
|
||||||
|
responseActions?.data?.related_search_fields || []
|
||||||
|
).map(val => val.slice(0, -8)),
|
||||||
|
searchableKeys: Object.keys(
|
||||||
|
responseActions.data.actions?.GET || {}
|
||||||
|
).filter(key => responseActions.data.actions?.GET[key].filterable),
|
||||||
};
|
};
|
||||||
}, [location]),
|
}, [location]),
|
||||||
{
|
{
|
||||||
credentialTypes: [],
|
credentialTypes: [],
|
||||||
credentialTypesCount: 0,
|
credentialTypesCount: 0,
|
||||||
actions: {},
|
actions: {},
|
||||||
|
relatedSearchableKeys: [],
|
||||||
|
searchableKeys: [],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -100,6 +114,8 @@ function CredentialTypeList({ i18n }) {
|
|||||||
pluralizedItemName={i18n._(t`Credential Types`)}
|
pluralizedItemName={i18n._(t`Credential Types`)}
|
||||||
qsConfig={QS_CONFIG}
|
qsConfig={QS_CONFIG}
|
||||||
onRowClick={handleSelect}
|
onRowClick={handleSelect}
|
||||||
|
toolbarSearchableKeys={searchableKeys}
|
||||||
|
toolbarRelatedSearchableKeys={relatedSearchableKeys}
|
||||||
renderToolbar={props => (
|
renderToolbar={props => (
|
||||||
<DatalistToolbar
|
<DatalistToolbar
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@@ -49,7 +49,13 @@ function InstanceGroupList({ i18n }) {
|
|||||||
error: contentError,
|
error: contentError,
|
||||||
isLoading,
|
isLoading,
|
||||||
request: fetchInstanceGroups,
|
request: fetchInstanceGroups,
|
||||||
result: { instanceGroups, instanceGroupsCount, actions },
|
result: {
|
||||||
|
instanceGroups,
|
||||||
|
instanceGroupsCount,
|
||||||
|
actions,
|
||||||
|
relatedSearchableKeys,
|
||||||
|
searchableKeys,
|
||||||
|
},
|
||||||
} = useRequest(
|
} = useRequest(
|
||||||
useCallback(async () => {
|
useCallback(async () => {
|
||||||
const params = parseQueryString(QS_CONFIG, location.search);
|
const params = parseQueryString(QS_CONFIG, location.search);
|
||||||
@@ -63,12 +69,20 @@ function InstanceGroupList({ i18n }) {
|
|||||||
instanceGroups: response.data.results,
|
instanceGroups: response.data.results,
|
||||||
instanceGroupsCount: response.data.count,
|
instanceGroupsCount: response.data.count,
|
||||||
actions: responseActions.data.actions,
|
actions: responseActions.data.actions,
|
||||||
|
relatedSearchableKeys: (
|
||||||
|
responseActions?.data?.related_search_fields || []
|
||||||
|
).map(val => val.slice(0, -8)),
|
||||||
|
searchableKeys: Object.keys(
|
||||||
|
responseActions.data.actions?.GET || {}
|
||||||
|
).filter(key => responseActions.data.actions?.GET[key].filterable),
|
||||||
};
|
};
|
||||||
}, [location]),
|
}, [location]),
|
||||||
{
|
{
|
||||||
instanceGroups: [],
|
instanceGroups: [],
|
||||||
instanceGroupsCount: 0,
|
instanceGroupsCount: 0,
|
||||||
actions: {},
|
actions: {},
|
||||||
|
relatedSearchableKeys: [],
|
||||||
|
searchableKeys: [],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -171,6 +185,8 @@ function InstanceGroupList({ i18n }) {
|
|||||||
pluralizedItemName={pluralizedItemName}
|
pluralizedItemName={pluralizedItemName}
|
||||||
qsConfig={QS_CONFIG}
|
qsConfig={QS_CONFIG}
|
||||||
onRowClick={handleSelect}
|
onRowClick={handleSelect}
|
||||||
|
toolbarSearchableKeys={searchableKeys}
|
||||||
|
toolbarRelatedSearchableKeys={relatedSearchableKeys}
|
||||||
renderToolbar={props => (
|
renderToolbar={props => (
|
||||||
<DatalistToolbar
|
<DatalistToolbar
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
Reference in New Issue
Block a user