mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
Fix filter to take only hostname__icontains and disable advance search
This commit is contained in:
parent
9135ff2f77
commit
d40fdd77ad
@ -57,6 +57,7 @@ function DataListToolbar({
|
||||
enableRelatedFuzzyFiltering,
|
||||
handleIsAnsibleFactsSelected,
|
||||
isFilterCleared,
|
||||
advancedSearchDisabled,
|
||||
}) {
|
||||
const showExpandCollapse = onCompact && onExpand;
|
||||
const [isKebabOpen, setIsKebabOpen] = useState(false);
|
||||
@ -86,6 +87,10 @@ function DataListToolbar({
|
||||
}),
|
||||
[setIsKebabModalOpen]
|
||||
);
|
||||
const columns = [...searchColumns];
|
||||
if ( !advancedSearchDisabled ) {
|
||||
columns.push({ name: t`Advanced`, key: 'advanced' });
|
||||
}
|
||||
return (
|
||||
<Toolbar
|
||||
id={`${qsConfig.namespace}-list-toolbar`}
|
||||
@ -134,10 +139,7 @@ function DataListToolbar({
|
||||
<ToolbarItem>
|
||||
<Search
|
||||
qsConfig={qsConfig}
|
||||
columns={[
|
||||
...searchColumns,
|
||||
{ name: t`Advanced`, key: 'advanced' },
|
||||
]}
|
||||
columns={columns}
|
||||
searchableKeys={searchableKeys}
|
||||
relatedSearchableKeys={relatedSearchableKeys}
|
||||
onSearch={onSearch}
|
||||
@ -224,6 +226,7 @@ DataListToolbar.propTypes = {
|
||||
additionalControls: PropTypes.arrayOf(PropTypes.node),
|
||||
enableNegativeFiltering: PropTypes.bool,
|
||||
enableRelatedFuzzyFiltering: PropTypes.bool,
|
||||
advancedSearchDisabled : PropTypes.bool,
|
||||
};
|
||||
|
||||
DataListToolbar.defaultProps = {
|
||||
@ -243,6 +246,7 @@ DataListToolbar.defaultProps = {
|
||||
additionalControls: [],
|
||||
enableNegativeFiltering: true,
|
||||
enableRelatedFuzzyFiltering: true,
|
||||
advancedSearchDisabled: false,
|
||||
};
|
||||
|
||||
export default DataListToolbar;
|
||||
|
||||
@ -62,10 +62,10 @@ function HostMetrics() {
|
||||
pluralizedItemName={t`Host Metrics`}
|
||||
renderRow={(item)=> (<HostMetricsListItem item={item} />)}
|
||||
qsConfig={QS_CONFIG}
|
||||
toolbarSearchColumns={[{name: t`Hostname`, key: 'hostname', isDefault: true}]}
|
||||
toolbarSearchColumns={[{name: t`Hostname`, key: 'hostname__icontains', isDefault: true}]}
|
||||
toolbarSearchableKeys={[]}
|
||||
toolbarRelatedSearchableKeys={[]}
|
||||
renderToolbar={(props) => <DataListToolbar {...props} fillWidth />}
|
||||
renderToolbar={(props) => <DataListToolbar {...props} advancedSearchDisabled={true} fillWidth}
|
||||
headerRow={
|
||||
<HeaderRow qsConfig={QS_CONFIG}>
|
||||
<HeaderCell sortKey="hostname">{t`Hostname`}</HeaderCell>
|
||||
@ -83,4 +83,5 @@ function HostMetrics() {
|
||||
);
|
||||
}
|
||||
|
||||
export { HostMetrics as _HostMetrics };
|
||||
export default HostMetrics;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user