From 2d00623c16d581dbdffd1465a4244d3ad3af558c Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Wed, 18 Dec 2019 12:44:04 -0500 Subject: [PATCH] update search keys for various lists in the mvp --- .../components/AddRole/AddResourceRole.jsx | 20 ++++- .../components/Lookup/OrganizationLookup.jsx | 17 ++++ .../components/Lookup/shared/OptionsList.jsx | 17 +++- .../InventoryGroups/InventoryGroupsList.jsx | 27 ++++++ .../InventoryHosts/InventoryHosts.jsx | 25 +++--- .../src/screens/Job/JobList/JobList.jsx | 86 ++++++++++++++++++- .../Project/ProjectList/ProjectList.jsx | 47 +++++++--- .../src/screens/Team/TeamList/TeamList.jsx | 16 +--- .../Template/TemplateList/TemplateList.jsx | 34 +++++--- .../src/screens/User/UserList/UserList.jsx | 10 +-- 10 files changed, 236 insertions(+), 63 deletions(-) diff --git a/awx/ui_next/src/components/AddRole/AddResourceRole.jsx b/awx/ui_next/src/components/AddRole/AddResourceRole.jsx index f0542321b3..9327078808 100644 --- a/awx/ui_next/src/components/AddRole/AddResourceRole.jsx +++ b/awx/ui_next/src/components/AddRole/AddResourceRole.jsx @@ -148,6 +148,14 @@ class AddResourceRole extends React.Component { key: 'username', isDefault: true }, + { + name: i18n._(t`First name`), + key: 'first_name', + }, + { + name: i18n._(t`Last name`), + key: 'last_name', + } ]; const userSortColumns = [ @@ -155,11 +163,19 @@ class AddResourceRole extends React.Component { name: i18n._(t`Username`), key: 'username', }, + { + name: i18n._(t`First name`), + key: 'first_name', + }, + { + name: i18n._(t`Last name`), + key: 'last_name', + } ]; const teamSearchColumns = [ { - name: i18n._(t`name`), + name: i18n._(t`Name`), key: 'name', isDefault: true }, @@ -167,7 +183,7 @@ class AddResourceRole extends React.Component { const teamSortColumns = [ { - name: i18n._(t`name`), + name: i18n._(t`Name`), key: 'name', }, ]; diff --git a/awx/ui_next/src/components/Lookup/OrganizationLookup.jsx b/awx/ui_next/src/components/Lookup/OrganizationLookup.jsx index 9fd5c4bb88..87c7ec3275 100644 --- a/awx/ui_next/src/components/Lookup/OrganizationLookup.jsx +++ b/awx/ui_next/src/components/Lookup/OrganizationLookup.jsx @@ -70,6 +70,23 @@ function OrganizationLookup({ header={i18n._(t`Organization`)} name="organization" qsConfig={QS_CONFIG} + searchColumns={[ + { + name: i18n._(t`Name`), + key: 'name', + isDefault: true + }, + { + name: i18n._(t`Team name`), + key: 'teams__name', + } + ]} + sortColumns={[ + { + name: i18n._(t`Name`), + key: 'name', + }, + ]} readOnly={!canDelete} selectItem={item => dispatch({ type: 'SELECT_ITEM', item })} deselectItem={item => dispatch({ type: 'DESELECT_ITEM', item })} diff --git a/awx/ui_next/src/components/Lookup/shared/OptionsList.jsx b/awx/ui_next/src/components/Lookup/shared/OptionsList.jsx index fa9eb8f67c..9fd1dec6c1 100644 --- a/awx/ui_next/src/components/Lookup/shared/OptionsList.jsx +++ b/awx/ui_next/src/components/Lookup/shared/OptionsList.jsx @@ -8,6 +8,7 @@ import { string, oneOfType, } from 'prop-types'; +import styled from 'styled-components'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import SelectedList from '../../SelectedList'; @@ -16,11 +17,18 @@ import CheckboxListItem from '../../CheckboxListItem'; import DataListToolbar from '../../DataListToolbar'; import { QSConfig, SearchColumns, SortColumns } from '@types'; +const ModalList = styled.div` + .pf-c-data-toolbar__content { + padding: 0 !important; + } +`; + function OptionsList({ value, options, optionCount, - columns, + searchColumns, + sortColumns, multiple, header, name, @@ -33,7 +41,7 @@ function OptionsList({ i18n, }) { return ( -
+ {value.length > 0 && ( ( @@ -67,7 +76,7 @@ function OptionsList({ renderToolbar={props => } showPageSizeOptions={false} /> -
+ ); } diff --git a/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.jsx b/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.jsx index ecfab0d651..fcde03f6dd 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.jsx @@ -177,6 +177,33 @@ function InventoryGroupsList({ i18n, location, match }) { itemCount={groupCount} qsConfig={QS_CONFIG} onRowClick={handleSelect} + toolbarSearchColumns={[ + { + name: i18n._(t`Name`), + key: 'name', + isDefault: true + }, + { + name: i18n._(t`Is root group`), + key: 'parents__isnull', + isDefault: true, + isBoolean: true + }, + { + name: i18n._(t`Created by (username)`), + key: 'created_by__username', + }, + { + name: i18n._(t`Modified by (username)`), + key: 'modified_by__username', + }, + ]} + toolbarSortColumns={[ + { + name: i18n._(t`Name`), + key: 'name' + } + ]} renderItem={item => ( ( ( ( ( diff --git a/awx/ui_next/src/screens/User/UserList/UserList.jsx b/awx/ui_next/src/screens/User/UserList/UserList.jsx index a25d727b79..18c490e908 100644 --- a/awx/ui_next/src/screens/User/UserList/UserList.jsx +++ b/awx/ui_next/src/screens/User/UserList/UserList.jsx @@ -161,13 +161,13 @@ class UsersList extends Component { isDefault: true }, { - name: i18n._(t`First Name`), + name: i18n._(t`First name`), key: 'first_name', }, { - name: i18n._(t`Last Name`), + name: i18n._(t`Last name`), key: 'last_name', - }, + } ]} toolbarSortColumns={[ { @@ -176,11 +176,11 @@ class UsersList extends Component { isDefault: true }, { - name: i18n._(t`First Name`), + name: i18n._(t`First name`), key: 'first_name', }, { - name: i18n._(t`Last Name`), + name: i18n._(t`Last name`), key: 'last_name', }, ]}