diff --git a/awx/ui_next/.eslintrc b/awx/ui_next/.eslintrc index 1f83a5dd44..c029eb3417 100644 --- a/awx/ui_next/.eslintrc +++ b/awx/ui_next/.eslintrc @@ -19,6 +19,11 @@ "settings": { "react": { "version": "16.5.2" + }, + "import/resolver": { + "node": { + paths: ["src"] + } } }, "env": { @@ -135,6 +140,7 @@ "jsx-a11y/label-has-for": "off", "jsx-a11y/label-has-associated-control": "off", "react-hooks/rules-of-hooks": "error", - "react-hooks/exhaustive-deps": "warn" + "react-hooks/exhaustive-deps": "warn", + "react/jsx-filename-extension": "off" } } diff --git a/awx/ui_next/CONTRIBUTING.md b/awx/ui_next/CONTRIBUTING.md index 2ec214a31a..15aaa783fe 100644 --- a/awx/ui_next/CONTRIBUTING.md +++ b/awx/ui_next/CONTRIBUTING.md @@ -156,6 +156,7 @@ Inside these folders, the internal structure is: - **/api** - All classes used to interact with API's are found here. See [AWX REST API Interaction](#awx-rest-api-interaction) for more information. - **/components** - All generic components that are meant to be used in multiple contexts throughout awx. Things like buttons, tabs go here. - **/contexts** - Components which utilize react's context api. +- **/hooks** - Custom react [hooks](https://reactjs.org/docs/hooks-custom.html) - **/locales** - [Internationalization](#internationalization) config and source files. - **/screens** - Based on the various routes of awx. - **/shared** - Components that are meant to be used specifically by a particular route, but might be sharable across pages of that route. For example, a form component which is used on both add and edit screens. @@ -169,24 +170,24 @@ Inside these folders, the internal structure is: In the root of `/src`, there are a few files which are used to initialize the react app. These are -- **index.jsx** +- **index.js** - Connects react app to root dom node. - Sets up root route structure, navigation grouping and login modal - Calls base context providers - Imports .scss styles. -- **app.jsx** +- **app.js** - Sets standard page layout, about modal, and root dialog modal. -- **RootProvider.jsx** +- **RootProvider.js** - Sets up all context providers. - Initializes i18n and router ### Naming files -Ideally, files should be named the same as the component they export, and tests with `.test` appended. In other words, `` would be defined in `FooBar.jsx`, and its tests would be defined in `FooBar.test.jsx`. +Ideally, files should be named the same as the component they export, and tests with `.test` appended. In other words, `` would be defined in `FooBar.js`, and its tests would be defined in `FooBar.test.js`. #### Naming components that use the context api -**File naming** - Since contexts export both consumer and provider (and potentially in withContext function form), the file can be simplified to be named after the consumer export. In other words, the file containing the `Network` context components would be named `Network.jsx`. +**File naming** - Since contexts export both consumer and provider (and potentially in withContext function form), the file can be simplified to be named after the consumer export. In other words, the file containing the `Network` context components would be named `Network.js`. **Component naming and conventions** - In order to provide a consistent interface with react-router and [lingui](https://lingui.js.org/), as well as make their usage easier and less verbose, context components follow these conventions: @@ -264,7 +265,7 @@ There are currently a few custom hooks: 1. [useRequest](https://github.com/ansible/awx/blob/devel/awx/ui_next/src/util/useRequest.js#L21) encapsulates main actions related to requests. 2. [useDismissableError](https://github.com/ansible/awx/blob/devel/awx/ui_next/src/util/useRequest.js#L71) provides controls for "dismissing" an error message. 3. [useDeleteItems](https://github.com/ansible/awx/blob/devel/awx/ui_next/src/util/useRequest.js#L98) handles deletion of items from a paginated item list. -4. [useSelected](https://github.com/ansible/awx/blob/devel/awx/ui_next/src/util/useSelected.jsx#L14) provides a way to read and update a selected list. +4. [useSelected](https://github.com/ansible/awx/blob/devel/awx/ui_next/src/util/useSelected.js#L14) provides a way to read and update a selected list. ### Naming Functions @@ -302,7 +303,7 @@ this.state = { ### Testing components that use contexts -We have several React contexts that wrap much of the app, including those from react-router, lingui, and some of our own. When testing a component that depends on one or more of these, you can use the `mountWithContexts()` helper function found in `testUtils/enzymeHelpers.jsx`. This can be used just like Enzyme's `mount()` function, except it will wrap the component tree with the necessary context providers and basic stub data. +We have several React contexts that wrap much of the app, including those from react-router, lingui, and some of our own. When testing a component that depends on one or more of these, you can use the `mountWithContexts()` helper function found in `testUtils/enzymeHelpers.js`. This can be used just like Enzyme's `mount()` function, except it will wrap the component tree with the necessary context providers and basic stub data. If you want to stub the value of a context, or assert actions taken on it, you can customize a contexts value by passing a second parameter to `mountWithContexts`. For example, this provides a custom value for the `Config` context: @@ -352,7 +353,7 @@ You can learn more about the ways lingui and its React helpers at [this link](ht 1. `npm run add-locale` to add the language that you want to translate to (we should only have to do this once and the commit to repo afaik). Example: `npm run add-locale en es fr` # Add English, Spanish and French locale 2. `npm run extract-strings` to create .po files for each language specified. The .po files will be placed in src/locales. When updating strings that are used by `` or `plural()` you will need to run this command to get the strings to render properly. This command will create `.po` files for each of the supported languages that will need to be committed with your PR. 3. Open up the .po file for the language you want to test and add some translations. In production we would pass this .po file off to the translation team. -4. Once you've edited your .po file (or we've gotten a .po file back from the translation team) run `npm run compile-strings`. This command takes the .po files and turns them into a minified JSON object and can be seen in the `messages.js` file in each locale directory. These files get loaded at the App root level (see: App.jsx). +4. Once you've edited your .po file (or we've gotten a .po file back from the translation team) run `npm run compile-strings`. This command takes the .po files and turns them into a minified JSON object and can be seen in the `messages.js` file in each locale directory. These files get loaded at the App root level (see: App.js). 5. Change the language in your browser and reload the page. You should see your specified translations in place of English strings. ### Marking an issue to be translated diff --git a/awx/ui_next/jsconfig.json b/awx/ui_next/jsconfig.json new file mode 100644 index 0000000000..ec2332eb49 --- /dev/null +++ b/awx/ui_next/jsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "baseUrl": "src" + } +} diff --git a/awx/ui_next/src/App.jsx b/awx/ui_next/src/App.js similarity index 87% rename from awx/ui_next/src/App.jsx rename to awx/ui_next/src/App.js index 59a8e28cd9..77116d3f8b 100644 --- a/awx/ui_next/src/App.jsx +++ b/awx/ui_next/src/App.js @@ -16,21 +16,21 @@ import { ConfigProvider, useAuthorizedPath, useUserProfile, -} from './contexts/Config'; -import { SessionProvider, useSession } from './contexts/Session'; -import AppContainer from './components/AppContainer'; -import Background from './components/Background'; -import ContentError from './components/ContentError'; -import NotFound from './screens/NotFound'; -import Login from './screens/Login'; -import { isAuthenticated } from './util/auth'; -import { getLanguageWithoutRegionCode } from './util/language'; +} from 'contexts/Config'; +import { SessionProvider, useSession } from 'contexts/Session'; +import AppContainer from 'components/AppContainer'; +import Background from 'components/Background'; +import ContentError from 'components/ContentError'; +import NotFound from 'screens/NotFound'; +import Login from 'screens/Login'; +import { isAuthenticated } from 'util/auth'; +import { getLanguageWithoutRegionCode } from 'util/language'; +import Metrics from 'screens/Metrics'; +import SubscriptionEdit from 'screens/Setting/Subscription/SubscriptionEdit'; +import { RootAPI } from 'api'; import { dynamicActivate, locales } from './i18nLoader'; -import Metrics from './screens/Metrics'; import getRouteConfig from './routeConfig'; -import SubscriptionEdit from './screens/Setting/Subscription/SubscriptionEdit'; import { SESSION_REDIRECT_URL } from './constants'; -import { RootAPI } from './api'; function ErrorFallback({ error }) { return ( diff --git a/awx/ui_next/src/App.test.jsx b/awx/ui_next/src/App.test.js similarity index 89% rename from awx/ui_next/src/App.test.jsx rename to awx/ui_next/src/App.test.js index a76d9634b5..a8b842714a 100644 --- a/awx/ui_next/src/App.test.jsx +++ b/awx/ui_next/src/App.test.js @@ -1,8 +1,8 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; +import { RootAPI } from 'api'; +import * as SessionContext from 'contexts/Session'; import { mountWithContexts } from '../testUtils/enzymeHelpers'; -import { RootAPI } from './api'; -import * as SessionContext from './contexts/Session'; import App from './App'; jest.mock('./api'); diff --git a/awx/ui_next/src/api/Base.js b/awx/ui_next/src/api/Base.js index 5081e20ab6..bc38870a8a 100644 --- a/awx/ui_next/src/api/Base.js +++ b/awx/ui_next/src/api/Base.js @@ -1,7 +1,7 @@ import axios from 'axios'; +import { encodeQueryString } from 'util/qs'; +import debounce from 'util/debounce'; import { SESSION_TIMEOUT_KEY } from '../constants'; -import { encodeQueryString } from '../util/qs'; -import debounce from '../util/debounce'; const updateStorage = debounce((key, val) => { window.localStorage.setItem(key, val); diff --git a/awx/ui_next/src/api/Base.test.jsx b/awx/ui_next/src/api/Base.test.js similarity index 100% rename from awx/ui_next/src/api/Base.test.jsx rename to awx/ui_next/src/api/Base.test.js diff --git a/awx/ui_next/src/api/models/Organizations.test.jsx b/awx/ui_next/src/api/models/Organizations.test.js similarity index 100% rename from awx/ui_next/src/api/models/Organizations.test.jsx rename to awx/ui_next/src/api/models/Organizations.test.js diff --git a/awx/ui_next/src/api/models/Root.test.jsx b/awx/ui_next/src/api/models/Root.test.js similarity index 100% rename from awx/ui_next/src/api/models/Root.test.jsx rename to awx/ui_next/src/api/models/Root.test.js diff --git a/awx/ui_next/src/api/models/Teams.test.jsx b/awx/ui_next/src/api/models/Teams.test.js similarity index 100% rename from awx/ui_next/src/api/models/Teams.test.jsx rename to awx/ui_next/src/api/models/Teams.test.js diff --git a/awx/ui_next/src/api/models/Users.test.jsx b/awx/ui_next/src/api/models/Users.test.js similarity index 100% rename from awx/ui_next/src/api/models/Users.test.jsx rename to awx/ui_next/src/api/models/Users.test.js diff --git a/awx/ui_next/src/components/About/About.jsx b/awx/ui_next/src/components/About/About.js similarity index 96% rename from awx/ui_next/src/components/About/About.jsx rename to awx/ui_next/src/components/About/About.js index 64073ddb57..39842f0623 100644 --- a/awx/ui_next/src/components/About/About.jsx +++ b/awx/ui_next/src/components/About/About.js @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { t } from '@lingui/macro'; import { AboutModal } from '@patternfly/react-core'; -import useBrandName from '../../util/useBrandName'; +import useBrandName from 'hooks/useBrandName'; function About({ version, isOpen, onClose }) { const brandName = useBrandName(); diff --git a/awx/ui_next/src/components/About/About.test.jsx b/awx/ui_next/src/components/About/About.test.js similarity index 92% rename from awx/ui_next/src/components/About/About.test.jsx rename to awx/ui_next/src/components/About/About.test.js index d2cb8a4637..baf7392948 100644 --- a/awx/ui_next/src/components/About/About.test.jsx +++ b/awx/ui_next/src/components/About/About.test.js @@ -2,7 +2,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import About from './About'; -jest.mock('../../util/useBrandName', () => ({ +jest.mock('../../hooks/useBrandName', () => ({ __esModule: true, default: () => ({ current: 'AWX', diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocCommands.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocCommands.js similarity index 95% rename from awx/ui_next/src/components/AdHocCommands/AdHocCommands.jsx rename to awx/ui_next/src/components/AdHocCommands/AdHocCommands.js index f85120f8f7..f3bddc6abf 100644 --- a/awx/ui_next/src/components/AdHocCommands/AdHocCommands.jsx +++ b/awx/ui_next/src/components/AdHocCommands/AdHocCommands.js @@ -5,13 +5,13 @@ import { t } from '@lingui/macro'; import PropTypes from 'prop-types'; import { Button, DropdownItem } from '@patternfly/react-core'; -import useRequest, { useDismissableError } from '../../util/useRequest'; -import { InventoriesAPI, CredentialTypesAPI } from '../../api'; +import useRequest, { useDismissableError } from 'hooks/useRequest'; +import { InventoriesAPI, CredentialTypesAPI } from 'api'; +import { KebabifiedContext } from 'contexts/Kebabified'; import AlertModal from '../AlertModal'; import ErrorDetail from '../ErrorDetail'; import AdHocCommandsWizard from './AdHocCommandsWizard'; -import { KebabifiedContext } from '../../contexts/Kebabified'; import ContentError from '../ContentError'; function AdHocCommands({ adHocItems, hasListItems, onLaunchLoading }) { diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocCommands.test.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocCommands.test.js similarity index 99% rename from awx/ui_next/src/components/AdHocCommands/AdHocCommands.test.jsx rename to awx/ui_next/src/components/AdHocCommands/AdHocCommands.test.js index 3e279a92d7..1f201b60e8 100644 --- a/awx/ui_next/src/components/AdHocCommands/AdHocCommands.test.jsx +++ b/awx/ui_next/src/components/AdHocCommands/AdHocCommands.test.js @@ -1,16 +1,16 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { - mountWithContexts, - waitForElement, -} from '../../../testUtils/enzymeHelpers'; import { CredentialTypesAPI, InventoriesAPI, CredentialsAPI, ExecutionEnvironmentsAPI, RootAPI, -} from '../../api'; +} from 'api'; +import { + mountWithContexts, + waitForElement, +} from '../../../testUtils/enzymeHelpers'; import AdHocCommands from './AdHocCommands'; jest.mock('../../api/models/CredentialTypes'); diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.js similarity index 100% rename from awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.jsx rename to awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.js diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.test.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.test.js similarity index 99% rename from awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.test.jsx rename to awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.test.js index c415df1104..c20da81f4f 100644 --- a/awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.test.jsx +++ b/awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.test.js @@ -1,10 +1,10 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; +import { CredentialsAPI, ExecutionEnvironmentsAPI, RootAPI } from 'api'; import { mountWithContexts, waitForElement, } from '../../../testUtils/enzymeHelpers'; -import { CredentialsAPI, ExecutionEnvironmentsAPI, RootAPI } from '../../api'; import AdHocCommandsWizard from './AdHocCommandsWizard'; jest.mock('../../api/models/CredentialTypes'); diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.js similarity index 94% rename from awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.jsx rename to awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.js index 0246bf444d..94a8038b54 100644 --- a/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.jsx +++ b/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.js @@ -5,14 +5,14 @@ import { t } from '@lingui/macro'; import PropTypes from 'prop-types'; import { useField } from 'formik'; import { Form, FormGroup } from '@patternfly/react-core'; -import { CredentialsAPI } from '../../api'; +import { CredentialsAPI } from 'api'; +import { getQSConfig, parseQueryString, mergeParams } from 'util/qs'; +import useRequest from 'hooks/useRequest'; +import { required } from 'util/validators'; import Popover from '../Popover'; -import { getQSConfig, parseQueryString, mergeParams } from '../../util/qs'; -import useRequest from '../../util/useRequest'; import ContentError from '../ContentError'; import ContentLoading from '../ContentLoading'; -import { required } from '../../util/validators'; import OptionsList from '../OptionsList'; const QS_CONFIG = getQSConfig('credentials', { diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.test.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.test.js similarity index 96% rename from awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.test.jsx rename to awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.test.js index 9513632834..0e54e79158 100644 --- a/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.test.jsx +++ b/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.test.js @@ -1,11 +1,11 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { CredentialsAPI } from 'api'; import { mountWithContexts, waitForElement, } from '../../../testUtils/enzymeHelpers'; -import { CredentialsAPI } from '../../api'; import AdHocCredentialStep from './AdHocCredentialStep'; jest.mock('../../api/models/Credentials'); diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.js similarity index 99% rename from awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.jsx rename to awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.js index e97780713a..0b92e14d84 100644 --- a/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.jsx +++ b/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.js @@ -6,6 +6,8 @@ import PropTypes from 'prop-types'; import { useField } from 'formik'; import { Form, FormGroup, Switch, Checkbox } from '@patternfly/react-core'; import styled from 'styled-components'; +import { required } from 'util/validators'; +import useBrandName from 'hooks/useBrandName'; import AnsibleSelect from '../AnsibleSelect'; import FormField from '../FormField'; import { VariablesField } from '../CodeEditor'; @@ -15,8 +17,6 @@ import { FormCheckboxLayout, } from '../FormLayout'; import Popover from '../Popover'; -import { required } from '../../util/validators'; -import useBrandName from '../../util/useBrandName'; const TooltipWrapper = styled.div` text-align: left; diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.test.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.test.js similarity index 99% rename from awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.test.jsx rename to awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.test.js index e71759f3cd..2a78ffe0d0 100644 --- a/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.test.jsx +++ b/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.test.js @@ -1,8 +1,8 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { RootAPI } from 'api'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; -import { RootAPI } from '../../api'; import DetailsStep from './AdHocDetailsStep'; jest.mock('../../api/models/Credentials'); diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnironmentStep.test.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnironmentStep.test.js similarity index 96% rename from awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnironmentStep.test.jsx rename to awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnironmentStep.test.js index a78a0a673c..7c2f2c1e36 100644 --- a/awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnironmentStep.test.jsx +++ b/awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnironmentStep.test.js @@ -1,11 +1,11 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { ExecutionEnvironmentsAPI } from 'api'; import { mountWithContexts, waitForElement, } from '../../../testUtils/enzymeHelpers'; -import { ExecutionEnvironmentsAPI } from '../../api'; import AdHocExecutionEnvironmentStep from './AdHocExecutionEnvironmentStep'; jest.mock('../../api/models/ExecutionEnvironments'); diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnvironmentStep.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnvironmentStep.js similarity index 95% rename from awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnvironmentStep.jsx rename to awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnvironmentStep.js index ea0a6ae9b4..6e75c618c4 100644 --- a/awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnvironmentStep.jsx +++ b/awx/ui_next/src/components/AdHocCommands/AdHocExecutionEnvironmentStep.js @@ -3,11 +3,11 @@ import { useHistory } from 'react-router-dom'; import { t } from '@lingui/macro'; import { useField } from 'formik'; import { Form, FormGroup } from '@patternfly/react-core'; -import { ExecutionEnvironmentsAPI } from '../../api'; -import Popover from '../Popover'; +import { ExecutionEnvironmentsAPI } from 'api'; -import { parseQueryString, getQSConfig, mergeParams } from '../../util/qs'; -import useRequest from '../../util/useRequest'; +import { parseQueryString, getQSConfig, mergeParams } from 'util/qs'; +import useRequest from 'hooks/useRequest'; +import Popover from '../Popover'; import ContentError from '../ContentError'; import ContentLoading from '../ContentLoading'; import OptionsList from '../OptionsList'; diff --git a/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx b/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.js similarity index 95% rename from awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx rename to awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.js index 8f5b97ae19..fba404f6d8 100644 --- a/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx +++ b/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.js @@ -2,8 +2,8 @@ import React, { useState, useRef, useEffect, Fragment } from 'react'; import { t } from '@lingui/macro'; import PropTypes from 'prop-types'; import { Dropdown, DropdownPosition } from '@patternfly/react-core'; +import { useKebabifiedMenu } from 'contexts/Kebabified'; import { ToolbarAddButton } from '../PaginatedTable'; -import { useKebabifiedMenu } from '../../contexts/Kebabified'; function AddDropDownButton({ dropdownItems, ouiaId }) { const { isKebabified } = useKebabifiedMenu(); diff --git a/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.test.jsx b/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.test.js similarity index 100% rename from awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.test.jsx rename to awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.test.js diff --git a/awx/ui_next/src/components/AddRole/AddResourceRole.jsx b/awx/ui_next/src/components/AddRole/AddResourceRole.js similarity index 99% rename from awx/ui_next/src/components/AddRole/AddResourceRole.jsx rename to awx/ui_next/src/components/AddRole/AddResourceRole.js index 34bb4a0a9b..9e38dae844 100644 --- a/awx/ui_next/src/components/AddRole/AddResourceRole.jsx +++ b/awx/ui_next/src/components/AddRole/AddResourceRole.js @@ -2,11 +2,11 @@ import React, { Fragment, useState, useEffect } from 'react'; import PropTypes from 'prop-types'; import { useHistory } from 'react-router-dom'; import { t } from '@lingui/macro'; +import { TeamsAPI, UsersAPI } from 'api'; import SelectableCard from '../SelectableCard'; import Wizard from '../Wizard'; import SelectResourceStep from './SelectResourceStep'; import SelectRoleStep from './SelectRoleStep'; -import { TeamsAPI, UsersAPI } from '../../api'; const readUsers = async queryParams => UsersAPI.read(Object.assign(queryParams, { is_superuser: false })); diff --git a/awx/ui_next/src/components/AddRole/AddResourceRole.test.jsx b/awx/ui_next/src/components/AddRole/AddResourceRole.test.js similarity index 99% rename from awx/ui_next/src/components/AddRole/AddResourceRole.test.jsx rename to awx/ui_next/src/components/AddRole/AddResourceRole.test.js index 53c450f0b9..4136d6e54c 100644 --- a/awx/ui_next/src/components/AddRole/AddResourceRole.test.jsx +++ b/awx/ui_next/src/components/AddRole/AddResourceRole.test.js @@ -4,12 +4,12 @@ import { shallow } from 'enzyme'; import { createMemoryHistory } from 'history'; import { act } from 'react-dom/test-utils'; +import { TeamsAPI, UsersAPI } from 'api'; import { mountWithContexts, waitForElement, } from '../../../testUtils/enzymeHelpers'; import AddResourceRole, { _AddResourceRole } from './AddResourceRole'; -import { TeamsAPI, UsersAPI } from '../../api'; jest.mock('../../api/models/Teams'); jest.mock('../../api/models/Users'); diff --git a/awx/ui_next/src/components/AddRole/CheckboxCard.jsx b/awx/ui_next/src/components/AddRole/CheckboxCard.js similarity index 100% rename from awx/ui_next/src/components/AddRole/CheckboxCard.jsx rename to awx/ui_next/src/components/AddRole/CheckboxCard.js diff --git a/awx/ui_next/src/components/AddRole/CheckboxCard.test.jsx b/awx/ui_next/src/components/AddRole/CheckboxCard.test.js similarity index 100% rename from awx/ui_next/src/components/AddRole/CheckboxCard.test.jsx rename to awx/ui_next/src/components/AddRole/CheckboxCard.test.js diff --git a/awx/ui_next/src/components/AddRole/SelectResourceStep.jsx b/awx/ui_next/src/components/AddRole/SelectResourceStep.js similarity index 96% rename from awx/ui_next/src/components/AddRole/SelectResourceStep.jsx rename to awx/ui_next/src/components/AddRole/SelectResourceStep.js index abf3b8d10f..6121a7abae 100644 --- a/awx/ui_next/src/components/AddRole/SelectResourceStep.jsx +++ b/awx/ui_next/src/components/AddRole/SelectResourceStep.js @@ -2,12 +2,12 @@ import React, { Fragment, useCallback, useEffect } from 'react'; import PropTypes from 'prop-types'; import { withRouter, useLocation } from 'react-router-dom'; import { t } from '@lingui/macro'; -import useRequest from '../../util/useRequest'; -import { SearchColumns, SortColumns } from '../../types'; +import useRequest from 'hooks/useRequest'; +import { SearchColumns, SortColumns } from 'types'; +import { getQSConfig, parseQueryString } from 'util/qs'; import DataListToolbar from '../DataListToolbar'; import CheckboxListItem from '../CheckboxListItem'; import { SelectedList } from '../SelectedList'; -import { getQSConfig, parseQueryString } from '../../util/qs'; import PaginatedTable, { HeaderCell, HeaderRow } from '../PaginatedTable'; const QS_Config = sortColumns => { diff --git a/awx/ui_next/src/components/AddRole/SelectResourceStep.test.jsx b/awx/ui_next/src/components/AddRole/SelectResourceStep.test.js similarity index 100% rename from awx/ui_next/src/components/AddRole/SelectResourceStep.test.jsx rename to awx/ui_next/src/components/AddRole/SelectResourceStep.test.js diff --git a/awx/ui_next/src/components/AddRole/SelectRoleStep.jsx b/awx/ui_next/src/components/AddRole/SelectRoleStep.js similarity index 100% rename from awx/ui_next/src/components/AddRole/SelectRoleStep.jsx rename to awx/ui_next/src/components/AddRole/SelectRoleStep.js diff --git a/awx/ui_next/src/components/AddRole/SelectRoleStep.test.jsx b/awx/ui_next/src/components/AddRole/SelectRoleStep.test.js similarity index 100% rename from awx/ui_next/src/components/AddRole/SelectRoleStep.test.jsx rename to awx/ui_next/src/components/AddRole/SelectRoleStep.test.js diff --git a/awx/ui_next/src/components/AlertModal/AlertModal.jsx b/awx/ui_next/src/components/AlertModal/AlertModal.js similarity index 100% rename from awx/ui_next/src/components/AlertModal/AlertModal.jsx rename to awx/ui_next/src/components/AlertModal/AlertModal.js diff --git a/awx/ui_next/src/components/AlertModal/AlertModal.test.jsx b/awx/ui_next/src/components/AlertModal/AlertModal.test.js similarity index 100% rename from awx/ui_next/src/components/AlertModal/AlertModal.test.jsx rename to awx/ui_next/src/components/AlertModal/AlertModal.test.js diff --git a/awx/ui_next/src/components/AnsibleSelect/AnsibleSelect.jsx b/awx/ui_next/src/components/AnsibleSelect/AnsibleSelect.js similarity index 100% rename from awx/ui_next/src/components/AnsibleSelect/AnsibleSelect.jsx rename to awx/ui_next/src/components/AnsibleSelect/AnsibleSelect.js diff --git a/awx/ui_next/src/components/AnsibleSelect/AnsibleSelect.test.jsx b/awx/ui_next/src/components/AnsibleSelect/AnsibleSelect.test.js similarity index 100% rename from awx/ui_next/src/components/AnsibleSelect/AnsibleSelect.test.jsx rename to awx/ui_next/src/components/AnsibleSelect/AnsibleSelect.test.js diff --git a/awx/ui_next/src/components/AppContainer/AppContainer.jsx b/awx/ui_next/src/components/AppContainer/AppContainer.js similarity index 95% rename from awx/ui_next/src/components/AppContainer/AppContainer.jsx rename to awx/ui_next/src/components/AppContainer/AppContainer.js index 6dd0632af4..d1c31c305a 100644 --- a/awx/ui_next/src/components/AppContainer/AppContainer.jsx +++ b/awx/ui_next/src/components/AppContainer/AppContainer.js @@ -15,9 +15,9 @@ import { t, Plural } from '@lingui/macro'; import styled from 'styled-components'; -import { useConfig, useAuthorizedPath } from '../../contexts/Config'; -import { useSession } from '../../contexts/Session'; -import issuePendoIdentity from '../../util/issuePendoIdentity'; +import { useConfig, useAuthorizedPath } from 'contexts/Config'; +import { useSession } from 'contexts/Session'; +import issuePendoIdentity from 'util/issuePendoIdentity'; import About from '../About'; import BrandLogo from './BrandLogo'; import NavExpandableGroup from './NavExpandableGroup'; diff --git a/awx/ui_next/src/components/AppContainer/AppContainer.test.jsx b/awx/ui_next/src/components/AppContainer/AppContainer.test.js similarity index 98% rename from awx/ui_next/src/components/AppContainer/AppContainer.test.jsx rename to awx/ui_next/src/components/AppContainer/AppContainer.test.js index ef168f0278..577ee1ba74 100644 --- a/awx/ui_next/src/components/AppContainer/AppContainer.test.jsx +++ b/awx/ui_next/src/components/AppContainer/AppContainer.test.js @@ -1,11 +1,11 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; +import { MeAPI, RootAPI } from 'api'; +import { useAuthorizedPath } from 'contexts/Config'; import { mountWithContexts, waitForElement, } from '../../../testUtils/enzymeHelpers'; -import { MeAPI, RootAPI } from '../../api'; -import { useAuthorizedPath } from '../../contexts/Config'; import AppContainer from './AppContainer'; jest.mock('../../api'); diff --git a/awx/ui_next/src/components/AppContainer/BrandLogo.jsx b/awx/ui_next/src/components/AppContainer/BrandLogo.js similarity index 100% rename from awx/ui_next/src/components/AppContainer/BrandLogo.jsx rename to awx/ui_next/src/components/AppContainer/BrandLogo.js diff --git a/awx/ui_next/src/components/AppContainer/BrandLogo.test.jsx b/awx/ui_next/src/components/AppContainer/BrandLogo.test.js similarity index 100% rename from awx/ui_next/src/components/AppContainer/BrandLogo.test.jsx rename to awx/ui_next/src/components/AppContainer/BrandLogo.test.js diff --git a/awx/ui_next/src/components/AppContainer/NavExpandableGroup.jsx b/awx/ui_next/src/components/AppContainer/NavExpandableGroup.js similarity index 100% rename from awx/ui_next/src/components/AppContainer/NavExpandableGroup.jsx rename to awx/ui_next/src/components/AppContainer/NavExpandableGroup.js diff --git a/awx/ui_next/src/components/AppContainer/NavExpandableGroup.test.jsx b/awx/ui_next/src/components/AppContainer/NavExpandableGroup.test.js similarity index 100% rename from awx/ui_next/src/components/AppContainer/NavExpandableGroup.test.jsx rename to awx/ui_next/src/components/AppContainer/NavExpandableGroup.test.js diff --git a/awx/ui_next/src/components/AppContainer/PageHeaderToolbar.jsx b/awx/ui_next/src/components/AppContainer/PageHeaderToolbar.js similarity index 95% rename from awx/ui_next/src/components/AppContainer/PageHeaderToolbar.jsx rename to awx/ui_next/src/components/AppContainer/PageHeaderToolbar.js index c00721f7a8..487ec0f0c6 100644 --- a/awx/ui_next/src/components/AppContainer/PageHeaderToolbar.jsx +++ b/awx/ui_next/src/components/AppContainer/PageHeaderToolbar.js @@ -20,10 +20,10 @@ import { QuestionCircleIcon, UserIcon, } from '@patternfly/react-icons'; -import { WorkflowApprovalsAPI } from '../../api'; -import useRequest from '../../util/useRequest'; -import getDocsBaseUrl from '../../util/getDocsBaseUrl'; -import { useConfig } from '../../contexts/Config'; +import { WorkflowApprovalsAPI } from 'api'; +import useRequest from 'hooks/useRequest'; +import getDocsBaseUrl from 'util/getDocsBaseUrl'; +import { useConfig } from 'contexts/Config'; import useWsPendingApprovalCount from './useWsPendingApprovalCount'; const PendingWorkflowApprovals = styled.div` diff --git a/awx/ui_next/src/components/AppContainer/PageHeaderToolbar.test.jsx b/awx/ui_next/src/components/AppContainer/PageHeaderToolbar.test.js similarity index 98% rename from awx/ui_next/src/components/AppContainer/PageHeaderToolbar.test.jsx rename to awx/ui_next/src/components/AppContainer/PageHeaderToolbar.test.js index 0966c8bc4e..a326707c04 100644 --- a/awx/ui_next/src/components/AppContainer/PageHeaderToolbar.test.jsx +++ b/awx/ui_next/src/components/AppContainer/PageHeaderToolbar.test.js @@ -1,8 +1,8 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; +import { WorkflowApprovalsAPI } from 'api'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import PageHeaderToolbar from './PageHeaderToolbar'; -import { WorkflowApprovalsAPI } from '../../api'; jest.mock('../../api'); diff --git a/awx/ui_next/src/components/AppContainer/index.jsx b/awx/ui_next/src/components/AppContainer/index.js similarity index 100% rename from awx/ui_next/src/components/AppContainer/index.jsx rename to awx/ui_next/src/components/AppContainer/index.js diff --git a/awx/ui_next/src/components/AppContainer/useWsPendingApprovalCount.js b/awx/ui_next/src/components/AppContainer/useWsPendingApprovalCount.js index d6b1edde4a..da0f713ef4 100644 --- a/awx/ui_next/src/components/AppContainer/useWsPendingApprovalCount.js +++ b/awx/ui_next/src/components/AppContainer/useWsPendingApprovalCount.js @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react'; -import useWebsocket from '../../util/useWebsocket'; -import useThrottle from '../../util/useThrottle'; +import useWebsocket from 'hooks/useWebsocket'; +import useThrottle from 'hooks/useThrottle'; export default function useWsPendingApprovalCount( initialCount, diff --git a/awx/ui_next/src/components/AppContainer/useWsPendingApprovalCount.test.jsx b/awx/ui_next/src/components/AppContainer/useWsPendingApprovalCount.test.js similarity index 98% rename from awx/ui_next/src/components/AppContainer/useWsPendingApprovalCount.test.jsx rename to awx/ui_next/src/components/AppContainer/useWsPendingApprovalCount.test.js index 51091a12d2..1a1d5cd1b6 100644 --- a/awx/ui_next/src/components/AppContainer/useWsPendingApprovalCount.test.jsx +++ b/awx/ui_next/src/components/AppContainer/useWsPendingApprovalCount.test.js @@ -23,7 +23,7 @@ describe('useWsPendingApprovalCount hook', () => { Jest mock timers don’t play well with jest-websocket-mock, so we'll stub out throttling to resolve immediately */ - jest.mock('../../util/useThrottle', () => ({ + jest.mock('../../hooks/useThrottle', () => ({ __esModule: true, default: jest.fn(val => val), })); diff --git a/awx/ui_next/src/components/AppendBody/AppendBody.jsx b/awx/ui_next/src/components/AppendBody/AppendBody.js similarity index 100% rename from awx/ui_next/src/components/AppendBody/AppendBody.jsx rename to awx/ui_next/src/components/AppendBody/AppendBody.js diff --git a/awx/ui_next/src/components/AssociateModal/AssociateModal.jsx b/awx/ui_next/src/components/AssociateModal/AssociateModal.js similarity index 96% rename from awx/ui_next/src/components/AssociateModal/AssociateModal.jsx rename to awx/ui_next/src/components/AssociateModal/AssociateModal.js index 6c388091fc..57330f4f01 100644 --- a/awx/ui_next/src/components/AssociateModal/AssociateModal.jsx +++ b/awx/ui_next/src/components/AssociateModal/AssociateModal.js @@ -3,10 +3,10 @@ import { useHistory } from 'react-router-dom'; import { t } from '@lingui/macro'; import { Button, Modal } from '@patternfly/react-core'; +import useRequest from 'hooks/useRequest'; +import { getQSConfig, parseQueryString } from 'util/qs'; +import useSelected from 'hooks/useSelected'; import OptionsList from '../OptionsList'; -import useRequest from '../../util/useRequest'; -import { getQSConfig, parseQueryString } from '../../util/qs'; -import useSelected from '../../util/useSelected'; const QS_CONFIG = (order_by = 'name') => { return getQSConfig('associate', { diff --git a/awx/ui_next/src/components/AssociateModal/AssociateModal.test.jsx b/awx/ui_next/src/components/AssociateModal/AssociateModal.test.js similarity index 100% rename from awx/ui_next/src/components/AssociateModal/AssociateModal.test.jsx rename to awx/ui_next/src/components/AssociateModal/AssociateModal.test.js diff --git a/awx/ui_next/src/components/Background/Background.jsx b/awx/ui_next/src/components/Background/Background.js similarity index 100% rename from awx/ui_next/src/components/Background/Background.jsx rename to awx/ui_next/src/components/Background/Background.js diff --git a/awx/ui_next/src/components/Background/Background.test.jsx b/awx/ui_next/src/components/Background/Background.test.js similarity index 100% rename from awx/ui_next/src/components/Background/Background.test.jsx rename to awx/ui_next/src/components/Background/Background.test.js diff --git a/awx/ui_next/src/components/Card/CardActionsRow.jsx b/awx/ui_next/src/components/Card/CardActionsRow.js similarity index 100% rename from awx/ui_next/src/components/Card/CardActionsRow.jsx rename to awx/ui_next/src/components/Card/CardActionsRow.js diff --git a/awx/ui_next/src/components/Card/CardBody.jsx b/awx/ui_next/src/components/Card/CardBody.js similarity index 100% rename from awx/ui_next/src/components/Card/CardBody.jsx rename to awx/ui_next/src/components/Card/CardBody.js diff --git a/awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.jsx b/awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.js similarity index 100% rename from awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.jsx rename to awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.js diff --git a/awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.test.jsx b/awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.test.js similarity index 100% rename from awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.test.jsx rename to awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.test.js diff --git a/awx/ui_next/src/components/ChipGroup/ChipGroup.jsx b/awx/ui_next/src/components/ChipGroup/ChipGroup.js similarity index 100% rename from awx/ui_next/src/components/ChipGroup/ChipGroup.jsx rename to awx/ui_next/src/components/ChipGroup/ChipGroup.js diff --git a/awx/ui_next/src/components/ChipGroup/ChipGroup.test.jsx b/awx/ui_next/src/components/ChipGroup/ChipGroup.test.js similarity index 100% rename from awx/ui_next/src/components/ChipGroup/ChipGroup.test.jsx rename to awx/ui_next/src/components/ChipGroup/ChipGroup.test.js diff --git a/awx/ui_next/src/components/CodeEditor/CodeEditor.jsx b/awx/ui_next/src/components/CodeEditor/CodeEditor.js similarity index 99% rename from awx/ui_next/src/components/CodeEditor/CodeEditor.jsx rename to awx/ui_next/src/components/CodeEditor/CodeEditor.js index 3c36df348c..8aaa0516f0 100644 --- a/awx/ui_next/src/components/CodeEditor/CodeEditor.jsx +++ b/awx/ui_next/src/components/CodeEditor/CodeEditor.js @@ -11,7 +11,7 @@ import 'ace-builds/src-noconflict/theme-github'; import { t } from '@lingui/macro'; import styled from 'styled-components'; -import debounce from '../../util/debounce'; +import debounce from 'util/debounce'; config.set('loadWorkerFromBlob', false); diff --git a/awx/ui_next/src/components/CodeEditor/CodeEditor.test.jsx b/awx/ui_next/src/components/CodeEditor/CodeEditor.test.js similarity index 97% rename from awx/ui_next/src/components/CodeEditor/CodeEditor.test.jsx rename to awx/ui_next/src/components/CodeEditor/CodeEditor.test.js index 69f498d2e3..c83544a788 100644 --- a/awx/ui_next/src/components/CodeEditor/CodeEditor.test.jsx +++ b/awx/ui_next/src/components/CodeEditor/CodeEditor.test.js @@ -1,7 +1,7 @@ import React from 'react'; +import debounce from 'util/debounce'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import CodeEditor from './CodeEditor'; -import debounce from '../../util/debounce'; jest.mock('../../util/debounce'); diff --git a/awx/ui_next/src/components/CodeEditor/CodeEditorField.jsx b/awx/ui_next/src/components/CodeEditor/CodeEditorField.js similarity index 100% rename from awx/ui_next/src/components/CodeEditor/CodeEditorField.jsx rename to awx/ui_next/src/components/CodeEditor/CodeEditorField.js diff --git a/awx/ui_next/src/components/CodeEditor/VariablesDetail.jsx b/awx/ui_next/src/components/CodeEditor/VariablesDetail.js similarity index 98% rename from awx/ui_next/src/components/CodeEditor/VariablesDetail.jsx rename to awx/ui_next/src/components/CodeEditor/VariablesDetail.js index 55c0fa1883..bd1926b5ea 100644 --- a/awx/ui_next/src/components/CodeEditor/VariablesDetail.jsx +++ b/awx/ui_next/src/components/CodeEditor/VariablesDetail.js @@ -11,15 +11,10 @@ import { Modal, } from '@patternfly/react-core'; import { ExpandArrowsAltIcon } from '@patternfly/react-icons'; +import { yamlToJson, jsonToYaml, isJsonObject, isJsonString } from 'util/yaml'; import { DetailName, DetailValue } from '../DetailList'; import MultiButtonToggle from '../MultiButtonToggle'; import Popover from '../Popover'; -import { - yamlToJson, - jsonToYaml, - isJsonObject, - isJsonString, -} from '../../util/yaml'; import CodeEditor from './CodeEditor'; import { JSON_MODE, YAML_MODE } from './constants'; diff --git a/awx/ui_next/src/components/CodeEditor/VariablesDetail.test.jsx b/awx/ui_next/src/components/CodeEditor/VariablesDetail.test.js similarity index 100% rename from awx/ui_next/src/components/CodeEditor/VariablesDetail.test.jsx rename to awx/ui_next/src/components/CodeEditor/VariablesDetail.test.js diff --git a/awx/ui_next/src/components/CodeEditor/VariablesField.jsx b/awx/ui_next/src/components/CodeEditor/VariablesField.js similarity index 98% rename from awx/ui_next/src/components/CodeEditor/VariablesField.jsx rename to awx/ui_next/src/components/CodeEditor/VariablesField.js index 71b1dc8581..41942d1643 100644 --- a/awx/ui_next/src/components/CodeEditor/VariablesField.jsx +++ b/awx/ui_next/src/components/CodeEditor/VariablesField.js @@ -6,9 +6,9 @@ import { useField } from 'formik'; import styled from 'styled-components'; import { Split, SplitItem, Button, Modal } from '@patternfly/react-core'; import { ExpandArrowsAltIcon } from '@patternfly/react-icons'; +import { yamlToJson, jsonToYaml, isJsonString } from 'util/yaml'; import { CheckboxField } from '../FormField'; import MultiButtonToggle from '../MultiButtonToggle'; -import { yamlToJson, jsonToYaml, isJsonString } from '../../util/yaml'; import CodeEditor from './CodeEditor'; import Popover from '../Popover'; import { JSON_MODE, YAML_MODE } from './constants'; diff --git a/awx/ui_next/src/components/CodeEditor/VariablesField.test.jsx b/awx/ui_next/src/components/CodeEditor/VariablesField.test.js similarity index 100% rename from awx/ui_next/src/components/CodeEditor/VariablesField.test.jsx rename to awx/ui_next/src/components/CodeEditor/VariablesField.test.js diff --git a/awx/ui_next/src/components/CodeEditor/VariablesInput.jsx b/awx/ui_next/src/components/CodeEditor/VariablesInput.js similarity index 97% rename from awx/ui_next/src/components/CodeEditor/VariablesInput.jsx rename to awx/ui_next/src/components/CodeEditor/VariablesInput.js index 09c68a7247..c75f6df519 100644 --- a/awx/ui_next/src/components/CodeEditor/VariablesInput.jsx +++ b/awx/ui_next/src/components/CodeEditor/VariablesInput.js @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { string, func, bool, number } from 'prop-types'; import { Split, SplitItem } from '@patternfly/react-core'; import styled from 'styled-components'; -import { yamlToJson, jsonToYaml, isJsonString } from '../../util/yaml'; +import { yamlToJson, jsonToYaml, isJsonString } from 'util/yaml'; import MultiButtonToggle from '../MultiButtonToggle'; import CodeEditor from './CodeEditor'; import { JSON_MODE, YAML_MODE } from './constants'; diff --git a/awx/ui_next/src/components/ContentEmpty/ContentEmpty.jsx b/awx/ui_next/src/components/ContentEmpty/ContentEmpty.js similarity index 100% rename from awx/ui_next/src/components/ContentEmpty/ContentEmpty.jsx rename to awx/ui_next/src/components/ContentEmpty/ContentEmpty.js diff --git a/awx/ui_next/src/components/ContentEmpty/ContentEmpty.test.jsx b/awx/ui_next/src/components/ContentEmpty/ContentEmpty.test.js similarity index 100% rename from awx/ui_next/src/components/ContentEmpty/ContentEmpty.test.jsx rename to awx/ui_next/src/components/ContentEmpty/ContentEmpty.test.js diff --git a/awx/ui_next/src/components/ContentError/ContentError.jsx b/awx/ui_next/src/components/ContentError/ContentError.js similarity index 97% rename from awx/ui_next/src/components/ContentError/ContentError.jsx rename to awx/ui_next/src/components/ContentError/ContentError.js index 6ac256ec26..ef05510898 100644 --- a/awx/ui_next/src/components/ContentError/ContentError.jsx +++ b/awx/ui_next/src/components/ContentError/ContentError.js @@ -10,7 +10,7 @@ import { EmptyStateBody, } from '@patternfly/react-core'; import { ExclamationTriangleIcon } from '@patternfly/react-icons'; -import { useSession } from '../../contexts/Session'; +import { useSession } from 'contexts/Session'; import ErrorDetail from '../ErrorDetail'; function ContentError({ error, children, isNotFound }) { diff --git a/awx/ui_next/src/components/ContentError/ContentError.test.jsx b/awx/ui_next/src/components/ContentError/ContentError.test.js similarity index 100% rename from awx/ui_next/src/components/ContentError/ContentError.test.jsx rename to awx/ui_next/src/components/ContentError/ContentError.test.js diff --git a/awx/ui_next/src/components/ContentLoading/ContentLoading.jsx b/awx/ui_next/src/components/ContentLoading/ContentLoading.js similarity index 100% rename from awx/ui_next/src/components/ContentLoading/ContentLoading.jsx rename to awx/ui_next/src/components/ContentLoading/ContentLoading.js diff --git a/awx/ui_next/src/components/ContentLoading/ContentLoading.test.jsx b/awx/ui_next/src/components/ContentLoading/ContentLoading.test.js similarity index 100% rename from awx/ui_next/src/components/ContentLoading/ContentLoading.test.jsx rename to awx/ui_next/src/components/ContentLoading/ContentLoading.test.js diff --git a/awx/ui_next/src/components/CopyButton/CopyButton.jsx b/awx/ui_next/src/components/CopyButton/CopyButton.js similarity index 95% rename from awx/ui_next/src/components/CopyButton/CopyButton.jsx rename to awx/ui_next/src/components/CopyButton/CopyButton.js index 6923ee16f0..a6caa26a7e 100644 --- a/awx/ui_next/src/components/CopyButton/CopyButton.jsx +++ b/awx/ui_next/src/components/CopyButton/CopyButton.js @@ -3,7 +3,7 @@ import { t } from '@lingui/macro'; import PropTypes from 'prop-types'; import { Button } from '@patternfly/react-core'; import { CopyIcon } from '@patternfly/react-icons'; -import useRequest, { useDismissableError } from '../../util/useRequest'; +import useRequest, { useDismissableError } from 'hooks/useRequest'; import AlertModal from '../AlertModal'; import ErrorDetail from '../ErrorDetail'; diff --git a/awx/ui_next/src/components/CopyButton/CopyButton.test.jsx b/awx/ui_next/src/components/CopyButton/CopyButton.test.js similarity index 100% rename from awx/ui_next/src/components/CopyButton/CopyButton.test.jsx rename to awx/ui_next/src/components/CopyButton/CopyButton.test.js diff --git a/awx/ui_next/src/components/CredentialChip/CredentialChip.jsx b/awx/ui_next/src/components/CredentialChip/CredentialChip.js similarity index 90% rename from awx/ui_next/src/components/CredentialChip/CredentialChip.jsx rename to awx/ui_next/src/components/CredentialChip/CredentialChip.js index 04f7894730..0c4780ced6 100644 --- a/awx/ui_next/src/components/CredentialChip/CredentialChip.jsx +++ b/awx/ui_next/src/components/CredentialChip/CredentialChip.js @@ -2,8 +2,8 @@ import React from 'react'; import { t } from '@lingui/macro'; import { Chip } from '@patternfly/react-core'; -import { Credential } from '../../types'; -import { toTitleCase } from '../../util/strings'; +import { Credential } from 'types'; +import { toTitleCase } from 'util/strings'; function CredentialChip({ credential, ...props }) { let type; diff --git a/awx/ui_next/src/components/CredentialChip/CredentialChip.test.jsx b/awx/ui_next/src/components/CredentialChip/CredentialChip.test.js similarity index 100% rename from awx/ui_next/src/components/CredentialChip/CredentialChip.test.jsx rename to awx/ui_next/src/components/CredentialChip/CredentialChip.test.js diff --git a/awx/ui_next/src/components/DataListToolbar/DataListToolbar.jsx b/awx/ui_next/src/components/DataListToolbar/DataListToolbar.js similarity index 98% rename from awx/ui_next/src/components/DataListToolbar/DataListToolbar.jsx rename to awx/ui_next/src/components/DataListToolbar/DataListToolbar.js index 57f135d05c..92c33625aa 100644 --- a/awx/ui_next/src/components/DataListToolbar/DataListToolbar.jsx +++ b/awx/ui_next/src/components/DataListToolbar/DataListToolbar.js @@ -20,11 +20,11 @@ import { AngleRightIcon, SearchIcon, } from '@patternfly/react-icons'; +import { SearchColumns, SortColumns, QSConfig } from 'types'; +import { KebabifiedProvider } from 'contexts/Kebabified'; import ExpandCollapse from '../ExpandCollapse'; import Search from '../Search'; import Sort from '../Sort'; -import { SearchColumns, SortColumns, QSConfig } from '../../types'; -import { KebabifiedProvider } from '../../contexts/Kebabified'; const ToolbarContent = styled(PFToolbarContent)` & > .pf-c-toolbar__content-section { diff --git a/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx b/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.js similarity index 100% rename from awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx rename to awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.js diff --git a/awx/ui_next/src/components/DeleteButton/DeleteButton.jsx b/awx/ui_next/src/components/DeleteButton/DeleteButton.js similarity index 97% rename from awx/ui_next/src/components/DeleteButton/DeleteButton.jsx rename to awx/ui_next/src/components/DeleteButton/DeleteButton.js index 24a7f24fd5..fef07fb892 100644 --- a/awx/ui_next/src/components/DeleteButton/DeleteButton.jsx +++ b/awx/ui_next/src/components/DeleteButton/DeleteButton.js @@ -4,8 +4,8 @@ import PropTypes from 'prop-types'; import { t } from '@lingui/macro'; import styled from 'styled-components'; import { Button, Badge, Alert, Tooltip } from '@patternfly/react-core'; +import { getRelatedResourceDeleteCounts } from 'util/getRelatedResourceDeleteDetails'; import AlertModal from '../AlertModal'; -import { getRelatedResourceDeleteCounts } from '../../util/getRelatedResourceDeleteDetails'; import ErrorDetail from '../ErrorDetail'; const WarningMessage = styled(Alert)` diff --git a/awx/ui_next/src/components/DeleteButton/DeleteButton.test.jsx b/awx/ui_next/src/components/DeleteButton/DeleteButton.test.js similarity index 98% rename from awx/ui_next/src/components/DeleteButton/DeleteButton.test.jsx rename to awx/ui_next/src/components/DeleteButton/DeleteButton.test.js index 966fd9b74b..18f9f47126 100644 --- a/awx/ui_next/src/components/DeleteButton/DeleteButton.test.jsx +++ b/awx/ui_next/src/components/DeleteButton/DeleteButton.test.js @@ -1,10 +1,10 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; +import { CredentialsAPI } from 'api'; import { mountWithContexts, waitForElement, } from '../../../testUtils/enzymeHelpers'; -import { CredentialsAPI } from '../../api'; import DeleteButton from './DeleteButton'; jest.mock('../../api'); diff --git a/awx/ui_next/src/components/DetailList/ArrayDetail.jsx b/awx/ui_next/src/components/DetailList/ArrayDetail.js similarity index 100% rename from awx/ui_next/src/components/DetailList/ArrayDetail.jsx rename to awx/ui_next/src/components/DetailList/ArrayDetail.js diff --git a/awx/ui_next/src/components/DetailList/CodeDetail.jsx b/awx/ui_next/src/components/DetailList/CodeDetail.js similarity index 100% rename from awx/ui_next/src/components/DetailList/CodeDetail.jsx rename to awx/ui_next/src/components/DetailList/CodeDetail.js diff --git a/awx/ui_next/src/components/DetailList/DeletedDetail.jsx b/awx/ui_next/src/components/DetailList/DeletedDetail.js similarity index 100% rename from awx/ui_next/src/components/DetailList/DeletedDetail.jsx rename to awx/ui_next/src/components/DetailList/DeletedDetail.js diff --git a/awx/ui_next/src/components/DetailList/Detail.jsx b/awx/ui_next/src/components/DetailList/Detail.js similarity index 100% rename from awx/ui_next/src/components/DetailList/Detail.jsx rename to awx/ui_next/src/components/DetailList/Detail.js diff --git a/awx/ui_next/src/components/DetailList/Detail.test.jsx b/awx/ui_next/src/components/DetailList/Detail.test.js similarity index 100% rename from awx/ui_next/src/components/DetailList/Detail.test.jsx rename to awx/ui_next/src/components/DetailList/Detail.test.js diff --git a/awx/ui_next/src/components/DetailList/DetailBadge.jsx b/awx/ui_next/src/components/DetailList/DetailBadge.js similarity index 100% rename from awx/ui_next/src/components/DetailList/DetailBadge.jsx rename to awx/ui_next/src/components/DetailList/DetailBadge.js diff --git a/awx/ui_next/src/components/DetailList/DetailList.jsx b/awx/ui_next/src/components/DetailList/DetailList.js similarity index 100% rename from awx/ui_next/src/components/DetailList/DetailList.jsx rename to awx/ui_next/src/components/DetailList/DetailList.js diff --git a/awx/ui_next/src/components/DetailList/DetailList.test.jsx b/awx/ui_next/src/components/DetailList/DetailList.test.js similarity index 100% rename from awx/ui_next/src/components/DetailList/DetailList.test.jsx rename to awx/ui_next/src/components/DetailList/DetailList.test.js diff --git a/awx/ui_next/src/components/DetailList/LaunchedByDetail.jsx b/awx/ui_next/src/components/DetailList/LaunchedByDetail.js similarity index 100% rename from awx/ui_next/src/components/DetailList/LaunchedByDetail.jsx rename to awx/ui_next/src/components/DetailList/LaunchedByDetail.js diff --git a/awx/ui_next/src/components/DetailList/NumberSinceDetail.jsx b/awx/ui_next/src/components/DetailList/NumberSinceDetail.js similarity index 92% rename from awx/ui_next/src/components/DetailList/NumberSinceDetail.jsx rename to awx/ui_next/src/components/DetailList/NumberSinceDetail.js index 6f58783fea..66a8e03726 100644 --- a/awx/ui_next/src/components/DetailList/NumberSinceDetail.jsx +++ b/awx/ui_next/src/components/DetailList/NumberSinceDetail.js @@ -2,7 +2,7 @@ import React from 'react'; import { node, string } from 'prop-types'; import { t } from '@lingui/macro'; import styled from 'styled-components'; -import { formatDateString } from '../../util/dates'; +import { formatDateString } from 'util/dates'; import _Detail from './Detail'; const Detail = styled(_Detail)` diff --git a/awx/ui_next/src/components/DetailList/UserDateDetail.jsx b/awx/ui_next/src/components/DetailList/UserDateDetail.js similarity index 89% rename from awx/ui_next/src/components/DetailList/UserDateDetail.jsx rename to awx/ui_next/src/components/DetailList/UserDateDetail.js index 29826175c5..ca42adde3c 100644 --- a/awx/ui_next/src/components/DetailList/UserDateDetail.jsx +++ b/awx/ui_next/src/components/DetailList/UserDateDetail.js @@ -3,9 +3,9 @@ import { node, string } from 'prop-types'; import { Trans } from '@lingui/macro'; import { Link } from 'react-router-dom'; import styled from 'styled-components'; -import { formatDateString } from '../../util/dates'; +import { formatDateString } from 'util/dates'; +import { SummaryFieldUser } from 'types'; import _Detail from './Detail'; -import { SummaryFieldUser } from '../../types'; const Detail = styled(_Detail)` word-break: break-word; diff --git a/awx/ui_next/src/components/DisassociateButton/DisassociateButton.jsx b/awx/ui_next/src/components/DisassociateButton/DisassociateButton.js similarity index 98% rename from awx/ui_next/src/components/DisassociateButton/DisassociateButton.jsx rename to awx/ui_next/src/components/DisassociateButton/DisassociateButton.js index 697dc6b304..17b2a9b157 100644 --- a/awx/ui_next/src/components/DisassociateButton/DisassociateButton.jsx +++ b/awx/ui_next/src/components/DisassociateButton/DisassociateButton.js @@ -4,7 +4,7 @@ import { arrayOf, func, shape, string, oneOfType, number } from 'prop-types'; import { t } from '@lingui/macro'; import { Button, Tooltip, DropdownItem } from '@patternfly/react-core'; import styled from 'styled-components'; -import { KebabifiedContext } from '../../contexts/Kebabified'; +import { KebabifiedContext } from 'contexts/Kebabified'; import AlertModal from '../AlertModal'; diff --git a/awx/ui_next/src/components/DisassociateButton/DisassociateButton.test.jsx b/awx/ui_next/src/components/DisassociateButton/DisassociateButton.test.js similarity index 100% rename from awx/ui_next/src/components/DisassociateButton/DisassociateButton.test.jsx rename to awx/ui_next/src/components/DisassociateButton/DisassociateButton.test.js diff --git a/awx/ui_next/src/components/DocsLink/DocsLink.jsx b/awx/ui_next/src/components/DocsLink/DocsLink.js similarity index 100% rename from awx/ui_next/src/components/DocsLink/DocsLink.jsx rename to awx/ui_next/src/components/DocsLink/DocsLink.js diff --git a/awx/ui_next/src/components/DocsLink/index.jsx b/awx/ui_next/src/components/DocsLink/index.js similarity index 100% rename from awx/ui_next/src/components/DocsLink/index.jsx rename to awx/ui_next/src/components/DocsLink/index.js diff --git a/awx/ui_next/src/components/ErrorDetail/ErrorDetail.jsx b/awx/ui_next/src/components/ErrorDetail/ErrorDetail.js similarity index 100% rename from awx/ui_next/src/components/ErrorDetail/ErrorDetail.jsx rename to awx/ui_next/src/components/ErrorDetail/ErrorDetail.js diff --git a/awx/ui_next/src/components/ErrorDetail/ErrorDetail.test.jsx b/awx/ui_next/src/components/ErrorDetail/ErrorDetail.test.js similarity index 100% rename from awx/ui_next/src/components/ErrorDetail/ErrorDetail.test.jsx rename to awx/ui_next/src/components/ErrorDetail/ErrorDetail.test.js diff --git a/awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.jsx b/awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.js similarity index 95% rename from awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.jsx rename to awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.js index 7a1f26724c..d59097310f 100644 --- a/awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.jsx +++ b/awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.js @@ -5,10 +5,10 @@ import { t, Trans } from '@lingui/macro'; import { Popover, Tooltip } from '@patternfly/react-core'; import styled from 'styled-components'; import { ExclamationTriangleIcon as PFExclamationTriangleIcon } from '@patternfly/react-icons'; +import { ExecutionEnvironment } from 'types'; +import getDocsBaseUrl from 'util/getDocsBaseUrl'; +import { useConfig } from 'contexts/Config'; import { Detail } from '../DetailList'; -import { ExecutionEnvironment } from '../../types'; -import getDocsBaseUrl from '../../util/getDocsBaseUrl'; -import { useConfig } from '../../contexts/Config'; const ExclamationTriangleIcon = styled(PFExclamationTriangleIcon)` color: var(--pf-global--warning-color--100); diff --git a/awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.test.jsx b/awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.test.js similarity index 100% rename from awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.test.jsx rename to awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.test.js diff --git a/awx/ui_next/src/components/ExpandCollapse/ExpandCollapse.jsx b/awx/ui_next/src/components/ExpandCollapse/ExpandCollapse.js similarity index 100% rename from awx/ui_next/src/components/ExpandCollapse/ExpandCollapse.jsx rename to awx/ui_next/src/components/ExpandCollapse/ExpandCollapse.js diff --git a/awx/ui_next/src/components/ExpandCollapse/ExpandCollapse.test.jsx b/awx/ui_next/src/components/ExpandCollapse/ExpandCollapse.test.js similarity index 100% rename from awx/ui_next/src/components/ExpandCollapse/ExpandCollapse.test.jsx rename to awx/ui_next/src/components/ExpandCollapse/ExpandCollapse.test.js diff --git a/awx/ui_next/src/components/FieldWithPrompt/FieldWithPrompt.jsx b/awx/ui_next/src/components/FieldWithPrompt/FieldWithPrompt.js similarity index 100% rename from awx/ui_next/src/components/FieldWithPrompt/FieldWithPrompt.jsx rename to awx/ui_next/src/components/FieldWithPrompt/FieldWithPrompt.js diff --git a/awx/ui_next/src/components/FieldWithPrompt/FieldWithPrompt.test.jsx b/awx/ui_next/src/components/FieldWithPrompt/FieldWithPrompt.test.js similarity index 100% rename from awx/ui_next/src/components/FieldWithPrompt/FieldWithPrompt.test.jsx rename to awx/ui_next/src/components/FieldWithPrompt/FieldWithPrompt.test.js diff --git a/awx/ui_next/src/components/FormActionGroup/FormActionGroup.jsx b/awx/ui_next/src/components/FormActionGroup/FormActionGroup.js similarity index 100% rename from awx/ui_next/src/components/FormActionGroup/FormActionGroup.jsx rename to awx/ui_next/src/components/FormActionGroup/FormActionGroup.js diff --git a/awx/ui_next/src/components/FormActionGroup/FormActionGroup.test.jsx b/awx/ui_next/src/components/FormActionGroup/FormActionGroup.test.js similarity index 100% rename from awx/ui_next/src/components/FormActionGroup/FormActionGroup.test.jsx rename to awx/ui_next/src/components/FormActionGroup/FormActionGroup.test.js diff --git a/awx/ui_next/src/components/FormField/ArrayTextField.jsx b/awx/ui_next/src/components/FormField/ArrayTextField.js similarity index 100% rename from awx/ui_next/src/components/FormField/ArrayTextField.jsx rename to awx/ui_next/src/components/FormField/ArrayTextField.js diff --git a/awx/ui_next/src/components/FormField/CheckboxField.jsx b/awx/ui_next/src/components/FormField/CheckboxField.js similarity index 100% rename from awx/ui_next/src/components/FormField/CheckboxField.jsx rename to awx/ui_next/src/components/FormField/CheckboxField.js diff --git a/awx/ui_next/src/components/FormField/FormField.jsx b/awx/ui_next/src/components/FormField/FormField.js similarity index 100% rename from awx/ui_next/src/components/FormField/FormField.jsx rename to awx/ui_next/src/components/FormField/FormField.js diff --git a/awx/ui_next/src/components/FormField/FormSubmitError.jsx b/awx/ui_next/src/components/FormField/FormSubmitError.js similarity index 100% rename from awx/ui_next/src/components/FormField/FormSubmitError.jsx rename to awx/ui_next/src/components/FormField/FormSubmitError.js diff --git a/awx/ui_next/src/components/FormField/FormSubmitError.test.jsx b/awx/ui_next/src/components/FormField/FormSubmitError.test.js similarity index 100% rename from awx/ui_next/src/components/FormField/FormSubmitError.test.jsx rename to awx/ui_next/src/components/FormField/FormSubmitError.test.js diff --git a/awx/ui_next/src/components/FormField/PasswordField.jsx b/awx/ui_next/src/components/FormField/PasswordField.js similarity index 100% rename from awx/ui_next/src/components/FormField/PasswordField.jsx rename to awx/ui_next/src/components/FormField/PasswordField.js diff --git a/awx/ui_next/src/components/FormField/PasswordField.test.jsx b/awx/ui_next/src/components/FormField/PasswordField.test.js similarity index 100% rename from awx/ui_next/src/components/FormField/PasswordField.test.jsx rename to awx/ui_next/src/components/FormField/PasswordField.test.js diff --git a/awx/ui_next/src/components/FormField/PasswordInput.jsx b/awx/ui_next/src/components/FormField/PasswordInput.js similarity index 100% rename from awx/ui_next/src/components/FormField/PasswordInput.jsx rename to awx/ui_next/src/components/FormField/PasswordInput.js diff --git a/awx/ui_next/src/components/FormField/PasswordInput.test.jsx b/awx/ui_next/src/components/FormField/PasswordInput.test.js similarity index 100% rename from awx/ui_next/src/components/FormField/PasswordInput.test.jsx rename to awx/ui_next/src/components/FormField/PasswordInput.test.js diff --git a/awx/ui_next/src/components/FormLayout/FormLayout.jsx b/awx/ui_next/src/components/FormLayout/FormLayout.js similarity index 100% rename from awx/ui_next/src/components/FormLayout/FormLayout.jsx rename to awx/ui_next/src/components/FormLayout/FormLayout.js diff --git a/awx/ui_next/src/components/FullPage/FullPage.jsx b/awx/ui_next/src/components/FullPage/FullPage.js similarity index 100% rename from awx/ui_next/src/components/FullPage/FullPage.jsx rename to awx/ui_next/src/components/FullPage/FullPage.js diff --git a/awx/ui_next/src/components/HostForm/HostForm.jsx b/awx/ui_next/src/components/HostForm/HostForm.js similarity index 98% rename from awx/ui_next/src/components/HostForm/HostForm.jsx rename to awx/ui_next/src/components/HostForm/HostForm.js index fb8f231262..d7b358d5c0 100644 --- a/awx/ui_next/src/components/HostForm/HostForm.jsx +++ b/awx/ui_next/src/components/HostForm/HostForm.js @@ -3,13 +3,13 @@ import { bool, func, shape } from 'prop-types'; import { Formik, useField, useFormikContext } from 'formik'; import { t } from '@lingui/macro'; import { Form, FormGroup, Tooltip } from '@patternfly/react-core'; +import { required } from 'util/validators'; import FormField, { FormSubmitError } from '../FormField'; import FormActionGroup from '../FormActionGroup/FormActionGroup'; import { VariablesField } from '../CodeEditor'; import { InventoryLookup } from '../Lookup'; import { FormColumnLayout, FormFullWidthLayout } from '../FormLayout'; import Popover from '../Popover'; -import { required } from '../../util/validators'; const InventoryLookupField = ({ isDisabled }) => { const { setFieldValue, setFieldTouched } = useFormikContext(); diff --git a/awx/ui_next/src/components/HostForm/HostForm.test.jsx b/awx/ui_next/src/components/HostForm/HostForm.test.js similarity index 100% rename from awx/ui_next/src/components/HostForm/HostForm.test.jsx rename to awx/ui_next/src/components/HostForm/HostForm.test.js diff --git a/awx/ui_next/src/components/HostToggle/HostToggle.jsx b/awx/ui_next/src/components/HostToggle/HostToggle.js similarity index 96% rename from awx/ui_next/src/components/HostToggle/HostToggle.jsx rename to awx/ui_next/src/components/HostToggle/HostToggle.js index 4a7b03d55a..1085f5659d 100644 --- a/awx/ui_next/src/components/HostToggle/HostToggle.jsx +++ b/awx/ui_next/src/components/HostToggle/HostToggle.js @@ -3,10 +3,10 @@ import React, { Fragment, useState, useEffect, useCallback } from 'react'; import { t } from '@lingui/macro'; import { Switch, Tooltip } from '@patternfly/react-core'; +import useRequest from 'hooks/useRequest'; +import { HostsAPI } from 'api'; import AlertModal from '../AlertModal'; import ErrorDetail from '../ErrorDetail'; -import useRequest from '../../util/useRequest'; -import { HostsAPI } from '../../api'; function HostToggle({ className, diff --git a/awx/ui_next/src/components/HostToggle/HostToggle.test.jsx b/awx/ui_next/src/components/HostToggle/HostToggle.test.js similarity index 98% rename from awx/ui_next/src/components/HostToggle/HostToggle.test.jsx rename to awx/ui_next/src/components/HostToggle/HostToggle.test.js index 7391036bf2..6c211f7bde 100644 --- a/awx/ui_next/src/components/HostToggle/HostToggle.test.jsx +++ b/awx/ui_next/src/components/HostToggle/HostToggle.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { HostsAPI } from '../../api'; +import { HostsAPI } from 'api'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import HostToggle from './HostToggle'; diff --git a/awx/ui_next/src/components/InstanceToggle/InstanceToggle.jsx b/awx/ui_next/src/components/InstanceToggle/InstanceToggle.js similarity index 93% rename from awx/ui_next/src/components/InstanceToggle/InstanceToggle.jsx rename to awx/ui_next/src/components/InstanceToggle/InstanceToggle.js index 7865d2d312..9ff2f6ec8f 100644 --- a/awx/ui_next/src/components/InstanceToggle/InstanceToggle.jsx +++ b/awx/ui_next/src/components/InstanceToggle/InstanceToggle.js @@ -2,11 +2,11 @@ import React, { useState, useEffect, useCallback } from 'react'; import { t } from '@lingui/macro'; import { Switch, Tooltip } from '@patternfly/react-core'; -import AlertModal from '../AlertModal'; +import useRequest from 'hooks/useRequest'; +import { InstancesAPI } from 'api'; +import { useConfig } from 'contexts/Config'; import ErrorDetail from '../ErrorDetail'; -import useRequest from '../../util/useRequest'; -import { InstancesAPI } from '../../api'; -import { useConfig } from '../../contexts/Config'; +import AlertModal from '../AlertModal'; function InstanceToggle({ className, fetchInstances, instance, onToggle }) { const { me = {} } = useConfig(); diff --git a/awx/ui_next/src/components/InstanceToggle/InstanceToggle.test.jsx b/awx/ui_next/src/components/InstanceToggle/InstanceToggle.test.js similarity index 98% rename from awx/ui_next/src/components/InstanceToggle/InstanceToggle.test.jsx rename to awx/ui_next/src/components/InstanceToggle/InstanceToggle.test.js index 6ac9dbda7e..bb5ad02065 100644 --- a/awx/ui_next/src/components/InstanceToggle/InstanceToggle.test.jsx +++ b/awx/ui_next/src/components/InstanceToggle/InstanceToggle.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { InstancesAPI } from '../../api'; +import { InstancesAPI } from 'api'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import InstanceToggle from './InstanceToggle'; diff --git a/awx/ui_next/src/components/JobCancelButton/JobCancelButton.jsx b/awx/ui_next/src/components/JobCancelButton/JobCancelButton.js similarity index 95% rename from awx/ui_next/src/components/JobCancelButton/JobCancelButton.jsx rename to awx/ui_next/src/components/JobCancelButton/JobCancelButton.js index b9098836e5..beab662f81 100644 --- a/awx/ui_next/src/components/JobCancelButton/JobCancelButton.jsx +++ b/awx/ui_next/src/components/JobCancelButton/JobCancelButton.js @@ -2,8 +2,8 @@ import React, { useCallback, useState } from 'react'; import { t } from '@lingui/macro'; import { MinusCircleIcon } from '@patternfly/react-icons'; import { Button, Tooltip } from '@patternfly/react-core'; -import { getJobModel } from '../../util/jobs'; -import useRequest, { useDismissableError } from '../../util/useRequest'; +import { getJobModel } from 'util/jobs'; +import useRequest, { useDismissableError } from 'hooks/useRequest'; import AlertModal from '../AlertModal'; import ErrorDetail from '../ErrorDetail'; diff --git a/awx/ui_next/src/components/JobCancelButton/JobCancelButton.test.jsx b/awx/ui_next/src/components/JobCancelButton/JobCancelButton.test.js similarity index 99% rename from awx/ui_next/src/components/JobCancelButton/JobCancelButton.test.jsx rename to awx/ui_next/src/components/JobCancelButton/JobCancelButton.test.js index dd98838ac2..8c381e021c 100644 --- a/awx/ui_next/src/components/JobCancelButton/JobCancelButton.test.jsx +++ b/awx/ui_next/src/components/JobCancelButton/JobCancelButton.test.js @@ -6,7 +6,7 @@ import { SystemJobsAPI, WorkflowJobsAPI, JobsAPI, -} from '../../api'; +} from 'api'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import JobCancelButton from './JobCancelButton'; diff --git a/awx/ui_next/src/components/JobList/JobList.jsx b/awx/ui_next/src/components/JobList/JobList.js similarity index 96% rename from awx/ui_next/src/components/JobList/JobList.jsx rename to awx/ui_next/src/components/JobList/JobList.js index 83e8e8f851..c2c4c4606e 100644 --- a/awx/ui_next/src/components/JobList/JobList.jsx +++ b/awx/ui_next/src/components/JobList/JobList.js @@ -3,6 +3,16 @@ import { useLocation } from 'react-router-dom'; import { t, Plural } from '@lingui/macro'; import { Card } from '@patternfly/react-core'; +import useRequest, { + useDeleteItems, + useDismissableError, +} from 'hooks/useRequest'; +import { useConfig } from 'contexts/Config'; +import useSelected from 'hooks/useSelected'; +import useExpanded from 'hooks/useExpanded'; +import { isJobRunning, getJobModel } from 'util/jobs'; +import { getQSConfig, parseQueryString } from 'util/qs'; +import { UnifiedJobsAPI } from 'api'; import AlertModal from '../AlertModal'; import DatalistToolbar from '../DataListToolbar'; import ErrorDetail from '../ErrorDetail'; @@ -11,19 +21,9 @@ import PaginatedTable, { HeaderCell, ToolbarDeleteButton, } from '../PaginatedTable'; -import useRequest, { - useDeleteItems, - useDismissableError, -} from '../../util/useRequest'; -import { useConfig } from '../../contexts/Config'; -import useSelected from '../../util/useSelected'; -import useExpanded from '../../util/useExpanded'; -import { isJobRunning, getJobModel } from '../../util/jobs'; -import { getQSConfig, parseQueryString } from '../../util/qs'; import JobListItem from './JobListItem'; import JobListCancelButton from './JobListCancelButton'; import useWsJobs from './useWsJobs'; -import { UnifiedJobsAPI } from '../../api'; function JobList({ defaultParams, showTypeColumn = false }) { const qsConfig = getQSConfig( diff --git a/awx/ui_next/src/components/JobList/JobList.test.jsx b/awx/ui_next/src/components/JobList/JobList.test.js similarity index 99% rename from awx/ui_next/src/components/JobList/JobList.test.jsx rename to awx/ui_next/src/components/JobList/JobList.test.js index 494c8614db..36b8bd9054 100644 --- a/awx/ui_next/src/components/JobList/JobList.test.jsx +++ b/awx/ui_next/src/components/JobList/JobList.test.js @@ -1,9 +1,5 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { - mountWithContexts, - waitForElement, -} from '../../../testUtils/enzymeHelpers'; import { AdHocCommandsAPI, InventoryUpdatesAPI, @@ -12,7 +8,11 @@ import { SystemJobsAPI, UnifiedJobsAPI, WorkflowJobsAPI, -} from '../../api'; +} from 'api'; +import { + mountWithContexts, + waitForElement, +} from '../../../testUtils/enzymeHelpers'; import JobList from './JobList'; jest.mock('../../api'); diff --git a/awx/ui_next/src/components/JobList/JobListCancelButton.jsx b/awx/ui_next/src/components/JobList/JobListCancelButton.js similarity index 97% rename from awx/ui_next/src/components/JobList/JobListCancelButton.jsx rename to awx/ui_next/src/components/JobList/JobListCancelButton.js index 225acadf45..05eebaa7cc 100644 --- a/awx/ui_next/src/components/JobList/JobListCancelButton.jsx +++ b/awx/ui_next/src/components/JobList/JobListCancelButton.js @@ -3,10 +3,10 @@ import React, { useContext, useEffect, useState } from 'react'; import { t, Plural } from '@lingui/macro'; import { arrayOf, func } from 'prop-types'; import { Button, DropdownItem, Tooltip } from '@patternfly/react-core'; -import { KebabifiedContext } from '../../contexts/Kebabified'; -import { isJobRunning } from '../../util/jobs'; +import { KebabifiedContext } from 'contexts/Kebabified'; +import { isJobRunning } from 'util/jobs'; +import { Job } from 'types'; import AlertModal from '../AlertModal'; -import { Job } from '../../types'; function cannotCancelBecausePermissions(job) { return ( diff --git a/awx/ui_next/src/components/JobList/JobListCancelButton.test.jsx b/awx/ui_next/src/components/JobList/JobListCancelButton.test.js similarity index 100% rename from awx/ui_next/src/components/JobList/JobListCancelButton.test.jsx rename to awx/ui_next/src/components/JobList/JobListCancelButton.test.js diff --git a/awx/ui_next/src/components/JobList/JobListItem.jsx b/awx/ui_next/src/components/JobList/JobListItem.js similarity index 98% rename from awx/ui_next/src/components/JobList/JobListItem.jsx rename to awx/ui_next/src/components/JobList/JobListItem.js index 22edb4b8b1..2dfb741c31 100644 --- a/awx/ui_next/src/components/JobList/JobListItem.jsx +++ b/awx/ui_next/src/components/JobList/JobListItem.js @@ -6,6 +6,8 @@ import { Button, Chip } from '@patternfly/react-core'; import { Tr, Td, ExpandableRowContent } from '@patternfly/react-table'; import { RocketIcon } from '@patternfly/react-icons'; import styled from 'styled-components'; +import { formatDateString } from 'util/dates'; +import { isJobRunning } from 'util/jobs'; import { ActionsTd, ActionItem } from '../PaginatedTable'; import { LaunchButton, ReLaunchDropDown } from '../LaunchButton'; import StatusLabel from '../StatusLabel'; @@ -13,8 +15,6 @@ import { DetailList, Detail, LaunchedByDetail } from '../DetailList'; import ChipGroup from '../ChipGroup'; import CredentialChip from '../CredentialChip'; import ExecutionEnvironmentDetail from '../ExecutionEnvironmentDetail'; -import { formatDateString } from '../../util/dates'; -import { isJobRunning } from '../../util/jobs'; import { JOB_TYPE_URL_SEGMENTS } from '../../constants'; import JobCancelButton from '../JobCancelButton'; diff --git a/awx/ui_next/src/components/JobList/JobListItem.test.jsx b/awx/ui_next/src/components/JobList/JobListItem.test.js similarity index 100% rename from awx/ui_next/src/components/JobList/JobListItem.test.jsx rename to awx/ui_next/src/components/JobList/JobListItem.test.js diff --git a/awx/ui_next/src/components/JobList/useWsJobs.js b/awx/ui_next/src/components/JobList/useWsJobs.js index 4560930818..d1bd5a5ded 100644 --- a/awx/ui_next/src/components/JobList/useWsJobs.js +++ b/awx/ui_next/src/components/JobList/useWsJobs.js @@ -1,8 +1,8 @@ import { useState, useEffect } from 'react'; import { useLocation } from 'react-router-dom'; -import useWebsocket from '../../util/useWebsocket'; -import useThrottle from '../../util/useThrottle'; -import { parseQueryString } from '../../util/qs'; +import useWebsocket from 'hooks/useWebsocket'; +import useThrottle from 'hooks/useThrottle'; +import { parseQueryString } from 'util/qs'; import sortJobs from './sortJobs'; export default function useWsJobs(initialJobs, fetchJobsById, qsConfig) { diff --git a/awx/ui_next/src/components/JobList/useWsJobs.test.jsx b/awx/ui_next/src/components/JobList/useWsJobs.test.js similarity index 98% rename from awx/ui_next/src/components/JobList/useWsJobs.test.jsx rename to awx/ui_next/src/components/JobList/useWsJobs.test.js index f88e4c822f..3cc6dc1b72 100644 --- a/awx/ui_next/src/components/JobList/useWsJobs.test.jsx +++ b/awx/ui_next/src/components/JobList/useWsJobs.test.js @@ -21,7 +21,7 @@ describe('useWsJobs hook', () => { Jest mock timers don’t play well with jest-websocket-mock, so we'll stub out throttling to resolve immediately */ - jest.mock('../../util/useThrottle', () => ({ + jest.mock('../../hooks/useThrottle', () => ({ __esModule: true, default: jest.fn(val => val), })); diff --git a/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx b/awx/ui_next/src/components/LaunchButton/LaunchButton.js similarity index 99% rename from awx/ui_next/src/components/LaunchButton/LaunchButton.jsx rename to awx/ui_next/src/components/LaunchButton/LaunchButton.js index 16430d803c..cc839a45b9 100644 --- a/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx +++ b/awx/ui_next/src/components/LaunchButton/LaunchButton.js @@ -4,8 +4,6 @@ import { number, shape } from 'prop-types'; import { t } from '@lingui/macro'; -import AlertModal from '../AlertModal'; -import ErrorDetail from '../ErrorDetail'; import { AdHocCommandsAPI, InventorySourcesAPI, @@ -14,7 +12,9 @@ import { ProjectsAPI, WorkflowJobsAPI, WorkflowJobTemplatesAPI, -} from '../../api'; +} from 'api'; +import AlertModal from '../AlertModal'; +import ErrorDetail from '../ErrorDetail'; import LaunchPrompt from '../LaunchPrompt'; function canLaunchWithoutPrompt(launchData) { diff --git a/awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx b/awx/ui_next/src/components/LaunchButton/LaunchButton.test.js similarity index 99% rename from awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx rename to awx/ui_next/src/components/LaunchButton/LaunchButton.test.js index ccc02edc04..888523ce62 100644 --- a/awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx +++ b/awx/ui_next/src/components/LaunchButton/LaunchButton.test.js @@ -1,10 +1,6 @@ import React from 'react'; import { createMemoryHistory } from 'history'; import { act } from 'react-dom/test-utils'; -import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; -import { sleep } from '../../../testUtils/testUtils'; - -import LaunchButton from './LaunchButton'; import { InventorySourcesAPI, JobsAPI, @@ -12,7 +8,11 @@ import { ProjectsAPI, WorkflowJobsAPI, WorkflowJobTemplatesAPI, -} from '../../api'; +} from 'api'; +import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; +import { sleep } from '../../../testUtils/testUtils'; + +import LaunchButton from './LaunchButton'; jest.mock('../../api'); diff --git a/awx/ui_next/src/components/LaunchButton/ReLaunchDropDown.jsx b/awx/ui_next/src/components/LaunchButton/ReLaunchDropDown.js similarity index 100% rename from awx/ui_next/src/components/LaunchButton/ReLaunchDropDown.jsx rename to awx/ui_next/src/components/LaunchButton/ReLaunchDropDown.js diff --git a/awx/ui_next/src/components/LaunchButton/ReLaunchDropDown.test.jsx b/awx/ui_next/src/components/LaunchButton/ReLaunchDropDown.test.js similarity index 100% rename from awx/ui_next/src/components/LaunchButton/ReLaunchDropDown.test.jsx rename to awx/ui_next/src/components/LaunchButton/ReLaunchDropDown.test.js diff --git a/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.jsx b/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.js similarity index 95% rename from awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.jsx rename to awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.js index 9dc05b3ca8..042917523b 100644 --- a/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.js @@ -2,11 +2,11 @@ import React, { useState } from 'react'; import { ExpandableSection, Wizard } from '@patternfly/react-core'; import { t } from '@lingui/macro'; import { Formik, useFormikContext } from 'formik'; -import ContentError from '../ContentError'; +import { useDismissableError } from 'hooks/useRequest'; +import mergeExtraVars from 'util/prompt/mergeExtraVars'; +import getSurveyValues from 'util/prompt/getSurveyValues'; import ContentLoading from '../ContentLoading'; -import { useDismissableError } from '../../util/useRequest'; -import mergeExtraVars from '../../util/prompt/mergeExtraVars'; -import getSurveyValues from '../../util/prompt/getSurveyValues'; +import ContentError from '../ContentError'; import useLaunchSteps from './useLaunchSteps'; import AlertModal from '../AlertModal'; diff --git a/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.test.jsx b/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.test.js similarity index 99% rename from awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.test.jsx rename to awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.test.js index 366437fdf7..27263d479c 100644 --- a/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.test.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.test.js @@ -1,5 +1,11 @@ import React from 'react'; import { act, isElementOfType } from 'react-dom/test-utils'; +import { + InventoriesAPI, + CredentialsAPI, + CredentialTypesAPI, + JobTemplatesAPI, +} from 'api'; import { mountWithContexts, waitForElement, @@ -10,12 +16,6 @@ import CredentialsStep from './steps/CredentialsStep'; import CredentialPasswordsStep from './steps/CredentialPasswordsStep'; import OtherPromptsStep from './steps/OtherPromptsStep'; import PreviewStep from './steps/PreviewStep'; -import { - InventoriesAPI, - CredentialsAPI, - CredentialTypesAPI, - JobTemplatesAPI, -} from '../../api'; jest.mock('../../api/models/Inventories'); jest.mock('../../api/models/CredentialTypes'); diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/CredentialPasswordsStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/CredentialPasswordsStep.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/CredentialPasswordsStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/CredentialPasswordsStep.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/CredentialPasswordsStep.test.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/CredentialPasswordsStep.test.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/CredentialPasswordsStep.test.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/CredentialPasswordsStep.test.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.js similarity index 97% rename from awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.js index dd6ebefc9c..ae777a5a0e 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.js @@ -6,14 +6,14 @@ import { t } from '@lingui/macro'; import { useField } from 'formik'; import styled from 'styled-components'; import { Alert, ToolbarItem } from '@patternfly/react-core'; -import { CredentialsAPI, CredentialTypesAPI } from '../../../api'; +import { CredentialsAPI, CredentialTypesAPI } from 'api'; +import { getQSConfig, parseQueryString } from 'util/qs'; +import useRequest from 'hooks/useRequest'; 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 credentialsValidator from './credentialsValidator'; const CredentialErrorAlert = styled(Alert)` diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.test.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.test.js similarity index 99% rename from awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.test.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.test.js index 3b6855f0b9..e826346876 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.test.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/CredentialsStep.test.js @@ -1,9 +1,9 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { CredentialsAPI, CredentialTypesAPI } from 'api'; import { mountWithContexts } from '../../../../testUtils/enzymeHelpers'; import CredentialsStep from './CredentialsStep'; -import { CredentialsAPI, CredentialTypesAPI } from '../../../api'; jest.mock('../../../api/models/CredentialTypes'); jest.mock('../../../api/models/Credentials'); diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.js similarity index 94% rename from awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.js index 123a157cdb..cf1f45dce2 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.js @@ -5,9 +5,9 @@ import { t } from '@lingui/macro'; import { useField } from 'formik'; import styled from 'styled-components'; import { Alert } from '@patternfly/react-core'; -import { InventoriesAPI } from '../../../api'; -import { getQSConfig, parseQueryString } from '../../../util/qs'; -import useRequest from '../../../util/useRequest'; +import { InventoriesAPI } from 'api'; +import { getQSConfig, parseQueryString } from 'util/qs'; +import useRequest from 'hooks/useRequest'; import OptionsList from '../../OptionsList'; import ContentLoading from '../../ContentLoading'; import ContentError from '../../ContentError'; diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.test.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.test.js similarity index 97% rename from awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.test.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.test.js index e7ca020efa..72e4291d69 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.test.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.test.js @@ -1,9 +1,9 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { InventoriesAPI } from 'api'; import { mountWithContexts } from '../../../../testUtils/enzymeHelpers'; import InventoryStep from './InventoryStep'; -import { InventoriesAPI } from '../../../api'; jest.mock('../../../api/models/Inventories'); diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.js similarity index 93% rename from awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.js index e4bc717ec4..4a33c8cdb5 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.js @@ -6,10 +6,8 @@ import { t } from '@lingui/macro'; import { useFormikContext } from 'formik'; import yaml from 'js-yaml'; -import mergeExtraVars, { - maskPasswords, -} from '../../../util/prompt/mergeExtraVars'; -import getSurveyValues from '../../../util/prompt/getSurveyValues'; +import mergeExtraVars, { maskPasswords } from 'util/prompt/mergeExtraVars'; +import getSurveyValues from 'util/prompt/getSurveyValues'; import PromptDetail from '../../PromptDetail'; const ExclamationCircleIcon = styled(PFExclamationCircleIcon)` diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.test.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.test.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.test.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/PreviewStep.test.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/StepName.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/StepName.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/StepName.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/StepName.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.js similarity index 98% rename from awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.js index 07d96b335d..d840dbe80d 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.js @@ -8,8 +8,6 @@ import { SelectOption, SelectVariant, } from '@patternfly/react-core'; -import FormField from '../../FormField'; -import Popover from '../../Popover'; import { required, minMaxValue, @@ -17,8 +15,10 @@ import { minLength, integer, combine, -} from '../../../util/validators'; -import { Survey } from '../../../types'; +} from 'util/validators'; +import { Survey } from 'types'; +import FormField from '../../FormField'; +import Popover from '../../Popover'; function SurveyStep({ surveyConfig }) { const fieldTypes = { diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.test.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.test.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.test.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.test.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/credentialsValidator.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/credentialsValidator.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/credentialsValidator.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/credentialsValidator.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/useCredentialPasswordsStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/useCredentialPasswordsStep.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/useCredentialPasswordsStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/useCredentialPasswordsStep.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/useCredentialsStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/useCredentialsStep.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/useCredentialsStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/useCredentialsStep.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/useInventoryStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/useInventoryStep.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/useInventoryStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/useInventoryStep.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/useOtherPromptsStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/useOtherPromptsStep.js similarity index 98% rename from awx/ui_next/src/components/LaunchPrompt/steps/useOtherPromptsStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/useOtherPromptsStep.js index d874d32995..6603d4bf48 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/useOtherPromptsStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/useOtherPromptsStep.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { t } from '@lingui/macro'; import { useField } from 'formik'; -import { jsonToYaml, yamlToJson } from '../../../util/yaml'; +import { jsonToYaml, yamlToJson } from 'util/yaml'; import OtherPromptsStep from './OtherPromptsStep'; import StepName from './StepName'; diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/usePreviewStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/usePreviewStep.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/usePreviewStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/usePreviewStep.js diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/useSurveyStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/useSurveyStep.js similarity index 100% rename from awx/ui_next/src/components/LaunchPrompt/steps/useSurveyStep.jsx rename to awx/ui_next/src/components/LaunchPrompt/steps/useSurveyStep.js diff --git a/awx/ui_next/src/components/ListHeader/ListHeader.jsx b/awx/ui_next/src/components/ListHeader/ListHeader.js similarity index 98% rename from awx/ui_next/src/components/ListHeader/ListHeader.jsx rename to awx/ui_next/src/components/ListHeader/ListHeader.js index b974f1d410..1e7264762d 100644 --- a/awx/ui_next/src/components/ListHeader/ListHeader.jsx +++ b/awx/ui_next/src/components/ListHeader/ListHeader.js @@ -3,15 +3,15 @@ import PropTypes from 'prop-types'; import { withRouter } from 'react-router-dom'; import styled from 'styled-components'; import { Toolbar, ToolbarContent } from '@patternfly/react-core'; -import DataListToolbar from '../DataListToolbar'; import { parseQueryString, mergeParams, removeParams, updateQueryString, -} from '../../util/qs'; -import { QSConfig, SearchColumns, SortColumns } from '../../types'; +} from 'util/qs'; +import { QSConfig, SearchColumns, SortColumns } from 'types'; +import DataListToolbar from '../DataListToolbar'; const EmptyStateControlsWrapper = styled.div` display: flex; diff --git a/awx/ui_next/src/components/ListHeader/ListHeader.test.jsx b/awx/ui_next/src/components/ListHeader/ListHeader.test.js similarity index 100% rename from awx/ui_next/src/components/ListHeader/ListHeader.test.jsx rename to awx/ui_next/src/components/ListHeader/ListHeader.test.js diff --git a/awx/ui_next/src/components/LoadingSpinner/LoadingSpinner.jsx b/awx/ui_next/src/components/LoadingSpinner/LoadingSpinner.js similarity index 100% rename from awx/ui_next/src/components/LoadingSpinner/LoadingSpinner.jsx rename to awx/ui_next/src/components/LoadingSpinner/LoadingSpinner.js diff --git a/awx/ui_next/src/components/Lookup/ApplicationLookup.jsx b/awx/ui_next/src/components/Lookup/ApplicationLookup.js similarity index 95% rename from awx/ui_next/src/components/Lookup/ApplicationLookup.jsx rename to awx/ui_next/src/components/Lookup/ApplicationLookup.js index a1ab723c70..2a78c63cbf 100644 --- a/awx/ui_next/src/components/Lookup/ApplicationLookup.jsx +++ b/awx/ui_next/src/components/Lookup/ApplicationLookup.js @@ -3,12 +3,12 @@ import { func, node, string } from 'prop-types'; import { withRouter, useLocation } from 'react-router-dom'; import { t } from '@lingui/macro'; import { FormGroup } from '@patternfly/react-core'; -import { ApplicationsAPI } from '../../api'; -import { Application } from '../../types'; -import { getQSConfig, parseQueryString } from '../../util/qs'; +import { ApplicationsAPI } from 'api'; +import { Application } from 'types'; +import { getQSConfig, parseQueryString } from 'util/qs'; +import useRequest from 'hooks/useRequest'; import Lookup from './Lookup'; import OptionsList from '../OptionsList'; -import useRequest from '../../util/useRequest'; import LookupErrorMessage from './shared/LookupErrorMessage'; const QS_CONFIG = getQSConfig('applications', { diff --git a/awx/ui_next/src/components/Lookup/ApplicationLookup.test.jsx b/awx/ui_next/src/components/Lookup/ApplicationLookup.test.js similarity index 97% rename from awx/ui_next/src/components/Lookup/ApplicationLookup.test.jsx rename to awx/ui_next/src/components/Lookup/ApplicationLookup.test.js index 10eac993bb..9c9cb6b481 100644 --- a/awx/ui_next/src/components/Lookup/ApplicationLookup.test.jsx +++ b/awx/ui_next/src/components/Lookup/ApplicationLookup.test.js @@ -1,9 +1,9 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { ApplicationsAPI } from 'api'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import ApplicationLookup from './ApplicationLookup'; -import { ApplicationsAPI } from '../../api'; jest.mock('../../api'); const application = { diff --git a/awx/ui_next/src/components/Lookup/CredentialLookup.jsx b/awx/ui_next/src/components/Lookup/CredentialLookup.js similarity index 96% rename from awx/ui_next/src/components/Lookup/CredentialLookup.jsx rename to awx/ui_next/src/components/Lookup/CredentialLookup.js index 97edad1d97..d76c4ba800 100644 --- a/awx/ui_next/src/components/Lookup/CredentialLookup.jsx +++ b/awx/ui_next/src/components/Lookup/CredentialLookup.js @@ -12,14 +12,14 @@ import { import { t } from '@lingui/macro'; import { FormGroup } from '@patternfly/react-core'; -import { CredentialsAPI } from '../../api'; -import { Credential } from '../../types'; -import { getQSConfig, parseQueryString, mergeParams } from '../../util/qs'; +import { CredentialsAPI } from 'api'; +import { Credential } from 'types'; +import { getQSConfig, parseQueryString, mergeParams } from 'util/qs'; +import useAutoPopulateLookup from 'hooks/useAutoPopulateLookup'; +import useRequest from 'hooks/useRequest'; import Popover from '../Popover'; import Lookup from './Lookup'; import OptionsList from '../OptionsList'; -import useAutoPopulateLookup from '../../util/useAutoPopulateLookup'; -import useRequest from '../../util/useRequest'; import LookupErrorMessage from './shared/LookupErrorMessage'; const QS_CONFIG = getQSConfig('credentials', { diff --git a/awx/ui_next/src/components/Lookup/CredentialLookup.test.jsx b/awx/ui_next/src/components/Lookup/CredentialLookup.test.js similarity index 99% rename from awx/ui_next/src/components/Lookup/CredentialLookup.test.jsx rename to awx/ui_next/src/components/Lookup/CredentialLookup.test.js index 7ed5910816..3a5c8bdaee 100644 --- a/awx/ui_next/src/components/Lookup/CredentialLookup.test.jsx +++ b/awx/ui_next/src/components/Lookup/CredentialLookup.test.js @@ -1,9 +1,9 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { CredentialsAPI } from 'api'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import CredentialLookup, { _CredentialLookup } from './CredentialLookup'; -import { CredentialsAPI } from '../../api'; jest.mock('../../api'); diff --git a/awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.jsx b/awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.js similarity index 96% rename from awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.jsx rename to awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.js index 524b4f7cad..2636915750 100644 --- a/awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.jsx +++ b/awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.js @@ -3,12 +3,12 @@ import { string, func, bool, oneOfType, number } from 'prop-types'; import { useLocation } from 'react-router-dom'; import { t } from '@lingui/macro'; import { FormGroup, Tooltip } from '@patternfly/react-core'; -import { ExecutionEnvironmentsAPI, ProjectsAPI } from '../../api'; -import { ExecutionEnvironment } from '../../types'; -import { getQSConfig, parseQueryString, mergeParams } from '../../util/qs'; +import { ExecutionEnvironmentsAPI, ProjectsAPI } from 'api'; +import { ExecutionEnvironment } from 'types'; +import { getQSConfig, parseQueryString, mergeParams } from 'util/qs'; +import useRequest from 'hooks/useRequest'; import Popover from '../Popover'; import OptionsList from '../OptionsList'; -import useRequest from '../../util/useRequest'; import Lookup from './Lookup'; import LookupErrorMessage from './shared/LookupErrorMessage'; diff --git a/awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.test.jsx b/awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.test.js similarity index 98% rename from awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.test.jsx rename to awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.test.js index 339f8235f7..d110059a9b 100644 --- a/awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.test.jsx +++ b/awx/ui_next/src/components/Lookup/ExecutionEnvironmentLookup.test.js @@ -1,9 +1,9 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { ExecutionEnvironmentsAPI, ProjectsAPI } from 'api'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import ExecutionEnvironmentLookup from './ExecutionEnvironmentLookup'; -import { ExecutionEnvironmentsAPI, ProjectsAPI } from '../../api'; jest.mock('../../api'); diff --git a/awx/ui_next/src/components/Lookup/HostFilterLookup.jsx b/awx/ui_next/src/components/Lookup/HostFilterLookup.js similarity index 98% rename from awx/ui_next/src/components/Lookup/HostFilterLookup.jsx rename to awx/ui_next/src/components/Lookup/HostFilterLookup.js index cb1c6411ee..3ca74cb37b 100644 --- a/awx/ui_next/src/components/Lookup/HostFilterLookup.jsx +++ b/awx/ui_next/src/components/Lookup/HostFilterLookup.js @@ -14,15 +14,15 @@ import { Modal, Tooltip, } from '@patternfly/react-core'; +import { HostsAPI } from 'api'; +import { getQSConfig, mergeParams, parseQueryString } from 'util/qs'; +import useRequest, { useDismissableError } from 'hooks/useRequest'; import ChipGroup from '../ChipGroup'; import Popover from '../Popover'; import DataListToolbar from '../DataListToolbar'; import LookupErrorMessage from './shared/LookupErrorMessage'; import PaginatedTable, { HeaderCell, HeaderRow } from '../PaginatedTable'; import HostListItem from './HostListItem'; -import { HostsAPI } from '../../api'; -import { getQSConfig, mergeParams, parseQueryString } from '../../util/qs'; -import useRequest, { useDismissableError } from '../../util/useRequest'; import { removeDefaultParams, removeNamespacedKeys, diff --git a/awx/ui_next/src/components/Lookup/HostListItem.jsx b/awx/ui_next/src/components/Lookup/HostListItem.js similarity index 100% rename from awx/ui_next/src/components/Lookup/HostListItem.jsx rename to awx/ui_next/src/components/Lookup/HostListItem.js diff --git a/awx/ui_next/src/components/Lookup/HostListItem.test.jsx b/awx/ui_next/src/components/Lookup/HostListItem.test.js similarity index 100% rename from awx/ui_next/src/components/Lookup/HostListItem.test.jsx rename to awx/ui_next/src/components/Lookup/HostListItem.test.js diff --git a/awx/ui_next/src/components/Lookup/InstanceGroupsLookup.jsx b/awx/ui_next/src/components/Lookup/InstanceGroupsLookup.js similarity index 95% rename from awx/ui_next/src/components/Lookup/InstanceGroupsLookup.jsx rename to awx/ui_next/src/components/Lookup/InstanceGroupsLookup.js index c3bfa74b4e..9af24e872c 100644 --- a/awx/ui_next/src/components/Lookup/InstanceGroupsLookup.jsx +++ b/awx/ui_next/src/components/Lookup/InstanceGroupsLookup.js @@ -4,12 +4,12 @@ import { withRouter } from 'react-router-dom'; import { t, Trans } from '@lingui/macro'; import { FormGroup } from '@patternfly/react-core'; -import { InstanceGroupsAPI } from '../../api'; -import { InstanceGroup } from '../../types'; -import { getQSConfig, parseQueryString } from '../../util/qs'; +import { InstanceGroupsAPI } from 'api'; +import { InstanceGroup } from 'types'; +import { getQSConfig, parseQueryString } from 'util/qs'; +import useRequest from 'hooks/useRequest'; import Popover from '../Popover'; import OptionsList from '../OptionsList'; -import useRequest from '../../util/useRequest'; import Lookup from './Lookup'; import LookupErrorMessage from './shared/LookupErrorMessage'; diff --git a/awx/ui_next/src/components/Lookup/InventoryLookup.jsx b/awx/ui_next/src/components/Lookup/InventoryLookup.js similarity index 97% rename from awx/ui_next/src/components/Lookup/InventoryLookup.jsx rename to awx/ui_next/src/components/Lookup/InventoryLookup.js index be18418972..30fb3df9ac 100644 --- a/awx/ui_next/src/components/Lookup/InventoryLookup.jsx +++ b/awx/ui_next/src/components/Lookup/InventoryLookup.js @@ -2,12 +2,12 @@ import React, { useCallback, useEffect } from 'react'; import { func, bool, string } from 'prop-types'; import { withRouter } from 'react-router-dom'; import { t } from '@lingui/macro'; -import { InventoriesAPI } from '../../api'; -import { Inventory } from '../../types'; +import { InventoriesAPI } from 'api'; +import { Inventory } from 'types'; +import useRequest from 'hooks/useRequest'; +import { getQSConfig, parseQueryString, mergeParams } from 'util/qs'; import Lookup from './Lookup'; import OptionsList from '../OptionsList'; -import useRequest from '../../util/useRequest'; -import { getQSConfig, parseQueryString, mergeParams } from '../../util/qs'; import LookupErrorMessage from './shared/LookupErrorMessage'; import FieldWithPrompt from '../FieldWithPrompt'; diff --git a/awx/ui_next/src/components/Lookup/InventoryLookup.test.jsx b/awx/ui_next/src/components/Lookup/InventoryLookup.test.js similarity index 98% rename from awx/ui_next/src/components/Lookup/InventoryLookup.test.jsx rename to awx/ui_next/src/components/Lookup/InventoryLookup.test.js index 765ad87bf7..7c20846d32 100644 --- a/awx/ui_next/src/components/Lookup/InventoryLookup.test.jsx +++ b/awx/ui_next/src/components/Lookup/InventoryLookup.test.js @@ -1,9 +1,9 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { InventoriesAPI } from 'api'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import InventoryLookup from './InventoryLookup'; -import { InventoriesAPI } from '../../api'; jest.mock('../../api'); diff --git a/awx/ui_next/src/components/Lookup/Lookup.jsx b/awx/ui_next/src/components/Lookup/Lookup.js similarity index 98% rename from awx/ui_next/src/components/Lookup/Lookup.jsx rename to awx/ui_next/src/components/Lookup/Lookup.js index 1114006c3e..b0cfee323b 100644 --- a/awx/ui_next/src/components/Lookup/Lookup.jsx +++ b/awx/ui_next/src/components/Lookup/Lookup.js @@ -22,10 +22,10 @@ import { } from '@patternfly/react-core'; import { t } from '@lingui/macro'; import styled from 'styled-components'; -import useDebounce from '../../util/useDebounce'; +import useDebounce from 'hooks/useDebounce'; +import { QSConfig } from 'types'; import ChipGroup from '../ChipGroup'; import reducer, { initReducer } from './shared/reducer'; -import { QSConfig } from '../../types'; const ChipHolder = styled.div` --pf-c-form-control--Height: auto; diff --git a/awx/ui_next/src/components/Lookup/Lookup.test.jsx b/awx/ui_next/src/components/Lookup/Lookup.test.js similarity index 99% rename from awx/ui_next/src/components/Lookup/Lookup.test.jsx rename to awx/ui_next/src/components/Lookup/Lookup.test.js index 801589f73b..6d44dfae73 100644 --- a/awx/ui_next/src/components/Lookup/Lookup.test.jsx +++ b/awx/ui_next/src/components/Lookup/Lookup.test.js @@ -2,11 +2,11 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { getQSConfig } from 'util/qs'; import { mountWithContexts, waitForElement, } from '../../../testUtils/enzymeHelpers'; -import { getQSConfig } from '../../util/qs'; import Lookup from './Lookup'; /** diff --git a/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.jsx b/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.js similarity index 97% rename from awx/ui_next/src/components/Lookup/MultiCredentialsLookup.jsx rename to awx/ui_next/src/components/Lookup/MultiCredentialsLookup.js index e54a53ca21..2a436e010b 100644 --- a/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.jsx +++ b/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.js @@ -4,14 +4,14 @@ import { withRouter } from 'react-router-dom'; import PropTypes from 'prop-types'; import { t } from '@lingui/macro'; import { ToolbarItem, Alert } from '@patternfly/react-core'; -import { CredentialsAPI, CredentialTypesAPI } from '../../api'; +import { CredentialsAPI, CredentialTypesAPI } from 'api'; +import useRequest from 'hooks/useRequest'; +import { getQSConfig, parseQueryString } from 'util/qs'; +import useIsMounted from 'hooks/useIsMounted'; import AnsibleSelect from '../AnsibleSelect'; import CredentialChip from '../CredentialChip'; import OptionsList from '../OptionsList'; -import useRequest from '../../util/useRequest'; -import { getQSConfig, parseQueryString } from '../../util/qs'; import Lookup from './Lookup'; -import useIsMounted from '../../util/useIsMounted'; const QS_CONFIG = getQSConfig('credentials', { page: 1, diff --git a/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.test.jsx b/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.test.js similarity index 99% rename from awx/ui_next/src/components/Lookup/MultiCredentialsLookup.test.jsx rename to awx/ui_next/src/components/Lookup/MultiCredentialsLookup.test.js index 0cfb3a66b5..45f0485614 100644 --- a/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.test.jsx +++ b/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.test.js @@ -1,12 +1,12 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { CredentialsAPI, CredentialTypesAPI } from 'api'; import { mountWithContexts, waitForElement, } from '../../../testUtils/enzymeHelpers'; import MultiCredentialsLookup from './MultiCredentialsLookup'; -import { CredentialsAPI, CredentialTypesAPI } from '../../api'; jest.mock('../../api'); diff --git a/awx/ui_next/src/components/Lookup/OrganizationLookup.jsx b/awx/ui_next/src/components/Lookup/OrganizationLookup.js similarity index 94% rename from awx/ui_next/src/components/Lookup/OrganizationLookup.jsx rename to awx/ui_next/src/components/Lookup/OrganizationLookup.js index 1741a900ca..78650465e1 100644 --- a/awx/ui_next/src/components/Lookup/OrganizationLookup.jsx +++ b/awx/ui_next/src/components/Lookup/OrganizationLookup.js @@ -3,11 +3,11 @@ import { node, func, bool, string } from 'prop-types'; import { withRouter } from 'react-router-dom'; import { t } from '@lingui/macro'; import { FormGroup } from '@patternfly/react-core'; -import { OrganizationsAPI } from '../../api'; -import { Organization } from '../../types'; -import { getQSConfig, parseQueryString } from '../../util/qs'; -import useRequest from '../../util/useRequest'; -import useAutoPopulateLookup from '../../util/useAutoPopulateLookup'; +import { OrganizationsAPI } from 'api'; +import { Organization } from 'types'; +import { getQSConfig, parseQueryString } from 'util/qs'; +import useRequest from 'hooks/useRequest'; +import useAutoPopulateLookup from 'hooks/useAutoPopulateLookup'; import OptionsList from '../OptionsList'; import Lookup from './Lookup'; import LookupErrorMessage from './shared/LookupErrorMessage'; diff --git a/awx/ui_next/src/components/Lookup/OrganizationLookup.test.jsx b/awx/ui_next/src/components/Lookup/OrganizationLookup.test.js similarity index 98% rename from awx/ui_next/src/components/Lookup/OrganizationLookup.test.jsx rename to awx/ui_next/src/components/Lookup/OrganizationLookup.test.js index 873310120e..76309446fe 100644 --- a/awx/ui_next/src/components/Lookup/OrganizationLookup.test.jsx +++ b/awx/ui_next/src/components/Lookup/OrganizationLookup.test.js @@ -1,9 +1,9 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { OrganizationsAPI } from 'api'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import OrganizationLookup, { _OrganizationLookup } from './OrganizationLookup'; -import { OrganizationsAPI } from '../../api'; jest.mock('../../api'); diff --git a/awx/ui_next/src/components/Lookup/ProjectLookup.jsx b/awx/ui_next/src/components/Lookup/ProjectLookup.js similarity index 95% rename from awx/ui_next/src/components/Lookup/ProjectLookup.jsx rename to awx/ui_next/src/components/Lookup/ProjectLookup.js index 2774a86eaf..631d46494c 100644 --- a/awx/ui_next/src/components/Lookup/ProjectLookup.jsx +++ b/awx/ui_next/src/components/Lookup/ProjectLookup.js @@ -3,13 +3,13 @@ import { node, string, func, bool } from 'prop-types'; import { withRouter } from 'react-router-dom'; import { t } from '@lingui/macro'; import { FormGroup } from '@patternfly/react-core'; -import { ProjectsAPI } from '../../api'; -import { Project } from '../../types'; -import Popover from '../Popover'; +import { ProjectsAPI } from 'api'; +import { Project } from 'types'; +import useAutoPopulateLookup from 'hooks/useAutoPopulateLookup'; +import useRequest from 'hooks/useRequest'; +import { getQSConfig, parseQueryString } from 'util/qs'; import OptionsList from '../OptionsList'; -import useAutoPopulateLookup from '../../util/useAutoPopulateLookup'; -import useRequest from '../../util/useRequest'; -import { getQSConfig, parseQueryString } from '../../util/qs'; +import Popover from '../Popover'; import Lookup from './Lookup'; import LookupErrorMessage from './shared/LookupErrorMessage'; diff --git a/awx/ui_next/src/components/Lookup/ProjectLookup.test.jsx b/awx/ui_next/src/components/Lookup/ProjectLookup.test.js similarity index 99% rename from awx/ui_next/src/components/Lookup/ProjectLookup.test.jsx rename to awx/ui_next/src/components/Lookup/ProjectLookup.test.js index 94430074f6..a714ef4c5c 100644 --- a/awx/ui_next/src/components/Lookup/ProjectLookup.test.jsx +++ b/awx/ui_next/src/components/Lookup/ProjectLookup.test.js @@ -1,8 +1,8 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { Formik } from 'formik'; +import { ProjectsAPI } from 'api'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; -import { ProjectsAPI } from '../../api'; import ProjectLookup from './ProjectLookup'; jest.mock('../../api'); diff --git a/awx/ui_next/src/components/Lookup/shared/HostFilterUtils.jsx b/awx/ui_next/src/components/Lookup/shared/HostFilterUtils.js similarity index 100% rename from awx/ui_next/src/components/Lookup/shared/HostFilterUtils.jsx rename to awx/ui_next/src/components/Lookup/shared/HostFilterUtils.js diff --git a/awx/ui_next/src/components/Lookup/shared/HostFilterUtils.test.jsx b/awx/ui_next/src/components/Lookup/shared/HostFilterUtils.test.js similarity index 100% rename from awx/ui_next/src/components/Lookup/shared/HostFilterUtils.test.jsx rename to awx/ui_next/src/components/Lookup/shared/HostFilterUtils.test.js diff --git a/awx/ui_next/src/components/Lookup/shared/LookupErrorMessage.jsx b/awx/ui_next/src/components/Lookup/shared/LookupErrorMessage.js similarity index 100% rename from awx/ui_next/src/components/Lookup/shared/LookupErrorMessage.jsx rename to awx/ui_next/src/components/Lookup/shared/LookupErrorMessage.js diff --git a/awx/ui_next/src/components/MultiButtonToggle/ButtonGroup.jsx b/awx/ui_next/src/components/MultiButtonToggle/ButtonGroup.js similarity index 100% rename from awx/ui_next/src/components/MultiButtonToggle/ButtonGroup.jsx rename to awx/ui_next/src/components/MultiButtonToggle/ButtonGroup.js diff --git a/awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.jsx b/awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.js similarity index 100% rename from awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.jsx rename to awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.js diff --git a/awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.test.jsx b/awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.test.js similarity index 100% rename from awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.test.jsx rename to awx/ui_next/src/components/MultiButtonToggle/MultiButtonToggle.test.js diff --git a/awx/ui_next/src/components/MultiSelect/TagMultiSelect.jsx b/awx/ui_next/src/components/MultiSelect/TagMultiSelect.js similarity index 96% rename from awx/ui_next/src/components/MultiSelect/TagMultiSelect.jsx rename to awx/ui_next/src/components/MultiSelect/TagMultiSelect.js index 6452992123..c1e3d54ad5 100644 --- a/awx/ui_next/src/components/MultiSelect/TagMultiSelect.jsx +++ b/awx/ui_next/src/components/MultiSelect/TagMultiSelect.js @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { func, string } from 'prop-types'; import { t } from '@lingui/macro'; import { Select, SelectOption, SelectVariant } from '@patternfly/react-core'; -import { arrayToString, stringToArray } from '../../util/strings'; +import { arrayToString, stringToArray } from 'util/strings'; function TagMultiSelect({ onChange, value }) { const selections = stringToArray(value); diff --git a/awx/ui_next/src/components/MultiSelect/TagMultiSelect.test.jsx b/awx/ui_next/src/components/MultiSelect/TagMultiSelect.test.js similarity index 100% rename from awx/ui_next/src/components/MultiSelect/TagMultiSelect.test.jsx rename to awx/ui_next/src/components/MultiSelect/TagMultiSelect.test.js diff --git a/awx/ui_next/src/components/MultiSelect/useSyncedSelectValue.js b/awx/ui_next/src/components/MultiSelect/useSyncedSelectValue.js index 1b4c46195d..55b6c3b4c9 100644 --- a/awx/ui_next/src/components/MultiSelect/useSyncedSelectValue.js +++ b/awx/ui_next/src/components/MultiSelect/useSyncedSelectValue.js @@ -1,5 +1,5 @@ import { useState, useEffect } from 'react'; -import useIsMounted from '../../util/useIsMounted'; +import useIsMounted from 'hooks/useIsMounted'; /* Hook for using PatternFly's