From a6a50f0eb188d4e9fae0a2c348f839dad3424f44 Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 19 Sep 2019 11:13:55 -0400 Subject: [PATCH] Changes InventoriesLookup to InventoryLookup and removes pluralization of lookup headers for Inventory and Project since only one can be selected. --- ...ventoriesLookup.jsx => InventoryLookup.jsx} | 18 +++++++++--------- awx/ui_next/src/components/Lookup/index.js | 2 +- .../JobTemplateAdd/JobTemplateAdd.test.jsx | 2 +- .../Template/shared/JobTemplateForm.jsx | 4 ++-- .../Template/shared/JobTemplateForm.test.jsx | 2 +- .../screens/Template/shared/ProjectLookup.jsx | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) rename awx/ui_next/src/components/Lookup/{InventoriesLookup.jsx => InventoryLookup.jsx} (82%) diff --git a/awx/ui_next/src/components/Lookup/InventoriesLookup.jsx b/awx/ui_next/src/components/Lookup/InventoryLookup.jsx similarity index 82% rename from awx/ui_next/src/components/Lookup/InventoriesLookup.jsx rename to awx/ui_next/src/components/Lookup/InventoryLookup.jsx index c0e0dd04a3..b7179032a3 100644 --- a/awx/ui_next/src/components/Lookup/InventoriesLookup.jsx +++ b/awx/ui_next/src/components/Lookup/InventoryLookup.jsx @@ -11,7 +11,7 @@ import Lookup from '@components/Lookup'; const getInventories = async params => InventoriesAPI.read(params); -class InventoriesLookup extends React.Component { +class InventoryLookup extends React.Component { render() { const { value, tooltip, onChange, required, i18n } = this.props; @@ -19,7 +19,7 @@ class InventoriesLookup extends React.Component { - {i18n._(t`Inventories`)}{' '} + {i18n._(t`Inventory`)}{' '} {tooltip && ( @@ -28,12 +28,12 @@ class InventoriesLookup extends React.Component { } isRequired={required} - fieldId="inventories-lookup" + fieldId="inventory-lookup" > ', () => { expect(wrapper.find('input#template-description').text()).toBe( defaultProps.description ); - expect(wrapper.find('InventoriesLookup').prop('value')).toBe(null); + expect(wrapper.find('InventoryLookup').prop('value')).toBe(null); expect(wrapper.find('AnsibleSelect[name="job_type"]').props().value).toBe( defaultProps.job_type ); diff --git a/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx index 26fdd4c6e1..93fe52dd53 100644 --- a/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx +++ b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx @@ -25,7 +25,7 @@ import CollapsibleSection from '@components/CollapsibleSection'; import { required } from '@util/validators'; import styled from 'styled-components'; import { JobTemplate } from '@types'; -import { InventoriesLookup, InstanceGroupsLookup } from '@components/Lookup'; +import { InventoryLookup, InstanceGroupsLookup } from '@components/Lookup'; import ProjectLookup from './ProjectLookup'; import { JobTemplatesAPI, LabelsAPI, ProjectsAPI } from '@api'; @@ -397,7 +397,7 @@ class JobTemplateForm extends Component { name="inventory" validate={required(null, i18n)} render={({ form }) => ( - ', () => { target: { value: 'new job type', name: 'job_type' }, }); expect(form.state('values').job_type).toEqual('new job type'); - wrapper.find('InventoriesLookup').prop('onChange')({ + wrapper.find('InventoryLookup').prop('onChange')({ id: 3, name: 'inventory', }); diff --git a/awx/ui_next/src/screens/Template/shared/ProjectLookup.jsx b/awx/ui_next/src/screens/Template/shared/ProjectLookup.jsx index fd38b5079e..0bcc42dd84 100644 --- a/awx/ui_next/src/screens/Template/shared/ProjectLookup.jsx +++ b/awx/ui_next/src/screens/Template/shared/ProjectLookup.jsx @@ -43,7 +43,7 @@ class ProjectLookup extends React.Component { )}