From 43f32f98a92c83000b3e9389de565c810e0aa692 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Thu, 7 May 2020 17:38:07 -0400 Subject: [PATCH] Fix tests --- awx/ui_next/src/App.test.jsx | 2 +- awx/ui_next/src/RootProvider.jsx | 4 +- .../src/api/models/CredentialTypes.test.js | 5 +- awx/ui_next/src/api/models/Teams.test.jsx | 7 +- awx/ui_next/src/api/models/Users.test.jsx | 7 +- awx/ui_next/src/components/About/About.jsx | 2 +- .../src/components/About/brand-logo.svg | 232 ++++++++++++ .../AddRole/AddResourceRole.test.jsx | 5 +- .../src/components/Background/Background.jsx | 12 +- .../CodeMirrorInput/VariablesDetail.jsx | 5 +- .../CodeMirrorInput/VariablesDetail.test.jsx | 16 +- .../CodeMirrorInput/VariablesField.jsx | 5 +- .../CodeMirrorInput/VariablesInput.jsx | 5 +- .../components/DataListCell/DataListCell.jsx | 9 +- .../DisassociateButton/DisassociateButton.jsx | 6 + .../components/LaunchPrompt/LaunchPrompt.jsx | 9 +- .../LaunchPrompt/LaunchPrompt.test.jsx | 5 +- .../LaunchPrompt/steps/CredentialsStep.jsx | 10 +- .../steps/CredentialsStep.test.jsx | 8 +- .../LaunchPrompt/steps/InventoryStep.jsx | 6 +- .../LaunchPrompt/steps/InventoryStep.test.jsx | 6 +- .../LaunchPrompt/steps/OtherPromptsStep.jsx | 8 +- .../steps/OtherPromptsStep.test.jsx | 2 +- .../LaunchPrompt/steps/PreviewStep.jsx | 2 +- .../LaunchPrompt/steps/SurveyStep.jsx | 4 +- .../components/Lookup/CredentialLookup.jsx | 2 +- .../src/components/Lookup/InventoryLookup.jsx | 2 +- awx/ui_next/src/components/Lookup/Lookup.jsx | 2 +- .../MultiButtonToggle.test.jsx | 5 +- .../NotificationListItem.test.jsx.snap | 69 ++-- .../components/PromptDetail/PromptDetail.jsx | 16 +- .../PromptInventorySourceDetail.jsx | 8 +- .../PromptDetail/PromptJobTemplateDetail.jsx | 10 +- .../PromptWFJobTemplateDetail.jsx | 10 +- .../ResourceAccessListItem.jsx | 4 +- .../DeleteRoleConfirmationModal.test.jsx.snap | 126 +++---- .../ResourceAccessListItem.test.jsx.snap | 356 +++++++++--------- .../components/ResourceAccessList/index.js | 4 +- .../src/components/Schedule/Schedule.jsx | 3 +- .../ScheduleDetail/ScheduleDetail.jsx | 22 +- .../ScheduleOccurrences.jsx | 5 +- .../src/components/Schedule/Schedules.jsx | 4 +- .../components/SelectedList/SelectedList.jsx | 2 +- .../SelectedList/SelectedList.test.jsx | 2 +- .../src/components/StatusIcon/StatusIcon.jsx | 14 + .../components/StatusIcon/StatusIcon.test.jsx | 32 +- .../components/Workflow/WorkflowStartNode.jsx | 3 +- awx/ui_next/src/components/Workflow/index.js | 4 +- .../CredentialList/CredentialList.jsx | 2 +- .../InventoryAdd/InventoryAdd.test.jsx | 5 +- .../InventoryDetail/InventoryDetail.jsx | 6 +- .../InventoryDetail/InventoryDetail.test.jsx | 4 +- .../InventoryEdit/InventoryEdit.test.jsx | 5 +- .../InventoryList/InventoryListItem.jsx | 3 +- .../InventorySource/InventorySource.jsx | 4 +- .../InventorySource/InventorySource.test.jsx | 5 +- .../InventorySourceDetail.jsx | 6 +- .../InventorySourceDetail.test.jsx | 5 +- .../InventorySourceList.test.jsx | 18 +- .../InventorySourceSyncButton.jsx | 4 + .../Inventory/shared/InventoryForm.test.jsx | 10 +- .../screens/Job/JobDetail/JobDetail.test.jsx | 8 +- .../screens/Job/JobOutput/HostEventModal.jsx | 4 +- .../Job/JobOutput/HostEventModal.test.jsx | 16 +- .../src/screens/Job/JobOutput/JobEvent.jsx | 4 +- .../screens/Job/JobOutput/JobOutput.test.jsx | 228 ++++++++--- .../Job/JobOutput/shared/HostStatusBar.jsx | 1 + .../JobOutput/shared/HostStatusBar.test.jsx | 4 +- .../JobOutput/shared/JobEventLineNumber.jsx | 6 +- .../Job/JobOutput/shared/JobEventLineText.jsx | 6 +- .../WorkflowOutput/WorkflowOutputGraph.jsx | 3 +- .../Job/WorkflowOutput/WorkflowOutputNode.jsx | 2 + .../WorkflowOutputNode.test.jsx | 4 +- awx/ui_next/src/screens/Login/Login.jsx | 2 +- awx/ui_next/src/screens/Login/brand-logo.svg | 232 ++++++++++++ .../OrganizationAdd/OrganizationAdd.test.jsx | 10 +- .../OrganizationDetail/OrganizationDetail.jsx | 6 +- .../OrganizationDetail.test.jsx | 5 +- .../OrganizationEdit.test.jsx | 5 +- .../shared/OrganizationForm.test.jsx | 10 +- .../Project/ProjectList/ProjectListItem.jsx | 1 + .../ProjectList/ProjectListItem.test.jsx | 2 +- .../Team/TeamAccess/TeamAccessList.jsx | 2 +- .../Team/TeamAccess/TeamAccessList.test.jsx | 7 +- .../Team/TeamAccess/TeamAccessListItem.jsx | 3 +- .../JobTemplateDetail.test.jsx | 5 +- .../JobTemplateEdit/JobTemplateEdit.test.jsx | 10 +- .../Template/Survey/SurveyListItem.jsx | 3 +- .../WorkflowJobTemplateDetail.jsx | 6 +- .../WorkflowJobTemplateDetail.test.jsx | 4 +- .../WorkflowJobTemplateEdit.test.jsx | 10 +- .../Modals/NodeModals/NodeModal.jsx | 3 +- .../Modals/NodeModals/NodeTypeStep/index.js | 4 +- .../VisualizerGraph.jsx | 3 +- .../Template/shared/JobTemplateForm.test.jsx | 7 +- .../Template/shared/LabelSelect.test.jsx | 10 +- .../Template/shared/WebhookSubForm.jsx | 2 +- .../shared/WorkflowJobTemplateForm.test.jsx | 10 +- .../User/UserAccess/UserAccessList.test.jsx | 7 +- .../User/UserAccess/UserAccessListItem.jsx | 3 +- 100 files changed, 1277 insertions(+), 545 deletions(-) create mode 100644 awx/ui_next/src/components/About/brand-logo.svg create mode 100644 awx/ui_next/src/screens/Login/brand-logo.svg diff --git a/awx/ui_next/src/App.test.jsx b/awx/ui_next/src/App.test.jsx index 6f954a8fa2..5b410f95eb 100644 --- a/awx/ui_next/src/App.test.jsx +++ b/awx/ui_next/src/App.test.jsx @@ -2,7 +2,7 @@ import React from 'react'; import { mountWithContexts, waitForElement } from '../testUtils/enzymeHelpers'; import { ConfigAPI, MeAPI, RootAPI } from './api'; -import { asyncFlush } from '../jest.setup'; +import { asyncFlush } from './setupTests'; import App from './App'; diff --git a/awx/ui_next/src/RootProvider.jsx b/awx/ui_next/src/RootProvider.jsx index f391f28619..d81121492b 100644 --- a/awx/ui_next/src/RootProvider.jsx +++ b/awx/ui_next/src/RootProvider.jsx @@ -4,8 +4,8 @@ import { I18nProvider } from '@lingui/react'; import { HashRouter } from 'react-router-dom'; import { getLanguageWithoutRegionCode } from './util/language'; -import ja from '../build/locales/ja/messages'; -import en from '../build/locales/en/messages'; +import ja from './locales/ja/messages'; +import en from './locales/en/messages'; class RootProvider extends Component { render() { diff --git a/awx/ui_next/src/api/models/CredentialTypes.test.js b/awx/ui_next/src/api/models/CredentialTypes.test.js index 5cb038912e..d68ff06a0c 100644 --- a/awx/ui_next/src/api/models/CredentialTypes.test.js +++ b/awx/ui_next/src/api/models/CredentialTypes.test.js @@ -1,6 +1,9 @@ import CredentialTypes from './CredentialTypes'; -const typesData = [{ id: 1, kind: 'machine' }, { id: 2, kind: 'cloud' }]; +const typesData = [ + { id: 1, kind: 'machine' }, + { id: 2, kind: 'cloud' }, +]; describe('CredentialTypesAPI', () => { test('should load all types', async () => { diff --git a/awx/ui_next/src/api/models/Teams.test.jsx b/awx/ui_next/src/api/models/Teams.test.jsx index 9bcbe65413..b618b1dddd 100644 --- a/awx/ui_next/src/api/models/Teams.test.jsx +++ b/awx/ui_next/src/api/models/Teams.test.jsx @@ -16,10 +16,9 @@ describe('TeamsAPI', () => { await TeamsAPI.associateRole(teamId, roleId); expect(mockHttp.post).toHaveBeenCalledTimes(1); - expect(mockHttp.post.mock.calls[0]).toContainEqual( - `/api/v2/teams/${teamId}/roles/`, - { id: roleId } - ); + expect( + mockHttp.post.mock.calls[0] + ).toContainEqual(`/api/v2/teams/${teamId}/roles/`, { id: roleId }); done(); }); diff --git a/awx/ui_next/src/api/models/Users.test.jsx b/awx/ui_next/src/api/models/Users.test.jsx index 10ec37411d..6eb662f4d7 100644 --- a/awx/ui_next/src/api/models/Users.test.jsx +++ b/awx/ui_next/src/api/models/Users.test.jsx @@ -16,10 +16,9 @@ describe('UsersAPI', () => { await UsersAPI.associateRole(userId, roleId); expect(mockHttp.post).toHaveBeenCalledTimes(1); - expect(mockHttp.post.mock.calls[0]).toContainEqual( - `/api/v2/users/${userId}/roles/`, - { id: roleId } - ); + expect( + mockHttp.post.mock.calls[0] + ).toContainEqual(`/api/v2/users/${userId}/roles/`, { id: roleId }); done(); }); diff --git a/awx/ui_next/src/components/About/About.jsx b/awx/ui_next/src/components/About/About.jsx index 785ecf4a19..8444797830 100644 --- a/awx/ui_next/src/components/About/About.jsx +++ b/awx/ui_next/src/components/About/About.jsx @@ -10,7 +10,7 @@ import { } from '@patternfly/react-core'; import { BrandName } from '../../variables'; -import brandLogoImg from '../../../images/brand-logo.svg'; +import brandLogoImg from './brand-logo.svg'; class About extends React.Component { static createSpeechBubble(version) { diff --git a/awx/ui_next/src/components/About/brand-logo.svg b/awx/ui_next/src/components/About/brand-logo.svg new file mode 100644 index 0000000000..6d80915fb6 --- /dev/null +++ b/awx/ui_next/src/components/About/brand-logo.svg @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/awx/ui_next/src/components/AddRole/AddResourceRole.test.jsx b/awx/ui_next/src/components/AddRole/AddResourceRole.test.jsx index 8a17a10a97..76f5dbb87e 100644 --- a/awx/ui_next/src/components/AddRole/AddResourceRole.test.jsx +++ b/awx/ui_next/src/components/AddRole/AddResourceRole.test.jsx @@ -11,7 +11,10 @@ describe('<_AddResourceRole />', () => { UsersAPI.read.mockResolvedValue({ data: { count: 2, - results: [{ id: 1, username: 'foo' }, { id: 2, username: 'bar' }], + results: [ + { id: 1, username: 'foo' }, + { id: 2, username: 'bar' }, + ], }, }); const roles = { diff --git a/awx/ui_next/src/components/Background/Background.jsx b/awx/ui_next/src/components/Background/Background.jsx index d44711fa17..7857a1ed54 100644 --- a/awx/ui_next/src/components/Background/Background.jsx +++ b/awx/ui_next/src/components/Background/Background.jsx @@ -1,15 +1,13 @@ import React, { Fragment } from 'react'; import { BackgroundImage, BackgroundImageSrc } from '@patternfly/react-core'; -import bgFilter from '@patternfly/patternfly/assets/images/background-filter.svg'; const backgroundImageConfig = { - [BackgroundImageSrc.xs]: '/assets/images/pfbg_576.jpg', - [BackgroundImageSrc.xs2x]: '/assets/images/pfbg_576@2x.jpg', - [BackgroundImageSrc.sm]: '/assets/images/pfbg_768.jpg', - [BackgroundImageSrc.sm2x]: '/assets/images/pfbg_768@2x.jpg', - [BackgroundImageSrc.lg]: '/assets/images/pfbg_2000.jpg', - [BackgroundImageSrc.filter]: `${bgFilter}#image_overlay`, + [BackgroundImageSrc.xs]: './images/pfbg_576.jpg', + [BackgroundImageSrc.xs2x]: './images/pfbg_576@2x.jpg', + [BackgroundImageSrc.sm]: './images/pfbg_768.jpg', + [BackgroundImageSrc.sm2x]: './images/pfbg_768@2x.jpg', + [BackgroundImageSrc.lg]: './images/pfbg_2000.jpg', }; export default ({ children }) => ( diff --git a/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.jsx b/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.jsx index 48bed46f4b..4c9e37a8cc 100644 --- a/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.jsx +++ b/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.jsx @@ -51,7 +51,10 @@ function VariablesDetail({ value, label, rows, fullHeight }) { { try { diff --git a/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.test.jsx b/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.test.jsx index d745236dc5..760a23f1e8 100644 --- a/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.test.jsx +++ b/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.test.jsx @@ -10,7 +10,7 @@ describe('', () => { const wrapper = shallow( ); - const input = wrapper.find('Styled(CodeMirrorInput)'); + const input = wrapper.find('CodeMirrorInput'); expect(input).toHaveLength(1); expect(input.prop('mode')).toEqual('yaml'); expect(input.prop('value')).toEqual('---foo: bar'); @@ -21,7 +21,7 @@ describe('', () => { const wrapper = shallow( ); - const input = wrapper.find('Styled(CodeMirrorInput)'); + const input = wrapper.find('CodeMirrorInput'); expect(input).toHaveLength(1); expect(input.prop('mode')).toEqual('javascript'); expect(input.prop('value')).toEqual('{"foo": "bar"}'); @@ -32,19 +32,19 @@ describe('', () => { ); wrapper.find('MultiButtonToggle').invoke('onChange')('javascript'); - const input = wrapper.find('Styled(CodeMirrorInput)'); + const input = wrapper.find('CodeMirrorInput'); expect(input.prop('mode')).toEqual('javascript'); expect(input.prop('value')).toEqual('{\n "foo": "bar"\n}'); wrapper.find('MultiButtonToggle').invoke('onChange')('yaml'); - const input2 = wrapper.find('Styled(CodeMirrorInput)'); + const input2 = wrapper.find('CodeMirrorInput'); expect(input2.prop('mode')).toEqual('yaml'); expect(input2.prop('value')).toEqual('foo: bar\n'); }); test('should render label and value= --- when there are no values', () => { const wrapper = shallow(); - expect(wrapper.find('Styled(CodeMirrorInput)').length).toBe(1); + expect(wrapper.find('CodeMirrorInput').length).toBe(1); expect(wrapper.find('div.pf-c-form__label').text()).toBe('Variables'); }); @@ -59,14 +59,14 @@ describe('', () => { value: '---bar: baz', }); wrapper.update(); - const input = wrapper.find('Styled(CodeMirrorInput)'); + const input = wrapper.find('CodeMirrorInput'); expect(input.prop('mode')).toEqual('javascript'); expect(input.prop('value')).toEqual('{\n "bar": "baz"\n}'); }); test('should default yaml value to "---"', () => { const wrapper = shallow(); - const input = wrapper.find('Styled(CodeMirrorInput)'); + const input = wrapper.find('CodeMirrorInput'); expect(input.prop('value')).toEqual('---'); }); @@ -76,7 +76,7 @@ describe('', () => { wrapper.find('MultiButtonToggle').invoke('onChange')('javascript'); }); wrapper.setProps({ value: '' }); - const input = wrapper.find('Styled(CodeMirrorInput)'); + const input = wrapper.find('CodeMirrorInput'); expect(input.prop('value')).toEqual('{}'); }); }); diff --git a/awx/ui_next/src/components/CodeMirrorInput/VariablesField.jsx b/awx/ui_next/src/components/CodeMirrorInput/VariablesField.jsx index 7be1a24de9..72b4e57f17 100644 --- a/awx/ui_next/src/components/CodeMirrorInput/VariablesField.jsx +++ b/awx/ui_next/src/components/CodeMirrorInput/VariablesField.jsx @@ -44,7 +44,10 @@ function VariablesField({ { try { diff --git a/awx/ui_next/src/components/CodeMirrorInput/VariablesInput.jsx b/awx/ui_next/src/components/CodeMirrorInput/VariablesInput.jsx index fda9bec4d1..4b2deab789 100644 --- a/awx/ui_next/src/components/CodeMirrorInput/VariablesInput.jsx +++ b/awx/ui_next/src/components/CodeMirrorInput/VariablesInput.jsx @@ -43,7 +43,10 @@ function VariablesInput(props) { { try { diff --git a/awx/ui_next/src/components/DataListCell/DataListCell.jsx b/awx/ui_next/src/components/DataListCell/DataListCell.jsx index 4cb698b50c..79aff02595 100644 --- a/awx/ui_next/src/components/DataListCell/DataListCell.jsx +++ b/awx/ui_next/src/components/DataListCell/DataListCell.jsx @@ -1,9 +1,12 @@ -import { DataListCell } from '@patternfly/react-core'; +import { DataListCell as PFDataListCell } from '@patternfly/react-core'; import styled from 'styled-components'; -DataListCell.displayName = 'PFDataListCell'; +PFDataListCell.displayName = 'PFDataListCell'; // Once https://github.com/patternfly/patternfly-react/issues/3938 // has been resolved this component can be removed -export default styled(DataListCell)` +const DataListCell = styled(PFDataListCell)` word-break: break-word; `; +DataListCell.displayName = 'DataListCell'; + +export default DataListCell; diff --git a/awx/ui_next/src/components/DisassociateButton/DisassociateButton.jsx b/awx/ui_next/src/components/DisassociateButton/DisassociateButton.jsx index dacb44aaae..cafde49f73 100644 --- a/awx/ui_next/src/components/DisassociateButton/DisassociateButton.jsx +++ b/awx/ui_next/src/components/DisassociateButton/DisassociateButton.jsx @@ -112,6 +112,12 @@ function DisassociateButton({ ); } +DisassociateButton.defaultProps = { + itemsToDisassociate: [], + modalNote: '', + modalTitle: '', +}; + DisassociateButton.propTypes = { itemsToDisassociate: arrayOf(object), modalNote: string, diff --git a/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.jsx b/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.jsx index f9d926d267..bb24c66393 100644 --- a/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.jsx @@ -3,8 +3,8 @@ import { Wizard } from '@patternfly/react-core'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import { Formik } from 'formik'; -import ContentError from '../../components/ContentError'; -import ContentLoading from '../../components/ContentLoading'; +import ContentError from '../ContentError'; +import ContentLoading from '../ContentLoading'; import mergeExtraVars from './mergeExtraVars'; import useSteps from './useSteps'; import getSurveyValues from './getSurveyValues'; @@ -36,7 +36,10 @@ function LaunchPrompt({ config, resource, onLaunch, onCancel, i18n }) { }; const surveyValues = getSurveyValues(values); setValue('inventory_id', values.inventory?.id); - setValue('credentials', values.credentials?.map(c => c.id)); + setValue( + 'credentials', + values.credentials?.map(c => c.id) + ); setValue('job_type', values.job_type); setValue('limit', values.limit); setValue('job_tags', values.job_tags); diff --git a/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.test.jsx b/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.test.jsx index 5cab9562ff..25f8660585 100644 --- a/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.test.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.test.jsx @@ -1,6 +1,9 @@ import React from 'react'; import { act, isElementOfType } from 'react-dom/test-utils'; -import { mountWithContexts, waitForElement } from '../../../testUtils/enzymeHelpers'; +import { + mountWithContexts, + waitForElement, +} from '../../../testUtils/enzymeHelpers'; import LaunchPrompt from './LaunchPrompt'; import InventoryStep from './steps/InventoryStep'; import CredentialsStep from './steps/CredentialsStep'; diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.jsx index ccf6cc3178..1477859028 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.jsx @@ -5,11 +5,11 @@ import { t } from '@lingui/macro'; import { useField } from 'formik'; import { ToolbarItem } from '@patternfly/react-core'; import { CredentialsAPI, CredentialTypesAPI } from '../../../api'; -import AnsibleSelect from '../../../components/AnsibleSelect'; -import OptionsList from '../../../components/OptionsList'; -import ContentLoading from '../../../components/ContentLoading'; -import CredentialChip from '../../../components/CredentialChip'; -import ContentError from '../../../components/ContentError'; +import AnsibleSelect from '../../AnsibleSelect'; +import OptionsList from '../../OptionsList'; +import ContentLoading from '../../ContentLoading'; +import CredentialChip from '../../CredentialChip'; +import ContentError from '../../ContentError'; import { getQSConfig, parseQueryString } from '../../../util/qs'; import useRequest from '../../../util/useRequest'; import { required } from '../../../util/validators'; diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.test.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.test.jsx index af056990ce..543ac0baad 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.test.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.test.jsx @@ -1,12 +1,12 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; -import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; +import { mountWithContexts } from '../../../../testUtils/enzymeHelpers'; import CredentialsStep from './CredentialsStep'; -import { CredentialsAPI, CredentialTypesAPI } from '../../api'; +import { CredentialsAPI, CredentialTypesAPI } from '../../../api'; -jest.mock('../../api/models/CredentialTypes'); -jest.mock('../../api/models/Credentials'); +jest.mock('../../../api/models/CredentialTypes'); +jest.mock('../../../api/models/Credentials'); const types = [ { id: 1, kind: 'ssh', name: 'SSH' }, diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.jsx index 535fdd19c8..7360a53f07 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.jsx @@ -6,9 +6,9 @@ import { useField } from 'formik'; import { InventoriesAPI } from '../../../api'; import { getQSConfig, parseQueryString } from '../../../util/qs'; import useRequest from '../../../util/useRequest'; -import OptionsList from '../../../components/OptionsList'; -import ContentLoading from '../../../components/ContentLoading'; -import ContentError from '../../../components/ContentError'; +import OptionsList from '../../OptionsList'; +import ContentLoading from '../../ContentLoading'; +import ContentError from '../../ContentError'; import { required } from '../../../util/validators'; const QS_CONFIG = getQSConfig('inventory', { diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.test.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.test.jsx index 260e48cae6..f2bf29d90a 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.test.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.test.jsx @@ -1,11 +1,11 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; -import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; +import { mountWithContexts } from '../../../../testUtils/enzymeHelpers'; import InventoryStep from './InventoryStep'; -import { InventoriesAPI } from '../../api'; +import { InventoriesAPI } from '../../../api'; -jest.mock('../../api/models/Inventories'); +jest.mock('../../../api/models/Inventories'); const inventories = [ { id: 1, name: 'inv one', url: '/inventories/1' }, diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.jsx index 6705a4b576..a1dc0ad8ab 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.jsx @@ -4,10 +4,10 @@ import { t } from '@lingui/macro'; import { useField } from 'formik'; import { Form, FormGroup, Switch } from '@patternfly/react-core'; import styled from 'styled-components'; -import FormField, { FieldTooltip } from '../FormField'; -import { TagMultiSelect } from '../MultiSelect'; -import AnsibleSelect from '../AnsibleSelect'; -import { VariablesField } from '../CodeMirrorInput'; +import FormField, { FieldTooltip } from '../../FormField'; +import { TagMultiSelect } from '../../MultiSelect'; +import AnsibleSelect from '../../AnsibleSelect'; +import { VariablesField } from '../../CodeMirrorInput'; const FieldHeader = styled.div` display: flex; diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.jsx index 76c87e8302..7d3a374c84 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; -import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; +import { mountWithContexts } from '../../../../testUtils/enzymeHelpers'; import OtherPromptsStep from './OtherPromptsStep'; describe('OtherPromptsStep', () => { diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.jsx index 2ab8b4f6f5..e8171debe2 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { useFormikContext } from 'formik'; import yaml from 'js-yaml'; -import PromptDetail from '../../../components/PromptDetail'; +import PromptDetail from '../../PromptDetail'; import mergeExtraVars, { maskPasswords } from '../mergeExtraVars'; import getSurveyValues from '../getSurveyValues'; diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.jsx index dd74c202a5..73da31f76f 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.jsx @@ -8,8 +8,8 @@ import { SelectOption, SelectVariant, } from '@patternfly/react-core'; -import FormField, { FieldTooltip } from '../../../components/FormField'; -import AnsibleSelect from '../../../components/AnsibleSelect'; +import FormField, { FieldTooltip } from '../../FormField'; +import AnsibleSelect from '../../AnsibleSelect'; import { required, minMaxValue, diff --git a/awx/ui_next/src/components/Lookup/CredentialLookup.jsx b/awx/ui_next/src/components/Lookup/CredentialLookup.jsx index 5617ccb8ed..2562b81f50 100644 --- a/awx/ui_next/src/components/Lookup/CredentialLookup.jsx +++ b/awx/ui_next/src/components/Lookup/CredentialLookup.jsx @@ -8,7 +8,7 @@ import { CredentialsAPI } from '../../api'; import { Credential } from '../../types'; import { getQSConfig, parseQueryString, mergeParams } from '../../util/qs'; import { FieldTooltip } from '../FormField'; -import Lookup from '.'; +import Lookup from './Lookup'; import OptionsList from '../OptionsList'; import LookupErrorMessage from './shared/LookupErrorMessage'; diff --git a/awx/ui_next/src/components/Lookup/InventoryLookup.jsx b/awx/ui_next/src/components/Lookup/InventoryLookup.jsx index b47f2aa583..01e25af6e7 100644 --- a/awx/ui_next/src/components/Lookup/InventoryLookup.jsx +++ b/awx/ui_next/src/components/Lookup/InventoryLookup.jsx @@ -5,7 +5,7 @@ import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import { InventoriesAPI } from '../../api'; import { Inventory } from '../../types'; -import Lookup from '.'; +import Lookup from './Lookup'; import OptionsList from '../OptionsList'; import { getQSConfig, parseQueryString } from '../../util/qs'; import LookupErrorMessage from './shared/LookupErrorMessage'; diff --git a/awx/ui_next/src/components/Lookup/Lookup.jsx b/awx/ui_next/src/components/Lookup/Lookup.jsx index 1397e7b776..db32b2dd25 100644 --- a/awx/ui_next/src/components/Lookup/Lookup.jsx +++ b/awx/ui_next/src/components/Lookup/Lookup.jsx @@ -17,10 +17,10 @@ import { InputGroup as PFInputGroup, Modal, } from '@patternfly/react-core'; -import ChipGroup from '../../components/ChipGroup'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import styled from 'styled-components'; +import ChipGroup from '../ChipGroup'; import reducer, { initReducer } from './shared/reducer'; import { QSConfig } from '../../types'; diff --git a/awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.test.jsx b/awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.test.jsx index 15c65e3a29..01dafe0cdd 100644 --- a/awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.test.jsx +++ b/awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.test.jsx @@ -8,7 +8,10 @@ describe('', () => { beforeAll(() => { wrapper = mount( diff --git a/awx/ui_next/src/components/NotificationList/__snapshots__/NotificationListItem.test.jsx.snap b/awx/ui_next/src/components/NotificationList/__snapshots__/NotificationListItem.test.jsx.snap index d817689533..f99a0c51fd 100644 --- a/awx/ui_next/src/components/NotificationList/__snapshots__/NotificationListItem.test.jsx.snap +++ b/awx/ui_next/src/components/NotificationList/__snapshots__/NotificationListItem.test.jsx.snap @@ -42,8 +42,8 @@ exports[` initially renders succe - + initially renders succe > Foo - - , - + + , + Slack - , + , ] } key=".0" @@ -77,17 +77,19 @@ exports[` initially renders succe "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "DataListCell-sc-18ntxrx-0", - "isStatic": true, - "lastClassName": "flJMIO", + "componentId": "sc-bdVaJa", + "isStatic": false, + "lastClassName": "kruorc", "rules": Array [ - "word-break:break-word;", + " + word-break: break-word; +", ], }, "displayName": "DataListCell", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "DataListCell-sc-18ntxrx-0", + "styledComponentId": "sc-bdVaJa", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -97,10 +99,10 @@ exports[` initially renders succe forwardedRef={null} >
initially renders succe "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "DataListCell-sc-18ntxrx-0", - "isStatic": true, - "lastClassName": "flJMIO", + "componentId": "sc-bdVaJa", + "isStatic": false, + "lastClassName": "kruorc", "rules": Array [ - "word-break:break-word;", + " + word-break: break-word; +", ], }, "displayName": "DataListCell", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "DataListCell-sc-18ntxrx-0", + "styledComponentId": "sc-bdVaJa", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -158,10 +162,10 @@ exports[` initially renders succe forwardedRef={null} >
Slack
@@ -170,7 +174,7 @@ exports[` initially renders succe
- initially renders succe "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "NotificationListItem__DataListAction-w674ng-0", - "isStatic": true, - "lastClassName": "hhZchj", + "componentId": "sc-bwzfXH", + "isStatic": false, + "lastClassName": "llKtln", "rules": Array [ - "align-items:center;display:grid;grid-gap:16px;grid-template-columns:repeat(3,max-content);", + " + align-items: center; + display: grid; + grid-gap: 16px; + grid-template-columns: repeat(3, max-content); +", ], }, - "displayName": "NotificationListItem__DataListAction", + "displayName": "Styled(DataListAction)", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "NotificationListItem__DataListAction-w674ng-0", + "styledComponentId": "sc-bwzfXH", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -209,12 +218,12 @@ exports[` initially renders succe
initially renders succe
-
+ diff --git a/awx/ui_next/src/components/PromptDetail/PromptDetail.jsx b/awx/ui_next/src/components/PromptDetail/PromptDetail.jsx index aa6e1c76df..9ebcf1a0a1 100644 --- a/awx/ui_next/src/components/PromptDetail/PromptDetail.jsx +++ b/awx/ui_next/src/components/PromptDetail/PromptDetail.jsx @@ -4,13 +4,13 @@ import { withI18n } from '@lingui/react'; import { t, Trans } from '@lingui/macro'; import { Link } from 'react-router-dom'; import styled from 'styled-components'; +import { Chip, Divider } from '@patternfly/react-core'; import { toTitleCase } from '../../util/strings'; -import { Chip, Divider } from '@patternfly/react-core'; -import CredentialChip from '../../components/CredentialChip'; -import ChipGroup from '../../components/ChipGroup'; -import { DetailList, Detail, UserDateDetail } from '../../components/DetailList'; -import { VariablesDetail } from '../../components/CodeMirrorInput'; +import CredentialChip from '../CredentialChip'; +import ChipGroup from '../ChipGroup'; +import { DetailList, Detail, UserDateDetail } from '../DetailList'; +import { VariablesDetail } from '../CodeMirrorInput'; import PromptProjectDetail from './PromptProjectDetail'; import PromptInventorySourceDetail from './PromptInventorySourceDetail'; @@ -43,7 +43,7 @@ function buildResourceLink(resource) { workflow_job_template: `/templates/workflow_job_template/${resource.id}/details`, }; - return link[(resource?.type)] ? ( + return link[resource?.type] ? ( {resource.name} ) : ( resource.name @@ -241,6 +241,10 @@ function PromptDetail({ i18n, resource, launchConfig = {}, overrides = {} }) { ); } +PromptDetail.defaultProps = { + launchConfig: { defaults: {} }, +}; + PromptDetail.propTypes = { resource: shape({}).isRequired, launchConfig: shape({}), diff --git a/awx/ui_next/src/components/PromptDetail/PromptInventorySourceDetail.jsx b/awx/ui_next/src/components/PromptDetail/PromptInventorySourceDetail.jsx index e4d61bf97c..46c89b7b4a 100644 --- a/awx/ui_next/src/components/PromptDetail/PromptInventorySourceDetail.jsx +++ b/awx/ui_next/src/components/PromptDetail/PromptInventorySourceDetail.jsx @@ -4,10 +4,10 @@ import { t } from '@lingui/macro'; import { Link } from 'react-router-dom'; import { Chip, List, ListItem } from '@patternfly/react-core'; -import { Detail, DeletedDetail } from '../../components/DetailList'; -import { VariablesDetail } from '../../components/CodeMirrorInput'; -import CredentialChip from '../../components/CredentialChip'; -import ChipGroup from '../../components/ChipGroup'; +import { Detail, DeletedDetail } from '../DetailList'; +import { VariablesDetail } from '../CodeMirrorInput'; +import CredentialChip from '../CredentialChip'; +import ChipGroup from '../ChipGroup'; function PromptInventorySourceDetail({ i18n, resource }) { const { diff --git a/awx/ui_next/src/components/PromptDetail/PromptJobTemplateDetail.jsx b/awx/ui_next/src/components/PromptDetail/PromptJobTemplateDetail.jsx index ce5ed6cc52..d0d44272b8 100644 --- a/awx/ui_next/src/components/PromptDetail/PromptJobTemplateDetail.jsx +++ b/awx/ui_next/src/components/PromptDetail/PromptJobTemplateDetail.jsx @@ -4,11 +4,11 @@ import { t } from '@lingui/macro'; import { Link } from 'react-router-dom'; import { Chip, List, ListItem } from '@patternfly/react-core'; -import CredentialChip from '../../components/CredentialChip'; -import ChipGroup from '../../components/ChipGroup'; -import Sparkline from '../../components/Sparkline'; -import { Detail, DeletedDetail } from '../../components/DetailList'; -import { VariablesDetail } from '../../components/CodeMirrorInput'; +import CredentialChip from '../CredentialChip'; +import ChipGroup from '../ChipGroup'; +import Sparkline from '../Sparkline'; +import { Detail, DeletedDetail } from '../DetailList'; +import { VariablesDetail } from '../CodeMirrorInput'; import { toTitleCase } from '../../util/strings'; function PromptJobTemplateDetail({ i18n, resource }) { diff --git a/awx/ui_next/src/components/PromptDetail/PromptWFJobTemplateDetail.jsx b/awx/ui_next/src/components/PromptDetail/PromptWFJobTemplateDetail.jsx index afa3c552e6..888f2f78d3 100644 --- a/awx/ui_next/src/components/PromptDetail/PromptWFJobTemplateDetail.jsx +++ b/awx/ui_next/src/components/PromptDetail/PromptWFJobTemplateDetail.jsx @@ -4,11 +4,11 @@ import { t } from '@lingui/macro'; import { Link } from 'react-router-dom'; import { Chip, List, ListItem } from '@patternfly/react-core'; -import CredentialChip from '../../components/CredentialChip'; -import ChipGroup from '../../components/ChipGroup'; -import { Detail } from '../../components/DetailList'; -import { VariablesDetail } from '../../components/CodeMirrorInput'; -import Sparkline from '../../components/Sparkline'; +import CredentialChip from '../CredentialChip'; +import ChipGroup from '../ChipGroup'; +import { Detail } from '../DetailList'; +import { VariablesDetail } from '../CodeMirrorInput'; +import Sparkline from '../Sparkline'; import { toTitleCase } from '../../util/strings'; function PromptWFJobTemplateDetail({ i18n, resource }) { diff --git a/awx/ui_next/src/components/ResourceAccessList/ResourceAccessListItem.jsx b/awx/ui_next/src/components/ResourceAccessList/ResourceAccessListItem.jsx index 689b2c72ce..ab093fd620 100644 --- a/awx/ui_next/src/components/ResourceAccessList/ResourceAccessListItem.jsx +++ b/awx/ui_next/src/components/ResourceAccessList/ResourceAccessListItem.jsx @@ -15,8 +15,8 @@ import { Link } from 'react-router-dom'; import styled from 'styled-components'; import DataListCell from '../DataListCell'; -import ChipGroup from '../../components/ChipGroup'; -import { DetailList, Detail } from '../../components/DetailList'; +import ChipGroup from '../ChipGroup'; +import { DetailList, Detail } from '../DetailList'; import { AccessRecord } from '../../types'; const DataListItemCells = styled(PFDataListItemCells)` diff --git a/awx/ui_next/src/components/ResourceAccessList/__snapshots__/DeleteRoleConfirmationModal.test.jsx.snap b/awx/ui_next/src/components/ResourceAccessList/__snapshots__/DeleteRoleConfirmationModal.test.jsx.snap index e66d8780df..aa1198970d 100644 --- a/awx/ui_next/src/components/ResourceAccessList/__snapshots__/DeleteRoleConfirmationModal.test.jsx.snap +++ b/awx/ui_next/src/components/ResourceAccessList/__snapshots__/DeleteRoleConfirmationModal.test.jsx.snap @@ -100,11 +100,11 @@ exports[` should render initially 1`] = ` class="pf-c-title" >
should render initially 1`] = ` ariaDescribedById="" className="" header={ - - + Remove Team Access - + } hideTitle={false} isFooterLeftAligned={true} @@ -219,11 +223,11 @@ exports[` should render initially 1`] = ` class="pf-c-title" >
should render initially 1`] = ` ariaDescribedById="" className="" header={ - - + Remove Team Access - + } hideTitle={false} id="pf-modal-0" @@ -432,24 +440,29 @@ exports[` should render initially 1`] = `
- + should render initially 1`] = ` forwardedRef={null} >
- - - - - - - - - + + + @@ -531,7 +513,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
-
+
initially renders succesfully 1`] = `
- + - initially renders succesfully 1`] = ` } > jane - + - initially renders succesfully 1`] = ` label="Name" value="jane brown" /> - - , - - + , + + initially renders succesfully 1`] = ` } /> - - , + + , ] } key=".0" @@ -111,12 +112,13 @@ exports[` initially renders succesfully 1`] = ` + - initially renders succesfully 1`] = ` } > jane - + - initially renders succesfully 1`] = ` label="Name" value="jane brown" /> - - , - - + , + + initially renders succesfully 1`] = ` } /> - - , + + , ] } forwardedComponent={ @@ -169,17 +171,19 @@ exports[` initially renders succesfully 1`] = ` "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "ResourceAccessListItem__DataListItemCells-a3r9sq-0", - "isStatic": true, - "lastClassName": "WzRoT", + "componentId": "sc-bZQynM", + "isStatic": false, + "lastClassName": "dLjtme", "rules": Array [ - "align-items:start;", + " + align-items: start; +", ], }, - "displayName": "ResourceAccessListItem__DataListItemCells", + "displayName": "Styled(DataListItemCells)", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "ResourceAccessListItem__DataListItemCells-a3r9sq-0", + "styledComponentId": "sc-bZQynM", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -190,15 +194,16 @@ exports[` initially renders succesfully 1`] = ` rowid="access-list-item" > + - initially renders succesfully 1`] = ` } > jane - + - initially renders succesfully 1`] = ` label="Name" value="jane brown" /> - - , - - + , + + initially renders succesfully 1`] = ` } /> - - , + + , ] } rowid="access-list-item" >
initially renders succesfully 1`] = ` "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "DataListCell-sc-18ntxrx-0", - "isStatic": true, - "lastClassName": "flJMIO", + "componentId": "sc-bdVaJa", + "isStatic": false, + "lastClassName": "kruorc", "rules": Array [ - "word-break:break-word;", + " + word-break: break-word; +", ], }, "displayName": "DataListCell", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "DataListCell-sc-18ntxrx-0", + "styledComponentId": "sc-bdVaJa", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -280,10 +287,10 @@ exports[` initially renders succesfully 1`] = ` forwardedRef={null} >
initially renders succesfully 1`] = ` className="" data-pf-content={true} > - - - - - - jane - - - - - + jane + + +
- initially renders succesfully 1`] = ` "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "DetailList-sc-12g7m4-0", + "componentId": "sc-bwzfXH", "isStatic": false, - "lastClassName": "iAtits", + "lastClassName": "kVCDmm", "rules": Array [ - "display:grid;grid-gap:20px;align-items:center;", + " + display: grid; + grid-gap: 20px; + align-items: center; + ", [Function], + " +", ], }, - "displayName": "DetailList", + "displayName": "Styled(DetailList)", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "DetailList-sc-12g7m4-0", + "styledComponentId": "sc-bwzfXH", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -410,15 +366,15 @@ exports[` initially renders succesfully 1`] = ` stacked={true} >
initially renders succesfully 1`] = ` label="Name" value="jane brown" > - initially renders succesfully 1`] = ` "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "Detail__DetailName-sc-16ypsyv-0", + "componentId": "sc-htpNat", "isStatic": false, - "lastClassName": "erdIBg", + "lastClassName": "iYJcPm", "rules": Array [ - "font-weight:var(--pf-global--FontWeight--bold);", + " + font-weight: var(--pf-global--FontWeight--bold); + ", [Function], + " +", ], }, - "displayName": "Detail__DetailName", + "displayName": "Styled(Component)", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "Detail__DetailName-sc-16ypsyv-0", + "styledComponentId": "sc-htpNat", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -462,18 +422,18 @@ exports[` initially renders succesfully 1`] = ` fullWidth={false} >
@@ -482,8 +442,8 @@ exports[` initially renders succesfully 1`] = ` - - + initially renders succesfully 1`] = ` "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "Detail__DetailValue-sc-16ypsyv-1", + "componentId": "sc-bxivhb", "isStatic": false, - "lastClassName": "kCDjmZ", + "lastClassName": "gxmPlV", "rules": Array [ - "word-break:break-all;", + " + word-break: break-all; + ", [Function], - " ", + " + ", [Function], + " +", ], }, - "displayName": "Detail__DetailValue", + "displayName": "Styled(Component)", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "Detail__DetailValue-sc-16ypsyv-1", + "styledComponentId": "sc-bxivhb", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -520,18 +485,18 @@ exports[` initially renders succesfully 1`] = ` fullWidth={false} >
@@ -540,13 +505,13 @@ exports[` initially renders succesfully 1`] = ` - +
-
+
@@ -560,17 +525,19 @@ exports[` initially renders succesfully 1`] = ` "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "DataListCell-sc-18ntxrx-0", - "isStatic": true, - "lastClassName": "flJMIO", + "componentId": "sc-bdVaJa", + "isStatic": false, + "lastClassName": "kruorc", "rules": Array [ - "word-break:break-word;", + " + word-break: break-word; +", ], }, "displayName": "DataListCell", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "DataListCell-sc-18ntxrx-0", + "styledComponentId": "sc-bdVaJa", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -580,12 +547,12 @@ exports[` initially renders succesfully 1`] = ` forwardedRef={null} >
- initially renders succesfully 1`] = ` "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "DetailList-sc-12g7m4-0", + "componentId": "sc-bwzfXH", "isStatic": false, - "lastClassName": "iAtits", + "lastClassName": "kVCDmm", "rules": Array [ - "display:grid;grid-gap:20px;align-items:center;", + " + display: grid; + grid-gap: 20px; + align-items: center; + ", [Function], + " +", ], }, - "displayName": "DetailList", + "displayName": "Styled(DetailList)", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "DetailList-sc-12g7m4-0", + "styledComponentId": "sc-bwzfXH", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -616,15 +589,15 @@ exports[` initially renders succesfully 1`] = ` stacked={true} >
initially renders succesfully 1`] = ` } > - initially renders succesfully 1`] = ` "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "Detail__DetailName-sc-16ypsyv-0", + "componentId": "sc-htpNat", "isStatic": false, - "lastClassName": "erdIBg", + "lastClassName": "iYJcPm", "rules": Array [ - "font-weight:var(--pf-global--FontWeight--bold);", + " + font-weight: var(--pf-global--FontWeight--bold); + ", [Function], + " +", ], }, - "displayName": "Detail__DetailName", + "displayName": "Styled(Component)", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "Detail__DetailName-sc-16ypsyv-0", + "styledComponentId": "sc-htpNat", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -680,18 +657,18 @@ exports[` initially renders succesfully 1`] = ` fullWidth={false} >
@@ -700,8 +677,8 @@ exports[` initially renders succesfully 1`] = ` - - + initially renders succesfully 1`] = ` "$$typeof": Symbol(react.forward_ref), "attrs": Array [], "componentStyle": ComponentStyle { - "componentId": "Detail__DetailValue-sc-16ypsyv-1", + "componentId": "sc-bxivhb", "isStatic": false, - "lastClassName": "kCDjmZ", + "lastClassName": "gxmPlV", "rules": Array [ - "word-break:break-all;", + " + word-break: break-all; + ", [Function], - " ", + " + ", [Function], + " +", ], }, - "displayName": "Detail__DetailValue", + "displayName": "Styled(Component)", "foldedComponentIds": Array [], "render": [Function], - "styledComponentId": "Detail__DetailValue-sc-16ypsyv-1", + "styledComponentId": "sc-bxivhb", "target": [Function], "toString": [Function], "warnTooManyClasses": [Function], @@ -738,18 +720,18 @@ exports[` initially renders succesfully 1`] = ` fullWidth={false} >
@@ -944,13 +926,13 @@ exports[` initially renders succesfully 1`] = ` - +
-
+
@@ -958,7 +940,7 @@ exports[` initially renders succesfully 1`] = `
-
+
diff --git a/awx/ui_next/src/components/ResourceAccessList/index.js b/awx/ui_next/src/components/ResourceAccessList/index.js index 1993e74cba..30a5ba1e1b 100644 --- a/awx/ui_next/src/components/ResourceAccessList/index.js +++ b/awx/ui_next/src/components/ResourceAccessList/index.js @@ -1,5 +1,3 @@ export { default as ResourceAccessList } from './ResourceAccessList'; export { default as ResourceAccessListItem } from './ResourceAccessListItem'; -export { - default as DeleteRoleConfirmationModal, -} from './DeleteRoleConfirmationModal'; +export { default as DeleteRoleConfirmationModal } from './DeleteRoleConfirmationModal'; diff --git a/awx/ui_next/src/components/Schedule/Schedule.jsx b/awx/ui_next/src/components/Schedule/Schedule.jsx index 3a3a24def4..6282e50bfb 100644 --- a/awx/ui_next/src/components/Schedule/Schedule.jsx +++ b/awx/ui_next/src/components/Schedule/Schedule.jsx @@ -17,7 +17,8 @@ import RoutedTabs from '../RoutedTabs'; import ContentError from '../ContentError'; import ContentLoading from '../ContentLoading'; import { TabbedCardHeader } from '../Card'; -import { ScheduleDetail, ScheduleEdit } from '.'; +import ScheduleDetail from './ScheduleDetail'; +import ScheduleEdit from './ScheduleEdit'; import { SchedulesAPI } from '../../api'; function Schedule({ i18n, setBreadcrumb, unifiedJobTemplate }) { diff --git a/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.jsx b/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.jsx index 8d398a86b4..3b2bf93db9 100644 --- a/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.jsx +++ b/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.jsx @@ -4,21 +4,21 @@ import { RRule, rrulestr } from 'rrule'; import styled from 'styled-components'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; -import { Schedule } from '../../../types'; import { Chip, Title, Button } from '@patternfly/react-core'; -import AlertModal from '../../../components/AlertModal'; -import { CardBody, CardActionsRow } from '../../../components/Card'; -import ContentError from '../../../components/ContentError'; -import ContentLoading from '../../../components/ContentLoading'; -import CredentialChip from '../../../components/CredentialChip'; -import { DetailList, Detail, UserDateDetail } from '../../../components/DetailList'; -import { ScheduleOccurrences, ScheduleToggle } from '../../../components/Schedule'; +import { Schedule } from '../../../types'; +import AlertModal from '../../AlertModal'; +import { CardBody, CardActionsRow } from '../../Card'; +import ContentError from '../../ContentError'; +import ContentLoading from '../../ContentLoading'; +import CredentialChip from '../../CredentialChip'; +import { DetailList, Detail, UserDateDetail } from '../../DetailList'; +import { ScheduleOccurrences, ScheduleToggle } from '..'; import { formatDateString } from '../../../util/dates'; import useRequest from '../../../util/useRequest'; import { SchedulesAPI } from '../../../api'; -import DeleteButton from '../../../components/DeleteButton'; -import ErrorDetail from '../../../components/ErrorDetail'; -import ChipGroup from '../../../components/ChipGroup'; +import DeleteButton from '../../DeleteButton'; +import ErrorDetail from '../../ErrorDetail'; +import ChipGroup from '../../ChipGroup'; const PromptTitle = styled(Title)` --pf-c-title--m-md--FontWeight: 700; diff --git a/awx/ui_next/src/components/Schedule/ScheduleOccurrences/ScheduleOccurrences.jsx b/awx/ui_next/src/components/Schedule/ScheduleOccurrences/ScheduleOccurrences.jsx index e2ba223943..472c0e0883 100644 --- a/awx/ui_next/src/components/Schedule/ScheduleOccurrences/ScheduleOccurrences.jsx +++ b/awx/ui_next/src/components/Schedule/ScheduleOccurrences/ScheduleOccurrences.jsx @@ -44,7 +44,10 @@ function ScheduleOccurrences({ preview = { local: [], utc: [] }, i18n }) { setMode(newMode)} /> diff --git a/awx/ui_next/src/components/Schedule/Schedules.jsx b/awx/ui_next/src/components/Schedule/Schedules.jsx index 3d818d8740..b9da804e63 100644 --- a/awx/ui_next/src/components/Schedule/Schedules.jsx +++ b/awx/ui_next/src/components/Schedule/Schedules.jsx @@ -1,7 +1,9 @@ import React from 'react'; import { withI18n } from '@lingui/react'; import { Switch, Route, useRouteMatch } from 'react-router-dom'; -import { Schedule, ScheduleAdd, ScheduleList } from '.'; +import Schedule from './Schedule'; +import ScheduleAdd from './ScheduleAdd'; +import ScheduleList from './ScheduleList'; function Schedules({ createSchedule, diff --git a/awx/ui_next/src/components/SelectedList/SelectedList.jsx b/awx/ui_next/src/components/SelectedList/SelectedList.jsx index fd4624ba3c..a36eab044a 100644 --- a/awx/ui_next/src/components/SelectedList/SelectedList.jsx +++ b/awx/ui_next/src/components/SelectedList/SelectedList.jsx @@ -2,8 +2,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Chip, Split as PFSplit, SplitItem } from '@patternfly/react-core'; -import ChipGroup from '../../components/ChipGroup'; import styled from 'styled-components'; +import ChipGroup from '../ChipGroup'; const Split = styled(PFSplit)` margin: 20px 0px; diff --git a/awx/ui_next/src/components/SelectedList/SelectedList.test.jsx b/awx/ui_next/src/components/SelectedList/SelectedList.test.jsx index 2540fe8b76..ea58520acf 100644 --- a/awx/ui_next/src/components/SelectedList/SelectedList.test.jsx +++ b/awx/ui_next/src/components/SelectedList/SelectedList.test.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; -import ChipGroup from '../../components/ChipGroup'; +import ChipGroup from '../ChipGroup'; import SelectedList from './SelectedList'; diff --git a/awx/ui_next/src/components/StatusIcon/StatusIcon.jsx b/awx/ui_next/src/components/StatusIcon/StatusIcon.jsx index e04a169121..c468d2f2dd 100644 --- a/awx/ui_next/src/components/StatusIcon/StatusIcon.jsx +++ b/awx/ui_next/src/components/StatusIcon/StatusIcon.jsx @@ -77,6 +77,20 @@ const SkippedBottom = styled.div` background-color: #2dbaba; `; +RunningJob.displayName = 'RunningJob'; +WaitingJob.displayName = 'WaitingJob'; +FinishedJob.displayName = 'FinishedJob'; +SuccessfulTop.displayName = 'SuccessfulTop'; +SuccessfulBottom.displayName = 'SuccessfulBottom'; +FailedTop.displayName = 'FailedTop'; +FailedBottom.displayName = 'FailedBottom'; +UnreachableTop.displayName = 'UnreachableTop'; +UnreachableBottom.displayName = 'UnreachableBottom'; +ChangedTop.displayName = 'ChangedTop'; +ChangedBottom.displayName = 'ChangedBottom'; +SkippedTop.displayName = 'SkippedTop'; +SkippedBottom.displayName = 'SkippedBottom'; + const StatusIcon = ({ status, ...props }) => { return (
diff --git a/awx/ui_next/src/components/StatusIcon/StatusIcon.test.jsx b/awx/ui_next/src/components/StatusIcon/StatusIcon.test.jsx index d0b3bf8c17..dd552b3ef4 100644 --- a/awx/ui_next/src/components/StatusIcon/StatusIcon.test.jsx +++ b/awx/ui_next/src/components/StatusIcon/StatusIcon.test.jsx @@ -6,53 +6,53 @@ describe('StatusIcon', () => { test('renders the successful status', () => { const wrapper = mount(); expect(wrapper).toHaveLength(1); - expect(wrapper.find('StatusIcon__SuccessfulTop')).toHaveLength(1); - expect(wrapper.find('StatusIcon__SuccessfulBottom')).toHaveLength(1); + expect(wrapper.find('StatusIcon SuccessfulTop')).toHaveLength(1); + expect(wrapper.find('StatusIcon SuccessfulBottom')).toHaveLength(1); }); test('renders running status', () => { const wrapper = mount(); expect(wrapper).toHaveLength(1); - expect(wrapper.find('StatusIcon__RunningJob')).toHaveLength(1); + expect(wrapper.find('StatusIcon RunningJob')).toHaveLength(1); }); test('renders waiting status', () => { const wrapper = mount(); expect(wrapper).toHaveLength(1); - expect(wrapper.find('StatusIcon__WaitingJob')).toHaveLength(1); + expect(wrapper.find('StatusIcon WaitingJob')).toHaveLength(1); }); test('renders failed status', () => { const wrapper = mount(); expect(wrapper).toHaveLength(1); - expect(wrapper.find('StatusIcon__FailedTop')).toHaveLength(1); - expect(wrapper.find('StatusIcon__FailedBottom')).toHaveLength(1); + expect(wrapper.find('StatusIcon FailedTop')).toHaveLength(1); + expect(wrapper.find('StatusIcon FailedBottom')).toHaveLength(1); }); test('renders a successful status when host status is "ok"', () => { const wrapper = mount(); expect(wrapper).toHaveLength(1); - expect(wrapper.find('StatusIcon__SuccessfulTop')).toHaveLength(1); - expect(wrapper.find('StatusIcon__SuccessfulBottom')).toHaveLength(1); + expect(wrapper.find('StatusIcon SuccessfulTop')).toHaveLength(1); + expect(wrapper.find('StatusIcon SuccessfulBottom')).toHaveLength(1); }); test('renders "failed" host status', () => { const wrapper = mount(); expect(wrapper).toHaveLength(1); - expect(wrapper.find('StatusIcon__FailedTop')).toHaveLength(1); - expect(wrapper.find('StatusIcon__FailedBottom')).toHaveLength(1); + expect(wrapper.find('StatusIcon FailedTop')).toHaveLength(1); + expect(wrapper.find('StatusIcon FailedBottom')).toHaveLength(1); }); test('renders "changed" host status', () => { const wrapper = mount(); expect(wrapper).toHaveLength(1); - expect(wrapper.find('StatusIcon__ChangedTop')).toHaveLength(1); - expect(wrapper.find('StatusIcon__ChangedBottom')).toHaveLength(1); + expect(wrapper.find('StatusIcon ChangedTop')).toHaveLength(1); + expect(wrapper.find('StatusIcon ChangedBottom')).toHaveLength(1); }); test('renders "skipped" host status', () => { const wrapper = mount(); expect(wrapper).toHaveLength(1); - expect(wrapper.find('StatusIcon__SkippedTop')).toHaveLength(1); - expect(wrapper.find('StatusIcon__SkippedBottom')).toHaveLength(1); + expect(wrapper.find('StatusIcon SkippedTop')).toHaveLength(1); + expect(wrapper.find('StatusIcon SkippedBottom')).toHaveLength(1); }); test('renders "unreachable" host status', () => { const wrapper = mount(); expect(wrapper).toHaveLength(1); - expect(wrapper.find('StatusIcon__UnreachableTop')).toHaveLength(1); - expect(wrapper.find('StatusIcon__UnreachableBottom')).toHaveLength(1); + expect(wrapper.find('StatusIcon UnreachableTop')).toHaveLength(1); + expect(wrapper.find('StatusIcon UnreachableBottom')).toHaveLength(1); }); }); diff --git a/awx/ui_next/src/components/Workflow/WorkflowStartNode.jsx b/awx/ui_next/src/components/Workflow/WorkflowStartNode.jsx index e4eb70ea26..7735d6c98d 100644 --- a/awx/ui_next/src/components/Workflow/WorkflowStartNode.jsx +++ b/awx/ui_next/src/components/Workflow/WorkflowStartNode.jsx @@ -9,7 +9,8 @@ import { WorkflowStateContext, } from '../../contexts/Workflow'; import { constants as wfConstants } from './WorkflowUtils'; -import { WorkflowActionTooltip, WorkflowActionTooltipItem } from '.'; +import WorkflowActionTooltip from './WorkflowActionTooltip'; +import WorkflowActionTooltipItem from './WorkflowActionTooltipItem'; const StartG = styled.g` pointer-events: ${props => (props.ignorePointerEvents ? 'none' : 'auto')}; diff --git a/awx/ui_next/src/components/Workflow/index.js b/awx/ui_next/src/components/Workflow/index.js index d3c5d519da..c6f431cccb 100644 --- a/awx/ui_next/src/components/Workflow/index.js +++ b/awx/ui_next/src/components/Workflow/index.js @@ -1,7 +1,5 @@ export { default as WorkflowActionTooltip } from './WorkflowActionTooltip'; -export { - default as WorkflowActionTooltipItem, -} from './WorkflowActionTooltipItem'; +export { default as WorkflowActionTooltipItem } from './WorkflowActionTooltipItem'; export { default as WorkflowHelp } from './WorkflowHelp'; export { default as WorkflowLegend } from './WorkflowLegend'; export { default as WorkflowLinkHelp } from './WorkflowLinkHelp'; diff --git a/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx b/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx index 063b5efd04..792ea25355 100644 --- a/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx +++ b/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx @@ -13,7 +13,7 @@ import PaginatedDataList, { } from '../../../components/PaginatedDataList'; import useRequest, { useDeleteItems } from '../../../util/useRequest'; import { getQSConfig, parseQueryString } from '../../../util/qs'; -import { CredentialListItem } from '.'; +import CredentialListItem from './CredentialListItem'; const QS_CONFIG = getQSConfig('credential', { page: 1, diff --git a/awx/ui_next/src/screens/Inventory/InventoryAdd/InventoryAdd.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryAdd/InventoryAdd.test.jsx index 07941c0997..fc371c7afc 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryAdd/InventoryAdd.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryAdd/InventoryAdd.test.jsx @@ -45,7 +45,10 @@ describe('', () => { expect(wrapper.length).toBe(1); }); test('handleSubmit should call the api and redirect to details page', async () => { - const instanceGroups = [{ name: 'Bizz', id: 1 }, { name: 'Buzz', id: 2 }]; + const instanceGroups = [ + { name: 'Bizz', id: 1 }, + { name: 'Buzz', id: 2 }, + ]; await waitForElement(wrapper, 'isLoading', el => el.length === 0); wrapper.find('InventoryForm').prop('onSubmit')({ diff --git a/awx/ui_next/src/screens/Inventory/InventoryDetail/InventoryDetail.jsx b/awx/ui_next/src/screens/Inventory/InventoryDetail/InventoryDetail.jsx index e82d78fdb2..a4f8a63830 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryDetail/InventoryDetail.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryDetail/InventoryDetail.jsx @@ -4,7 +4,11 @@ import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import { Button, Chip } from '@patternfly/react-core'; import { CardBody, CardActionsRow } from '../../../components/Card'; -import { DetailList, Detail, UserDateDetail } from '../../../components/DetailList'; +import { + DetailList, + Detail, + UserDateDetail, +} from '../../../components/DetailList'; import { VariablesDetail } from '../../../components/CodeMirrorInput'; import DeleteButton from '../../../components/DeleteButton'; import ContentError from '../../../components/ContentError'; diff --git a/awx/ui_next/src/screens/Inventory/InventoryDetail/InventoryDetail.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryDetail/InventoryDetail.test.jsx index 1ceeca5ba9..69f11b4303 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryDetail/InventoryDetail.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryDetail/InventoryDetail.test.jsx @@ -90,11 +90,11 @@ describe('', () => { expectDetailToMatch(wrapper, 'Type', 'Inventory'); const org = wrapper.find('Detail[label="Organization"]'); expect(org.prop('value')).toMatchInlineSnapshot(` - The Organization - + `); const vars = wrapper.find('VariablesDetail'); expect(vars).toHaveLength(1); diff --git a/awx/ui_next/src/screens/Inventory/InventoryEdit/InventoryEdit.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryEdit/InventoryEdit.test.jsx index 67d2a6f249..e2e86956bb 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryEdit/InventoryEdit.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryEdit/InventoryEdit.test.jsx @@ -110,7 +110,10 @@ describe('', () => { test('handleSubmit should post to the api', async () => { await waitForElement(wrapper, 'isLoading', el => el.length === 0); - const instanceGroups = [{ name: 'Bizz', id: 2 }, { name: 'Buzz', id: 3 }]; + const instanceGroups = [ + { name: 'Bizz', id: 2 }, + { name: 'Buzz', id: 3 }, + ]; wrapper.find('InventoryForm').prop('onSubmit')({ name: 'Foo', id: 13, diff --git a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx index f71e929eeb..9d272ace69 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx @@ -18,7 +18,8 @@ import { PencilAltIcon } from '@patternfly/react-icons'; import { timeOfDay } from '../../../util/dates'; import { InventoriesAPI } from '../../../api'; import { Inventory } from '../../../types'; -import CopyButton from '../../../components/CopyButton/CopyButton'; +import DataListCell from '../../../components/DataListCell'; +import CopyButton from '../../../components/CopyButton'; const DataListAction = styled(_DataListAction)` align-items: center; diff --git a/awx/ui_next/src/screens/Inventory/InventorySource/InventorySource.jsx b/awx/ui_next/src/screens/Inventory/InventorySource/InventorySource.jsx index f8fb0b9695..1b88478b55 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySource/InventorySource.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySource/InventorySource.jsx @@ -9,11 +9,11 @@ import { useRouteMatch, useLocation, } from 'react-router-dom'; +import { CaretLeftIcon } from '@patternfly/react-icons'; +import { CardActions } from '@patternfly/react-core'; import useRequest from '../../../util/useRequest'; import { InventoriesAPI } from '../../../api'; -import { CaretLeftIcon } from '@patternfly/react-icons'; -import { CardActions } from '@patternfly/react-core'; import { TabbedCardHeader } from '../../../components/Card'; import CardCloseButton from '../../../components/CardCloseButton'; import ContentError from '../../../components/ContentError'; diff --git a/awx/ui_next/src/screens/Inventory/InventorySource/InventorySource.test.jsx b/awx/ui_next/src/screens/Inventory/InventorySource/InventorySource.test.jsx index 84df4fbb0b..7e622ca5d9 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySource/InventorySource.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySource/InventorySource.test.jsx @@ -2,7 +2,10 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { createMemoryHistory } from 'history'; import { InventoriesAPI } from '../../../api'; -import { mountWithContexts, waitForElement } from '../../../../testUtils/enzymeHelpers'; +import { + mountWithContexts, + waitForElement, +} from '../../../../testUtils/enzymeHelpers'; import mockInventorySource from '../shared/data.inventory_source.json'; import InventorySource from './InventorySource'; diff --git a/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.jsx b/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.jsx index 1921d378ad..cd74091c60 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.jsx @@ -15,7 +15,11 @@ import { CardBody, CardActionsRow } from '../../../components/Card'; import { VariablesDetail } from '../../../components/CodeMirrorInput'; import CredentialChip from '../../../components/CredentialChip'; import DeleteButton from '../../../components/DeleteButton'; -import { DetailList, Detail, UserDateDetail } from '../../../components/DetailList'; +import { + DetailList, + Detail, + UserDateDetail, +} from '../../../components/DetailList'; import ErrorDetail from '../../../components/ErrorDetail'; import { InventorySourcesAPI } from '../../../api'; diff --git a/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.test.jsx b/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.test.jsx index 0118d5a16b..1eeab58dca 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.test.jsx @@ -1,7 +1,10 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { createMemoryHistory } from 'history'; -import { mountWithContexts, waitForElement } from '../../../../testUtils/enzymeHelpers'; +import { + mountWithContexts, + waitForElement, +} from '../../../../testUtils/enzymeHelpers'; import InventorySourceDetail from './InventorySourceDetail'; import mockInvSource from '../shared/data.inventory_source.json'; import { InventorySourcesAPI } from '../../../api'; diff --git a/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceList.test.jsx b/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceList.test.jsx index f7c98695bb..b34ed5952c 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceList.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceList.test.jsx @@ -43,7 +43,14 @@ describe('', () => { InventorySourcesAPI.readOptions.mockResolvedValue({ data: { actions: { - GET: { source: { choices: [['scm', 'SCM'], ['ec2', 'EC2']] } }, + GET: { + source: { + choices: [ + ['scm', 'SCM'], + ['ec2', 'EC2'], + ], + }, + }, POST: {}, }, }, @@ -247,7 +254,14 @@ describe(' RBAC testing', () => { InventorySourcesAPI.readOptions.mockResolvedValue({ data: { actions: { - GET: { source: { choices: [['scm', 'SCM'], ['ec2', 'EC2']] } }, + GET: { + source: { + choices: [ + ['scm', 'SCM'], + ['ec2', 'EC2'], + ], + }, + }, }, }, }); diff --git a/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceSyncButton.jsx b/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceSyncButton.jsx index 54f6f633e6..02d66345ac 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceSyncButton.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceSyncButton.jsx @@ -100,6 +100,10 @@ function InventorySourceSyncButton({ onSyncLoading, source, i18n }) { ); } +InventorySourceSyncButton.defaultProps = { + source: {}, +}; + InventorySourceSyncButton.propTypes = { onSyncLoading: PropTypes.func.isRequired, source: PropTypes.shape({}), diff --git a/awx/ui_next/src/screens/Inventory/shared/InventoryForm.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventoryForm.test.jsx index 580ebb79a6..77161446c7 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventoryForm.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventoryForm.test.jsx @@ -1,6 +1,9 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { mountWithContexts, waitForElement } from '../../../../testUtils/enzymeHelpers'; +import { + mountWithContexts, + waitForElement, +} from '../../../../testUtils/enzymeHelpers'; import InventoryForm from './InventoryForm'; @@ -47,7 +50,10 @@ const inventory = { pending_deletion: false, }; -const instanceGroups = [{ name: 'Foo', id: 1 }, { name: 'Bar', id: 2 }]; +const instanceGroups = [ + { name: 'Foo', id: 1 }, + { name: 'Bar', id: 2 }, +]; describe('', () => { let wrapper; let onCancel; diff --git a/awx/ui_next/src/screens/Job/JobDetail/JobDetail.test.jsx b/awx/ui_next/src/screens/Job/JobDetail/JobDetail.test.jsx index a27434900f..e5bc71c53d 100644 --- a/awx/ui_next/src/screens/Job/JobDetail/JobDetail.test.jsx +++ b/awx/ui_next/src/screens/Job/JobDetail/JobDetail.test.jsx @@ -59,14 +59,14 @@ describe('', () => { test('should display successful job status icon', () => { const statusDetail = wrapper.find('Detail[label="Status"]'); - expect(statusDetail.find('StatusIcon__SuccessfulTop')).toHaveLength(1); - expect(statusDetail.find('StatusIcon__SuccessfulBottom')).toHaveLength(1); + expect(statusDetail.find('StatusIcon SuccessfulTop')).toHaveLength(1); + expect(statusDetail.find('StatusIcon SuccessfulBottom')).toHaveLength(1); }); test('should display successful project status icon', () => { const statusDetail = wrapper.find('Detail[label="Project"]'); - expect(statusDetail.find('StatusIcon__SuccessfulTop')).toHaveLength(1); - expect(statusDetail.find('StatusIcon__SuccessfulBottom')).toHaveLength(1); + expect(statusDetail.find('StatusIcon SuccessfulTop')).toHaveLength(1); + expect(statusDetail.find('StatusIcon SuccessfulBottom')).toHaveLength(1); }); test('should properly delete job', async () => { diff --git a/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.jsx b/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.jsx index baa9fe3e86..7a9f1c9399 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.jsx @@ -4,13 +4,13 @@ import PropTypes from 'prop-types'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import styled from 'styled-components'; -import Entities from 'html-entities'; +import { AllHtmlEntities } from 'html-entities'; import StatusIcon from '../../../components/StatusIcon'; import { DetailList, Detail } from '../../../components/DetailList'; import ContentEmpty from '../../../components/ContentEmpty'; import CodeMirrorInput from '../../../components/CodeMirrorInput'; -const entities = new Entities.AllHtmlEntities(); +const entities = new AllHtmlEntities(); const Modal = styled(PFModal)` --pf-c-modal-box__footer--MarginTop: 0; diff --git a/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.test.jsx b/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.test.jsx index 8706189a04..0a18cc3d93 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.test.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.test.jsx @@ -130,8 +130,8 @@ describe('HostEventModal', () => { ); const icon = wrapper.find('StatusIcon'); expect(icon.prop('status')).toBe('ok'); - expect(icon.find('StatusIcon__SuccessfulTop').length).toBe(1); - expect(icon.find('StatusIcon__SuccessfulBottom').length).toBe(1); + expect(icon.find('StatusIcon SuccessfulTop').length).toBe(1); + expect(icon.find('StatusIcon SuccessfulBottom').length).toBe(1); }); test('should display skipped host status icon', () => { @@ -142,8 +142,8 @@ describe('HostEventModal', () => { const icon = wrapper.find('StatusIcon'); expect(icon.prop('status')).toBe('skipped'); - expect(icon.find('StatusIcon__SkippedTop').length).toBe(1); - expect(icon.find('StatusIcon__SkippedBottom').length).toBe(1); + expect(icon.find('StatusIcon SkippedTop').length).toBe(1); + expect(icon.find('StatusIcon SkippedBottom').length).toBe(1); }); test('should display unreachable host status icon', () => { @@ -162,8 +162,8 @@ describe('HostEventModal', () => { const icon = wrapper.find('StatusIcon'); expect(icon.prop('status')).toBe('unreachable'); - expect(icon.find('StatusIcon__UnreachableTop').length).toBe(1); - expect(icon.find('StatusIcon__UnreachableBottom').length).toBe(1); + expect(icon.find('StatusIcon UnreachableTop').length).toBe(1); + expect(icon.find('StatusIcon UnreachableBottom').length).toBe(1); }); test('should display failed host status icon', () => { @@ -183,8 +183,8 @@ describe('HostEventModal', () => { const icon = wrapper.find('StatusIcon'); expect(icon.prop('status')).toBe('failed'); - expect(icon.find('StatusIcon__FailedTop').length).toBe(1); - expect(icon.find('StatusIcon__FailedBottom').length).toBe(1); + expect(icon.find('StatusIcon FailedTop').length).toBe(1); + expect(icon.find('StatusIcon FailedBottom').length).toBe(1); }); test('should display JSON tab content on tab click', () => { diff --git a/awx/ui_next/src/screens/Job/JobOutput/JobEvent.jsx b/awx/ui_next/src/screens/Job/JobOutput/JobEvent.jsx index f94e0ed12d..59908f695c 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/JobEvent.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/JobEvent.jsx @@ -1,6 +1,6 @@ import Ansi from 'ansi-to-html'; import hasAnsi from 'has-ansi'; -import Entities from 'html-entities'; +import { AllHtmlEntities } from 'html-entities'; import React from 'react'; import { JobEventLine, @@ -35,7 +35,7 @@ const ansi = new Ansi({ 15: '#FFF', }, }); -const entities = new Entities.AllHtmlEntities(); +const entities = new AllHtmlEntities(); function getTimestamp({ created }) { const date = new Date(created); diff --git a/awx/ui_next/src/screens/Job/JobOutput/JobOutput.test.jsx b/awx/ui_next/src/screens/Job/JobOutput/JobOutput.test.jsx index 8771ce63ac..5afa5d2573 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/JobOutput.test.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/JobOutput.test.jsx @@ -12,7 +12,7 @@ jest.mock('../../../api'); async function checkOutput(wrapper, expectedLines) { await waitForElement(wrapper, 'div[type="job_event"]', el => el.length > 1); - const jobEventLines = wrapper.find('div[type="job_event_line_text"]'); + const jobEventLines = wrapper.find('JobEventLineText div'); const actualLines = []; jobEventLines.forEach(line => { actualLines.push(line.text()); @@ -67,58 +67,184 @@ describe('', () => { wrapper = mountWithContexts(); await waitForElement(wrapper, 'JobEvent', el => el.length > 0); await checkOutput(wrapper, [ + 'ok: [localhost] => (item=37) => {', + ' "msg": "This is a debug message: 37"', + '}', + 'ok: [localhost] => (item=38) => {', + ' "msg": "This is a debug message: 38"', + '}', + 'ok: [localhost] => (item=39) => {', + ' "msg": "This is a debug message: 39"', + '}', + 'ok: [localhost] => (item=40) => {', + ' "msg": "This is a debug message: 40"', + '}', + 'ok: [localhost] => (item=41) => {', + ' "msg": "This is a debug message: 41"', + '}', + 'ok: [localhost] => (item=42) => {', + ' "msg": "This is a debug message: 42"', + '}', + 'ok: [localhost] => (item=43) => {', + ' "msg": "This is a debug message: 43"', + '}', + 'ok: [localhost] => (item=44) => {', + ' "msg": "This is a debug message: 44"', + '}', + 'ok: [localhost] => (item=45) => {', + ' "msg": "This is a debug message: 45"', + '}', + 'ok: [localhost] => (item=46) => {', + ' "msg": "This is a debug message: 46"', + '}', + 'ok: [localhost] => (item=47) => {', + ' "msg": "This is a debug message: 47"', + '}', + 'ok: [localhost] => (item=48) => {', + ' "msg": "This is a debug message: 48"', + '}', + 'ok: [localhost] => (item=49) => {', + ' "msg": "This is a debug message: 49"', + '}', + 'ok: [localhost] => (item=50) => {', + ' "msg": "This is a debug message: 50"', + '}', + 'ok: [localhost] => (item=51) => {', + ' "msg": "This is a debug message: 51"', + '}', + 'ok: [localhost] => (item=52) => {', + ' "msg": "This is a debug message: 52"', + '}', + 'ok: [localhost] => (item=53) => {', + ' "msg": "This is a debug message: 53"', + '}', + 'ok: [localhost] => (item=54) => {', + ' "msg": "This is a debug message: 54"', + '}', + 'ok: [localhost] => (item=55) => {', + ' "msg": "This is a debug message: 55"', + '}', + 'ok: [localhost] => (item=56) => {', + ' "msg": "This is a debug message: 56"', + '}', + 'ok: [localhost] => (item=57) => {', + ' "msg": "This is a debug message: 57"', + '}', + 'ok: [localhost] => (item=58) => {', + ' "msg": "This is a debug message: 58"', + '}', + 'ok: [localhost] => (item=59) => {', + ' "msg": "This is a debug message: 59"', + '}', + 'ok: [localhost] => (item=60) => {', + ' "msg": "This is a debug message: 60"', + '}', + 'ok: [localhost] => (item=61) => {', + ' "msg": "This is a debug message: 61"', + '}', + 'ok: [localhost] => (item=62) => {', + ' "msg": "This is a debug message: 62"', + '}', + 'ok: [localhost] => (item=63) => {', + ' "msg": "This is a debug message: 63"', + '}', + 'ok: [localhost] => (item=64) => {', + ' "msg": "This is a debug message: 64"', + '}', + 'ok: [localhost] => (item=65) => {', + ' "msg": "This is a debug message: 65"', + '}', + 'ok: [localhost] => (item=66) => {', + ' "msg": "This is a debug message: 66"', + '}', + 'ok: [localhost] => (item=67) => {', + ' "msg": "This is a debug message: 67"', + '}', + 'ok: [localhost] => (item=68) => {', + ' "msg": "This is a debug message: 68"', + '}', + 'ok: [localhost] => (item=69) => {', + ' "msg": "This is a debug message: 69"', + '}', + 'ok: [localhost] => (item=70) => {', + ' "msg": "This is a debug message: 70"', + '}', + 'ok: [localhost] => (item=71) => {', + ' "msg": "This is a debug message: 71"', + '}', + 'ok: [localhost] => (item=72) => {', + ' "msg": "This is a debug message: 72"', + '}', + 'ok: [localhost] => (item=73) => {', + ' "msg": "This is a debug message: 73"', + '}', + 'ok: [localhost] => (item=74) => {', + ' "msg": "This is a debug message: 74"', + '}', + 'ok: [localhost] => (item=75) => {', + ' "msg": "This is a debug message: 75"', + '}', + 'ok: [localhost] => (item=76) => {', + ' "msg": "This is a debug message: 76"', + '}', + 'ok: [localhost] => (item=77) => {', + ' "msg": "This is a debug message: 77"', + '}', + 'ok: [localhost] => (item=78) => {', + ' "msg": "This is a debug message: 78"', + '}', + 'ok: [localhost] => (item=79) => {', + ' "msg": "This is a debug message: 79"', + '}', + 'ok: [localhost] => (item=80) => {', + ' "msg": "This is a debug message: 80"', + '}', + 'ok: [localhost] => (item=81) => {', + ' "msg": "This is a debug message: 81"', + '}', + 'ok: [localhost] => (item=82) => {', + ' "msg": "This is a debug message: 82"', + '}', + 'ok: [localhost] => (item=83) => {', + ' "msg": "This is a debug message: 83"', + '}', + 'ok: [localhost] => (item=84) => {', + ' "msg": "This is a debug message: 84"', + '}', + 'ok: [localhost] => (item=85) => {', + ' "msg": "This is a debug message: 85"', + '}', + 'ok: [localhost] => (item=86) => {', + ' "msg": "This is a debug message: 86"', + '}', + 'ok: [localhost] => (item=87) => {', + ' "msg": "This is a debug message: 87"', + '}', + 'ok: [localhost] => (item=88) => {', + ' "msg": "This is a debug message: 88"', + '}', + 'ok: [localhost] => (item=89) => {', + ' "msg": "This is a debug message: 89"', + '}', + 'ok: [localhost] => (item=90) => {', + ' "msg": "This is a debug message: 90"', + '}', + 'ok: [localhost] => (item=91) => {', + ' "msg": "This is a debug message: 91"', + '}', + 'ok: [localhost] => (item=92) => {', + ' "msg": "This is a debug message: 92"', + '}', + 'ok: [localhost] => (item=93) => {', + ' "msg": "This is a debug message: 93"', + '}', + 'ok: [localhost] => (item=94) => {', + ' "msg": "This is a debug message: 94"', + '}', '', - 'PLAY [all] *********************************************************************15:37:25', + 'PLAY RECAP *********************************************************************15:37:26', + 'localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ', '', - 'TASK [debug] *******************************************************************15:37:25', - 'ok: [localhost] => (item=1) => {', - ' "msg": "This is a debug message: 1"', - '}', - 'ok: [localhost] => (item=2) => {', - ' "msg": "This is a debug message: 2"', - '}', - 'ok: [localhost] => (item=3) => {', - ' "msg": "This is a debug message: 3"', - '}', - 'ok: [localhost] => (item=4) => {', - ' "msg": "This is a debug message: 4"', - '}', - 'ok: [localhost] => (item=5) => {', - ' "msg": "This is a debug message: 5"', - '}', - 'ok: [localhost] => (item=6) => {', - ' "msg": "This is a debug message: 6"', - '}', - 'ok: [localhost] => (item=7) => {', - ' "msg": "This is a debug message: 7"', - '}', - 'ok: [localhost] => (item=8) => {', - ' "msg": "This is a debug message: 8"', - '}', - 'ok: [localhost] => (item=9) => {', - ' "msg": "This is a debug message: 9"', - '}', - 'ok: [localhost] => (item=10) => {', - ' "msg": "This is a debug message: 10"', - '}', - 'ok: [localhost] => (item=11) => {', - ' "msg": "This is a debug message: 11"', - '}', - 'ok: [localhost] => (item=12) => {', - ' "msg": "This is a debug message: 12"', - '}', - 'ok: [localhost] => (item=13) => {', - ' "msg": "This is a debug message: 13"', - '}', - 'ok: [localhost] => (item=14) => {', - ' "msg": "This is a debug message: 14"', - '}', - 'ok: [localhost] => (item=15) => {', - ' "msg": "This is a debug message: 15"', - '}', - 'ok: [localhost] => (item=16) => {', - ' "msg": "This is a debug message: 16"', - '}', ]); expect(wrapper.find('JobOutput').length).toBe(1); diff --git a/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.jsx b/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.jsx index d6e47092e9..605419bab1 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.jsx @@ -16,6 +16,7 @@ const BarSegment = styled.div` background-color: ${props => props.color || 'inherit'}; flex-grow: ${props => props.count || 0}; `; +BarSegment.displayName = 'BarSegment'; const TooltipContent = styled.div` align-items: center; diff --git a/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.test.jsx b/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.test.jsx index e97cb598f0..5174501386 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.test.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.test.jsx @@ -22,7 +22,7 @@ describe('', () => { }); test('should render five bar segments', () => { - expect(wrapper.find('HostStatusBar__BarSegment').length).toBe(5); + expect(wrapper.find('BarSegment').length).toBe(5); }); test('tooltips should display host status and count', () => { @@ -44,7 +44,7 @@ describe('', () => { test('empty host counts should display tooltip and one bar segment', () => { wrapper = mountWithContexts(); - expect(wrapper.find('HostStatusBar__BarSegment').length).toBe(1); + expect(wrapper.find('BarSegment').length).toBe(1); expect(wrapper.find('TooltipContent').text()).toEqual( 'Host status information for this job is unavailable.' ); diff --git a/awx/ui_next/src/screens/Job/JobOutput/shared/JobEventLineNumber.jsx b/awx/ui_next/src/screens/Job/JobOutput/shared/JobEventLineNumber.jsx index 52b3c4b670..e724ddb59b 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/shared/JobEventLineNumber.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/shared/JobEventLineNumber.jsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -export default styled.div` +const JobEventLineNumber = styled.div` color: #161b1f; background-color: #ebebeb; flex: 0 0 45px; @@ -10,3 +10,7 @@ export default styled.div` border-right: 1px solid #d7d7d7; user-select: none; `; + +JobEventLineNumber.displayName = 'JobEventLineNumber'; + +export default JobEventLineNumber; diff --git a/awx/ui_next/src/screens/Job/JobOutput/shared/JobEventLineText.jsx b/awx/ui_next/src/screens/Job/JobOutput/shared/JobEventLineText.jsx index 71f80a3134..50c7996dee 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/shared/JobEventLineText.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/shared/JobEventLineText.jsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -export default styled.div` +const JobEventLineText = styled.div` padding: 0 15px; white-space: pre-wrap; word-break: break-all; @@ -27,3 +27,7 @@ export default styled.div` border-radius: 5px; } `; + +JobEventLineText.displayName = 'JobEventLineText'; + +export default JobEventLineText; diff --git a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputGraph.jsx b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputGraph.jsx index 8f752131f1..d2e52b8153 100644 --- a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputGraph.jsx +++ b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputGraph.jsx @@ -5,7 +5,8 @@ import { getScaleAndOffsetToFit, getTranslatePointsForZoom, } from '../../../components/Workflow/WorkflowUtils'; -import { WorkflowOutputLink, WorkflowOutputNode } from '.'; +import WorkflowOutputLink from './WorkflowOutputLink'; +import WorkflowOutputNode from './WorkflowOutputNode'; import { WorkflowHelp, WorkflowLegend, diff --git a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.jsx b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.jsx index b8551e872e..4a566834ac 100644 --- a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.jsx +++ b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.jsx @@ -59,6 +59,8 @@ const NodeDefaultLabel = styled.p` white-space: nowrap; `; +Elapsed.displayName = 'Elapsed'; + function WorkflowOutputNode({ i18n, mouseEnter, mouseLeave, node }) { const history = useHistory(); const { nodePositions } = useContext(WorkflowStateContext); diff --git a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.test.jsx b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.test.jsx index 3c982f8e86..feb9de5b38 100644 --- a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.test.jsx +++ b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.test.jsx @@ -73,7 +73,7 @@ describe('WorkflowOutputNode', () => { ); expect(wrapper.contains(

Automation JT

)).toEqual(true); - expect(wrapper.find('WorkflowOutputNode__Elapsed').text()).toBe('00:00:07'); + expect(wrapper.find('WorkflowOutputNode Elapsed').text()).toBe('00:00:07'); }); test('node contents displayed correctly when Job Template deleted', () => { const wrapper = mountWithContexts( @@ -88,7 +88,7 @@ describe('WorkflowOutputNode', () => { ); expect(wrapper.contains(

Automation JT 2

)).toEqual(true); - expect(wrapper.find('WorkflowOutputNode__Elapsed').text()).toBe('00:00:07'); + expect(wrapper.find('WorkflowOutputNode Elapsed').text()).toBe('00:00:07'); }); test('node contents displayed correctly when Job deleted', () => { const wrapper = mountWithContexts( diff --git a/awx/ui_next/src/screens/Login/Login.jsx b/awx/ui_next/src/screens/Login/Login.jsx index 51617be26c..ff0254b848 100644 --- a/awx/ui_next/src/screens/Login/Login.jsx +++ b/awx/ui_next/src/screens/Login/Login.jsx @@ -7,7 +7,7 @@ import { LoginForm, LoginPage as PFLoginPage } from '@patternfly/react-core'; import { RootAPI } from '../../api'; import { BrandName } from '../../variables'; -import brandLogo from '../../../images/brand-logo.svg'; +import brandLogo from './brand-logo.svg'; const LoginPage = styled(PFLoginPage)` & .pf-c-brand { diff --git a/awx/ui_next/src/screens/Login/brand-logo.svg b/awx/ui_next/src/screens/Login/brand-logo.svg new file mode 100644 index 0000000000..6d80915fb6 --- /dev/null +++ b/awx/ui_next/src/screens/Login/brand-logo.svg @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/awx/ui_next/src/screens/Organization/OrganizationAdd/OrganizationAdd.test.jsx b/awx/ui_next/src/screens/Organization/OrganizationAdd/OrganizationAdd.test.jsx index 978fbeed86..1d579fb85d 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationAdd/OrganizationAdd.test.jsx +++ b/awx/ui_next/src/screens/Organization/OrganizationAdd/OrganizationAdd.test.jsx @@ -92,7 +92,10 @@ describe('', () => { }); test('AnsibleSelect component renders if there are virtual environments', async () => { - const mockInstanceGroups = [{ name: 'One', id: 1 }, { name: 'Two', id: 2 }]; + const mockInstanceGroups = [ + { name: 'One', id: 1 }, + { name: 'Two', id: 2 }, + ]; OrganizationsAPI.readInstanceGroups.mockReturnValue({ data: { results: mockInstanceGroups, @@ -119,7 +122,10 @@ describe('', () => { }); test('AnsibleSelect component does not render if there are 0 virtual environments', async () => { - const mockInstanceGroups = [{ name: 'One', id: 1 }, { name: 'Two', id: 2 }]; + const mockInstanceGroups = [ + { name: 'One', id: 1 }, + { name: 'Two', id: 2 }, + ]; OrganizationsAPI.readInstanceGroups.mockReturnValue({ data: { results: mockInstanceGroups, diff --git a/awx/ui_next/src/screens/Organization/OrganizationDetail/OrganizationDetail.jsx b/awx/ui_next/src/screens/Organization/OrganizationDetail/OrganizationDetail.jsx index 58444a3d19..ff6bd42012 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationDetail/OrganizationDetail.jsx +++ b/awx/ui_next/src/screens/Organization/OrganizationDetail/OrganizationDetail.jsx @@ -4,7 +4,11 @@ import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import { Button, Chip } from '@patternfly/react-core'; import { OrganizationsAPI } from '../../../api'; -import { DetailList, Detail, UserDateDetail } from '../../../components/DetailList'; +import { + DetailList, + Detail, + UserDateDetail, +} from '../../../components/DetailList'; import { CardBody, CardActionsRow } from '../../../components/Card'; import AlertModal from '../../../components/AlertModal'; import ChipGroup from '../../../components/ChipGroup'; diff --git a/awx/ui_next/src/screens/Organization/OrganizationDetail/OrganizationDetail.test.jsx b/awx/ui_next/src/screens/Organization/OrganizationDetail/OrganizationDetail.test.jsx index f1c3b3875f..0c946f1265 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationDetail/OrganizationDetail.test.jsx +++ b/awx/ui_next/src/screens/Organization/OrganizationDetail/OrganizationDetail.test.jsx @@ -28,7 +28,10 @@ describe('', () => { }; const mockInstanceGroups = { data: { - results: [{ name: 'One', id: 1 }, { name: 'Two', id: 2 }], + results: [ + { name: 'One', id: 1 }, + { name: 'Two', id: 2 }, + ], }, }; diff --git a/awx/ui_next/src/screens/Organization/OrganizationEdit/OrganizationEdit.test.jsx b/awx/ui_next/src/screens/Organization/OrganizationEdit/OrganizationEdit.test.jsx index 7e8b16fe49..ea62e38c9e 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationEdit/OrganizationEdit.test.jsx +++ b/awx/ui_next/src/screens/Organization/OrganizationEdit/OrganizationEdit.test.jsx @@ -64,7 +64,10 @@ describe('', () => { }); test('should navigate to organization detail when cancel is clicked', async () => { - const mockInstanceGroups = [{ name: 'One', id: 1 }, { name: 'Two', id: 2 }]; + const mockInstanceGroups = [ + { name: 'One', id: 1 }, + { name: 'Two', id: 2 }, + ]; OrganizationsAPI.readInstanceGroups.mockReturnValue({ data: { results: mockInstanceGroups, diff --git a/awx/ui_next/src/screens/Organization/shared/OrganizationForm.test.jsx b/awx/ui_next/src/screens/Organization/shared/OrganizationForm.test.jsx index abd55fcc44..0048a13b13 100644 --- a/awx/ui_next/src/screens/Organization/shared/OrganizationForm.test.jsx +++ b/awx/ui_next/src/screens/Organization/shared/OrganizationForm.test.jsx @@ -27,7 +27,10 @@ describe('', () => { instance_groups: '/api/v2/organizations/1/instance_groups', }, }; - const mockInstanceGroups = [{ name: 'One', id: 1 }, { name: 'Two', id: 2 }]; + const mockInstanceGroups = [ + { name: 'One', id: 1 }, + { name: 'Two', id: 2 }, + ]; afterEach(() => { jest.clearAllMocks(); @@ -232,7 +235,10 @@ describe('', () => { await waitForElement(wrapper, 'ContentLoading', el => el.length === 0); await act(async () => { wrapper.find('InstanceGroupsLookup').prop('onChange')( - [{ name: 'One', id: 1 }, { name: 'Three', id: 3 }], + [ + { name: 'One', id: 1 }, + { name: 'Three', id: 3 }, + ], 'instanceGroups' ); }); diff --git a/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.jsx b/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.jsx index c506b0f548..a9ef04ed9c 100644 --- a/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.jsx +++ b/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.jsx @@ -19,6 +19,7 @@ import { timeOfDay } from '../../../util/dates'; import { ProjectsAPI } from '../../../api'; import ClipboardCopyButton from '../../../components/ClipboardCopyButton'; import StatusIcon from '../../../components/StatusIcon'; +import DataListCell from '../../../components/DataListCell'; import { toTitleCase } from '../../../util/strings'; import CopyButton from '../../../components/CopyButton'; import ProjectSyncButton from '../shared/ProjectSyncButton'; diff --git a/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.test.jsx b/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.test.jsx index 74c61fbed5..9dfa8e8f1b 100644 --- a/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.test.jsx +++ b/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.test.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import { mountWithContexts } from '../../../../testUtils/enzymeHelpers'; import { act } from 'react-dom/test-utils'; +import { mountWithContexts } from '../../../../testUtils/enzymeHelpers'; import ProjectsListItem from './ProjectListItem'; import { ProjectsAPI } from '../../../api'; diff --git a/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessList.jsx b/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessList.jsx index c7cadc1fe6..79531fb561 100644 --- a/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessList.jsx +++ b/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessList.jsx @@ -4,8 +4,8 @@ import { useLocation, useRouteMatch, useParams } from 'react-router-dom'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; -import { TeamsAPI } from '../../../api'; import { Card } from '@patternfly/react-core'; +import { TeamsAPI } from '../../../api'; import useRequest from '../../../util/useRequest'; import DataListToolbar from '../../../components/DataListToolbar'; diff --git a/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessList.test.jsx b/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessList.test.jsx index fba2bb0d23..b7b5e26025 100644 --- a/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessList.test.jsx +++ b/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessList.test.jsx @@ -1,9 +1,12 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { createMemoryHistory } from 'history'; -import { TeamsAPI } from '../../../api'; import { Route } from 'react-router-dom'; -import { mountWithContexts, waitForElement } from '../../../../testUtils/enzymeHelpers'; +import { TeamsAPI } from '../../../api'; +import { + mountWithContexts, + waitForElement, +} from '../../../../testUtils/enzymeHelpers'; import TeamAccessList from './TeamAccessList'; jest.mock('../../../api/models/Teams'); diff --git a/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessListItem.jsx b/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessListItem.jsx index 838163b144..117ce861ab 100644 --- a/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessListItem.jsx +++ b/awx/ui_next/src/screens/Team/TeamAccess/TeamAccessListItem.jsx @@ -6,9 +6,8 @@ import { DataListItemCells, DataListItemRow, } from '@patternfly/react-core'; -import DataListCell from '../../../components/DataListCell'; - import { Link } from 'react-router-dom'; +import DataListCell from '../../../components/DataListCell'; function TeamAccessListItem({ role, i18n, detailUrl }) { const labelId = `teamRole-${role.id}`; diff --git a/awx/ui_next/src/screens/Template/JobTemplateDetail/JobTemplateDetail.test.jsx b/awx/ui_next/src/screens/Template/JobTemplateDetail/JobTemplateDetail.test.jsx index a1fecf6f60..3f147ebaa0 100644 --- a/awx/ui_next/src/screens/Template/JobTemplateDetail/JobTemplateDetail.test.jsx +++ b/awx/ui_next/src/screens/Template/JobTemplateDetail/JobTemplateDetail.test.jsx @@ -13,7 +13,10 @@ jest.mock('../../../api'); const mockInstanceGroups = { count: 5, data: { - results: [{ id: 1, name: 'IG1' }, { id: 2, name: 'IG2' }], + results: [ + { id: 1, name: 'IG1' }, + { id: 2, name: 'IG2' }, + ], }, }; diff --git a/awx/ui_next/src/screens/Template/JobTemplateEdit/JobTemplateEdit.test.jsx b/awx/ui_next/src/screens/Template/JobTemplateEdit/JobTemplateEdit.test.jsx index b2dfd57eee..b6dbc78281 100644 --- a/awx/ui_next/src/screens/Template/JobTemplateEdit/JobTemplateEdit.test.jsx +++ b/awx/ui_next/src/screens/Template/JobTemplateEdit/JobTemplateEdit.test.jsx @@ -46,7 +46,10 @@ const mockJobTemplate = { edit: true, }, labels: { - results: [{ name: 'Sushi', id: 1 }, { name: 'Major', id: 2 }], + results: [ + { name: 'Sushi', id: 1 }, + { name: 'Major', id: 2 }, + ], }, inventory: { id: 2, @@ -309,7 +312,10 @@ describe('', () => { edit: true, }, labels: { - results: [{ name: 'Sushi', id: 1 }, { name: 'Major', id: 2 }], + results: [ + { name: 'Sushi', id: 1 }, + { name: 'Major', id: 2 }, + ], }, inventory: { id: 2, diff --git a/awx/ui_next/src/screens/Template/Survey/SurveyListItem.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyListItem.jsx index 6d3a3a8957..b978d5927d 100644 --- a/awx/ui_next/src/screens/Template/Survey/SurveyListItem.jsx +++ b/awx/ui_next/src/screens/Template/Survey/SurveyListItem.jsx @@ -13,11 +13,10 @@ import { Stack, StackItem, } from '@patternfly/react-core'; -import DataListCell from '../../../components/DataListCell'; -import ChipGroup from '../../../components/ChipGroup'; import { CaretDownIcon, CaretUpIcon } from '@patternfly/react-icons'; import styled from 'styled-components'; import DataListCell from '../../../components/DataListCell'; +import ChipGroup from '../../../components/ChipGroup'; const DataListAction = styled(_DataListAction)` margin-left: 0; diff --git a/awx/ui_next/src/screens/Template/WorkflowJobTemplateDetail/WorkflowJobTemplateDetail.jsx b/awx/ui_next/src/screens/Template/WorkflowJobTemplateDetail/WorkflowJobTemplateDetail.jsx index c75e020174..ddbadb8b16 100644 --- a/awx/ui_next/src/screens/Template/WorkflowJobTemplateDetail/WorkflowJobTemplateDetail.jsx +++ b/awx/ui_next/src/screens/Template/WorkflowJobTemplateDetail/WorkflowJobTemplateDetail.jsx @@ -19,7 +19,11 @@ import ChipGroup from '../../../components/ChipGroup'; import { VariablesDetail } from '../../../components/CodeMirrorInput'; import ContentLoading from '../../../components/ContentLoading'; import DeleteButton from '../../../components/DeleteButton'; -import { DetailList, Detail, UserDateDetail } from '../../../components/DetailList'; +import { + DetailList, + Detail, + UserDateDetail, +} from '../../../components/DetailList'; import ErrorDetail from '../../../components/ErrorDetail'; import LaunchButton from '../../../components/LaunchButton'; import Sparkline from '../../../components/Sparkline'; diff --git a/awx/ui_next/src/screens/Template/WorkflowJobTemplateDetail/WorkflowJobTemplateDetail.test.jsx b/awx/ui_next/src/screens/Template/WorkflowJobTemplateDetail/WorkflowJobTemplateDetail.test.jsx index b3ee7736c9..9930643538 100644 --- a/awx/ui_next/src/screens/Template/WorkflowJobTemplateDetail/WorkflowJobTemplateDetail.test.jsx +++ b/awx/ui_next/src/screens/Template/WorkflowJobTemplateDetail/WorkflowJobTemplateDetail.test.jsx @@ -100,7 +100,7 @@ describe('', () => { { element: 'Detail[label="Webhook URL"]', prop: 'value', - value: 'http://127.0.0.1:3001/api/v2/workflow_job_templates/45/github/', + value: 'http://localhost/api/v2/workflow_job_templates/45/github/', }, { element: "Detail[label='Webhook Service']", @@ -136,7 +136,7 @@ describe('', () => { const labels = wrapper .find('Detail[label="Labels"]') .find('Chip[component="li"]'); - const sparkline = wrapper.find('Sparkline__Link'); + const sparkline = wrapper.find('Sparkline Link'); expect(organization.text()).toBe('Org'); expect(inventory.text()).toEqual('Bar'); diff --git a/awx/ui_next/src/screens/Template/WorkflowJobTemplateEdit/WorkflowJobTemplateEdit.test.jsx b/awx/ui_next/src/screens/Template/WorkflowJobTemplateEdit/WorkflowJobTemplateEdit.test.jsx index b9984f2f3e..81ae43e817 100644 --- a/awx/ui_next/src/screens/Template/WorkflowJobTemplateEdit/WorkflowJobTemplateEdit.test.jsx +++ b/awx/ui_next/src/screens/Template/WorkflowJobTemplateEdit/WorkflowJobTemplateEdit.test.jsx @@ -23,7 +23,10 @@ const mockTemplate = { inventory: { id: 1, name: 'Inventory 1' }, organization: { id: 1, name: 'Organization 1' }, labels: { - results: [{ name: 'Label 1', id: 1 }, { name: 'Label 2', id: 2 }], + results: [ + { name: 'Label 1', id: 1 }, + { name: 'Label 2', id: 2 }, + ], }, }, scm_branch: 'devel', @@ -187,7 +190,10 @@ describe('', () => { summary_fields: { inventory: { id: 1, name: 'Inventory 1' }, labels: { - results: [{ name: 'Label 1', id: 1 }, { name: 'Label 2', id: 2 }], + results: [ + { name: 'Label 1', id: 1 }, + { name: 'Label 2', id: 2 }, + ], }, }, scm_branch: 'devel', diff --git a/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeModal.jsx b/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeModal.jsx index 47971fe236..11a691575d 100644 --- a/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeModal.jsx +++ b/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeModal.jsx @@ -14,7 +14,8 @@ import { } from '../../../../../contexts/Workflow'; import Wizard from '../../../../../components/Wizard'; import { NodeTypeStep } from './NodeTypeStep'; -import { RunStep, NodeNextButton } from '.'; +import RunStep from './RunStep'; +import NodeNextButton from './NodeNextButton'; function NodeModal({ askLinkType, i18n, onSave, title }) { const history = useHistory(); diff --git a/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeTypeStep/index.js b/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeTypeStep/index.js index 7864636d38..da82572dd3 100644 --- a/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeTypeStep/index.js +++ b/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeTypeStep/index.js @@ -2,6 +2,4 @@ export { default as InventorySourcesList } from './InventorySourcesList'; export { default as JobTemplatesList } from './JobTemplatesList'; export { default as NodeTypeStep } from './NodeTypeStep'; export { default as ProjectsList } from './ProjectsList'; -export { - default as WorkflowJobTemplatesList, -} from './WorkflowJobTemplatesList'; +export { default as WorkflowJobTemplatesList } from './WorkflowJobTemplatesList'; diff --git a/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/VisualizerGraph.jsx b/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/VisualizerGraph.jsx index 55948c052f..7975d7140f 100644 --- a/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/VisualizerGraph.jsx +++ b/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/VisualizerGraph.jsx @@ -21,7 +21,8 @@ import { WorkflowStartNode, WorkflowTools, } from '../../../components/Workflow'; -import { VisualizerLink, VisualizerNode } from '.'; +import VisualizerLink from './VisualizerLink'; +import VisualizerNode from './VisualizerNode'; const PotentialLink = styled.polyline` pointer-events: none; diff --git a/awx/ui_next/src/screens/Template/shared/JobTemplateForm.test.jsx b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.test.jsx index 978d0dba05..b4664cb2bf 100644 --- a/awx/ui_next/src/screens/Template/shared/JobTemplateForm.test.jsx +++ b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.test.jsx @@ -38,7 +38,12 @@ describe('', () => { id: 3, name: 'qux', }, - labels: { results: [{ name: 'Sushi', id: 1 }, { name: 'Major', id: 2 }] }, + labels: { + results: [ + { name: 'Sushi', id: 1 }, + { name: 'Major', id: 2 }, + ], + }, credentials: [ { id: 1, kind: 'cloud', name: 'Foo' }, { id: 2, kind: 'ssh', name: 'Bar' }, diff --git a/awx/ui_next/src/screens/Template/shared/LabelSelect.test.jsx b/awx/ui_next/src/screens/Template/shared/LabelSelect.test.jsx index 39342dd3fe..b47c6643fa 100644 --- a/awx/ui_next/src/screens/Template/shared/LabelSelect.test.jsx +++ b/awx/ui_next/src/screens/Template/shared/LabelSelect.test.jsx @@ -6,7 +6,10 @@ import LabelSelect from './LabelSelect'; jest.mock('../../../api'); -const options = [{ id: 1, name: 'one' }, { id: 2, name: 'two' }]; +const options = [ + { id: 1, name: 'one' }, + { id: 2, name: 'two' }, +]; describe('', () => { afterEach(() => { @@ -40,7 +43,10 @@ describe('', () => { }); LabelsAPI.read.mockReturnValueOnce({ data: { - results: [{ id: 3, name: 'three' }, { id: 4, name: 'four' }], + results: [ + { id: 3, name: 'three' }, + { id: 4, name: 'four' }, + ], }, }); let wrapper; diff --git a/awx/ui_next/src/screens/Template/shared/WebhookSubForm.jsx b/awx/ui_next/src/screens/Template/shared/WebhookSubForm.jsx index 3141a650b7..94adbeb600 100644 --- a/awx/ui_next/src/screens/Template/shared/WebhookSubForm.jsx +++ b/awx/ui_next/src/screens/Template/shared/WebhookSubForm.jsx @@ -9,10 +9,10 @@ import { InputGroup, Button, } from '@patternfly/react-core'; +import { useField } from 'formik'; import ContentError from '../../../components/ContentError'; import ContentLoading from '../../../components/ContentLoading'; import useRequest from '../../../util/useRequest'; -import { useField } from 'formik'; import { FormColumnLayout } from '../../../components/FormLayout'; import { CredentialLookup } from '../../../components/Lookup'; import AnsibleSelect from '../../../components/AnsibleSelect'; diff --git a/awx/ui_next/src/screens/Template/shared/WorkflowJobTemplateForm.test.jsx b/awx/ui_next/src/screens/Template/shared/WorkflowJobTemplateForm.test.jsx index 57747a12bf..4cddaec8e7 100644 --- a/awx/ui_next/src/screens/Template/shared/WorkflowJobTemplateForm.test.jsx +++ b/awx/ui_next/src/screens/Template/shared/WorkflowJobTemplateForm.test.jsx @@ -32,7 +32,10 @@ describe('', () => { inventory: { id: 1, name: 'Inventory 1' }, organization: { id: 1, name: 'Organization 1' }, labels: { - results: [{ name: 'Label 1', id: 1 }, { name: 'Label 2', id: 2 }], + results: [ + { name: 'Label 1', id: 1 }, + { name: 'Label 2', id: 2 }, + ], }, }, scm_branch: 'devel', @@ -61,7 +64,10 @@ describe('', () => { results: [{ id: 1 }, { id: 2 }], }); InventoriesAPI.read.mockResolvedValue({ - results: [{ id: 1, name: 'Foo' }, { id: 2, name: 'Bar' }], + results: [ + { id: 1, name: 'Foo' }, + { id: 2, name: 'Bar' }, + ], }); history = createMemoryHistory({ diff --git a/awx/ui_next/src/screens/User/UserAccess/UserAccessList.test.jsx b/awx/ui_next/src/screens/User/UserAccess/UserAccessList.test.jsx index d25649ddd9..acb1400608 100644 --- a/awx/ui_next/src/screens/User/UserAccess/UserAccessList.test.jsx +++ b/awx/ui_next/src/screens/User/UserAccess/UserAccessList.test.jsx @@ -1,9 +1,12 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { createMemoryHistory } from 'history'; -import { UsersAPI } from '../../../api'; import { Route } from 'react-router-dom'; -import { mountWithContexts, waitForElement } from '../../../../testUtils/enzymeHelpers'; +import { UsersAPI } from '../../../api'; +import { + mountWithContexts, + waitForElement, +} from '../../../../testUtils/enzymeHelpers'; import UserAccessList from './UserAccessList'; jest.mock('../../../api/models/Users'); diff --git a/awx/ui_next/src/screens/User/UserAccess/UserAccessListItem.jsx b/awx/ui_next/src/screens/User/UserAccess/UserAccessListItem.jsx index fcf1fabf0f..834b76da47 100644 --- a/awx/ui_next/src/screens/User/UserAccess/UserAccessListItem.jsx +++ b/awx/ui_next/src/screens/User/UserAccess/UserAccessListItem.jsx @@ -6,9 +6,8 @@ import { DataListItemCells, DataListItemRow, } from '@patternfly/react-core'; -import DataListCell from '../../../components/DataListCell'; - import { Link } from 'react-router-dom'; +import DataListCell from '../../../components/DataListCell'; function UserAccessListItem({ role, i18n, detailUrl }) { const labelId = `userRole-${role.id}`;