Skip to content

Commit

Permalink
Fix js imports
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bucher committed Feb 21, 2024
1 parent 3ab5629 commit 4ab9dfc
Show file tree
Hide file tree
Showing 22 changed files with 36 additions and 101 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import $ from 'jquery';

Check failure on line 1 in webpack/components/ApplicationDefinition/ApplicationDefinition.js

View workflow job for this annotation

GitHub Actions / test_js (14)

File has too many lines (493). Maximum allowed is 300

Check failure on line 1 in webpack/components/ApplicationDefinition/ApplicationDefinition.js

View workflow job for this annotation

GitHub Actions / test_js (14)

'$' is defined but never used
import React, { useState } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import {
Icon,
Expand All @@ -12,12 +12,12 @@ import {
import * as resolve from 'table-resolver';
import ForemanModal from 'foremanReact/components/ForemanModal';
import Select from 'foremanReact/components/common/forms/Select';
import { translate as __ } from 'foremanReact/common/I18n';
import ParameterSelection from '../ParameterSelection';
import AddTableEntry from '../common/AddTableEntry';
import DeleteTableEntry from '../common/DeleteTableEntry';
import RailsData from '../common/RailsData';
import AnsiblePlaybookSelector from './components/AnsiblePlaybookSelector';
import { translate as __ } from 'foremanReact/common/I18n';
import { EasyHeaderFormatter } from '../../helper';

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import api from 'foremanReact/API';

import {
Expand All @@ -8,11 +7,6 @@ import {

import { actionHeaderCellFormatter } from 'patternfly-react';

import {
propsToSnakeCase,
propsToCamelCase,
} from 'foremanReact/common/helpers';

import {
APPLICATION_DEFINITION_INIT,
APPLICATION_DEFINITION_CLOSE_ALERT_MODAL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Immutable from 'seamless-immutable';
import { translate as __ } from 'foremanReact/common/I18n';

import { cloneDeep, findIndex, findLastIndex } from 'lodash';
import { cloneDeep, findIndex } from 'lodash';

import {
APPLICATION_DEFINITION_INIT,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import React, { useState } from 'react';
import { cloneDeep } from 'lodash';
import React from 'react';
import PropTypes from 'prop-types';
import {
Icon,
Button,
MessageDialog,
Table,
FormControl,
inlineEditFormatterFactory,
} from 'patternfly-react';
import * as resolve from 'table-resolver';
import Select from 'foremanReact/components/common/forms/Select';
import CommonForm from 'foremanReact/components/common/forms/CommonForm';
import AddTableEntry from '../common/AddTableEntry';
import DeleteTableEntry from '../common/DeleteTableEntry';
import { translate as __ } from 'foremanReact/common/I18n';
import RailsData from '../common/RailsData';
import { EasyHeaderFormatter } from '../../helper';
import { translate as __ } from 'foremanReact/common/I18n';

class ApplicationDefinitionImport extends React.Component {
constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
import React from 'react';
import { API, actionTypeGenerator } from 'foremanReact/redux/API';
import { API } from 'foremanReact/redux/API';
import { addToast } from 'foremanReact/components/ToastsList';
import { sprintf, translate as __ } from 'foremanReact/common/I18n';

import {
setModalOpen,
setModalClosed,
} from 'foremanReact/components/ForemanModal/ForemanModalActions';

import { actionHeaderCellFormatter } from 'patternfly-react';

import {
propsToSnakeCase,
propsToCamelCase,
} from 'foremanReact/common/helpers';

import {
APPLICATION_DEFINITION_IMPORT_INIT,
APPLICATION_DEFINITION_IMPORT_CLOSE_ALERT_MODAL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Immutable from 'seamless-immutable';

import { cloneDeep, findIndex, findLastIndex } from 'lodash';

import { translate as __ } from 'foremanReact/common/I18n';
import { cloneDeep, findIndex } from 'lodash';

import {
APPLICATION_DEFINITION_IMPORT_INIT,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import {
Icon,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import React from 'react';
import api from 'foremanReact/API';
import { translate as __ } from 'foremanReact/common/I18n';
import {
setModalOpen,
setModalClosed,
} from 'foremanReact/components/ForemanModal/ForemanModalActions';

import { actionHeaderCellFormatter } from 'patternfly-react';

import {
propsToSnakeCase,
propsToCamelCase,
} from 'foremanReact/common/helpers';

import {
APPLICATION_INSTANCE_INIT,
APPLICATION_INSTANCE_CLOSE_ALERT_MODAL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Immutable from 'seamless-immutable';
import { translate as __ } from 'foremanReact/common/I18n';
import { calculateServiceUsage } from './ApplicationInstanceHelper';
import { cloneDeep, findIndex } from 'lodash';

import { cloneDeep, findIndex, findLastIndex } from 'lodash';
import { calculateServiceUsage } from './ApplicationInstanceHelper';

import {
APPLICATION_INSTANCE_INIT,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { translate as __ } from 'foremanReact/common/I18n';

const Service = ({ name, currentCount, minCount, maxCount }) => (
<div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { cloneDeep } from 'lodash';
import Service from './Service';
import { arrayToObjectObj } from '../../../helper';
import { cloneDeep } from 'lodash';

const ServiceCounter = ({ title, serviceList }) => {
if (serviceList == undefined || serviceList.length == 0) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React from 'react';
import PropTypes from 'prop-types';

import { Icon, Spinner } from 'patternfly-react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import React from 'react';
import api from 'foremanReact/API';

import { actionHeaderCellFormatter } from 'patternfly-react';

import {
propsToSnakeCase,
propsToCamelCase,
} from 'foremanReact/common/helpers';

import {
APPLICATION_INSTANCE_REPORT_INIT,
APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import Immutable from 'seamless-immutable';

import { cloneDeep, findIndex, findLastIndex } from 'lodash';

import {
APPLICATION_INSTANCE_REPORT_INIT,
APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';
import { orderBy, cloneDeep } from 'lodash';
import { cloneDeep } from 'lodash';
import { DualListControlled } from 'patternfly-react';
import { translate as __ } from 'foremanReact/common/I18n';
import ServiceSelector from './components/ServiceSelector';
import { arrayToObject } from '../../helper';

import { Icon, Button, DualListControlled } from 'patternfly-react';

class ExistingHostSelection extends React.Component {
constructor(props) {
super(props);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import React from 'react';
import * as sort from 'sortabular';
import { translate as __ } from 'foremanReact/common/I18n';

import api from 'foremanReact/API';

import {
propsToSnakeCase,
propsToCamelCase,
} from 'foremanReact/common/helpers';

import {
EXISTING_HOST_SELECTION_INIT,
EXISTING_HOST_SELECTION_LOAD_HOSTS_SUCCESS,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Immutable from 'seamless-immutable';

import { cloneDeep, findIndex, findLastIndex } from 'lodash';
import { translate as __ } from 'foremanReact/common/I18n';

import { shortHostname } from '../../helper';
import * as sort from 'sortabular';

import {
EXISTING_HOST_SELECTION_INIT,
Expand Down
7 changes: 3 additions & 4 deletions webpack/components/ParameterSelection/ParameterSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@ import $ from 'jquery';
import React from 'react';
import PropTypes from 'prop-types';
import * as sort from 'sortabular';
import { orderBy, dropRight, findIndex, cloneDeep } from 'lodash';
import { orderBy, findIndex, cloneDeep } from 'lodash';
import * as resolve from 'table-resolver';
import Select from 'foremanReact/components/common/forms/Select';
import ForemanModal from 'foremanReact/components/ForemanModal';
import { translate as __ } from 'foremanReact/common/I18n';
import AddTableEntry from '../common/AddTableEntry';
import EditTableEntry from '../common/EditTableEntry';
import DeleteTableEntry from '../common/DeleteTableEntry';
import LockTableEntry from '../common/LockTableEntry';
import ForemanModal from 'foremanReact/components/ForemanModal';
import * as YamlValidator from '../../js-yaml';

import { transformForemanData } from './ParameterSelectionHelper';

import {
PARAMETER_SELECTION_TYPES,
PARAMETER_SELECTION_PARAM_TYPE_FOREMAN,
PARAMETER_SELECTION_PARAM_TYPE_ANSIBLE,
} from './ParameterSelectionConstants';

import {
Icon,
Button,
Table,
FormControl,
Expand Down
16 changes: 3 additions & 13 deletions webpack/components/ParameterSelection/ParameterSelectionActions.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
import React from 'react';
import * as sort from 'sortabular';
import { translate as __ } from 'foremanReact/common/I18n';

import {
actionHeaderCellFormatter,
sortableHeaderCellFormatter,
tableCellFormatter,
TABLE_SORT_DIRECTION,
} from 'patternfly-react';

import { translate as __ } from 'foremanReact/common/I18n';
import api from 'foremanReact/API';

import {
propsToSnakeCase,
propsToCamelCase,
} from 'foremanReact/common/helpers';

import { filterParameterTypes } from './ParameterSelectionHelper';

import {
setModalOpen,
setModalClosed,
} from 'foremanReact/components/ForemanModal/ForemanModalActions';

import { filterParameterTypes } from './ParameterSelectionHelper';

import {
PARAMETER_SELECTION_INIT,
PARAMETER_SELECTION_TYPES,
Expand All @@ -35,7 +26,6 @@ import {
PARAMETER_SELECTION_EDIT_CANCEL,
PARAMETER_SELECTION_SORT,
PARAMETER_SELECTION_PARAM_TYPE_FOREMAN,
PARAMETER_SELECTION_PARAM_TYPE_ANSIBLE,
PARAMETER_SELECTION_LOAD_PARAM_DATA_REQUEST,
PARAMETER_SELECTION_LOAD_PARAM_DATA_SUCCESS,
PARAMETER_SELECTION_LOAD_PARAM_DATA_FAILURE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import Immutable from 'seamless-immutable';

import { cloneDeep, findIndex, findLastIndex } from 'lodash';

import { filterParameterTypes } from './ParameterSelectionHelper';
import { cloneDeep, findIndex } from 'lodash';

import * as sort from 'sortabular';

import { filterParameterTypes } from './ParameterSelectionHelper';

import {
PARAMETER_SELECTION_INIT,
PARAMETER_SELECTION_TYPES,
PARAMETER_SELECTION_LOCK,
PARAMETER_SELECTION_DELETE,
PARAMETER_SELECTION_ADD,
Expand Down
17 changes: 5 additions & 12 deletions webpack/components/SyncGitRepo/SyncGitRepo.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import React, { useState } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import {
Icon,
Button,
FormControl,
inlineEditFormatterFactory,
} from 'patternfly-react';
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
import { Select, TextInput } from 'foremanReact/components/common/forms/Select';
import Button from 'patternfly-react';
import $ from 'jquery';
import CommonForm from 'foremanReact/components/common/forms/CommonForm';
import { translate as __ } from 'foremanReact/common/I18n';
import ScmTypeSelector from './components/ScmTypeSelector';
import FormTextInput from './components/FormTextInput';
import { arrayToObject } from '../../helper';
import CommonForm from 'foremanReact/components/common/forms/CommonForm';
import $ from 'jquery';

class SyncGitRepo extends React.Component {
constructor(props) {
Expand Down
6 changes: 4 additions & 2 deletions webpack/components/SyncGitRepo/SyncGitRepoActions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import { API, actionTypeGenerator } from 'foremanReact/redux/API';
import {
API,
// actionTypeGenerator,
} from 'foremanReact/redux/API';
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
import { addToast } from 'foremanReact/components/ToastsList';

Expand Down

0 comments on commit 4ab9dfc

Please sign in to comment.