Skip to content

Commit

Permalink
lint and check js error resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-dighe committed May 9, 2023
1 parent 0877913 commit 844feba
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

.flex_header {
position: relative;
/* width: 919px; */
margin: 1.5rem auto auto;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const RadioSelect = ({ pipetteName, pipetteType }: any): JSX.Element => {
}
const gen3Options = specsByCategory[GEN3].map(specToOption).filter(allowlist)
const gen1Options = specsByCategory[GEN1].map(specToOption).filter(allowlist)
let groupedOptions = [
const groupedOptions = [
...(gen3Options.length > 0 ? gen3Options : []),
...(gen1Options.length > 0 ? gen1Options : []),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { i18n } from '../../../localization'
import styles from '../FlexComponents.css'
import { useFormikContext } from 'formik'
import { TipRackOptions } from './TipRackList'
import { FormPipettesByMount } from '../FlexProtocolEditor'

interface SelectPipetteOptionProps {
pipetteName: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import cx from 'classnames'
import styles from '../FlexComponents.css'
import { reduce } from 'lodash'
import { getLabwareDefURI, getLabwareDisplayName } from '@opentrons/shared-data'
import { FormPipettesByMount } from '../FlexProtocolEditor'

interface formikContextProps {
pipettesByMount: FormPipettesByMount
pipettesByMount: any
tiprack: any
}

Expand All @@ -35,7 +35,7 @@ export const TipRackOptions = ({ pipetteName }: any): JSX.Element => {
const [selected, setSelected] = useState<string[]>([])
const [customTipRack, setCustomTipRack] = useState(false)
const {
values: { pipettesByMount },
values,
errors,
setFieldValue,
} = useFormikContext<formikContextProps>()
Expand All @@ -52,7 +52,7 @@ export const TipRackOptions = ({ pipetteName }: any): JSX.Element => {
const handleNameChange = (selected: string[]): any => {
setFieldValue(`pipettesByMount.${pipetteName}.tipRackList`, selected)
}
const latestTipRackList = pipettesByMount[pipetteName].tipRackList
const latestTipRackList = values.pipettesByMount[pipetteName].tipRackList
useEffect(() => {
setSelected(latestTipRackList)
}, [latestTipRackList])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ function FlexProtocolEditor(): JSX.Element {
tiprack?: string
}

const validateFields = (values: InitialValues) => {
const { pipettesByMount, fields } = values
let errors: FormikErrors = {}
const validateFields = (values: InitialValues): FormikErrors => {
const { pipettesByMount } = values
const errors: FormikErrors = {}

if (!pipettesByMount.left.pipetteName) {
errors.pipette = `${i18n.t('flex.errors.first_pipette_not_selected')}`
Expand Down
2 changes: 1 addition & 1 deletion protocol-designer/src/components/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Icon, OutlineButton } from '@opentrons/components'
import { OutlineButton } from '@opentrons/components'
import { i18n } from '../localization'
import { CreateFlexFileForm } from './FlexProtocolEditor'
import styles from './FlexProtocolEditor/FlexComponents.css'
Expand Down

0 comments on commit 844feba

Please sign in to comment.