ESLint: Use --fix with new rules to order import declarations
Related to #795. This applies the new sorting rules in ESLint to the files by running `npm run lint:js:fix`
This commit is contained in:
parent
c6902ab347
commit
0bced556a9
27 changed files with 75 additions and 77 deletions
|
|
@ -1,5 +1,5 @@
|
|||
const { DefinePlugin } = require('webpack');
|
||||
const { resolve } = require('path');
|
||||
const { DefinePlugin } = require('webpack');
|
||||
const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
|
||||
const config = require('@redhat-cloud-services/frontend-components-config');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
const { DefinePlugin } = require('webpack');
|
||||
const { resolve } = require('path');
|
||||
const { DefinePlugin } = require('webpack');
|
||||
const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
|
||||
const config = require('@redhat-cloud-services/frontend-components-config');
|
||||
const { config: webpackConfig, plugins } = config({
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import React, { useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Router } from './Router';
|
||||
import '@patternfly/patternfly/patternfly-addons.css';
|
||||
|
||||
import { getRegistry } from '@redhat-cloud-services/frontend-components-utilities/Registry';
|
||||
import NotificationsPortal from '@redhat-cloud-services/frontend-components-notifications/NotificationPortal';
|
||||
import { notificationsReducer } from '@redhat-cloud-services/frontend-components-notifications/redux';
|
||||
import { Router } from './Router';
|
||||
|
||||
const App = (props) => {
|
||||
const navigate = useNavigate();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
import App from './App';
|
||||
import { getBaseName } from '@redhat-cloud-services/frontend-components-utilities/helpers';
|
||||
import App from './App';
|
||||
import { store } from './store';
|
||||
|
||||
const ImageBuilder = () => (
|
||||
|
|
|
|||
|
|
@ -1,32 +1,30 @@
|
|||
import React from 'react';
|
||||
import ImageCreator from './ImageCreator';
|
||||
import { useNavigate, useLocation } from 'react-router-dom';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import componentTypes from '@data-driven-forms/react-form-renderer/component-types';
|
||||
import DocumentationButton from '../sharedComponents/DocumentationButton';
|
||||
import './CreateImageWizard.scss';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import api from '../../api';
|
||||
import { UNIT_KIB, UNIT_MIB, UNIT_GIB } from '../../constants';
|
||||
import isRhel from '../../Utilities/isRhel';
|
||||
import { composeAdded } from '../../store/actions/actions';
|
||||
import { addNotification } from '@redhat-cloud-services/frontend-components-notifications/redux';
|
||||
|
||||
import { useDispatch } from 'react-redux';
|
||||
import ImageCreator from './ImageCreator';
|
||||
import {
|
||||
review,
|
||||
awsTarget,
|
||||
registration,
|
||||
fileSystemConfiguration,
|
||||
googleCloudTarger,
|
||||
imageName,
|
||||
imageOutput,
|
||||
msAzureTarget,
|
||||
packages,
|
||||
imageOutput,
|
||||
fileSystemConfiguration,
|
||||
imageName,
|
||||
registration,
|
||||
review,
|
||||
} from './steps';
|
||||
|
||||
import {
|
||||
fileSystemConfigurationValidator,
|
||||
targetEnvironmentValidator,
|
||||
} from './validators';
|
||||
import DocumentationButton from '../sharedComponents/DocumentationButton';
|
||||
import './CreateImageWizard.scss';
|
||||
import api from '../../api';
|
||||
import { UNIT_GIB, UNIT_KIB, UNIT_MIB } from '../../constants';
|
||||
import isRhel from '../../Utilities/isRhel';
|
||||
import { composeAdded } from '../../store/actions/actions';
|
||||
|
||||
const handleKeyDown = (e, handleClose) => {
|
||||
if (e.key === 'Escape') {
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ import Pf4FormTemplate from '@data-driven-forms/pf4-component-mapper/form-templa
|
|||
import { componentMapper } from '@data-driven-forms/pf4-component-mapper';
|
||||
import { Spinner } from '@patternfly/react-core';
|
||||
import PropTypes from 'prop-types';
|
||||
import Select from '@data-driven-forms/pf4-component-mapper/select';
|
||||
import Review from './formComponents/ReviewStep';
|
||||
import TargetEnvironment from './formComponents/TargetEnvironment';
|
||||
import Packages from './formComponents/Packages';
|
||||
import RadioWithPopover from './formComponents/RadioWithPopover';
|
||||
import AzureAuthButton from './formComponents/AzureAuthButton';
|
||||
import ActivationKeys from './formComponents/ActivationKeys';
|
||||
import Select from '@data-driven-forms/pf4-component-mapper/select';
|
||||
import FileSystemConfiguration from './formComponents/FileSystemConfiguration';
|
||||
import FileSystemConfigToggle from './formComponents/FileSystemConfigToggle';
|
||||
import ImageOutputReleaseSelect from './formComponents/ImageOutputReleaseSelect';
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ import React, { useEffect, useState } from 'react';
|
|||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
FormGroup,
|
||||
Spinner,
|
||||
Select,
|
||||
SelectOption,
|
||||
SelectVariant,
|
||||
Spinner,
|
||||
} from '@patternfly/react-core';
|
||||
import useFormApi from '@data-driven-forms/react-form-renderer/use-form-api';
|
||||
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState, useEffect } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { ToggleGroup, ToggleGroupItem } from '@patternfly/react-core';
|
||||
|
||||
import useFormApi from '@data-driven-forms/react-form-renderer/use-form-api';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useEffect, useState, useRef } from 'react';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import {
|
||||
HelpIcon,
|
||||
MinusCircleIcon,
|
||||
|
|
@ -14,20 +14,20 @@ import {
|
|||
} from '@patternfly/react-core';
|
||||
import {
|
||||
TableComposable,
|
||||
Thead,
|
||||
Tbody,
|
||||
Tr,
|
||||
Th,
|
||||
Td,
|
||||
Th,
|
||||
Thead,
|
||||
Tr,
|
||||
} from '@patternfly/react-table';
|
||||
import styles from '@patternfly/react-styles/css/components/Table/table';
|
||||
import useFormApi from '@data-driven-forms/react-form-renderer/use-form-api';
|
||||
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { UNIT_GIB } from '../../../constants';
|
||||
import MountPoint from './MountPoint';
|
||||
import SizeUnit from './SizeUnit';
|
||||
import { UNIT_GIB } from '../../../constants';
|
||||
|
||||
let initialRow = {
|
||||
id: uuidv4(),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import path from 'path';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
|
|
@ -6,7 +7,6 @@ import {
|
|||
SelectVariant,
|
||||
TextInput,
|
||||
} from '@patternfly/react-core';
|
||||
import path from 'path';
|
||||
|
||||
const MountPoint = ({ ...props }) => {
|
||||
// check '/' last!
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import useFormApi from '@data-driven-forms/react-form-renderer/use-form-api';
|
||||
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
||||
import api from '../../../api';
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
DualListSelector,
|
||||
DualListSelectorPane,
|
||||
DualListSelectorControl,
|
||||
DualListSelectorControlsWrapper,
|
||||
DualListSelectorList,
|
||||
DualListSelectorListItem,
|
||||
DualListSelectorControlsWrapper,
|
||||
DualListSelectorControl,
|
||||
DualListSelectorPane,
|
||||
SearchInput,
|
||||
TextContent,
|
||||
} from '@patternfly/react-core';
|
||||
import {
|
||||
AngleDoubleLeftIcon,
|
||||
AngleLeftIcon,
|
||||
AngleDoubleRightIcon,
|
||||
AngleLeftIcon,
|
||||
AngleRightIcon,
|
||||
} from '@patternfly/react-icons';
|
||||
import api from '../../../api';
|
||||
|
||||
// the fields isHidden and isSelected should not be included in the package list sent for image creation
|
||||
const removePackagesDisplayFields = (packages) =>
|
||||
|
|
|
|||
|
|
@ -3,31 +3,31 @@ import PropTypes from 'prop-types';
|
|||
import {
|
||||
Button,
|
||||
DescriptionList,
|
||||
DescriptionListTerm,
|
||||
DescriptionListGroup,
|
||||
DescriptionListDescription,
|
||||
DescriptionListGroup,
|
||||
DescriptionListTerm,
|
||||
List,
|
||||
ListItem,
|
||||
Popover,
|
||||
Spinner,
|
||||
Tabs,
|
||||
Tab,
|
||||
Tabs,
|
||||
TabTitleText,
|
||||
Text,
|
||||
TextContent,
|
||||
TextVariants,
|
||||
TextList,
|
||||
TextListVariants,
|
||||
TextListItem,
|
||||
TextListItemVariants,
|
||||
TextListVariants,
|
||||
TextVariants,
|
||||
} from '@patternfly/react-core';
|
||||
import {
|
||||
TableComposable,
|
||||
Thead,
|
||||
Tbody,
|
||||
Tr,
|
||||
Th,
|
||||
Td,
|
||||
Th,
|
||||
Thead,
|
||||
Tr,
|
||||
} from '@patternfly/react-table';
|
||||
import { HelpIcon } from '@patternfly/react-icons';
|
||||
import useFormApi from '@data-driven-forms/react-form-renderer/use-form-api';
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
TextInput,
|
||||
} from '@patternfly/react-core';
|
||||
|
||||
import { UNIT_KIB, UNIT_MIB, UNIT_GIB } from '../../../constants';
|
||||
import { UNIT_GIB, UNIT_KIB, UNIT_MIB } from '../../../constants';
|
||||
|
||||
const SizeUnit = ({ ...props }) => {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState, useEffect } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import useFormApi from '@data-driven-forms/react-form-renderer/use-form-api';
|
||||
import useFieldApi from '@data-driven-forms/react-form-renderer/use-field-api';
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import componentTypes from '@data-driven-forms/react-form-renderer/component-types';
|
||||
import validatorTypes from '@data-driven-forms/react-form-renderer/validator-types';
|
||||
import nextStepMapper from './imageOutputStepMapper';
|
||||
import { Title } from '@patternfly/react-core';
|
||||
import nextStepMapper from './imageOutputStepMapper';
|
||||
import StepTemplate from './stepTemplate';
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -2,17 +2,17 @@ import React from 'react';
|
|||
import componentTypes from '@data-driven-forms/react-form-renderer/component-types';
|
||||
import validatorTypes from '@data-driven-forms/react-form-renderer/validator-types';
|
||||
import { HelpIcon } from '@patternfly/react-icons';
|
||||
import nextStepMapper from './imageOutputStepMapper';
|
||||
import {
|
||||
Title,
|
||||
Text,
|
||||
Button,
|
||||
Popover,
|
||||
Text,
|
||||
TextContent,
|
||||
TextList,
|
||||
TextListItem,
|
||||
Button,
|
||||
Title,
|
||||
} from '@patternfly/react-core';
|
||||
import PropTypes from 'prop-types';
|
||||
import nextStepMapper from './imageOutputStepMapper';
|
||||
import StepTemplate from './stepTemplate';
|
||||
|
||||
export const googleAccType = {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import React from 'react';
|
||||
import componentTypes from '@data-driven-forms/react-form-renderer/component-types';
|
||||
import validatorTypes from '@data-driven-forms/react-form-renderer/validator-types';
|
||||
import nextStepMapper from './imageOutputStepMapper';
|
||||
import { RHEL_9 } from '../../../constants.js';
|
||||
import { Text } from '@patternfly/react-core';
|
||||
import DocumentationButton from '../../sharedComponents/DocumentationButton';
|
||||
import nextStepMapper from './imageOutputStepMapper';
|
||||
import StepTemplate from './stepTemplate';
|
||||
import { RHEL_9 } from '../../../constants.js';
|
||||
import DocumentationButton from '../../sharedComponents/DocumentationButton';
|
||||
|
||||
export default {
|
||||
StepTemplate,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import componentTypes from '@data-driven-forms/react-form-renderer/component-types';
|
||||
import validatorTypes from '@data-driven-forms/react-form-renderer/validator-types';
|
||||
import { Title, Text, Button, TextContent } from '@patternfly/react-core';
|
||||
import { Button, Text, TextContent, Title } from '@patternfly/react-core';
|
||||
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
|
||||
import nextStepMapper from './imageOutputStepMapper';
|
||||
import StepTemplate from './stepTemplate';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import CustomButtons from '../formComponents/CustomSubmitButtons';
|
||||
import StepTemplate from './stepTemplate';
|
||||
import CustomButtons from '../formComponents/CustomSubmitButtons';
|
||||
|
||||
export default {
|
||||
StepTemplate,
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import PropTypes from 'prop-types';
|
|||
import { Flex } from '@patternfly/react-core';
|
||||
import {
|
||||
CheckCircleIcon,
|
||||
PendingIcon,
|
||||
ExclamationCircleIcon,
|
||||
InProgressIcon,
|
||||
PendingIcon,
|
||||
} from '@patternfly/react-icons';
|
||||
|
||||
import './ImageBuildStatus.scss';
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ import PropTypes from 'prop-types';
|
|||
|
||||
import {
|
||||
Button,
|
||||
TextContent,
|
||||
Text,
|
||||
TextVariants,
|
||||
Popover,
|
||||
Text,
|
||||
TextContent,
|
||||
TextVariants,
|
||||
} from '@patternfly/react-core';
|
||||
import { DownloadIcon, ExternalLinkAltIcon } from '@patternfly/react-icons';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,39 +1,39 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useSelector, useDispatch } from 'react-redux';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import {
|
||||
TableComposable,
|
||||
Thead,
|
||||
Tr,
|
||||
Th,
|
||||
Tbody,
|
||||
Td,
|
||||
ActionsColumn,
|
||||
ExpandableRowContent,
|
||||
TableComposable,
|
||||
Tbody,
|
||||
Td,
|
||||
Th,
|
||||
Thead,
|
||||
Tr,
|
||||
} from '@patternfly/react-table';
|
||||
import {
|
||||
EmptyState,
|
||||
EmptyStateVariant,
|
||||
EmptyStateIcon,
|
||||
EmptyStateBody,
|
||||
EmptyStateIcon,
|
||||
EmptyStateSecondaryActions,
|
||||
EmptyStateVariant,
|
||||
Pagination,
|
||||
PaginationVariant,
|
||||
Title,
|
||||
Toolbar,
|
||||
ToolbarContent,
|
||||
ToolbarItem,
|
||||
Title,
|
||||
} from '@patternfly/react-core';
|
||||
import { PlusCircleIcon } from '@patternfly/react-icons';
|
||||
import './ImagesTable.scss';
|
||||
import { composesGet, composeGetStatus } from '../../store/actions/actions';
|
||||
import DocumentationButton from '../sharedComponents/DocumentationButton';
|
||||
import ImageBuildStatus from './ImageBuildStatus';
|
||||
import Release from './Release';
|
||||
import Target from './Target';
|
||||
import ImageLink from './ImageLink';
|
||||
import ErrorDetails from './ImageBuildErrorDetails';
|
||||
import DocumentationButton from '../sharedComponents/DocumentationButton';
|
||||
import { composeGetStatus, composesGet } from '../../store/actions/actions';
|
||||
|
||||
const ImagesTable = () => {
|
||||
const [page, setPage] = useState(1);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import {
|
|||
PageHeaderTitle,
|
||||
} from '@redhat-cloud-services/frontend-components';
|
||||
|
||||
import { Button, Popover, TextContent, Text } from '@patternfly/react-core';
|
||||
import { Button, Popover, Text, TextContent } from '@patternfly/react-core';
|
||||
import { GithubIcon, HelpIcon } from '@patternfly/react-icons';
|
||||
|
||||
import ImagesTable from '../ImagesTable/ImagesTable';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { configureStore } from '@reduxjs/toolkit';
|
||||
import composes from './reducers/composes';
|
||||
import promiseMiddleware from 'redux-promise-middleware';
|
||||
import { notificationsReducer } from '@redhat-cloud-services/frontend-components-notifications/redux';
|
||||
import composes from './reducers/composes';
|
||||
|
||||
export const reducer = {
|
||||
composes: composes,
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ import '@testing-library/jest-dom';
|
|||
|
||||
import React from 'react';
|
||||
import {
|
||||
act,
|
||||
screen,
|
||||
waitFor,
|
||||
waitForElementToBeRemoved,
|
||||
within,
|
||||
act,
|
||||
} from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { renderWithReduxRouter } from '../../testUtils';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react';
|
||||
import { screen, render, within } from '@testing-library/react';
|
||||
import { render, screen, within } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { renderWithReduxRouter } from '../../testUtils';
|
||||
import ImagesTable from '../../../Components/ImagesTable/ImagesTable';
|
||||
import ImageBuildStatus from '../../../Components/ImagesTable/ImageBuildStatus';
|
||||
|
|
@ -7,7 +8,6 @@ import ImageLink from '../../../Components/ImagesTable/ImageLink';
|
|||
import Target from '../../../Components/ImagesTable/Target';
|
||||
import '@testing-library/jest-dom';
|
||||
import { RHEL_8 } from '../../../constants.js';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
jest.mock('../../../store/actions/actions', () => {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { configureStore } from '@reduxjs/toolkit';
|
|||
import { Provider } from 'react-redux';
|
||||
import { render } from '@testing-library/react';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { reducer, middleware } from '../store';
|
||||
import { middleware, reducer } from '../store';
|
||||
|
||||
export const renderWithReduxRouter = (
|
||||
component,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue