From 86029934ad8d8ca80a1d6d79e431bbcf981e45dc Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 13 Sep 2019 12:42:56 -0400 Subject: [PATCH 1/6] selectively add icontains to only text-based searches --- .../DataListToolbar/DataListToolbar.jsx | 5 +++++ awx/ui_next/src/components/Search/Search.jsx | 17 ++++++++++++++--- awx/ui_next/src/screens/Job/JobList/JobList.jsx | 1 + .../OrganizationAccess/OrganizationAccess.jsx | 1 + .../OrganizationList/OrganizationList.jsx | 1 + .../Template/TemplateList/TemplateList.jsx | 1 + awx/ui_next/src/util/qs.js | 4 +++- 7 files changed, 26 insertions(+), 4 deletions(-) diff --git a/awx/ui_next/src/components/DataListToolbar/DataListToolbar.jsx b/awx/ui_next/src/components/DataListToolbar/DataListToolbar.jsx index 8f8d0ecea6..b91cdf977e 100644 --- a/awx/ui_next/src/components/DataListToolbar/DataListToolbar.jsx +++ b/awx/ui_next/src/components/DataListToolbar/DataListToolbar.jsx @@ -15,6 +15,8 @@ import Search from '../Search'; import Sort from '../Sort'; import VerticalSeparator from '../VerticalSeparator'; +import { QSConfig } from '@types'; + const AWXToolbar = styled.div` --awx-toolbar--BackgroundColor: var(--pf-global--BackgroundColor--light-100); --awx-toolbar--BorderColor: #ebebeb; @@ -98,6 +100,7 @@ class DataListToolbar extends React.Component { sortedColumnKey, additionalControls, i18n, + qsConfig, } = this.props; const showExpandCollapse = onCompact && onExpand; @@ -120,6 +123,7 @@ class DataListToolbar extends React.Component { )} qsConfig + .integerFields + .filter(field => field === key).length || qsConfig.dateFields + .filter(field => field === key).length; + + // TODO: this will probably become more sophisticated, where date + // fields and string fields are passed to a formatter + const actualSearchKey = isNonStringField(searchKey) ? searchKey : `${searchKey}__icontains`; + + onSearch(actualSearchKey, searchValue); this.setState({ searchValue: '' }); } @@ -202,6 +212,7 @@ class Search extends React.Component { } Search.propTypes = { + qsConfig: QSConfig.isRequired, columns: PropTypes.arrayOf(PropTypes.object).isRequired, onSearch: PropTypes.func, sortedColumnKey: PropTypes.string, diff --git a/awx/ui_next/src/screens/Job/JobList/JobList.jsx b/awx/ui_next/src/screens/Job/JobList/JobList.jsx index 7836aabf9a..c5460b6f7b 100644 --- a/awx/ui_next/src/screens/Job/JobList/JobList.jsx +++ b/awx/ui_next/src/screens/Job/JobList/JobList.jsx @@ -183,6 +183,7 @@ class JobList extends Component { showExpandCollapse isAllSelected={isAllSelected} onSelectAll={this.handleSelectAll} + qsConfig={QS_CONFIG} additionalControls={[ ( { export function getQSConfig( namespace, defaultParams = { page: 1, page_size: 5, order_by: 'name' }, - integerFields = ['page', 'page_size'] + integerFields = ['page', 'page_size'], + dateFields = ['modified', 'created'] ) { if (!namespace) { throw new Error('a QS namespace is required'); @@ -170,6 +171,7 @@ export function getQSConfig( namespace, defaultParams, integerFields, + dateFields }; } From 34e1b8be1d55d85565d80728270057f89393fb40 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 13 Sep 2019 13:03:15 -0400 Subject: [PATCH 2/6] make default params only accept page, page_size and order_by --- awx/ui_next/src/util/qs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awx/ui_next/src/util/qs.js b/awx/ui_next/src/util/qs.js index 2a268dc08d..31a6df4c48 100644 --- a/awx/ui_next/src/util/qs.js +++ b/awx/ui_next/src/util/qs.js @@ -166,6 +166,8 @@ export function getQSConfig( ) { if (!namespace) { throw new Error('a QS namespace is required'); + } else if (Object.keys(defaultParams).filter(key => key !== 'page' || key !== 'page_size' || key !== 'order_by').length > 0) { + throw new Error('Only page, page_size, and order_by allowed as default params for QS.') } return { namespace, From 678fba1ffb326182ff9f6c097d3ecc6452a77fcb Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 13 Sep 2019 14:45:26 -0400 Subject: [PATCH 3/6] fix tests with search updates --- awx/ui_next/package-lock.json | 31 ++++++++++++------ .../DataListToolbar/DataListToolbar.test.jsx | 13 ++++++++ awx/ui_next/src/components/Search/Search.jsx | 11 ++++--- .../src/components/Search/Search.test.jsx | 13 ++++++-- .../OrganizationAccess.test.jsx.snap | 32 +++++++++++++++++++ .../OrganizationNotifications.test.jsx.snap | 32 +++++++++++++++++++ .../OrganizationTeams.test.jsx | 1 + awx/ui_next/src/util/qs.js | 12 +++++-- awx/ui_next/src/util/qs.test.js | 2 ++ 9 files changed, 127 insertions(+), 20 deletions(-) diff --git a/awx/ui_next/package-lock.json b/awx/ui_next/package-lock.json index db64b4ef90..91d63d9b14 100644 --- a/awx/ui_next/package-lock.json +++ b/awx/ui_next/package-lock.json @@ -13354,6 +13354,17 @@ "object-assign": "^4.1.1", "prop-types": "^15.6.2", "scheduler": "^0.13.6" + }, + "dependencies": { + "scheduler": { + "version": "0.13.6", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.6.tgz", + "integrity": "sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + } } }, "react-codemirror2": { @@ -13370,6 +13381,17 @@ "object-assign": "^4.1.1", "prop-types": "^15.6.2", "scheduler": "^0.13.6" + }, + "dependencies": { + "scheduler": { + "version": "0.13.6", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.6.tgz", + "integrity": "sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + } } }, "react-fast-compare": { @@ -14398,15 +14420,6 @@ "xmlchars": "^2.1.1" } }, - "scheduler": { - "version": "0.13.6", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.6.tgz", - "integrity": "sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==", - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" - } - }, "scheduler": { "version": "0.15.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.15.0.tgz", diff --git a/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx b/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx index 8beb597edb..266bcf6d78 100644 --- a/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx +++ b/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx @@ -5,6 +5,13 @@ import DataListToolbar from './DataListToolbar'; describe('', () => { let toolbar; + const QS_CONFIG = { + namespace: 'organization', + dateFields: [ 'modified', 'created' ], + defaultParams: { page: 1, page_size: 5, order_by: 'name' }, + integerFields: ['page', 'page_size'], + }; + afterEach(() => { if (toolbar) { toolbar.unmount(); @@ -28,6 +35,7 @@ describe('', () => { toolbar = mountWithContexts( ', () => { toolbar = mountWithContexts( ', () => { toolbar = mountWithContexts( ', () => { toolbar = mountWithContexts( ', () => { toolbar = mountWithContexts( ', () => { toolbar = mountWithContexts( qsConfig - .integerFields - .filter(field => field === key).length || qsConfig.dateFields - .filter(field => field === key).length; + const isNonStringField = key => + qsConfig.integerFields.filter(field => field === key).length || + qsConfig.dateFields.filter(field => field === key).length; // TODO: this will probably become more sophisticated, where date // fields and string fields are passed to a formatter - const actualSearchKey = isNonStringField(searchKey) ? searchKey : `${searchKey}__icontains`; + const actualSearchKey = isNonStringField(searchKey) + ? searchKey + : `${searchKey}__icontains`; onSearch(actualSearchKey, searchValue); diff --git a/awx/ui_next/src/components/Search/Search.test.jsx b/awx/ui_next/src/components/Search/Search.test.jsx index e611d876c3..62e1cd0b9e 100644 --- a/awx/ui_next/src/components/Search/Search.test.jsx +++ b/awx/ui_next/src/components/Search/Search.test.jsx @@ -5,6 +5,13 @@ import Search from './Search'; describe('', () => { let search; + const QS_CONFIG = { + namespace: 'organization', + dateFields: [ 'modified', 'created' ], + defaultParams: { page: 1, page_size: 5, order_by: 'name' }, + integerFields: ['page', 'page_size'], + }; + afterEach(() => { if (search) { search = null; @@ -22,7 +29,7 @@ describe('', () => { const onSearch = jest.fn(); search = mountWithContexts( - + ); search.find(searchTextInput).instance().value = 'test-321'; @@ -39,7 +46,7 @@ describe('', () => { ]; const onSearch = jest.fn(); const wrapper = mountWithContexts( - + ).find('Search'); expect(wrapper.state('isSearchDropdownOpen')).toEqual(false); wrapper.instance().handleDropdownToggle(true); @@ -58,7 +65,7 @@ describe('', () => { ]; const onSearch = jest.fn(); const wrapper = mountWithContexts( - + ).find('Search'); expect(wrapper.state('searchKey')).toEqual('name'); wrapper diff --git a/awx/ui_next/src/screens/Organization/OrganizationAccess/__snapshots__/OrganizationAccess.test.jsx.snap b/awx/ui_next/src/screens/Organization/OrganizationAccess/__snapshots__/OrganizationAccess.test.jsx.snap index a2acb59e74..78cf3807ad 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationAccess/__snapshots__/OrganizationAccess.test.jsx.snap +++ b/awx/ui_next/src/screens/Organization/OrganizationAccess/__snapshots__/OrganizationAccess.test.jsx.snap @@ -41,6 +41,10 @@ exports[` initially renders succesfully 1`] = ` items={Array []} qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "first_name", "page": 1, @@ -91,6 +95,10 @@ exports[` initially renders succesfully 1`] = ` items={Array []} qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "first_name", "page": 1, @@ -157,6 +165,10 @@ exports[` initially renders succesfully 1`] = ` } qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "first_name", "page": 1, @@ -221,6 +233,10 @@ exports[` initially renders succesfully 1`] = ` itemCount={0} qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "first_name", "page": 1, @@ -278,6 +294,10 @@ exports[` initially renders succesfully 1`] = ` } qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "first_name", "page": 1, @@ -329,6 +349,10 @@ exports[` initially renders succesfully 1`] = ` onRemoveAll={[Function]} qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "first_name", "page": 1, @@ -353,6 +377,10 @@ exports[` initially renders succesfully 1`] = ` onRemoveAll={[Function]} qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "first_name", "page": 1, @@ -391,6 +419,10 @@ exports[` initially renders succesfully 1`] = ` onRemoveAll={[Function]} qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "first_name", "page": 1, diff --git a/awx/ui_next/src/screens/Organization/OrganizationNotifications/__snapshots__/OrganizationNotifications.test.jsx.snap b/awx/ui_next/src/screens/Organization/OrganizationNotifications/__snapshots__/OrganizationNotifications.test.jsx.snap index e7d090a2ba..8116327545 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationNotifications/__snapshots__/OrganizationNotifications.test.jsx.snap +++ b/awx/ui_next/src/screens/Organization/OrganizationNotifications/__snapshots__/OrganizationNotifications.test.jsx.snap @@ -67,6 +67,10 @@ exports[` initially renders succesfully 1`] = ` } qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "name", "page": 1, @@ -137,6 +141,10 @@ exports[` initially renders succesfully 1`] = ` } qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "name", "page": 1, @@ -222,6 +230,10 @@ exports[` initially renders succesfully 1`] = ` } qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "name", "page": 1, @@ -286,6 +298,10 @@ exports[` initially renders succesfully 1`] = ` itemCount={2} qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "name", "page": 1, @@ -344,6 +360,10 @@ exports[` initially renders succesfully 1`] = ` } qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "name", "page": 1, @@ -1713,6 +1733,10 @@ exports[` initially renders succesfully 1`] = ` onRemoveAll={[Function]} qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "name", "page": 1, @@ -1737,6 +1761,10 @@ exports[` initially renders succesfully 1`] = ` onRemoveAll={[Function]} qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "name", "page": 1, @@ -1775,6 +1803,10 @@ exports[` initially renders succesfully 1`] = ` onRemoveAll={[Function]} qsConfig={ Object { + "dateFields": Array [ + "modified", + "created", + ], "defaultParams": Object { "order_by": "name", "page": 1, diff --git a/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx b/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx index 146ebfbc40..ee01d626a2 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx +++ b/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx @@ -65,6 +65,7 @@ describe('', () => { expect(list.prop('itemCount')).toEqual(listData.data.count); expect(list.prop('qsConfig')).toEqual({ namespace: 'team', + dateFields: [ 'modified', 'created' ], defaultParams: { page: 1, page_size: 5, diff --git a/awx/ui_next/src/util/qs.js b/awx/ui_next/src/util/qs.js index 31a6df4c48..8aaa00c29a 100644 --- a/awx/ui_next/src/util/qs.js +++ b/awx/ui_next/src/util/qs.js @@ -166,14 +166,20 @@ export function getQSConfig( ) { if (!namespace) { throw new Error('a QS namespace is required'); - } else if (Object.keys(defaultParams).filter(key => key !== 'page' || key !== 'page_size' || key !== 'order_by').length > 0) { - throw new Error('Only page, page_size, and order_by allowed as default params for QS.') + } else if ( + Object.keys(defaultParams).filter( + key => key !== 'page' && key !== 'page_size' && key !== 'order_by' + ).length > 0 + ) { + throw new Error( + 'Only page, page_size, and order_by allowed as default params for QS.' + ); } return { namespace, defaultParams, integerFields, - dateFields + dateFields, }; } diff --git a/awx/ui_next/src/util/qs.test.js b/awx/ui_next/src/util/qs.test.js index 9a9bb76515..63c9f80b05 100644 --- a/awx/ui_next/src/util/qs.test.js +++ b/awx/ui_next/src/util/qs.test.js @@ -78,6 +78,7 @@ describe('qs (qs.js)', () => { test('should get default QS config object', () => { expect(getQSConfig('organization')).toEqual({ namespace: 'organization', + dateFields: [ 'modified', 'created' ], defaultParams: { page: 1, page_size: 5, order_by: 'name' }, integerFields: ['page', 'page_size'], }); @@ -94,6 +95,7 @@ describe('qs (qs.js)', () => { }; expect(getQSConfig('inventory', defaults)).toEqual({ namespace: 'inventory', + dateFields: [ 'modified', 'created' ], defaultParams: { page: 1, page_size: 15 }, integerFields: ['page', 'page_size'], }); From d2e335c7c51c5d25ae5bf468fdb4bb13274c2526 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 13 Sep 2019 15:17:59 -0400 Subject: [PATCH 4/6] revert restriction on defaultParams --- awx/ui_next/src/util/qs.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/awx/ui_next/src/util/qs.js b/awx/ui_next/src/util/qs.js index 8aaa00c29a..d10585aa99 100644 --- a/awx/ui_next/src/util/qs.js +++ b/awx/ui_next/src/util/qs.js @@ -166,14 +166,6 @@ export function getQSConfig( ) { if (!namespace) { throw new Error('a QS namespace is required'); - } else if ( - Object.keys(defaultParams).filter( - key => key !== 'page' && key !== 'page_size' && key !== 'order_by' - ).length > 0 - ) { - throw new Error( - 'Only page, page_size, and order_by allowed as default params for QS.' - ); } return { namespace, From 9605d8049d4e308e84bbe5ed493cffca914cfff3 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Wed, 18 Sep 2019 12:41:05 -0400 Subject: [PATCH 5/6] rewrite search key type check to be a var instead of a function --- .../DataListToolbar/DataListToolbar.test.jsx | 2 +- awx/ui_next/src/components/Search/Search.jsx | 6 ++--- .../src/components/Search/Search.test.jsx | 23 +++++++++++++++---- .../OrganizationTeams.test.jsx | 2 +- awx/ui_next/src/util/qs.test.js | 4 ++-- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx b/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx index 266bcf6d78..22ad8e2dac 100644 --- a/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx +++ b/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx @@ -7,7 +7,7 @@ describe('', () => { const QS_CONFIG = { namespace: 'organization', - dateFields: [ 'modified', 'created' ], + dateFields: ['modified', 'created'], defaultParams: { page: 1, page_size: 5, order_by: 'name' }, integerFields: ['page', 'page_size'], }; diff --git a/awx/ui_next/src/components/Search/Search.jsx b/awx/ui_next/src/components/Search/Search.jsx index 2f011e05ab..020bc9d852 100644 --- a/awx/ui_next/src/components/Search/Search.jsx +++ b/awx/ui_next/src/components/Search/Search.jsx @@ -114,9 +114,9 @@ class Search extends React.Component { const { searchKey, searchValue } = this.state; const { onSearch, qsConfig } = this.props; - const isNonStringField = key => - qsConfig.integerFields.filter(field => field === key).length || - qsConfig.dateFields.filter(field => field === key).length; + const isNonStringField = + qsConfig.integerFields.filter(field => field === searchKey).length || + qsConfig.dateFields.filter(field => field === searchKey).length; // TODO: this will probably become more sophisticated, where date // fields and string fields are passed to a formatter diff --git a/awx/ui_next/src/components/Search/Search.test.jsx b/awx/ui_next/src/components/Search/Search.test.jsx index 62e1cd0b9e..d0ee274107 100644 --- a/awx/ui_next/src/components/Search/Search.test.jsx +++ b/awx/ui_next/src/components/Search/Search.test.jsx @@ -7,7 +7,7 @@ describe('', () => { const QS_CONFIG = { namespace: 'organization', - dateFields: [ 'modified', 'created' ], + dateFields: ['modified', 'created'], defaultParams: { page: 1, page_size: 5, order_by: 'name' }, integerFields: ['page', 'page_size'], }; @@ -29,7 +29,12 @@ describe('', () => { const onSearch = jest.fn(); search = mountWithContexts( - + ); search.find(searchTextInput).instance().value = 'test-321'; @@ -46,7 +51,12 @@ describe('', () => { ]; const onSearch = jest.fn(); const wrapper = mountWithContexts( - + ).find('Search'); expect(wrapper.state('isSearchDropdownOpen')).toEqual(false); wrapper.instance().handleDropdownToggle(true); @@ -65,7 +75,12 @@ describe('', () => { ]; const onSearch = jest.fn(); const wrapper = mountWithContexts( - + ).find('Search'); expect(wrapper.state('searchKey')).toEqual('name'); wrapper diff --git a/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx b/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx index ee01d626a2..1095c7751c 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx +++ b/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx @@ -65,7 +65,7 @@ describe('', () => { expect(list.prop('itemCount')).toEqual(listData.data.count); expect(list.prop('qsConfig')).toEqual({ namespace: 'team', - dateFields: [ 'modified', 'created' ], + dateFields: ['modified', 'created'], defaultParams: { page: 1, page_size: 5, diff --git a/awx/ui_next/src/util/qs.test.js b/awx/ui_next/src/util/qs.test.js index 63c9f80b05..b3c459b9ba 100644 --- a/awx/ui_next/src/util/qs.test.js +++ b/awx/ui_next/src/util/qs.test.js @@ -78,7 +78,7 @@ describe('qs (qs.js)', () => { test('should get default QS config object', () => { expect(getQSConfig('organization')).toEqual({ namespace: 'organization', - dateFields: [ 'modified', 'created' ], + dateFields: ['modified', 'created'], defaultParams: { page: 1, page_size: 5, order_by: 'name' }, integerFields: ['page', 'page_size'], }); @@ -95,7 +95,7 @@ describe('qs (qs.js)', () => { }; expect(getQSConfig('inventory', defaults)).toEqual({ namespace: 'inventory', - dateFields: [ 'modified', 'created' ], + dateFields: ['modified', 'created'], defaultParams: { page: 1, page_size: 15 }, integerFields: ['page', 'page_size'], }); From ac530e13280e049c7052e9b2a531fad4d630d2c9 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 19 Sep 2019 14:18:46 -0400 Subject: [PATCH 6/6] utilize far instead of function for search type --- awx/ui_next/src/components/Search/Search.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui_next/src/components/Search/Search.jsx b/awx/ui_next/src/components/Search/Search.jsx index 020bc9d852..a33e71e070 100644 --- a/awx/ui_next/src/components/Search/Search.jsx +++ b/awx/ui_next/src/components/Search/Search.jsx @@ -120,7 +120,7 @@ class Search extends React.Component { // TODO: this will probably become more sophisticated, where date // fields and string fields are passed to a formatter - const actualSearchKey = isNonStringField(searchKey) + const actualSearchKey = isNonStringField ? searchKey : `${searchKey}__icontains`;