mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Remove import aliases from ui_next
For posterity, the script used to remove the aliases is included with
this commit:
python3 tools/dealias.py awx/ui_next/src
npm run lint -- --fix
npm run prettier
This commit is contained in:
parent
12a04bf42e
commit
0f335170c5
@ -12,14 +12,14 @@ import styled from 'styled-components';
|
||||
import { t } from '@lingui/macro';
|
||||
import { withI18n } from '@lingui/react';
|
||||
|
||||
import { ConfigAPI, MeAPI, RootAPI } from '@api';
|
||||
import About from '@components/About';
|
||||
import AlertModal from '@components/AlertModal';
|
||||
import NavExpandableGroup from '@components/NavExpandableGroup';
|
||||
import BrandLogo from '@components/BrandLogo';
|
||||
import PageHeaderToolbar from '@components/PageHeaderToolbar';
|
||||
import ErrorDetail from '@components/ErrorDetail';
|
||||
import { ConfigProvider } from '@contexts/Config';
|
||||
import { ConfigAPI, MeAPI, RootAPI } from './api';
|
||||
import About from './components/About';
|
||||
import AlertModal from './components/AlertModal';
|
||||
import NavExpandableGroup from './components/NavExpandableGroup';
|
||||
import BrandLogo from './components/BrandLogo';
|
||||
import PageHeaderToolbar from './components/PageHeaderToolbar';
|
||||
import ErrorDetail from './components/ErrorDetail';
|
||||
import { ConfigProvider } from './contexts/Config';
|
||||
|
||||
const PageHeader = styled(PFPageHeader)`
|
||||
& .pf-c-page__header-brand-link {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import { mountWithContexts, waitForElement } from '@testUtils/enzymeHelpers';
|
||||
import { ConfigAPI, MeAPI, RootAPI } from '@api';
|
||||
import { mountWithContexts, waitForElement } from '../testUtils/enzymeHelpers';
|
||||
import { ConfigAPI, MeAPI, RootAPI } from './api';
|
||||
import { asyncFlush } from '../jest.setup';
|
||||
|
||||
import App from './App';
|
||||
|
||||
@ -3,7 +3,7 @@ import { I18nProvider } from '@lingui/react';
|
||||
|
||||
import { HashRouter } from 'react-router-dom';
|
||||
|
||||
import { getLanguageWithoutRegionCode } from '@util/language';
|
||||
import { getLanguageWithoutRegionCode } from './util/language';
|
||||
import ja from '../build/locales/ja/messages';
|
||||
import en from '../build/locales/en/messages';
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import axios from 'axios';
|
||||
|
||||
import { encodeQueryString } from '@util/qs';
|
||||
import { encodeQueryString } from '../util/qs';
|
||||
|
||||
const defaultHttp = axios.create({
|
||||
xsrfCookieName: 'csrftoken',
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { describeNotificationMixin } from '@testUtils/apiReusable';
|
||||
import { describeNotificationMixin } from '../../../testUtils/apiReusable';
|
||||
import Organizations from './Organizations';
|
||||
|
||||
describe('OrganizationsAPI', () => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import About from './About';
|
||||
|
||||
describe('<About />', () => {
|
||||
|
||||
@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Dropdown, DropdownPosition } from '@patternfly/react-core';
|
||||
import { ToolbarAddButton } from '@components/PaginatedDataList';
|
||||
import { ToolbarAddButton } from '../PaginatedDataList';
|
||||
|
||||
function AddDropDownButton({ dropdownItems }) {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import AddDropDownButton from './AddDropDownButton';
|
||||
|
||||
describe('<AddDropDownButton />', () => {
|
||||
|
||||
@ -2,8 +2,8 @@ import React, { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import SelectableCard from '@components/SelectableCard';
|
||||
import Wizard from '@components/Wizard';
|
||||
import SelectableCard from '../SelectableCard';
|
||||
import Wizard from '../Wizard';
|
||||
import SelectResourceStep from './SelectResourceStep';
|
||||
import SelectRoleStep from './SelectRoleStep';
|
||||
import { TeamsAPI, UsersAPI } from '../../api';
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
/* eslint-disable react/jsx-pascal-case */
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import AddResourceRole, { _AddResourceRole } from './AddResourceRole';
|
||||
import { TeamsAPI, UsersAPI } from '@api';
|
||||
import { TeamsAPI, UsersAPI } from '../../api';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
describe('<_AddResourceRole />', () => {
|
||||
UsersAPI.read.mockResolvedValue({
|
||||
|
||||
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { SearchColumns, SortColumns } from '@types';
|
||||
import { SearchColumns, SortColumns } from '../../types';
|
||||
import PaginatedDataList from '../PaginatedDataList';
|
||||
import DataListToolbar from '../DataListToolbar';
|
||||
import CheckboxListItem from '../CheckboxListItem';
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { shallow } from 'enzyme';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { sleep } from '@testUtils/testUtils';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import { sleep } from '../../../testUtils/testUtils';
|
||||
import SelectResourceStep from './SelectResourceStep';
|
||||
|
||||
describe('<SelectResourceStep />', () => {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import SelectRoleStep from './SelectRoleStep';
|
||||
|
||||
describe('<SelectRoleStep />', () => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import AnsibleSelect, { _AnsibleSelect } from './AnsibleSelect';
|
||||
|
||||
const mockData = [
|
||||
|
||||
@ -3,10 +3,10 @@ import { useHistory } from 'react-router-dom';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { Button, Modal } from '@patternfly/react-core';
|
||||
import OptionsList from '@components/OptionsList';
|
||||
import useRequest from '@util/useRequest';
|
||||
import { getQSConfig, parseQueryString } from '@util/qs';
|
||||
import useSelected from '@util/useSelected';
|
||||
import OptionsList from '../OptionsList';
|
||||
import useRequest from '../../util/useRequest';
|
||||
import { getQSConfig, parseQueryString } from '../../util/qs';
|
||||
import useSelected from '../../util/useSelected';
|
||||
|
||||
const QS_CONFIG = getQSConfig('associate', {
|
||||
page: 1,
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
|
||||
import { mountWithContexts, waitForElement } from '@testUtils/enzymeHelpers';
|
||||
import {
|
||||
mountWithContexts,
|
||||
waitForElement,
|
||||
} from '../../../testUtils/enzymeHelpers';
|
||||
import AssociateModal from './AssociateModal';
|
||||
import mockHosts from './data.hosts.json';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
describe('<AssociateModal />', () => {
|
||||
let wrapper;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import BrandLogo from './BrandLogo';
|
||||
|
||||
let logoWrapper;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import CardCloseButton from './CardCloseButton';
|
||||
|
||||
describe('<CardCloseButton>', () => {
|
||||
|
||||
@ -7,7 +7,7 @@ import {
|
||||
DataListCheck,
|
||||
Radio,
|
||||
} from '@patternfly/react-core';
|
||||
import DataListCell from '@components/DataListCell';
|
||||
import DataListCell from '../DataListCell';
|
||||
|
||||
const CheckboxListItem = ({
|
||||
isDisabled = false,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import ChipGroup from './ChipGroup';
|
||||
|
||||
describe('ChipGroup', () => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import ClipboardCopyButton from './ClipboardCopyButton';
|
||||
|
||||
document.execCommand = jest.fn();
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { string, node, number } from 'prop-types';
|
||||
import { Split, SplitItem, TextListItemVariants } from '@patternfly/react-core';
|
||||
import { DetailName, DetailValue } from '@components/DetailList';
|
||||
import MultiButtonToggle from '@components/MultiButtonToggle';
|
||||
import { yamlToJson, jsonToYaml, isJson } from '@util/yaml';
|
||||
import { DetailName, DetailValue } from '../DetailList';
|
||||
import MultiButtonToggle from '../MultiButtonToggle';
|
||||
import { yamlToJson, jsonToYaml, isJson } from '../../util/yaml';
|
||||
import CodeMirrorInput from './CodeMirrorInput';
|
||||
import { JSON_MODE, YAML_MODE } from './constants';
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import { act } from 'react-dom/test-utils';
|
||||
import { shallow, mount } from 'enzyme';
|
||||
import VariablesDetail from './VariablesDetail';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
describe('<VariablesDetail>', () => {
|
||||
test('should render readonly CodeMirrorInput', () => {
|
||||
|
||||
@ -5,9 +5,9 @@ import { t } from '@lingui/macro';
|
||||
import { useField } from 'formik';
|
||||
import styled from 'styled-components';
|
||||
import { Split, SplitItem } from '@patternfly/react-core';
|
||||
import { CheckboxField, FieldTooltip } from '@components/FormField';
|
||||
import MultiButtonToggle from '@components/MultiButtonToggle';
|
||||
import { yamlToJson, jsonToYaml, isJson } from '@util/yaml';
|
||||
import { CheckboxField, FieldTooltip } from '../FormField';
|
||||
import MultiButtonToggle from '../MultiButtonToggle';
|
||||
import { yamlToJson, jsonToYaml, isJson } from '../../util/yaml';
|
||||
import CodeMirrorInput from './CodeMirrorInput';
|
||||
import { JSON_MODE, YAML_MODE } from './constants';
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@ 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, isJson } from '@util/yaml';
|
||||
import MultiButtonToggle from '@components/MultiButtonToggle';
|
||||
import { yamlToJson, jsonToYaml, isJson } from '../../util/yaml';
|
||||
import MultiButtonToggle from '../MultiButtonToggle';
|
||||
import CodeMirrorInput from './CodeMirrorInput';
|
||||
import { JSON_MODE, YAML_MODE } from './constants';
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import { bool, string } from 'prop-types';
|
||||
import styled from 'styled-components';
|
||||
import { Button } from '@patternfly/react-core';
|
||||
import { AngleRightIcon } from '@patternfly/react-icons';
|
||||
import omitProps from '@util/omitProps';
|
||||
import omitProps from '../../util/omitProps';
|
||||
import ExpandingContainer from './ExpandingContainer';
|
||||
|
||||
// Make button findable by tests
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
|
||||
import ContentEmpty from './ContentEmpty';
|
||||
|
||||
|
||||
@ -10,8 +10,8 @@ import {
|
||||
EmptyStateBody,
|
||||
} from '@patternfly/react-core';
|
||||
import { ExclamationTriangleIcon } from '@patternfly/react-icons';
|
||||
import { RootAPI } from '@api';
|
||||
import ErrorDetail from '@components/ErrorDetail';
|
||||
import { RootAPI } from '../../api';
|
||||
import ErrorDetail from '../ErrorDetail';
|
||||
|
||||
async function logout() {
|
||||
await RootAPI.logout();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
|
||||
import ContentError from './ContentError';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
|
||||
import ContentLoading from './ContentLoading';
|
||||
|
||||
|
||||
@ -5,9 +5,9 @@ import PropTypes from 'prop-types';
|
||||
|
||||
import { Button, Tooltip } from '@patternfly/react-core';
|
||||
import { CopyIcon } from '@patternfly/react-icons';
|
||||
import useRequest, { useDismissableError } from '@util/useRequest';
|
||||
import AlertModal from '@components/AlertModal';
|
||||
import ErrorDetail from '@components/ErrorDetail';
|
||||
import useRequest, { useDismissableError } from '../../util/useRequest';
|
||||
import AlertModal from '../AlertModal';
|
||||
import ErrorDetail from '../ErrorDetail';
|
||||
|
||||
function CopyButton({ i18n, copyItem, onLoading, onDoneLoading, helperText }) {
|
||||
const { isLoading, error: copyError, request: copyItemToAPI } = useRequest(
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import CopyButton from './CopyButton';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
describe('<CopyButton/>', () => {
|
||||
test('shold mount properly', () => {
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { shape } from 'prop-types';
|
||||
import { toTitleCase } from '@util/strings';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { Credential } from '@types';
|
||||
import { Chip } from '@patternfly/react-core';
|
||||
import { Credential } from '../../types';
|
||||
import { toTitleCase } from '../../util/strings';
|
||||
|
||||
function CredentialChip({ credential, i18n, ...props }) {
|
||||
let type;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import CredentialChip from './CredentialChip';
|
||||
|
||||
describe('CredentialChip', () => {
|
||||
|
||||
@ -16,7 +16,7 @@ import ExpandCollapse from '../ExpandCollapse';
|
||||
import Search from '../Search';
|
||||
import Sort from '../Sort';
|
||||
|
||||
import { SearchColumns, SortColumns, QSConfig } from '@types';
|
||||
import { SearchColumns, SortColumns, QSConfig } from '../../types';
|
||||
|
||||
const DataToolbarContent = styled(_DataToolbarContent)`
|
||||
--pf-c-data-toolbar__content--PaddingLeft: 24px;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import DataListToolbar from './DataListToolbar';
|
||||
|
||||
describe('<DataListToolbar />', () => {
|
||||
|
||||
@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { Button } from '@patternfly/react-core';
|
||||
import AlertModal from '@components/AlertModal';
|
||||
import AlertModal from '../AlertModal';
|
||||
|
||||
function DeleteButton({
|
||||
onConfirm,
|
||||
|
||||
@ -3,7 +3,7 @@ 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 _Detail from './Detail';
|
||||
import { SummaryFieldUser } from '../../types';
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@ import { arrayOf, func, object, string } from 'prop-types';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { Button, Tooltip } from '@patternfly/react-core';
|
||||
import AlertModal from '@components/AlertModal';
|
||||
import styled from 'styled-components';
|
||||
import AlertModal from '../AlertModal';
|
||||
|
||||
const ModalNote = styled.div`
|
||||
margin-bottom: var(--pf-global--spacer--xl);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import DisassociateButton from './DisassociateButton';
|
||||
|
||||
describe('<DisassociateButton />', () => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
|
||||
import ErrorDetail from './ErrorDetail';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import ExpandCollapse from './ExpandCollapse';
|
||||
|
||||
describe('<ExpandCollapse />', () => {
|
||||
|
||||
@ -2,8 +2,8 @@ import React from 'react';
|
||||
import { bool, node, string } from 'prop-types';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { CheckboxField, FieldTooltip } from '@components/FormField';
|
||||
import styled from 'styled-components';
|
||||
import { CheckboxField, FieldTooltip } from '../FormField';
|
||||
|
||||
const FieldHeader = styled.div`
|
||||
display: flex;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { Field, Formik } from 'formik';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import FieldWithPrompt from './FieldWithPrompt';
|
||||
|
||||
describe('FieldWithPrompt', () => {
|
||||
|
||||
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { ActionGroup, Button } from '@patternfly/react-core';
|
||||
import { FormFullWidthLayout } from '@components/FormLayout';
|
||||
import { FormFullWidthLayout } from '../FormLayout';
|
||||
|
||||
const FormActionGroup = ({ onSubmit, submitDisabled, onCancel, i18n }) => (
|
||||
<FormFullWidthLayout>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
|
||||
import FormActionGroup from './FormActionGroup';
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { Formik } from 'formik';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import FormSubmitError from './FormSubmitError';
|
||||
|
||||
describe('<FormSubmitError>', () => {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { sleep } from '@testUtils/testUtils';
|
||||
import { Formik } from 'formik';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import { sleep } from '../../../testUtils/testUtils';
|
||||
import PasswordField from './PasswordField';
|
||||
|
||||
describe('PasswordField', () => {
|
||||
|
||||
@ -5,15 +5,12 @@ import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
|
||||
import { Form, FormGroup } from '@patternfly/react-core';
|
||||
import FormField, {
|
||||
FormSubmitError,
|
||||
FieldTooltip,
|
||||
} from '@components/FormField';
|
||||
import FormActionGroup from '@components/FormActionGroup/FormActionGroup';
|
||||
import { VariablesField } from '@components/CodeMirrorInput';
|
||||
import { InventoryLookup } from '@components/Lookup';
|
||||
import { FormColumnLayout, FormFullWidthLayout } from '@components/FormLayout';
|
||||
import { required } from '@util/validators';
|
||||
import FormField, { FormSubmitError, FieldTooltip } from '../FormField';
|
||||
import FormActionGroup from '../FormActionGroup/FormActionGroup';
|
||||
import { VariablesField } from '../CodeMirrorInput';
|
||||
import { InventoryLookup } from '../Lookup';
|
||||
import { FormColumnLayout, FormFullWidthLayout } from '../FormLayout';
|
||||
import { required } from '../../util/validators';
|
||||
|
||||
const InventoryLookupField = withI18n()(({ i18n, host }) => {
|
||||
const [inventory, setInventory] = useState(
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
|
||||
import HostForm from './HostForm';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
const mockData = {
|
||||
id: 1,
|
||||
|
||||
@ -2,10 +2,10 @@ import React, { Fragment, useState, useEffect, useCallback } from 'react';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { Switch, Tooltip } from '@patternfly/react-core';
|
||||
import AlertModal from '@components/AlertModal';
|
||||
import ErrorDetail from '@components/ErrorDetail';
|
||||
import useRequest from '@util/useRequest';
|
||||
import { HostsAPI } from '@api';
|
||||
import AlertModal from '../AlertModal';
|
||||
import ErrorDetail from '../ErrorDetail';
|
||||
import useRequest from '../../util/useRequest';
|
||||
import { HostsAPI } from '../../api';
|
||||
|
||||
function HostToggle({ host, onToggle, className, i18n }) {
|
||||
const [isEnabled, setIsEnabled] = useState(host.enabled);
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { HostsAPI } from '@api';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { HostsAPI } from '../../api';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import HostToggle from './HostToggle';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
const mockHost = {
|
||||
id: 1,
|
||||
|
||||
@ -4,14 +4,12 @@ import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
|
||||
import { Card } from '@patternfly/react-core';
|
||||
import AlertModal from '@components/AlertModal';
|
||||
import DatalistToolbar from '@components/DataListToolbar';
|
||||
import ErrorDetail from '@components/ErrorDetail';
|
||||
import PaginatedDataList, {
|
||||
ToolbarDeleteButton,
|
||||
} from '@components/PaginatedDataList';
|
||||
import useRequest, { useDeleteItems } from '@util/useRequest';
|
||||
import { getQSConfig, parseQueryString } from '@util/qs';
|
||||
import AlertModal from '../AlertModal';
|
||||
import DatalistToolbar from '../DataListToolbar';
|
||||
import ErrorDetail from '../ErrorDetail';
|
||||
import PaginatedDataList, { ToolbarDeleteButton } from '../PaginatedDataList';
|
||||
import useRequest, { useDeleteItems } from '../../util/useRequest';
|
||||
import { getQSConfig, parseQueryString } from '../../util/qs';
|
||||
import JobListItem from './JobListItem';
|
||||
import {
|
||||
AdHocCommandsAPI,
|
||||
@ -21,7 +19,7 @@ import {
|
||||
SystemJobsAPI,
|
||||
UnifiedJobsAPI,
|
||||
WorkflowJobsAPI,
|
||||
} from '@api';
|
||||
} from '../../api';
|
||||
|
||||
function JobList({ i18n, defaultParams, showTypeColumn = false }) {
|
||||
const QS_CONFIG = getQSConfig(
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { mountWithContexts, waitForElement } from '@testUtils/enzymeHelpers';
|
||||
import {
|
||||
mountWithContexts,
|
||||
waitForElement,
|
||||
} from '../../../testUtils/enzymeHelpers';
|
||||
import {
|
||||
AdHocCommandsAPI,
|
||||
InventoryUpdatesAPI,
|
||||
@ -9,10 +12,10 @@ import {
|
||||
SystemJobsAPI,
|
||||
UnifiedJobsAPI,
|
||||
WorkflowJobsAPI,
|
||||
} from '@api';
|
||||
} from '../../api';
|
||||
import JobList from './JobList';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
const mockResults = [
|
||||
{
|
||||
|
||||
@ -11,13 +11,13 @@ import {
|
||||
DataListItemCells,
|
||||
Tooltip,
|
||||
} from '@patternfly/react-core';
|
||||
import DataListCell from '@components/DataListCell';
|
||||
import { RocketIcon } from '@patternfly/react-icons';
|
||||
import LaunchButton from '@components/LaunchButton';
|
||||
import StatusIcon from '@components/StatusIcon';
|
||||
import { formatDateString } from '@util/dates';
|
||||
import { JOB_TYPE_URL_SEGMENTS } from '@constants';
|
||||
import styled from 'styled-components';
|
||||
import DataListCell from '../DataListCell';
|
||||
import LaunchButton from '../LaunchButton';
|
||||
import StatusIcon from '../StatusIcon';
|
||||
import { formatDateString } from '../../util/dates';
|
||||
import { JOB_TYPE_URL_SEGMENTS } from '../../constants';
|
||||
|
||||
const DataListAction = styled(_DataListAction)`
|
||||
align-items: center;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { createMemoryHistory } from 'history';
|
||||
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
|
||||
import JobListItem from './JobListItem';
|
||||
|
||||
|
||||
@ -4,8 +4,8 @@ import { number, shape } from 'prop-types';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
|
||||
import AlertModal from '@components/AlertModal';
|
||||
import ErrorDetail from '@components/ErrorDetail';
|
||||
import AlertModal from '../AlertModal';
|
||||
import ErrorDetail from '../ErrorDetail';
|
||||
import {
|
||||
AdHocCommandsAPI,
|
||||
InventorySourcesAPI,
|
||||
@ -14,8 +14,8 @@ import {
|
||||
ProjectsAPI,
|
||||
WorkflowJobsAPI,
|
||||
WorkflowJobTemplatesAPI,
|
||||
} from '@api';
|
||||
import LaunchPrompt from '@components/LaunchPrompt';
|
||||
} from '../../api';
|
||||
import LaunchPrompt from '../LaunchPrompt';
|
||||
|
||||
function canLaunchWithoutPrompt(launchData) {
|
||||
return (
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import React from 'react';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { sleep } from '@testUtils/testUtils';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import { sleep } from '../../../testUtils/testUtils';
|
||||
|
||||
import LaunchButton from './LaunchButton';
|
||||
import { JobTemplatesAPI, WorkflowJobTemplatesAPI } from '@api';
|
||||
import { JobTemplatesAPI, WorkflowJobTemplatesAPI } from '../../api';
|
||||
|
||||
jest.mock('@api/models/WorkflowJobTemplates');
|
||||
jest.mock('@api/models/JobTemplates');
|
||||
jest.mock('../../api/models/WorkflowJobTemplates');
|
||||
jest.mock('../../api/models/JobTemplates');
|
||||
|
||||
describe('LaunchButton', () => {
|
||||
JobTemplatesAPI.readLaunch.mockResolvedValue({
|
||||
|
||||
@ -3,8 +3,8 @@ import { Wizard } from '@patternfly/react-core';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { Formik } from 'formik';
|
||||
import ContentError from '@components/ContentError';
|
||||
import ContentLoading from '@components/ContentLoading';
|
||||
import ContentError from '../../components/ContentError';
|
||||
import ContentLoading from '../../components/ContentLoading';
|
||||
import mergeExtraVars from './mergeExtraVars';
|
||||
import useSteps from './useSteps';
|
||||
import getSurveyValues from './getSurveyValues';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { act, isElementOfType } from 'react-dom/test-utils';
|
||||
import { mountWithContexts, waitForElement } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts, waitForElement } from '../../../testUtils/enzymeHelpers';
|
||||
import LaunchPrompt from './LaunchPrompt';
|
||||
import InventoryStep from './steps/InventoryStep';
|
||||
import CredentialsStep from './steps/CredentialsStep';
|
||||
@ -11,12 +11,12 @@ import {
|
||||
CredentialsAPI,
|
||||
CredentialTypesAPI,
|
||||
JobTemplatesAPI,
|
||||
} from '@api';
|
||||
} from '../../api';
|
||||
|
||||
jest.mock('@api/models/Inventories');
|
||||
jest.mock('@api/models/CredentialTypes');
|
||||
jest.mock('@api/models/Credentials');
|
||||
jest.mock('@api/models/JobTemplates');
|
||||
jest.mock('../../api/models/Inventories');
|
||||
jest.mock('../../api/models/CredentialTypes');
|
||||
jest.mock('../../api/models/Credentials');
|
||||
jest.mock('../../api/models/JobTemplates');
|
||||
|
||||
let config;
|
||||
const resource = {
|
||||
|
||||
@ -4,15 +4,15 @@ import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { useField } from 'formik';
|
||||
import { ToolbarItem } from '@patternfly/react-core';
|
||||
import { CredentialsAPI, CredentialTypesAPI } from '@api';
|
||||
import AnsibleSelect from '@components/AnsibleSelect';
|
||||
import OptionsList from '@components/OptionsList';
|
||||
import ContentLoading from '@components/ContentLoading';
|
||||
import CredentialChip from '@components/CredentialChip';
|
||||
import ContentError from '@components/ContentError';
|
||||
import { getQSConfig, parseQueryString } from '@util/qs';
|
||||
import useRequest from '@util/useRequest';
|
||||
import { required } from '@util/validators';
|
||||
import { CredentialsAPI, CredentialTypesAPI } from '../../../api';
|
||||
import AnsibleSelect from '../../../components/AnsibleSelect';
|
||||
import OptionsList from '../../../components/OptionsList';
|
||||
import ContentLoading from '../../../components/ContentLoading';
|
||||
import CredentialChip from '../../../components/CredentialChip';
|
||||
import ContentError from '../../../components/ContentError';
|
||||
import { getQSConfig, parseQueryString } from '../../../util/qs';
|
||||
import useRequest from '../../../util/useRequest';
|
||||
import { required } from '../../../util/validators';
|
||||
|
||||
const QS_CONFIG = getQSConfig('credential', {
|
||||
page: 1,
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { Formik } from 'formik';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import CredentialsStep from './CredentialsStep';
|
||||
import { CredentialsAPI, CredentialTypesAPI } from '@api';
|
||||
import { CredentialsAPI, CredentialTypesAPI } from '../../api';
|
||||
|
||||
jest.mock('@api/models/CredentialTypes');
|
||||
jest.mock('@api/models/Credentials');
|
||||
jest.mock('../../api/models/CredentialTypes');
|
||||
jest.mock('../../api/models/Credentials');
|
||||
|
||||
const types = [
|
||||
{ id: 1, kind: 'ssh', name: 'SSH' },
|
||||
|
||||
@ -3,13 +3,13 @@ import { useHistory } from 'react-router-dom';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { useField } from 'formik';
|
||||
import { InventoriesAPI } from '@api';
|
||||
import { getQSConfig, parseQueryString } from '@util/qs';
|
||||
import useRequest from '@util/useRequest';
|
||||
import OptionsList from '@components/OptionsList';
|
||||
import ContentLoading from '@components/ContentLoading';
|
||||
import ContentError from '@components/ContentError';
|
||||
import { required } from '@util/validators';
|
||||
import { InventoriesAPI } from '../../../api';
|
||||
import { getQSConfig, parseQueryString } from '../../../util/qs';
|
||||
import useRequest from '../../../util/useRequest';
|
||||
import OptionsList from '../../../components/OptionsList';
|
||||
import ContentLoading from '../../../components/ContentLoading';
|
||||
import ContentError from '../../../components/ContentError';
|
||||
import { required } from '../../../util/validators';
|
||||
|
||||
const QS_CONFIG = getQSConfig('inventory', {
|
||||
page: 1,
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { Formik } from 'formik';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import InventoryStep from './InventoryStep';
|
||||
import { InventoriesAPI } from '@api';
|
||||
import { InventoriesAPI } from '../../api';
|
||||
|
||||
jest.mock('@api/models/Inventories');
|
||||
jest.mock('../../api/models/Inventories');
|
||||
|
||||
const inventories = [
|
||||
{ id: 1, name: 'inv one', url: '/inventories/1' },
|
||||
|
||||
@ -3,11 +3,11 @@ import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { useField } from 'formik';
|
||||
import { Form, FormGroup, Switch } from '@patternfly/react-core';
|
||||
import FormField, { FieldTooltip } from '@components/FormField';
|
||||
import { TagMultiSelect } from '@components/MultiSelect';
|
||||
import AnsibleSelect from '@components/AnsibleSelect';
|
||||
import { VariablesField } from '@components/CodeMirrorInput';
|
||||
import styled from 'styled-components';
|
||||
import FormField, { FieldTooltip } from '../FormField';
|
||||
import { TagMultiSelect } from '../MultiSelect';
|
||||
import AnsibleSelect from '../AnsibleSelect';
|
||||
import { VariablesField } from '../CodeMirrorInput';
|
||||
|
||||
const FieldHeader = styled.div`
|
||||
display: flex;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { Formik } from 'formik';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import OtherPromptsStep from './OtherPromptsStep';
|
||||
|
||||
describe('OtherPromptsStep', () => {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { useFormikContext } from 'formik';
|
||||
import yaml from 'js-yaml';
|
||||
import PromptDetail from '@components/PromptDetail';
|
||||
import PromptDetail from '../../../components/PromptDetail';
|
||||
import mergeExtraVars, { maskPasswords } from '../mergeExtraVars';
|
||||
import getSurveyValues from '../getSurveyValues';
|
||||
|
||||
|
||||
@ -8,8 +8,8 @@ import {
|
||||
SelectOption,
|
||||
SelectVariant,
|
||||
} from '@patternfly/react-core';
|
||||
import FormField, { FieldTooltip } from '@components/FormField';
|
||||
import AnsibleSelect from '@components/AnsibleSelect';
|
||||
import FormField, { FieldTooltip } from '../../../components/FormField';
|
||||
import AnsibleSelect from '../../../components/AnsibleSelect';
|
||||
import {
|
||||
required,
|
||||
minMaxValue,
|
||||
@ -17,8 +17,8 @@ import {
|
||||
minLength,
|
||||
integer,
|
||||
combine,
|
||||
} from '@util/validators';
|
||||
import { Survey } from '@types';
|
||||
} from '../../../util/validators';
|
||||
import { Survey } from '../../../types';
|
||||
|
||||
function SurveyStep({ survey, i18n }) {
|
||||
const fieldTypes = {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React, { useState, useEffect, useCallback } from 'react';
|
||||
import { t } from '@lingui/macro';
|
||||
import useRequest from '@util/useRequest';
|
||||
import { JobTemplatesAPI, WorkflowJobTemplatesAPI } from '@api';
|
||||
import useRequest from '../../../util/useRequest';
|
||||
import { JobTemplatesAPI, WorkflowJobTemplatesAPI } from '../../../api';
|
||||
import SurveyStep from './SurveyStep';
|
||||
import StepName from './StepName';
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
DataToolbar,
|
||||
DataToolbarContent,
|
||||
} from '@patternfly/react-core/dist/umd/experimental';
|
||||
import DataListToolbar from '@components/DataListToolbar';
|
||||
import DataListToolbar from '../DataListToolbar';
|
||||
|
||||
import {
|
||||
encodeNonDefaultQueryString,
|
||||
@ -14,8 +14,8 @@ import {
|
||||
mergeParams,
|
||||
replaceParams,
|
||||
removeParams,
|
||||
} from '@util/qs';
|
||||
import { QSConfig, SearchColumns, SortColumns } from '@types';
|
||||
} from '../../util/qs';
|
||||
import { QSConfig, SearchColumns, SortColumns } from '../../types';
|
||||
|
||||
const EmptyStateControlsWrapper = styled.div`
|
||||
display: flex;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import ListHeader from './ListHeader';
|
||||
|
||||
describe('ListHeader', () => {
|
||||
|
||||
@ -3,13 +3,13 @@ import { bool, func, node, number, string, oneOfType } from 'prop-types';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { CredentialsAPI } from '@api';
|
||||
import { Credential } from '@types';
|
||||
import { getQSConfig, parseQueryString, mergeParams } from '@util/qs';
|
||||
import { FieldTooltip } from '@components/FormField';
|
||||
import { FormGroup } from '@patternfly/react-core';
|
||||
import Lookup from '@components/Lookup';
|
||||
import OptionsList from '@components/OptionsList';
|
||||
import { CredentialsAPI } from '../../api';
|
||||
import { Credential } from '../../types';
|
||||
import { getQSConfig, parseQueryString, mergeParams } from '../../util/qs';
|
||||
import { FieldTooltip } from '../FormField';
|
||||
import Lookup from '.';
|
||||
import OptionsList from '../OptionsList';
|
||||
import LookupErrorMessage from './shared/LookupErrorMessage';
|
||||
|
||||
const QS_CONFIG = getQSConfig('credentials', {
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import CredentialLookup, { _CredentialLookup } from './CredentialLookup';
|
||||
import { CredentialsAPI } from '@api';
|
||||
import { CredentialsAPI } from '../../api';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
describe('CredentialLookup', () => {
|
||||
let wrapper;
|
||||
|
||||
@ -4,10 +4,10 @@ import { withRouter } from 'react-router-dom';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { FormGroup } from '@patternfly/react-core';
|
||||
import { InstanceGroupsAPI } from '@api';
|
||||
import { getQSConfig, parseQueryString } from '@util/qs';
|
||||
import { FieldTooltip } from '@components/FormField';
|
||||
import OptionsList from '@components/OptionsList';
|
||||
import { InstanceGroupsAPI } from '../../api';
|
||||
import { getQSConfig, parseQueryString } from '../../util/qs';
|
||||
import { FieldTooltip } from '../FormField';
|
||||
import OptionsList from '../OptionsList';
|
||||
import Lookup from './Lookup';
|
||||
import LookupErrorMessage from './shared/LookupErrorMessage';
|
||||
|
||||
|
||||
@ -3,11 +3,11 @@ import { func, bool } from 'prop-types';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { InventoriesAPI } from '@api';
|
||||
import { Inventory } from '@types';
|
||||
import Lookup from '@components/Lookup';
|
||||
import OptionsList from '@components/OptionsList';
|
||||
import { getQSConfig, parseQueryString } from '@util/qs';
|
||||
import { InventoriesAPI } from '../../api';
|
||||
import { Inventory } from '../../types';
|
||||
import Lookup from '.';
|
||||
import OptionsList from '../OptionsList';
|
||||
import { getQSConfig, parseQueryString } from '../../util/qs';
|
||||
import LookupErrorMessage from './shared/LookupErrorMessage';
|
||||
|
||||
const QS_CONFIG = getQSConfig('inventory', {
|
||||
|
||||
@ -17,13 +17,13 @@ import {
|
||||
InputGroup as PFInputGroup,
|
||||
Modal,
|
||||
} from '@patternfly/react-core';
|
||||
import ChipGroup from '@components/ChipGroup';
|
||||
import ChipGroup from '../../components/ChipGroup';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import reducer, { initReducer } from './shared/reducer';
|
||||
import { QSConfig } from '@types';
|
||||
import { QSConfig } from '../../types';
|
||||
|
||||
const SearchButton = styled(Button)`
|
||||
::after {
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
/* eslint-disable react/jsx-pascal-case */
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { mountWithContexts, waitForElement } from '@testUtils/enzymeHelpers';
|
||||
import { getQSConfig } from '@util/qs';
|
||||
import {
|
||||
mountWithContexts,
|
||||
waitForElement,
|
||||
} from '../../../testUtils/enzymeHelpers';
|
||||
import { getQSConfig } from '../../util/qs';
|
||||
import Lookup from './Lookup';
|
||||
|
||||
/**
|
||||
|
||||
@ -4,11 +4,11 @@ import PropTypes from 'prop-types';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { ToolbarItem, Alert } from '@patternfly/react-core';
|
||||
import { CredentialsAPI, CredentialTypesAPI } from '@api';
|
||||
import AnsibleSelect from '@components/AnsibleSelect';
|
||||
import CredentialChip from '@components/CredentialChip';
|
||||
import OptionsList from '@components/OptionsList';
|
||||
import { getQSConfig, parseQueryString } from '@util/qs';
|
||||
import { CredentialsAPI, CredentialTypesAPI } from '../../api';
|
||||
import AnsibleSelect from '../AnsibleSelect';
|
||||
import CredentialChip from '../CredentialChip';
|
||||
import OptionsList from '../OptionsList';
|
||||
import { getQSConfig, parseQueryString } from '../../util/qs';
|
||||
import Lookup from './Lookup';
|
||||
|
||||
const QS_CONFIG = getQSConfig('credentials', {
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { mountWithContexts, waitForElement } from '@testUtils/enzymeHelpers';
|
||||
import {
|
||||
mountWithContexts,
|
||||
waitForElement,
|
||||
} from '../../../testUtils/enzymeHelpers';
|
||||
import MultiCredentialsLookup from './MultiCredentialsLookup';
|
||||
import { CredentialsAPI, CredentialTypesAPI } from '@api';
|
||||
import { CredentialsAPI, CredentialTypesAPI } from '../../api';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
describe('<MultiCredentialsLookup />', () => {
|
||||
let wrapper;
|
||||
|
||||
@ -3,11 +3,11 @@ import { node, func, bool } from 'prop-types';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { OrganizationsAPI } from '@api';
|
||||
import { Organization } from '@types';
|
||||
import { FormGroup } from '@patternfly/react-core';
|
||||
import { getQSConfig, parseQueryString } from '@util/qs';
|
||||
import OptionsList from '@components/OptionsList';
|
||||
import { OrganizationsAPI } from '../../api';
|
||||
import { Organization } from '../../types';
|
||||
import { getQSConfig, parseQueryString } from '../../util/qs';
|
||||
import OptionsList from '../OptionsList';
|
||||
import Lookup from './Lookup';
|
||||
import LookupErrorMessage from './shared/LookupErrorMessage';
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import OrganizationLookup, { _OrganizationLookup } from './OrganizationLookup';
|
||||
import { OrganizationsAPI } from '@api';
|
||||
import { OrganizationsAPI } from '../../api';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
describe('OrganizationLookup', () => {
|
||||
let wrapper;
|
||||
|
||||
@ -4,11 +4,11 @@ import { withRouter } from 'react-router-dom';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { FormGroup } from '@patternfly/react-core';
|
||||
import { ProjectsAPI } from '@api';
|
||||
import { Project } from '@types';
|
||||
import { FieldTooltip } from '@components/FormField';
|
||||
import OptionsList from '@components/OptionsList';
|
||||
import { getQSConfig, parseQueryString } from '@util/qs';
|
||||
import { ProjectsAPI } from '../../api';
|
||||
import { Project } from '../../types';
|
||||
import { FieldTooltip } from '../FormField';
|
||||
import OptionsList from '../OptionsList';
|
||||
import { getQSConfig, parseQueryString } from '../../util/qs';
|
||||
import Lookup from './Lookup';
|
||||
import LookupErrorMessage from './shared/LookupErrorMessage';
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { sleep } from '@testUtils/testUtils';
|
||||
import { ProjectsAPI } from '@api';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import { sleep } from '../../../testUtils/testUtils';
|
||||
import { ProjectsAPI } from '../../api';
|
||||
import ProjectLookup from './ProjectLookup';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
describe('<ProjectLookup />', () => {
|
||||
test('should auto-select project when only one available', async () => {
|
||||
|
||||
@ -4,13 +4,13 @@ import { withRouter } from 'react-router-dom';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
|
||||
import AlertModal from '@components/AlertModal';
|
||||
import ErrorDetail from '@components/ErrorDetail';
|
||||
import NotificationListItem from '@components/NotificationList/NotificationListItem';
|
||||
import PaginatedDataList from '@components/PaginatedDataList';
|
||||
import { getQSConfig, parseQueryString } from '@util/qs';
|
||||
import AlertModal from '../AlertModal';
|
||||
import ErrorDetail from '../ErrorDetail';
|
||||
import NotificationListItem from './NotificationListItem';
|
||||
import PaginatedDataList from '../PaginatedDataList';
|
||||
import { getQSConfig, parseQueryString } from '../../util/qs';
|
||||
|
||||
import { NotificationTemplatesAPI } from '@api';
|
||||
import { NotificationTemplatesAPI } from '../../api';
|
||||
|
||||
const QS_CONFIG = getQSConfig('notification', {
|
||||
page: 1,
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import React from 'react';
|
||||
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { sleep } from '@testUtils/testUtils';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import { sleep } from '../../../testUtils/testUtils';
|
||||
|
||||
import { NotificationTemplatesAPI } from '@api';
|
||||
import { NotificationTemplatesAPI } from '../../api';
|
||||
|
||||
import NotificationList from './NotificationList';
|
||||
|
||||
jest.mock('@api');
|
||||
jest.mock('../../api');
|
||||
|
||||
describe('<NotificationList />', () => {
|
||||
const data = {
|
||||
|
||||
@ -10,9 +10,8 @@ import {
|
||||
DataListItemRow,
|
||||
Switch,
|
||||
} from '@patternfly/react-core';
|
||||
import DataListCell from '@components/DataListCell';
|
||||
|
||||
import styled from 'styled-components';
|
||||
import DataListCell from '../DataListCell';
|
||||
|
||||
const DataListAction = styled(_DataListAction)`
|
||||
align-items: center;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import NotificationListItem from './NotificationListItem';
|
||||
|
||||
describe('<NotificationListItem canToggleNotifications />', () => {
|
||||
|
||||
@ -15,7 +15,7 @@ import SelectedList from '../SelectedList';
|
||||
import PaginatedDataList from '../PaginatedDataList';
|
||||
import CheckboxListItem from '../CheckboxListItem';
|
||||
import DataListToolbar from '../DataListToolbar';
|
||||
import { QSConfig, SearchColumns, SortColumns } from '@types';
|
||||
import { QSConfig, SearchColumns, SortColumns } from '../../types';
|
||||
|
||||
const ModalList = styled.div`
|
||||
.pf-c-data-toolbar__content {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { getQSConfig } from '@util/qs';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import { getQSConfig } from '../../util/qs';
|
||||
import OptionsList from './OptionsList';
|
||||
|
||||
const qsConfig = getQSConfig('test', { order_by: 'foo' });
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import PageHeaderToolbar from './PageHeaderToolbar';
|
||||
|
||||
describe('PageHeaderToolbar', () => {
|
||||
|
||||
@ -5,20 +5,20 @@ import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
|
||||
import ListHeader from '@components/ListHeader';
|
||||
import ContentEmpty from '@components/ContentEmpty';
|
||||
import ContentError from '@components/ContentError';
|
||||
import ContentLoading from '@components/ContentLoading';
|
||||
import Pagination from '@components/Pagination';
|
||||
import DataListToolbar from '@components/DataListToolbar';
|
||||
import ListHeader from '../ListHeader';
|
||||
import ContentEmpty from '../ContentEmpty';
|
||||
import ContentError from '../ContentError';
|
||||
import ContentLoading from '../ContentLoading';
|
||||
import Pagination from '../Pagination';
|
||||
import DataListToolbar from '../DataListToolbar';
|
||||
|
||||
import {
|
||||
encodeNonDefaultQueryString,
|
||||
parseQueryString,
|
||||
replaceParams,
|
||||
} from '@util/qs';
|
||||
} from '../../util/qs';
|
||||
|
||||
import { QSConfig, SearchColumns, SortColumns } from '@types';
|
||||
import { QSConfig, SearchColumns, SortColumns } from '../../types';
|
||||
|
||||
import PaginatedDataListItem from './PaginatedDataListItem';
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import PaginatedDataList from './PaginatedDataList';
|
||||
|
||||
const mockData = [
|
||||
|
||||
@ -6,8 +6,8 @@ import {
|
||||
DataListItemCells,
|
||||
TextContent,
|
||||
} from '@patternfly/react-core';
|
||||
import DataListCell from '@components/DataListCell';
|
||||
import styled from 'styled-components';
|
||||
import DataListCell from '../DataListCell';
|
||||
|
||||
const DetailWrapper = styled(TextContent)`
|
||||
display: grid;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import ToolbarAddButton from './ToolbarAddButton';
|
||||
|
||||
describe('<ToolbarAddButton />', () => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import ToolbarDeleteButton from './ToolbarDeleteButton';
|
||||
|
||||
const itemA = {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
|
||||
import Pagination from './Pagination';
|
||||
|
||||
|
||||
@ -4,13 +4,13 @@ import { withI18n } from '@lingui/react';
|
||||
import { t, Trans } from '@lingui/macro';
|
||||
import { Link } from 'react-router-dom';
|
||||
import styled from 'styled-components';
|
||||
import { toTitleCase } from '@util/strings';
|
||||
import { toTitleCase } from '../../util/strings';
|
||||
|
||||
import { Chip, Divider } from '@patternfly/react-core';
|
||||
import CredentialChip from '@components/CredentialChip';
|
||||
import ChipGroup from '@components/ChipGroup';
|
||||
import { DetailList, Detail, UserDateDetail } from '@components/DetailList';
|
||||
import { VariablesDetail } from '@components/CodeMirrorInput';
|
||||
import CredentialChip from '../../components/CredentialChip';
|
||||
import ChipGroup from '../../components/ChipGroup';
|
||||
import { DetailList, Detail, UserDateDetail } from '../../components/DetailList';
|
||||
import { VariablesDetail } from '../../components/CodeMirrorInput';
|
||||
|
||||
import PromptProjectDetail from './PromptProjectDetail';
|
||||
import PromptInventorySourceDetail from './PromptInventorySourceDetail';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import mockTemplate from './data.job_template.json';
|
||||
|
||||
import PromptDetail from './PromptDetail';
|
||||
|
||||
@ -4,10 +4,10 @@ import { t } from '@lingui/macro';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import { Chip, List, ListItem } from '@patternfly/react-core';
|
||||
import { Detail, DeletedDetail } from '@components/DetailList';
|
||||
import { VariablesDetail } from '@components/CodeMirrorInput';
|
||||
import CredentialChip from '@components/CredentialChip';
|
||||
import ChipGroup from '@components/ChipGroup';
|
||||
import { Detail, DeletedDetail } from '../../components/DetailList';
|
||||
import { VariablesDetail } from '../../components/CodeMirrorInput';
|
||||
import CredentialChip from '../../components/CredentialChip';
|
||||
import ChipGroup from '../../components/ChipGroup';
|
||||
|
||||
function PromptInventorySourceDetail({ i18n, resource }) {
|
||||
const {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||
import PromptInventorySourceDetail from './PromptInventorySourceDetail';
|
||||
import mockInvSource from './data.inventory_source.json';
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user