Kaynağa Gözat

Fix ESLint errors

As a result of upgrading the ESLint library, new errors were identified.
Sergiu Miclea 4 yıl önce
ebeveyn
işleme
73f2103677
80 değiştirilmiş dosya ile 248 ekleme ve 328 silme
  1. 1 15
      .eslintrc
  2. 1 3
      server/azureProxy.ts
  3. 0 2
      src/components/App.tsx
  4. 0 13
      src/components/modules/AssessmentModule/AssessmentDetailsContent/AssessmentDetailsContent.tsx
  5. 9 8
      src/components/modules/AssessmentModule/AssessmentMigrationOptions/AssessmentMigrationOptions.tsx
  6. 1 3
      src/components/modules/DashboardModule/DashboardBarChart/DashboardBarChart.tsx
  7. 0 1
      src/components/modules/DashboardModule/DashboardPieChart/DashboardPieChart.tsx
  8. 2 1
      src/components/modules/EndpointModule/EndpointLogos/story.tsx
  9. 8 4
      src/components/modules/EndpointModule/EndpointModal/EndpointModal.tsx
  10. 0 1
      src/components/modules/LoginModule/LoginForm/LoginForm.tsx
  11. 0 4
      src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.tsx
  12. 0 1
      src/components/modules/NavigationModule/Navigation/Navigation.tsx
  13. 5 2
      src/components/modules/ProjectModule/ProjectDetailsContent/ProjectDetailsContent.tsx
  14. 0 34
      src/components/modules/TransferModule/Schedule/Schedule.tsx
  15. 0 3
      src/components/modules/TransferModule/TaskItem/story.tsx
  16. 1 1
      src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx
  17. 8 4
      src/components/modules/WizardModule/WizardPageContent/WizardPageContent.tsx
  18. 10 4
      src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx
  19. 5 2
      src/components/smart/DashboardPage/DashboardPage.tsx
  20. 0 1
      src/components/smart/LogsPage/DownloadsContent.tsx
  21. 1 3
      src/components/smart/MigrationDetailsPage/MigrationDetailsPage.tsx
  22. 0 8
      src/components/smart/MinionPoolDetailsPage/MinionPoolDetailsPage.tsx
  23. 1 3
      src/components/smart/ReplicaDetailsPage/ReplicaDetailsPage.tsx
  24. 1 3
      src/components/smart/WizardPage/WizardPage.tsx
  25. 1 1
      src/components/ui/Arrow/story.tsx
  26. 1 1
      src/components/ui/AutocompleteInput/story.tsx
  27. 1 1
      src/components/ui/Button/story.tsx
  28. 1 1
      src/components/ui/Checkbox/story.tsx
  29. 0 1
      src/components/ui/CopyButton/CopyButton.tsx
  30. 1 1
      src/components/ui/CopyButton/story.tsx
  31. 16 14
      src/components/ui/DatetimePicker/DatetimePicker.tsx
  32. 1 1
      src/components/ui/DatetimePicker/story.tsx
  33. 13 12
      src/components/ui/Dropdowns/ActionDropdown/ActionDropdown.tsx
  34. 1 1
      src/components/ui/Dropdowns/ActionDropdown/story.tsx
  35. 13 11
      src/components/ui/Dropdowns/AutocompleteDropdown/AutocompleteDropdown.tsx
  36. 1 1
      src/components/ui/Dropdowns/AutocompleteDropdown/story.tsx
  37. 64 63
      src/components/ui/Dropdowns/Dropdown/Dropdown.tsx
  38. 1 1
      src/components/ui/Dropdowns/Dropdown/story.tsx
  39. 1 1
      src/components/ui/Dropdowns/DropdownFilter/story.tsx
  40. 1 1
      src/components/ui/Dropdowns/DropdownInput/story.tsx
  41. 15 16
      src/components/ui/Dropdowns/DropdownLink/DropdownLink.tsx
  42. 1 1
      src/components/ui/Dropdowns/DropdownLink/story.tsx
  43. 1 1
      src/components/ui/Dropdowns/NewItemDropdown/story.tsx
  44. 1 1
      src/components/ui/Dropdowns/NotificationDropdown/story.tsx
  45. 1 1
      src/components/ui/Dropdowns/UserDropdown/story.tsx
  46. 1 1
      src/components/ui/InfoIcon/story.tsx
  47. 0 1
      src/components/ui/LoadingButton/LoadingButton.tsx
  48. 7 3
      src/components/ui/Modal/Modal.tsx
  49. 1 1
      src/components/ui/Modal/story.tsx
  50. 1 1
      src/components/ui/Panel/story.tsx
  51. 0 1
      src/components/ui/PasswordValue/PasswordValue.tsx
  52. 1 1
      src/components/ui/PasswordValue/story.tsx
  53. 1 1
      src/components/ui/ProgressBar/story.tsx
  54. 1 1
      src/components/ui/RadioInput/story.tsx
  55. 1 1
      src/components/ui/ReloadButton/story.tsx
  56. 0 1
      src/components/ui/SearchInput/SearchInput.tsx
  57. 1 1
      src/components/ui/SearchInput/story.tsx
  58. 1 3
      src/components/ui/SmallLoading/SmallLoading.tsx
  59. 1 1
      src/components/ui/SmallLoading/story.tsx
  60. 1 3
      src/components/ui/StatusComponents/StatusImage/StatusImage.tsx
  61. 1 1
      src/components/ui/Switch/story.tsx
  62. 1 1
      src/components/ui/Table/story.tsx
  63. 1 1
      src/components/ui/TextArea/story.tsx
  64. 1 1
      src/components/ui/TextInput/story.tsx
  65. 1 1
      src/components/ui/ToggleButtonBar/story.tsx
  66. 9 7
      src/plugins/azure/ConnectionSchemaPlugin.ts
  67. 1 0
      src/plugins/azure/ContentPlugin.tsx
  68. 1 0
      src/plugins/default/ContentPlugin.tsx
  69. 1 3
      src/plugins/default/OptionsSchemaPlugin.ts
  70. 2 3
      src/plugins/openstack/ContentPlugin.tsx
  71. 1 3
      src/sources/AzureSource.ts
  72. 2 1
      src/sources/ProviderSource.ts
  73. 5 5
      src/sources/ReplicaSource.ts
  74. 1 3
      src/sources/UserSource.ts
  75. 1 3
      src/stores/MigrationStore.ts
  76. 1 3
      src/stores/UserStore.ts
  77. 2 6
      src/stores/WizardStore.ts
  78. 1 3
      src/utils/DomUtils.ts
  79. 5 2
      src/utils/KeyboardManager.ts
  80. 2 4
      src/utils/ObjectUtils.ts

+ 1 - 15
.eslintrc

@@ -38,21 +38,6 @@
     "react/function-component-definition": "off",
     "import/no-relative-packages": "off",
     "react/sort-comp": "off",
-    "react/jsx-indent": [
-      2,
-      2,
-      {
-        "checkAttributes": true,
-        "indentLogicalExpressions": true
-      }
-    ],
-    "react/jsx-indent-props": [
-      2,
-      2
-    ],
-    "react/self-closing-comp": [
-      2
-    ],
     "react/jsx-one-expression-per-line": "off",
     "@typescript-eslint/semi": [
       2,
@@ -63,6 +48,7 @@
       "as-needed"
     ],
     "no-console": "off",
+    "react/require-default-props": "off",
     "class-methods-use-this": "off",
     "no-underscore-dangle": "off",
     "jsx-a11y/mouse-events-have-key-events": "off",

+ 1 - 3
server/azureProxy.ts

@@ -42,9 +42,7 @@ export default (app: express.Application) => {
     if (userCred && userCred.username && userCred.password) {
       MsRest.loginWithUsernamePassword(userCred.username, userCred.password, handleResponse)
     } else if (servicePrin && servicePrin.client_id && servicePrin.client_secret) {
-      MsRest.loginWithServicePrincipalSecret(
-        servicePrin.client_id, servicePrin.client_secret, connInfo.tenant, handleResponse,
-      )
+      MsRest.loginWithServicePrincipalSecret(servicePrin.client_id, servicePrin.client_secret, connInfo.tenant, handleResponse)
     } else {
       res.status(401).send(buildError('Azure API authentication error'))
     }

+ 0 - 2
src/components/App.tsx

@@ -86,8 +86,6 @@ class App extends React.Component<{}, State> {
     isConfigReady: false,
   }
 
-  awaitingRefresh: boolean = false
-
   async componentDidMount() {
     observe(userStore, 'loggedUser', () => {
       this.setState({})

+ 0 - 13
src/components/modules/AssessmentModule/AssessmentDetailsContent/AssessmentDetailsContent.tsx

@@ -225,19 +225,6 @@ class AssessmentDetailsContent extends React.Component<Props> {
       === vm.properties.datacenterManagementServerName
   }
 
-  renderBottomControls() {
-    return (
-      <Buttons>
-        <Button
-          alert
-          hollow
-          onClick={() => { }}
-        >Migrate
-        </Button>
-      </Buttons>
-    )
-  }
-
   renderMainDetails() {
     if (this.props.page !== '' || !this.props.item || !this.props.item.id) {
       return null

+ 9 - 8
src/components/modules/AssessmentModule/AssessmentMigrationOptions/AssessmentMigrationOptions.tsx

@@ -115,7 +115,7 @@ class AssessmentMigrationOptions extends React.Component<Props, State> {
     showAdvancedOptions: false,
   }
 
-  scrollableRef: HTMLElement | undefined | null
+  // scrollableRef: HTMLElement | undefined | null
 
   getFieldValue(fieldName: string) {
     if (this.state.fieldValues[fieldName] != null) {
@@ -140,12 +140,12 @@ class AssessmentMigrationOptions extends React.Component<Props, State> {
     })
   }
 
-  UNSAFE_componentDidUpdate(_: Props, prevState: State) {
-    if (prevState.showAdvancedOptions !== this.state.showAdvancedOptions
-      && this.props.onResizeUpdate && this.scrollableRef) {
-      this.props.onResizeUpdate(this.scrollableRef)
-    }
-  }
+  // UNSAFE_componentDidUpdate(_: Props, prevState: State) {
+  //   if (prevState.showAdvancedOptions !== this.state.showAdvancedOptions
+  //     && this.props.onResizeUpdate && this.scrollableRef) {
+  //     this.props.onResizeUpdate(this.scrollableRef)
+  //   }
+  // }
 
   handleObjectValueChange(fieldName: string, propName: string, value: any) {
     this.setState(prevState => {
@@ -263,7 +263,8 @@ class AssessmentMigrationOptions extends React.Component<Props, State> {
     })
 
     return (
-      <Fields ref={(ref: HTMLElement | null | undefined) => { this.scrollableRef = ref }}>
+      // <Fields ref={(ref: HTMLElement | null | undefined) => { this.scrollableRef = ref }}>
+      <Fields>
         {rows}
       </Fields>
     )

+ 1 - 3
src/components/modules/DashboardModule/DashboardBarChart/DashboardBarChart.tsx

@@ -120,9 +120,7 @@ class DashboardBarChart extends React.Component<Props> {
   }
 
   calculateYTicks(props: Props) {
-    this.range = props.data.reduce((max, item) => Math.max(
-      max, item.values.reduce((sum, value) => sum + value, 0),
-    ), 1)
+    this.range = props.data.reduce((max, item) => Math.max(max, item.values.reduce((sum, value) => sum + value, 0)), 1)
     const niceScale = new BarChartNiceScale(0, this.range, props.yNumTicks)
     this.ticks = []
     const numTicks = Math.floor(this.range / niceScale.tickSpacing) + 1

+ 0 - 1
src/components/modules/DashboardModule/DashboardPieChart/DashboardPieChart.tsx

@@ -18,7 +18,6 @@ import styled from 'styled-components'
 import autobind from 'autobind-decorator'
 import { ThemeProps } from '../../../Theme'
 
-
 const Wrapper = styled.div<any>`
   position: relative;
   display: flex;

+ 2 - 1
src/components/modules/EndpointModule/EndpointLogos/story.tsx

@@ -32,7 +32,8 @@ const Wrapper = styled.div<any>`
 const wrap = (
   endpoint: string | null | undefined,
   height: number | undefined,
-  disabled = false, white = false,
+  disabled = false,
+  white = false,
 ) => (
   <EndpointLogos
     endpoint={endpoint as any}

+ 8 - 4
src/components/modules/EndpointModule/EndpointModal/EndpointModal.tsx

@@ -185,10 +185,14 @@ class EndpointModal extends React.Component<Props, State> {
           ? (prevState.isNew === null || prevState.isNew) : prevState.isNew,
         endpoint: {
           ...prevState.endpoint,
-          ...ObjectUtils.flatten(props.endpoint || {},
-            plugin.REQUIRES_PARENT_OBJECT_PATH),
-          ...ObjectUtils.flatten(endpointStore.connectionInfo || {},
-            plugin.REQUIRES_PARENT_OBJECT_PATH),
+          ...ObjectUtils.flatten(
+            props.endpoint || {},
+            plugin.REQUIRES_PARENT_OBJECT_PATH,
+          ),
+          ...ObjectUtils.flatten(
+            endpointStore.connectionInfo || {},
+            plugin.REQUIRES_PARENT_OBJECT_PATH,
+          ),
         },
       }))
     } else {

+ 0 - 1
src/components/modules/LoginModule/LoginForm/LoginForm.tsx

@@ -21,7 +21,6 @@ import LoginOptions from '../LoginOptions/LoginOptions'
 import LoadingButton from '../../../ui/LoadingButton/LoadingButton'
 import LoginFormField from '../LoginFormField/LoginFormField'
 
-
 import errorIcon from './images/error.svg'
 
 import { loginButtons } from '../../../../constants'

+ 0 - 4
src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.tsx

@@ -87,10 +87,6 @@ type Props = {
 }
 @observer
 class MinionPoolDetailsContent extends React.Component<Props> {
-  getStatus() {
-    return this.props.item?.status
-  }
-
   isEndpointMissing() {
     const endpoint = this.props.endpoints
       .find(e => e.id === this.props.item?.endpoint_id)

+ 0 - 1
src/components/modules/NavigationModule/Navigation/Navigation.tsx

@@ -22,7 +22,6 @@ import Logo from '../../../ui/Logo/Logo'
 import userStore from '../../../../stores/UserStore'
 import configLoader from '../../../../utils/Config'
 
-
 import { navigationMenu } from '../../../../constants'
 import backgroundImage from './images/star-bg.jpg'
 import cbsImage from './images/cbsl-logo.svg'

+ 5 - 2
src/components/modules/ProjectModule/ProjectDetailsContent/ProjectDetailsContent.tsx

@@ -255,8 +255,11 @@ class ProjectDetailsContent extends React.Component<Props, State> {
           disabled={!user.enabled}
           style={{ opacity: user.enabled ? 1 : 0.7 }}
           onChange={item => {
-            this.props.onUserRoleChange(user,
-              item.value, !userRoles.find(i => i.value === item.value))
+            this.props.onUserRoleChange(
+              user,
+              item.value,
+              !userRoles.find(i => i.value === item.value),
+            )
           }}
         />,
         <UserColumn disabled={!user.enabled}>{user.enabled ? 'Enabled' : 'Disabled'}</UserColumn>,

+ 0 - 34
src/components/modules/TransferModule/Schedule/Schedule.tsx

@@ -29,7 +29,6 @@ import { ThemePalette, ThemeProps } from '../../../Theme'
 import DateUtils from '../../../../utils/DateUtils'
 import type { Schedule as ScheduleType } from '../../../../@types/Schedule'
 import type { Field } from '../../../../@types/Field'
-import { executionOptions } from '../../../../constants'
 
 import scheduleImage from './images/schedule.svg'
 import LoadingButton from '../../../ui/LoadingButton/LoadingButton'
@@ -200,39 +199,6 @@ class Schedule extends React.Component<Props, State> {
     this.props.onAddScheduleClick({ schedule: { hour, minute: 0 } })
   }
 
-  areExecutionOptionsChanged(schedule: ScheduleType) {
-    let isChanged = false
-    executionOptions.forEach(o => {
-      const usableSchedule: any = schedule
-      const scheduleValue = usableSchedule[o.name]
-      const optionValue = o.defaultValue !== undefined ? o.defaultValue : false
-      if (scheduleValue != null && scheduleValue !== optionValue) {
-        isChanged = true
-      }
-    })
-    return isChanged
-  }
-
-  padNumber(number: number) {
-    if (number < 10) {
-      return `0${number}`
-    }
-
-    return number.toString()
-  }
-
-  shouldUseBold(scheduleId: string | null, fieldName: string, isRootField?: boolean) {
-    const unsavedSchedule = this.props.unsavedSchedules.find(s => s.id === scheduleId)
-    if (!unsavedSchedule) {
-      return false
-    }
-    const data: any = isRootField ? unsavedSchedule : unsavedSchedule.schedule
-    if (data && data[fieldName] != null) {
-      return true
-    }
-    return false
-  }
-
   renderLoading() {
     if (!this.props.loading) {
       return null

+ 0 - 3
src/components/modules/TransferModule/TaskItem/story.tsx

@@ -72,7 +72,6 @@ storiesOf('TaskItem', module)
           item={newItem}
           columnWidths={columnWidths}
           onDependsOnClick={() => { }}
-
           open
         />
       </div>
@@ -87,7 +86,6 @@ storiesOf('TaskItem', module)
           item={newItem}
           columnWidths={columnWidths}
           onDependsOnClick={() => { }}
-
           open
         />
       </div>
@@ -102,7 +100,6 @@ storiesOf('TaskItem', module)
           item={newItem}
           columnWidths={columnWidths}
           onDependsOnClick={() => { }}
-
           open
         />
       </div>

+ 1 - 1
src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx

@@ -300,7 +300,7 @@ class TransferItemModal extends React.Component<Props, State> {
     const endpoint = type === 'source' ? this.props.sourceEndpoint : this.props.destinationEndpoint
     const plugin = OptionsSchemaPlugin.for(endpoint.type)
 
-    const osMapping = new RegExp('^(windows|linux)').exec(fieldName)
+    const osMapping = /^(windows|linux)/.exec(fieldName)
     if (osMapping) {
       const osData = replicaData[`${plugin.migrationImageMapFieldName}/${osMapping[0]}`]
       return osData

+ 8 - 4
src/components/modules/WizardModule/WizardPageContent/WizardPageContent.tsx

@@ -297,11 +297,15 @@ class WizardPageContent extends React.Component<Props, State> {
         return !this.props.wizardData.selectedInstances
           || !this.props.wizardData.selectedInstances.length
       case 'source-options':
-        return !isOptionsPageValid(this.props.wizardData.sourceOptions,
-          this.props.providerStore.sourceSchema)
+        return !isOptionsPageValid(
+          this.props.wizardData.sourceOptions,
+          this.props.providerStore.sourceSchema,
+        )
       case 'dest-options':
-        return !isOptionsPageValid(this.props.wizardData.destOptions,
-          this.props.providerStore.destinationSchema)
+        return !isOptionsPageValid(
+          this.props.wizardData.destOptions,
+          this.props.providerStore.destinationSchema,
+        )
       case 'networks':
         return !this.isNetworksPageValid()
       default:

+ 10 - 4
src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx

@@ -326,9 +326,12 @@ class WizardSummary extends React.Component<Props> {
           if (key.indexOf('password') > -1 || propertyName.indexOf('password') > -1) {
             optionValue = '•••••••••'
           } else {
-            optionValue = fieldHelper.getValueAlias(propertyName,
+            optionValue = fieldHelper.getValueAlias(
+              propertyName,
               value,
-              schema, provider)
+              schema,
+              provider,
+            )
           }
 
           return (
@@ -462,9 +465,12 @@ class WizardSummary extends React.Component<Props> {
             const optionLabel = optionName.split('/')
               .map(n => LabelDictionary.get(n, `${data.target ? data.target.type : ''}-destination`)).join(' - ')
 
-            const optionValue = fieldHelper.getValueAlias(optionName,
+            const optionValue = fieldHelper.getValueAlias(
+              optionName,
               data.destOptions && data.destOptions[optionName],
-              this.props.destinationSchema, provider)
+              this.props.destinationSchema,
+              provider,
+            )
 
             return (
               <Option key={optionName}>

+ 5 - 2
src/components/smart/DashboardPage/DashboardPage.tsx

@@ -109,8 +109,11 @@ class ProjectsPage extends React.Component<{ history: any }, State> {
   }
 
   async loadAdminData(showLoading: boolean) {
-    await Utils.waitFor(() => Boolean(userStore.loggedUser && userStore.loggedUser.isAdmin),
-      30000, 100)
+    await Utils.waitFor(
+      () => Boolean(userStore.loggedUser && userStore.loggedUser.isAdmin),
+      30000,
+      100,
+    )
     if (userStore.loggedUser?.isAdmin) {
       userStore.getAllUsers({ skipLog: true, showLoading })
       licenceStore.loadLicenceInfo({ skipLog: true, showLoading })

+ 0 - 1
src/components/smart/LogsPage/DownloadsContent.tsx

@@ -23,7 +23,6 @@ import { Close } from '../../ui/TextInput/TextInput'
 import DatetimePicker from '../../ui/DatetimePicker/DatetimePicker'
 import StatusIcon from '../../ui/StatusComponents/StatusIcon/StatusIcon'
 
-
 import downloadImage from './images/download.svg'
 import { ThemeProps } from '../../Theme'
 

+ 1 - 3
src/components/smart/MigrationDetailsPage/MigrationDetailsPage.tsx

@@ -290,9 +290,7 @@ class MigrationDetailsPage extends React.Component<Props, State> {
     if (this.state.pausePolling || this.stopPolling) {
       return
     }
-    await migrationStore.getMigration(
-      this.props.match.params.id, { showLoading: false, skipLog: true },
-    )
+    await migrationStore.getMigration(this.props.match.params.id, { showLoading: false, skipLog: true })
     setTimeout(() => { this.pollData() }, configLoader.config.requestPollTimeout)
   }
 

+ 0 - 8
src/components/smart/MinionPoolDetailsPage/MinionPoolDetailsPage.tsx

@@ -117,10 +117,6 @@ class MinionPoolDetailsPage extends React.Component<Props, State> {
     return schemaData
   }
 
-  getStatus() {
-    return this.minionPool?.status
-  }
-
   async loadMinionPool(minionPoolId?: string) {
     const usableId = minionPoolId || this.minionPoolId
     await Promise.all([
@@ -174,10 +170,6 @@ class MinionPoolDetailsPage extends React.Component<Props, State> {
     minionPoolStore.deleteMinionPool(this.minionPool!.id)
   }
 
-  handleCloseDeleteMinionPoolConfirmation() {
-    this.setState({ showDeleteMinionPoolConfirmation: false })
-  }
-
   handleMinionPoolEditClick() {
     this.setState({ showEditModal: true, pausePolling: true })
   }

+ 1 - 3
src/components/smart/ReplicaDetailsPage/ReplicaDetailsPage.tsx

@@ -367,9 +367,7 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
     const unsavedData = scheduleStore.unsavedSchedules.find(s => s.id === scheduleId)
 
     if (scheduleId) {
-      scheduleStore.updateSchedule(
-        this.replicaId, scheduleId, data, oldData, unsavedData, forceSave,
-      )
+      scheduleStore.updateSchedule(this.replicaId, scheduleId, data, oldData, unsavedData, forceSave)
     }
   }
 

+ 1 - 3
src/components/smart/WizardPage/WizardPage.tsx

@@ -319,9 +319,7 @@ class WizardPage extends React.Component<Props, State> {
 
   handleInstancesReloadClick() {
     if (wizardStore.data.source) {
-      instanceStore.reloadInstances(
-        wizardStore.data.source, this.instancesPerPage, wizardStore.data.sourceOptions,
-      )
+      instanceStore.reloadInstances(wizardStore.data.source, this.instancesPerPage, wizardStore.data.sourceOptions)
     }
   }
 

+ 1 - 1
src/components/ui/Arrow/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import Arrow from '../Arrow'
+import Arrow from '.'
 
 storiesOf('Arrow', module)
   .add('default', () => (

+ 1 - 1
src/components/ui/AutocompleteInput/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import AutocompleteInput from '../AutocompleteInput'
+import AutocompleteInput from '.'
 
 type State = {
   value: string,

+ 1 - 1
src/components/ui/Button/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import Button from '../Button'
+import Button from '.'
 
 storiesOf('Button', module)
   .add('primary', () => (

+ 1 - 1
src/components/ui/Checkbox/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import Checkbox from '../Checkbox'
+import Checkbox from '.'
 
 class Wrapper extends React.Component {
   state = { checked: false }

+ 0 - 1
src/components/ui/CopyButton/CopyButton.tsx

@@ -16,7 +16,6 @@ import React from 'react'
 import { observer } from 'mobx-react'
 import styled from 'styled-components'
 
-
 import copyImage from './images/copy.svg'
 import { ThemeProps } from '../../Theme'
 

+ 1 - 1
src/components/ui/CopyButton/story.tsx

@@ -16,7 +16,7 @@ import React from 'react'
 import { storiesOf } from '@storybook/react'
 import styled from 'styled-components'
 
-import CopyButton from '../CopyButton'
+import CopyButton from '.'
 
 const Wrapper = styled.div<any>`
   cursor: pointer;

+ 16 - 14
src/components/ui/DatetimePicker/DatetimePicker.tsx

@@ -192,22 +192,24 @@ class DatetimePicker extends React.Component<Props, State> {
     }
 
     const { body } = document
-    return ReactDOM.createPortal((
-      <Portal ref={(e: HTMLElement | null | undefined) => { this.portalRef = e }}>
-        <DatetimeStyled
-          input={false}
-          value={timezoneDate}
-          style={{ top: 0, right: 0 }}
-          onChange={(date: Date) => { this.handleChange(date) }}
-          dateFormat="DD/MM/YYYY"
-          timeFormat="hh:mm A"
-          locale="en-gb"
-          isValidDate={
+    return ReactDOM.createPortal(
+      (
+        <Portal ref={(e: HTMLElement | null | undefined) => { this.portalRef = e }}>
+          <DatetimeStyled
+            input={false}
+            value={timezoneDate}
+            style={{ top: 0, right: 0 }}
+            onChange={(date: Date) => { this.handleChange(date) }}
+            dateFormat="DD/MM/YYYY"
+            timeFormat="hh:mm A"
+            locale="en-gb"
+            isValidDate={
             (currentDate: Date, selectedDate: Date) => this.isValidDate(currentDate, selectedDate)
           }
-        />
-      </Portal>
-    ), body)
+          />
+        </Portal>
+      ), body,
+    )
   }
 
   render() {

+ 1 - 1
src/components/ui/DatetimePicker/story.tsx

@@ -15,7 +15,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 import React from 'react'
 import { storiesOf } from '@storybook/react'
 import moment from 'moment'
-import DatetimePicker from '../DatetimePicker'
+import DatetimePicker from '.'
 
 const Wrapper = (props: any) => (
   <div

+ 13 - 12
src/components/ui/Dropdowns/ActionDropdown/ActionDropdown.tsx

@@ -189,18 +189,19 @@ class ActionDropdown extends React.Component<Props, State> {
     }
 
     const { body } = document
-    return ReactDOM.createPortal((
-      <List
-        ref={(list: HTMLElement | null | undefined) => { this.listRef = list }}
-        width={`${ThemeProps.inputSizes.regular.width}px`}
-        padding={0}
-        customStyle={ListStyle}
-        data-test-id={`${TEST_ID}-list`}
-      >
-        <Tip ref={(ref: HTMLElement | null | undefined) => { this.tipRef = ref }} borderColor="rgba(111, 114, 118, 0.2)" />
-        {this.renderListItems()}
-      </List>
-    ), body)
+    return ReactDOM.createPortal(
+      (
+        <List
+          ref={(list: HTMLElement | null | undefined) => { this.listRef = list }}
+          width={`${ThemeProps.inputSizes.regular.width}px`}
+          padding={0}
+          customStyle={ListStyle}
+        >
+          <Tip ref={(ref: HTMLElement | null | undefined) => { this.tipRef = ref }} borderColor="rgba(111, 114, 118, 0.2)" />
+          {this.renderListItems()}
+        </List>
+      ), body,
+    )
   }
 
   render() {

+ 1 - 1
src/components/ui/Dropdowns/ActionDropdown/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import ActionDropdown from '../ActionDropdown'
+import ActionDropdown from '.'
 
 import { ThemePalette } from '../../../Theme'
 

+ 13 - 11
src/components/ui/Dropdowns/AutocompleteDropdown/AutocompleteDropdown.tsx

@@ -444,18 +444,20 @@ class AutocompleteDropdown extends React.Component<Props, State> {
       ? this.getValue(this.state.filteredItems[0]) : null
     const isFirstItemSelected = selectedItemValue !== null && selectedItemValue === firstItemValue
 
-    const list = ReactDOM.createPortal((
+    const list = ReactDOM.createPortal(
+      (
       // eslint-disable-next-line react/jsx-props-no-spreading
-      <List {...this.props} ref={(ref: HTMLElement | null | undefined) => { this.listRef = ref }}>
-        <Tip
-          ref={(ref: HTMLElement | null | undefined) => { this.tipRef = ref }}
-          primary={this.state.firstItemHover || isFirstItemSelected}
-          dangerouslySetInnerHTML={{ __html: tipImage }}
-        />
-        {this.renderItems()}
-        {this.renderSearchNotFound()}
-      </List>
-    ), body)
+        <List {...this.props} ref={(ref: HTMLElement | null | undefined) => { this.listRef = ref }}>
+          <Tip
+            ref={(ref: HTMLElement | null | undefined) => { this.tipRef = ref }}
+            primary={this.state.firstItemHover || isFirstItemSelected}
+            dangerouslySetInnerHTML={{ __html: tipImage }}
+          />
+          {this.renderItems()}
+          {this.renderSearchNotFound()}
+        </List>
+      ), body,
+    )
 
     return list
   }

+ 1 - 1
src/components/ui/Dropdowns/AutocompleteDropdown/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import AutocompleteDropdown from '../AutocompleteDropdown'
+import AutocompleteDropdown from '.'
 
 const generateItem = (item: string, value?: string) => ({
   value: value || item.replace(/ /g, '_').toLowerCase(),

+ 64 - 63
src/components/ui/Dropdowns/Dropdown/Dropdown.tsx

@@ -581,71 +581,72 @@ class Dropdown extends React.Component<Props, State> {
     const firstItemValue = this.props.items.length > 0 ? this.getValue(this.props.items[0]) : null
     const isFirstItemSelected = selectedValue === firstItemValue
 
-    const list = ReactDOM.createPortal((
-      <List
+    const list = ReactDOM.createPortal(
+      (
+        <List
         // eslint-disable-next-line react/jsx-props-no-spreading
-        {...this.props}
-        ref={(ref: HTMLElement | null | undefined) => { this.listRef = ref }}
-      >
-        <Tip
-          ref={(ref: HTMLElement | null | undefined) => { this.tipRef = ref }}
-          primary={this.state.firstItemHover || isFirstItemSelected}
-          dangerouslySetInnerHTML={{ __html: tipImage }}
-        />
-        <ListItems ref={(ref: HTMLElement | null | undefined) => { this.listItemsRef = ref }}>
-          {this.props.items.map((item, i) => {
-            if (item.separator === true) {
-              // eslint-disable-next-line react/no-array-index-key
-              return <Separator key={`sep-${i}`} />
-            }
-
-            const label = this.getLabel(item)
-            const value = this.getValue(item)
-            const duplicatedLabel = duplicatedLabels.find(l => l === label)
-            const multipleSelected = this.props.selectedItems && this.props.selectedItems
-              .find(j => this.getValue(j) === value)
-            const listItem = (
-              <ListItem
-                data-test-id="dropdownListItem"
-                ref={(ref: HTMLElement | null | undefined) => {
-                  if (i === 0) { this.firstItemRef = ref }
-                }}
-                key={value}
-                onMouseDown={() => { this.itemMouseDown = true }}
-                onMouseUp={() => { this.itemMouseDown = false }}
-                onMouseEnter={() => { this.handleItemMouseEnter(i) }}
-                onMouseLeave={() => { this.handleItemMouseLeave(i) }}
-                onClick={() => { this.handleItemClick(item) }}
-                selected={!this.props.multipleSelection && value === selectedValue}
-                multipleSelected={this.props.multipleSelection && multipleSelected}
-                dim={this.props.dimFirstItem && i === 0}
-                paddingLeft={this.props.multipleSelection ? 8 : 16}
-                arrowSelected={i === this.state.arrowSelection}
-                disabled={item.disabled}
-              >
-                {this.props.multipleSelection ? (
-                  <Checkmark
-                    ref={(ref: HTMLElement) => { this.checkmarkRefs[`${label}-${value || ''}`] = ref }}
-                    dangerouslySetInnerHTML={{ __html: checkmarkImage }}
-                    show={multipleSelected}
-                  />
-                ) : null}
-                <Labels>
-                  {label === '' ? '\u00A0' : label}
-                  {item.subtitleLabel ? (
-                    <SubtitleLabel>{item.subtitleLabel}</SubtitleLabel>
+          {...this.props}
+          ref={(ref: HTMLElement | null | undefined) => { this.listRef = ref }}
+        >
+          <Tip
+            ref={(ref: HTMLElement | null | undefined) => { this.tipRef = ref }}
+            primary={this.state.firstItemHover || isFirstItemSelected}
+            dangerouslySetInnerHTML={{ __html: tipImage }}
+          />
+          <ListItems ref={(ref: HTMLElement | null | undefined) => { this.listItemsRef = ref }}>
+            {this.props.items.map((item, i) => {
+              if (item.separator === true) {
+                // eslint-disable-next-line react/no-array-index-key
+                return <Separator key={`sep-${i}`} />
+              }
+
+              const label = this.getLabel(item)
+              const value = this.getValue(item)
+              const duplicatedLabel = duplicatedLabels.find(l => l === label)
+              const multipleSelected = this.props.selectedItems && this.props.selectedItems
+                .find(j => this.getValue(j) === value)
+              const listItem = (
+                <ListItem
+                  ref={(ref: HTMLElement | null | undefined) => {
+                    if (i === 0) { this.firstItemRef = ref }
+                  }}
+                  key={value}
+                  onMouseDown={() => { this.itemMouseDown = true }}
+                  onMouseUp={() => { this.itemMouseDown = false }}
+                  onMouseEnter={() => { this.handleItemMouseEnter(i) }}
+                  onMouseLeave={() => { this.handleItemMouseLeave(i) }}
+                  onClick={() => { this.handleItemClick(item) }}
+                  selected={!this.props.multipleSelection && value === selectedValue}
+                  multipleSelected={this.props.multipleSelection && multipleSelected}
+                  dim={this.props.dimFirstItem && i === 0}
+                  paddingLeft={this.props.multipleSelection ? 8 : 16}
+                  arrowSelected={i === this.state.arrowSelection}
+                  disabled={item.disabled}
+                >
+                  {this.props.multipleSelection ? (
+                    <Checkmark
+                      ref={(ref: HTMLElement) => { this.checkmarkRefs[`${label}-${value || ''}`] = ref }}
+                      dangerouslySetInnerHTML={{ __html: checkmarkImage }}
+                      show={multipleSelected}
+                    />
                   ) : null}
-
-                  {duplicatedLabel ? <DuplicatedLabel>(<span>{value || ''}</span>)</DuplicatedLabel> : ''}
-                </Labels>
-              </ListItem>
-            )
-
-            return listItem
-          })}
-        </ListItems>
-      </List>
-    ), body)
+                  <Labels>
+                    {label === '' ? '\u00A0' : label}
+                    {item.subtitleLabel ? (
+                      <SubtitleLabel>{item.subtitleLabel}</SubtitleLabel>
+                    ) : null}
+
+                    {duplicatedLabel ? <DuplicatedLabel>(<span>{value || ''}</span>)</DuplicatedLabel> : ''}
+                  </Labels>
+                </ListItem>
+              )
+
+              return listItem
+            })}
+          </ListItems>
+        </List>
+      ), body,
+    )
 
     return list
   }

+ 1 - 1
src/components/ui/Dropdowns/Dropdown/story.tsx

@@ -16,7 +16,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import Dropdown from '../Dropdown'
+import Dropdown from '.'
 
 const items = [
   { label: 'Item 1', value: 'item-1' },

+ 1 - 1
src/components/ui/Dropdowns/DropdownFilter/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import DropdownFilter from '../DropdownFilter'
+import DropdownFilter from '.'
 
 class Wrapper extends React.Component {
   state = {

+ 1 - 1
src/components/ui/Dropdowns/DropdownInput/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import DropdownInput from '../DropdownInput'
+import DropdownInput from '.'
 
 const items = [{
   label: 'Name',

+ 15 - 16
src/components/ui/Dropdowns/DropdownLink/DropdownLink.tsx

@@ -172,8 +172,6 @@ class DropdownLink extends React.Component<Props, State> {
 
   tipRef: HTMLElement | null | undefined
 
-  searchInputWrapperRef: HTMLElement | null | undefined
-
   componentDidMount() {
     window.addEventListener('mousedown', this.handlePageClick, false)
     if (this.arrowRef) {
@@ -309,7 +307,6 @@ class DropdownLink extends React.Component<Props, State> {
 
     return (
       <SearchInputWrapper
-        ref={(ref: HTMLElement | null | undefined) => { this.searchInputWrapperRef = ref }}
         onMouseDown={() => { this.itemMouseDown = true }}
         onMouseUp={() => { this.itemMouseDown = false }}
       >
@@ -385,19 +382,21 @@ class DropdownLink extends React.Component<Props, State> {
     }
 
     const { body } = document
-    return ReactDOM.createPortal((
-      <List
-        ref={(list: HTMLElement | null | undefined) => {
-          this.listRef = list
-        }}
-        width={this.props.listWidth}
-      >
-        <Tip ref={(ref: HTMLElement | null | undefined) => { this.tipRef = ref }} />
-        {this.renderSearch()}
-        {this.renderEmptySearch()}
-        {this.renderListItems()}
-      </List>
-    ), body)
+    return ReactDOM.createPortal(
+      (
+        <List
+          ref={(list: HTMLElement | null | undefined) => {
+            this.listRef = list
+          }}
+          width={this.props.listWidth}
+        >
+          <Tip ref={(ref: HTMLElement | null | undefined) => { this.tipRef = ref }} />
+          {this.renderSearch()}
+          {this.renderEmptySearch()}
+          {this.renderListItems()}
+        </List>
+      ), body,
+    )
   }
 
   render() {

+ 1 - 1
src/components/ui/Dropdowns/DropdownLink/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import DropdownLink from '../DropdownLink'
+import DropdownLink from '.'
 import { ThemePalette } from '../../../Theme'
 
 type State = {

+ 1 - 1
src/components/ui/Dropdowns/NewItemDropdown/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import NewItemDropdown from '../NewItemDropdown'
+import NewItemDropdown from '.'
 
 storiesOf('NewItemDropdown', module)
   .add('default', () => (

+ 1 - 1
src/components/ui/Dropdowns/NotificationDropdown/story.tsx

@@ -16,7 +16,7 @@ import React from 'react'
 import { storiesOf } from '@storybook/react'
 
 import type { NotificationItemData } from '../../../../@types/NotificationItem'
-import NotificationDropdown from '../NotificationDropdown'
+import NotificationDropdown from '.'
 
 const items: NotificationItemData[] = [
   {

+ 1 - 1
src/components/ui/Dropdowns/UserDropdown/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import UserDropdown from '../UserDropdown'
+import UserDropdown from '.'
 
 const user: any = {
   name: 'User name',

+ 1 - 1
src/components/ui/InfoIcon/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import InfoIcon from '../InfoIcon'
+import InfoIcon from '.'
 
 storiesOf('InfoIcon', module)
   .add('default', () => (

+ 0 - 1
src/components/ui/LoadingButton/LoadingButton.tsx

@@ -18,7 +18,6 @@ import styled from 'styled-components'
 
 import Button from '../Button/Button'
 
-
 import loadingImage from './images/loading.svg'
 import { ThemeProps } from '../../Theme'
 

+ 7 - 3
src/components/ui/Modal/Modal.tsx

@@ -198,13 +198,17 @@ class NewModal extends React.Component<Props> {
       ...this.props.contentStyle,
     }
 
-    const children = React.Children.map(this.props.children,
-      child => React.cloneElement(child as React.ReactElement<any>,
+    const children = React.Children.map(
+      this.props.children,
+      child => React.cloneElement(
+        child as React.ReactElement<any>,
         {
           onResizeUpdate: (scrollableRef: HTMLDivElement, scrollOffset: number) => {
             this.handleChildUpdate(scrollableRef, scrollOffset)
           },
-        }))
+        },
+      ),
+    )
 
     return (
       <Modal

+ 1 - 1
src/components/ui/Modal/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import Modal from '../Modal'
+import Modal from '.'
 
 storiesOf('Modal', module)
   .add('default', () => (

+ 1 - 1
src/components/ui/Panel/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import Panel from '../Panel'
+import Panel from '.'
 
 const navigationItems = [
   { value: 'dest_options', label: 'Destination Options' },

+ 0 - 1
src/components/ui/PasswordValue/PasswordValue.tsx

@@ -16,7 +16,6 @@ import React from 'react'
 import { observer } from 'mobx-react'
 import styled from 'styled-components'
 
-
 import eyeImage from './images/eye.svg'
 import { ThemeProps } from '../../Theme'
 

+ 1 - 1
src/components/ui/PasswordValue/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import PasswordValue from '../PasswordValue'
+import PasswordValue from '.'
 
 storiesOf('PasswordValue', module)
   .add('default', () => (

+ 1 - 1
src/components/ui/ProgressBar/story.tsx

@@ -15,7 +15,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 import React from 'react'
 import { storiesOf } from '@storybook/react'
 
-import ProgressBar from '../ProgressBar'
+import ProgressBar from '.'
 
 // eslint-disable-next-line react/jsx-props-no-spreading
 const Wrapper = (props: any) => <div style={{ width: '800px' }}><ProgressBar {...props} /></div>

+ 1 - 1
src/components/ui/RadioInput/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import RadioInput from '../RadioInput'
+import RadioInput from '.'
 
 const props: any = {}
 storiesOf('RadioInput', module)

+ 1 - 1
src/components/ui/ReloadButton/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import ReloadButton from '../ReloadButton'
+import ReloadButton from '.'
 
 storiesOf('ReloadButton', module)
   .add('default', () => (

+ 0 - 1
src/components/ui/SearchInput/SearchInput.tsx

@@ -22,7 +22,6 @@ import TextInput from '../TextInput/TextInput'
 import StatusIcon from '../StatusComponents/StatusIcon/StatusIcon'
 import { ThemeProps } from '../../Theme'
 
-
 const Input = styled(TextInput)<any>`
   padding-left: 32px;
   ${props => (props.loading || (props.showClose && props.value) ? 'padding-right: 32px;' : '')}

+ 1 - 1
src/components/ui/SearchInput/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import SearchInput from '../SearchInput'
+import SearchInput from '.'
 
 class Wrapper extends React.Component<any> {
   state = {

+ 1 - 3
src/components/ui/SmallLoading/SmallLoading.tsx

@@ -94,9 +94,7 @@ class SmallLoading extends React.Component<Props> {
     }
 
     return (
-      <ProgressText
-        data-test-id={`${TEST_ID}-progressText`}
-      >{this.props.loadingProgress ? this.props.loadingProgress.toFixed(0) : 0}%
+      <ProgressText>{this.props.loadingProgress ? this.props.loadingProgress.toFixed(0) : 0}%
       </ProgressText>
     )
   }

+ 1 - 1
src/components/ui/SmallLoading/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import SmallLoading from '../SmallLoading'
+import SmallLoading from '.'
 
 storiesOf('SmallLoading', module)
   .add('default', () => (

+ 1 - 3
src/components/ui/StatusComponents/StatusImage/StatusImage.tsx

@@ -138,9 +138,7 @@ class StatusImage extends React.Component<Props> {
 
   renderProgressText() {
     return (
-      <ProgressText
-        data-test-id="statusImage-progressText"
-      >{this.props.loadingProgress ? this.props.loadingProgress.toFixed(0) : 0}%
+      <ProgressText>{this.props.loadingProgress ? this.props.loadingProgress.toFixed(0) : 0}%
       </ProgressText>
     )
   }

+ 1 - 1
src/components/ui/Switch/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import * as React from 'react'
 import { storiesOf } from '@storybook/react'
-import Switch from '../Switch'
+import Switch from '.'
 
 type Props = {
   disabled?: boolean,

+ 1 - 1
src/components/ui/Table/story.tsx

@@ -16,7 +16,7 @@ import React from 'react'
 import { storiesOf } from '@storybook/react'
 import { css } from 'styled-components'
 import { ThemePalette, ThemeProps } from '../../Theme'
-import Table from '../Table'
+import Table from '.'
 
 const items = [
   ['item-1', 'item-2', 'item-3', 'item-4', 'item-5'],

+ 1 - 1
src/components/ui/TextArea/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import TextArea from '../TextArea'
+import TextArea from '.'
 
 storiesOf('TextArea', module)
   .add('default', () => <TextArea />)

+ 1 - 1
src/components/ui/TextInput/story.tsx

@@ -15,7 +15,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 import React from 'react'
 import { storiesOf } from '@storybook/react'
 import styled from 'styled-components'
-import TextInput from '../TextInput'
+import TextInput from '.'
 
 const Wrapper = styled.div<any>`
   display: inline-block;

+ 1 - 1
src/components/ui/ToggleButtonBar/story.tsx

@@ -14,7 +14,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import React from 'react'
 import { storiesOf } from '@storybook/react'
-import ToggleButtonBar from '../ToggleButtonBar'
+import ToggleButtonBar from '.'
 
 class Wrapper extends React.Component {
   state = {

+ 9 - 7
src/plugins/azure/ConnectionSchemaPlugin.ts

@@ -20,9 +20,7 @@ import {
 } from '../default/ConnectionSchemaPlugin'
 import { Endpoint } from '../../@types/Endpoint'
 
-const fieldsToPayloadUseDefaults = (
-  data: any, schema: { properties: any },
-) => {
+const fieldsToPayloadUseDefaults = (data: any, schema: { properties: any }) => {
   const info: any = {}
 
   Object.keys(schema.properties).forEach(fieldName => {
@@ -114,12 +112,16 @@ export default class ConnectionSchemaParser {
     if (data.cloud_profile === 'CustomCloud') {
       connectionInfo.custom_cloud_properties = {
         endpoints: {
-          ...fieldsToPayloadUseDefaults(data,
-            schema.properties.custom_cloud_properties.properties.endpoints),
+          ...fieldsToPayloadUseDefaults(
+            data,
+            schema.properties.custom_cloud_properties.properties.endpoints,
+          ),
         },
         suffixes: {
-          ...fieldsToPayloadUseDefaults(data,
-            schema.properties.custom_cloud_properties.properties.suffixes),
+          ...fieldsToPayloadUseDefaults(
+            data,
+            schema.properties.custom_cloud_properties.properties.suffixes,
+          ),
         },
       }
     }

+ 1 - 0
src/plugins/azure/ContentPlugin.tsx

@@ -146,6 +146,7 @@ class ContentPlugin extends React.Component<Props, State> {
       ? loginTypeField.items.find(f => f.name === this.getLoginTypeValue()) : null
   }
 
+  // eslint-disable-next-line react/no-unused-class-component-methods
   findInvalidFields = () => {
     const invalidFields: any[] = []
     const selectedLoginTypeField = this.getSelectedLoginTypeField()

+ 1 - 0
src/plugins/default/ContentPlugin.tsx

@@ -74,6 +74,7 @@ class ContentPlugin extends React.Component<Props> {
     this.props.onRef(undefined)
   }
 
+  // eslint-disable-next-line react/no-unused-class-component-methods
   findInvalidFields = () => {
     const invalidFields = this.props.connectionInfoSchema.filter(field => {
       if (field.required) {

+ 1 - 3
src/plugins/default/OptionsSchemaPlugin.ts

@@ -155,9 +155,7 @@ export const defaultGetMigrationImageMap = (
 export default class OptionsSchemaParser {
   static migrationImageMapFieldName = 'migr_image_map'
 
-  static parseSchemaToFields(
-    schema: SchemaProperties, schemaDefinitions?: SchemaDefinitions | null, dictionaryKey?: string,
-  ) {
+  static parseSchemaToFields(schema: SchemaProperties, schemaDefinitions?: SchemaDefinitions | null, dictionaryKey?: string) {
     return defaultSchemaToFields(schema, schemaDefinitions, dictionaryKey)
   }
 

+ 2 - 3
src/plugins/openstack/ContentPlugin.tsx

@@ -151,6 +151,7 @@ class ContentPlugin extends React.Component<Props, State> {
     return fieldValue
   }
 
+  // eslint-disable-next-line react/no-unused-class-component-methods
   findInvalidFields = () => {
     const inputChoices = ['user_domain', 'project_domain']
 
@@ -284,9 +285,7 @@ class ContentPlugin extends React.Component<Props, State> {
             this.props.connectionInfoSchema.find(n => n.name === fieldName),
           )}
           onFieldChange={(fieldName, fieldValue) => {
-            this.props.handleFieldChange(
-              this.props.connectionInfoSchema.find(n => n.name === fieldName), fieldValue,
-            )
+            this.props.handleFieldChange(this.props.connectionInfoSchema.find(n => n.name === fieldName), fieldValue)
           }}
         />
       )

+ 1 - 3
src/sources/AzureSource.ts

@@ -93,9 +93,7 @@ class AzureSource {
 
   static previousReqId: string
 
-  static async getAssessments(
-    subscriptionId: string, resourceGroupName: string, skipLog?: boolean | null,
-  ): Promise<Assessment[]> {
+  static async getAssessments(subscriptionId: string, resourceGroupName: string, skipLog?: boolean | null): Promise<Assessment[]> {
     const cancelId = subscriptionId + resourceGroupName
     if (this.previousReqId) {
       Api.cancelRequests(this.previousReqId)

+ 2 - 1
src/sources/ProviderSource.ts

@@ -57,7 +57,8 @@ class ProviderSource {
 
   async getOptionsValues(
     optionsType: 'source' | 'destination',
-    endpointId: string, envData: { [prop: string]: any } | null | undefined,
+    endpointId: string,
+    envData: { [prop: string]: any } | null | undefined,
     cache?: boolean | null,
     quietError?: boolean,
   ): Promise<OptionValues[]> {

+ 5 - 5
src/sources/ReplicaSource.ts

@@ -24,9 +24,7 @@ import type { Task, ProgressUpdate } from '../@types/Task'
 import type { Field } from '../@types/Field'
 import { INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS } from '../components/modules/WizardModule/WizardOptions/WizardOptions'
 
-export const sortTasks = (
-  tasks?: Task[], taskUpdatesSortFunction?: (updates: ProgressUpdate[]) => void,
-) => {
+export const sortTasks = (tasks?: Task[], taskUpdatesSortFunction?: (updates: ProgressUpdate[]) => void) => {
   if (!tasks) {
     return
   }
@@ -250,8 +248,10 @@ class ReplicaSource {
     }
 
     if (Object.keys(updateData.destination).length > 0) {
-      const destEnv = destinationParser.getDestinationEnv(updateData.destination,
-        { ...replica, ...replica.destination_environment })
+      const destEnv = destinationParser.getDestinationEnv(
+        updateData.destination,
+        { ...replica, ...replica.destination_environment },
+      )
 
       const newMinionMappings = destEnv[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS]
       if (newMinionMappings) {

+ 1 - 3
src/sources/UserSource.ts

@@ -281,9 +281,7 @@ class UserSource {
     await this.assignUserToProjectWithRole(userId, projectId, roleId)
   }
 
-  async assignUserToProjectWithRole(
-    userId: string, projectId: string, roleId: string,
-  ): Promise<void> {
+  async assignUserToProjectWithRole(userId: string, projectId: string, roleId: string): Promise<void> {
     await Api.send({
       url: `${configLoader.config.servicesUrls.keystone}/projects/${projectId}/users/${userId}/roles/${roleId}`,
       method: 'PUT',

+ 1 - 3
src/stores/MigrationStore.ts

@@ -96,9 +96,7 @@ class MigrationStore {
     return migrationResult
   }
 
-  @action async getMigration(
-    migrationId: string, options?: { showLoading?: boolean, skipLog?: boolean },
-  ) {
+  @action async getMigration(migrationId: string, options?: { showLoading?: boolean, skipLog?: boolean }) {
     if (options && options.showLoading) {
       this.detailsLoading = true
     }

+ 1 - 3
src/stores/UserStore.ts

@@ -234,9 +234,7 @@ class UserStore {
     }
   }
 
-  async assignUserToProjectWithRole(
-    userId: string, projectId: string, roleId: string,
-  ): Promise<void> {
+  async assignUserToProjectWithRole(userId: string, projectId: string, roleId: string): Promise<void> {
     await UserSource.assignUserToProjectWithRole(userId, projectId, roleId)
   }
 

+ 2 - 6
src/stores/WizardStore.ts

@@ -243,9 +243,7 @@ class WizardStore {
     this.creatingItem = true
 
     try {
-      const item: TransferItem = await source.create(
-        type, data, defaultStorage, storageMap, uploadedUserScripts,
-      )
+      const item: TransferItem = await source.create(type, data, defaultStorage, storageMap, uploadedUserScripts)
       runInAction(() => { this.createdItem = item })
     } finally {
       runInAction(() => { this.creatingItem = false })
@@ -262,9 +260,7 @@ class WizardStore {
     this.creatingItems = true
 
     try {
-      const items = await source.createMultiple(
-        type, data, defaultStorage, storageMap, uploadedUserScripts,
-      )
+      const items = await source.createMultiple(type, data, defaultStorage, storageMap, uploadedUserScripts)
       const nullItemsCount = items.filter(i => i === null).length
       if (items && nullItemsCount === 0) {
         runInAction(() => { this.createdItems = items })

+ 1 - 3
src/utils/DomUtils.ts

@@ -15,9 +15,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 import { Base64 } from 'js-base64'
 
 class DomUtils {
-  static getScrollableParent(
-    element: HTMLElement, includeHidden?: boolean,
-  ): HTMLElement {
+  static getScrollableParent(element: HTMLElement, includeHidden?: boolean): HTMLElement {
     let style = getComputedStyle(element)
     const excludeStaticParent = style.position === 'absolute'
     const overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/

+ 5 - 2
src/utils/KeyboardManager.ts

@@ -25,8 +25,11 @@ const keyDownHandler = (evt: KeyboardEvent) => {
 export default class KeyboardManager {
   static eventAdded = false
 
-  static onKeyDown(id: string,
-    callback: ((event: KeyboardEvent) => void) | null, priority?: number) {
+  static onKeyDown(
+    id: string,
+    callback: ((event: KeyboardEvent) => void) | null,
+    priority?: number,
+  ) {
     if (!eventAdded) {
       eventAdded = true
       document.addEventListener('keydown', (evt: KeyboardEvent) => { keyDownHandler(evt) })

+ 2 - 4
src/utils/ObjectUtils.ts

@@ -72,12 +72,10 @@ class ObjectUtils {
   }
 
   static async wait(ms: number) {
-    return new Promise<void>(r => setTimeout(() => r(), ms))
+    return new Promise<void>(r => { setTimeout(() => r(), ms) })
   }
 
-  static async waitFor(
-    predicate: () => boolean, timeoutMs: number = 15000, tryEvery: number = 1000,
-  ) {
+  static async waitFor(predicate: () => boolean, timeoutMs: number = 15000, tryEvery: number = 1000) {
     const startTime = new Date().getTime()
     const testLoop = async () => {
       if (predicate()) {