From aa69b925adcba41ee9d3e5834577db7e9bed482e Mon Sep 17 00:00:00 2001 From: nixocio Date: Thu, 24 Sep 2020 11:40:26 -0400 Subject: [PATCH] Make filter a bit more consistent accross UI Add `description`, `created_by` and `modified_by` when those fields are available. See: https://github.com/ansible/awx/issues/7410 --- .../Schedule/ScheduleList/ScheduleList.jsx | 12 ++++++++++++ .../CredentialList/CredentialList.jsx | 19 +++++++++++++++++++ .../CredentialTypeList/CredentialTypeList.jsx | 19 +++++++++++++++++++ .../src/screens/Host/HostList/HostList.jsx | 4 ++++ .../Inventory/InventoryList/InventoryList.jsx | 4 ++++ .../NotificationTemplateList.jsx | 4 ++++ .../OrganizationList/OrganizationList.jsx | 4 ++++ .../Project/ProjectList/ProjectList.jsx | 4 ++++ .../src/screens/Team/TeamList/TeamList.jsx | 4 ++++ 9 files changed, 74 insertions(+) diff --git a/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleList.jsx b/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleList.jsx index bd3b7497d0..512c7d5b62 100644 --- a/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleList.jsx +++ b/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleList.jsx @@ -140,6 +140,18 @@ function ScheduleList({ key: 'name__icontains', isDefault: true, }, + { + name: i18n._(t`Description`), + key: 'description__icontains', + }, + { + name: i18n._(t`Created By (Username)`), + key: 'created_by__username__icontains', + }, + { + name: i18n._(t`Modified By (Username)`), + key: 'modified_by__username__icontains', + }, ]} toolbarSortColumns={[ { diff --git a/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx b/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx index 792ea25355..0e2ea6fab0 100644 --- a/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx +++ b/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx @@ -102,6 +102,25 @@ function CredentialList({ i18n }) { itemCount={credentialCount} qsConfig={QS_CONFIG} onRowClick={handleSelect} + toolbarSearchColumns={[ + { + name: i18n._(t`Name`), + key: 'name__icontains', + isDefault: true, + }, + { + name: i18n._(t`Description`), + key: 'description__icontains', + }, + { + name: i18n._(t`Created By (Username)`), + key: 'created_by__username__icontains', + }, + { + name: i18n._(t`Modified By (Username)`), + key: 'modified_by__username__icontains', + }, + ]} renderItem={item => ( ( diff --git a/awx/ui_next/src/screens/Host/HostList/HostList.jsx b/awx/ui_next/src/screens/Host/HostList/HostList.jsx index a11ec3f4d1..c801fe8c6e 100644 --- a/awx/ui_next/src/screens/Host/HostList/HostList.jsx +++ b/awx/ui_next/src/screens/Host/HostList/HostList.jsx @@ -119,6 +119,10 @@ function HostList({ i18n }) { key: 'name__icontains', isDefault: true, }, + { + name: i18n._(t`Description`), + key: 'description__icontains', + }, { name: i18n._(t`Created By (Username)`), key: 'created_by__username__icontains', diff --git a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryList.jsx b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryList.jsx index e5ff1f6dd4..8ea1e12f57 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryList.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryList.jsx @@ -152,6 +152,10 @@ function InventoryList({ i18n }) { key: 'name__icontains', isDefault: true, }, + { + name: i18n._(t`Description`), + key: 'description__icontains', + }, { name: i18n._(t`Created By (Username)`), key: 'created_by__username__icontains', diff --git a/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx b/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx index 8b2b721b04..96bad47c5d 100644 --- a/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx +++ b/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx @@ -104,6 +104,10 @@ function NotificationTemplatesList({ i18n }) { key: 'name', isDefault: true, }, + { + name: i18n._(t`Description`), + key: 'description__icontains', + }, { name: i18n._(t`Type`), key: 'notification_type', diff --git a/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationList.jsx b/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationList.jsx index 7b3c0eeda2..ee20fb1eb2 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationList.jsx +++ b/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationList.jsx @@ -131,6 +131,10 @@ function OrganizationsList({ i18n }) { key: 'name__icontains', isDefault: true, }, + { + name: i18n._(t`Description`), + key: 'description__icontains', + }, { name: i18n._(t`Created By (Username)`), key: 'created_by__username__icontains', diff --git a/awx/ui_next/src/screens/Project/ProjectList/ProjectList.jsx b/awx/ui_next/src/screens/Project/ProjectList/ProjectList.jsx index b7b8661c1b..659c600e1d 100644 --- a/awx/ui_next/src/screens/Project/ProjectList/ProjectList.jsx +++ b/awx/ui_next/src/screens/Project/ProjectList/ProjectList.jsx @@ -130,6 +130,10 @@ function ProjectList({ i18n }) { key: 'name__icontains', isDefault: true, }, + { + name: i18n._(t`Description`), + key: 'description__icontains', + }, { name: i18n._(t`Type`), key: 'or__scm_type', diff --git a/awx/ui_next/src/screens/Team/TeamList/TeamList.jsx b/awx/ui_next/src/screens/Team/TeamList/TeamList.jsx index 07de516ca4..f7889df2b4 100644 --- a/awx/ui_next/src/screens/Team/TeamList/TeamList.jsx +++ b/awx/ui_next/src/screens/Team/TeamList/TeamList.jsx @@ -126,6 +126,10 @@ function TeamList({ i18n }) { key: 'name__icontains', isDefault: true, }, + { + name: i18n._(t`Description`), + key: 'description__icontains', + }, { name: i18n._(t`Organization Name`), key: 'organization__name__icontains',