Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol designer OT-3 development #12540

Closed
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
b9aa99a
Landing Page Initial Commit
aditya-sancheti Apr 7, 2023
29b20dc
Landing Page Initial Commit (#12446)
aditya-sancheti Apr 7, 2023
9dab933
Merge branch 'edge' into pd_flex_main
aditya-sancheti Apr 7, 2023
f3ad753
Merge branch 'pd_flex_main' into pd_dev_RPLC-225-RPLC-384-Protocol-De…
aditya-sancheti Apr 7, 2023
cb4cb1a
Merge branch 'edge' into pd_flex_main
aditya-sancheti Apr 11, 2023
248bc02
Merge branch 'pd_flex_main' into pd_dev_RPLC-225-RPLC-384-Protocol-De…
aditya-sancheti Apr 11, 2023
5286508
Round Tabs implementation
aditya-sancheti Apr 12, 2023
33262e0
Merge branch 'edge' into pd_flex_main
aditya-sancheti Apr 12, 2023
f4871aa
Merge branch 'pd_flex_main' into pd_dev_RPLC-225-RPLC-384-Protocol-De…
aditya-sancheti Apr 12, 2023
df31a44
Pd dev rplc 225 rplc 384 protocol designer landing page (#12477)
aditya-sancheti Apr 12, 2023
cb50e1f
Minor changes in code
aditya-sancheti Apr 13, 2023
26f9ca4
Merge branch 'edge' into pd_flex_main
aditya-sancheti Apr 13, 2023
48bc634
Merge branch 'pd_flex_main' into pd_dev_RPLC-225-RPLC-384-Protocol-De…
aditya-sancheti Apr 13, 2023
60372fc
pipette selection logic done
akshay-dighe Apr 13, 2023
8711f8c
Merge branch 'pd_dev_RPLC-225-RPLC-384-Protocol'
akshay-dighe Apr 13, 2023
dd378ce
imported styles css
akshay-dighe Apr 13, 2023
7715870
changed strings
aditya-sancheti Apr 13, 2023
85d35ed
Merge branch 'pd_dev_RPLC-225-RPLC-384-Protocol-Designer-Landing-Page…
aditya-sancheti Apr 13, 2023
d83009a
format
aditya-sancheti Apr 13, 2023
1d166c3
Creating components for tabs
aditya-sancheti Apr 13, 2023
28598b1
pipette and tiprack slection ongoing code
akshay-dighe Apr 14, 2023
fa14738
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe Apr 14, 2023
e2b8da4
Cosmetic CSS changes to match Figma design & look
aditya-sancheti Apr 18, 2023
c20609e
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe Apr 18, 2023
4a3cdbe
pipette and tiprack selection logic
akshay-dighe Apr 18, 2023
960f9c9
Merge branch 'pd_dev_RPLC-225-RPLC-384-Protocol-Designer-Landing-Page…
akshay-dighe Apr 18, 2023
2cd325c
new name as per flex json
akshay-dighe Apr 18, 2023
0ecb064
code refactor
akshay-dighe Apr 18, 2023
be43ddb
inital commit for module selection
aditya-sancheti Apr 18, 2023
aab78d9
import changes
aditya-sancheti Apr 18, 2023
eca58dd
fix cypress tests and update icon snapshot
jerader Apr 18, 2023
d7f06ab
Merge branch 'pd_dev_RPLC-225-RPLC-384-Protocol-Designer-Landing-Page…
aditya-sancheti Apr 19, 2023
4bdc6c0
Custom tiprack selection and code formatted
akshay-dighe Apr 19, 2023
de3c5fe
Modules selection place holder
aditya-sancheti Apr 19, 2023
e38c164
Merge branch 'pd_flex_module_selection' of https://github.com/Opentro…
akshay-dighe Apr 20, 2023
4ea7480
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe Apr 20, 2023
8c01fd5
converted 4 page navpills into the 3 pages
akshay-dighe Apr 20, 2023
4a910dc
pipette selection changes
akshay-dighe Apr 20, 2023
63c1550
Modules selection placeholder
aditya-sancheti Apr 20, 2023
444d0fa
Merge branch 'pd_dev_RPLC-225-RPLC-384-Protocol-Designer-Landing-Page…
aditya-sancheti Apr 20, 2023
433ee50
Flex Module selection
akshay-dighe Apr 21, 2023
4a20a10
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe Apr 21, 2023
1568453
lint error resolved
akshay-dighe Apr 21, 2023
9df7a8d
css changes
akshay-dighe Apr 21, 2023
7bb4294
React router dom added
akshay-dighe Apr 21, 2023
99f7697
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe Apr 21, 2023
edd8f92
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe Apr 21, 2023
7dc5357
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe Apr 24, 2023
0d558e2
for flex robot dynamic module selection
akshay-dighe Apr 25, 2023
487ad5c
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe Apr 25, 2023
9e2b014
created TipRackList file and removed unwanted code
akshay-dighe Apr 26, 2023
21f4c22
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe Apr 26, 2023
2a1fcf4
Merge branch 'pd_dev_RPLC-225-RPLC-384-Protocol-Designer-Landing-Page…
akshay-dighe Apr 26, 2023
0a79995
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 3, 2023
72c3231
Merge branch 'pd-flex-pipette-selection' of https://github.com/Opentr…
akshay-dighe May 3, 2023
b42c732
code review comment resolved
akshay-dighe May 3, 2023
693a9b7
errors resloved
akshay-dighe May 4, 2023
0ecbd00
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 4, 2023
fdfa5a0
code formatting done
akshay-dighe May 4, 2023
5987223
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 5, 2023
0c8e9ec
Altered Flex protocol directory structure
akshay-dighe May 5, 2023
063f198
file formatted
akshay-dighe May 5, 2023
bc1c879
Validations
aditya-sancheti May 5, 2023
a447b79
Merge branch 'pd_dev_RPLC-225-RPLC-384-Protocol-Designer-Landing-Page…
abhijit-botre May 6, 2023
d192d58
Folder structure Restructuring
abhijit-botre May 8, 2023
29ab1d9
Minor Code change for folder structure
abhijit-botre May 8, 2023
0ee1bcc
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 9, 2023
0877913
placed new flex inside existing PD environment
akshay-dighe May 9, 2023
844feba
lint and check js error resolved
akshay-dighe May 9, 2023
3fa2558
Merge branch 'pd-flex-pipette-selection' of https://github.com/Opentr…
aditya-sancheti May 10, 2023
30c2787
Confirmation Dialog and cosmetic changes
aditya-sancheti May 10, 2023
c3963c2
Merge branch 'pd-flex-pipette-selection' of https://github.com/Opentr…
abhijit-botre May 10, 2023
bd67347
Select pipette
aditya-sancheti May 10, 2023
32aa541
Merge branch 'pd-flex-pipette-selection' of https://github.com/Opentr…
akshay-dighe May 10, 2023
1639907
Swap_Pipettes_with_96_Channel
abhijit-botre May 10, 2023
3829350
import json file functionality
akshay-dighe May 11, 2023
49c8529
flex file changes and code merge
akshay-dighe May 11, 2023
65f39ec
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 11, 2023
60e89d8
Merge branch 'pd_dev_confiramtion' of https://github.com/Opentrons/op…
akshay-dighe May 11, 2023
e54b547
Merge branch 'pd_flex_file_details' of https://github.com/Opentrons/o…
akshay-dighe May 11, 2023
ade88ad
Tip rack style issue resolved
akshay-dighe May 11, 2023
d39cdcb
check js error resolved
akshay-dighe May 11, 2023
289a22e
instrument import
abhijit-botre May 11, 2023
75d09fb
gripper added in the module section & css changes
akshay-dighe May 11, 2023
00e9570
enabled flex supported tiprack
akshay-dighe May 15, 2023
a551a4e
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 15, 2023
95e9d96
module selection changes & check js error resolve
akshay-dighe May 15, 2023
a7143d6
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 15, 2023
1c655cf
Refactored pipette selection tabs into a unified form.
akshay-dighe May 16, 2023
dbe20f8
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 16, 2023
21e39ee
flex supported modules added in separate file
akshay-dighe May 16, 2023
5eae400
File details page implementation with partial edit
abhijit-botre May 16, 2023
912f904
Merge branch 'pd-flex-pipette-selection' of https://github.com/Opentr…
abhijit-botre May 16, 2023
0b85f1a
Design and dynamic module fetching logic in file details page impleme…
abhijit-botre May 17, 2023
5207a58
navigation changes and ot3 file save data
akshay-dighe May 18, 2023
6b9b10c
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 18, 2023
2ce7e7f
Merge branch 'pd_flex_file_details' of https://github.com/Opentrons/o…
akshay-dighe May 18, 2023
3abf0e5
resolved code conflict error
akshay-dighe May 18, 2023
b438b67
Refactored code to update the robot selection feature. Completed modi…
akshay-dighe May 19, 2023
3054156
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 19, 2023
1d45e16
Pipette Selection Validation(Disabled, 96 ch handling, Mount), Instru…
abhijit-botre May 21, 2023
8315b9d
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 22, 2023
69547c7
Merge branch 'pd_flex_file_details' of https://github.com/Opentrons/o…
akshay-dighe May 22, 2023
f908a04
Disable ConnectedSidebar for OT3 file-details page
akshay-dighe May 22, 2023
8f5b462
ModuleChange
abhijit-botre May 22, 2023
5001e8c
onEditUpdateButton
abhijit-botre May 22, 2023
6b2850f
Flex new cancel button functionalility
akshay-dighe May 22, 2023
2ea11fa
Merge branch 'pd_flex_file_details' of https://github.com/Opentrons/o…
akshay-dighe May 22, 2023
a35893a
Check js error resolved
akshay-dighe May 22, 2023
7f6cc0e
Reolved lint JS error
akshay-dighe May 23, 2023
f7b5a6c
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 23, 2023
2988f26
Flex Module Edit value update
abhijit-botre May 23, 2023
56c7aee
Merge branch 'pd-flex-pipette-selection' of https://github.com/Opentr…
abhijit-botre May 23, 2023
c18cbfc
CSS lint error resolved
akshay-dighe May 23, 2023
aa8f797
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 24, 2023
4d6fb7d
Flex Details CSS and name changes
abhijit-botre May 24, 2023
8e6d34f
Merge branch 'pd-flex-pipette-selection' of https://github.com/Opentr…
abhijit-botre May 24, 2023
ce71477
Code review comments resolved
akshay-dighe May 24, 2023
05f2597
Flex error resolved
abhijit-botre May 24, 2023
4100f39
removed unwated gripper code and validation changes
akshay-dighe May 24, 2023
cca46e3
Sandbox Review Changes May 23, 2023
abhijit-botre May 24, 2023
7623be8
resolved check js errors
akshay-dighe May 24, 2023
0f18954
Merge branch 'pd_flex_file_details' of https://github.com/Opentrons/o…
akshay-dighe May 24, 2023
dcfe698
removed unused code
akshay-dighe May 24, 2023
304eb5a
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 24, 2023
d18dfc0
removed router dom from yarn
akshay-dighe May 24, 2023
a2b686f
code review comment changes
akshay-dighe May 25, 2023
0ebb311
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 25, 2023
84a5aff
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 26, 2023
16d530d
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe May 29, 2023
73ab5aa
1. Confirmation dialog message updated
aditya-sancheti May 30, 2023
5f13b79
Revert "1. Confirmation dialog message updated"
aditya-sancheti May 30, 2023
3ff2bf3
Code review comment resolved
akshay-dighe Jun 1, 2023
3a2f679
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
akshay-dighe Jun 1, 2023
c6ef595
Merge branch 'pd_dev_RPLC-225-RPLC-384-Protocol-Designer-Landing-Page…
akshay-dighe Jun 1, 2023
ca9c80c
Removed unnecessary code.
akshay-dighe Jun 1, 2023
a205691
96 selection change
akshay-dighe Jun 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 Expand Up @@ -179,3 +178,15 @@
margin: 32px 0 45px;
width: 100%;
}

.error_text {
color: var(--c-red);
}

.ptb_10 {
padding: 5px 0;
}

.pb_10 {
padding-bottom: 10px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import styles from '../FlexComponents.css'
import { useFormikContext } from 'formik'

interface flexProtocolName {
fields: any
fields: {
name: string
author: string
description: string
}
handleChange: () => void
handleBlur: () => void
}
Expand All @@ -16,6 +20,8 @@ function FlexProtocolNameComponent(): JSX.Element {
values,
handleChange,
handleBlur,
errors,
touched,
} = useFormikContext<flexProtocolName>()

return (
Expand All @@ -42,8 +48,10 @@ function FlexProtocolNameComponent(): JSX.Element {
value={values.fields.name}
name="fields.name"
/>
<StyledText as="label">
{i18n.t('flex.name_and_description.supporting_error_text')}
<StyledText as="label" className={styles.error_text}>
{errors?.fields?.name && touched?.fields?.name
? errors.fields.name
: null}
</StyledText>
</FormGroup>

Expand All @@ -65,9 +73,6 @@ function FlexProtocolNameComponent(): JSX.Element {
value={values.fields.author}
name="fields.author"
/>
<StyledText as="label">
{i18n.t('flex.name_and_description.supporting_error_text')}
</StyledText>
</FormGroup>

<FormGroup className={styles.form_group}>
Expand All @@ -83,9 +88,6 @@ function FlexProtocolNameComponent(): JSX.Element {
value={values.fields.description}
name="fields.description"
/>
<StyledText as="label">
{i18n.t('flex.name_and_description.supporting_error_text')}
</StyledText>
</FormGroup>
</>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@opentrons/shared-data'
import type { PipetteNameSpecs } from '@opentrons/shared-data'
import { RadioGroup } from '@opentrons/components'
import { pipetteNameBlocklist } from '../constant'
import { pipetteNameBlocklist, pipetteSlot } from '../constant'
import { useFormikContext } from 'formik'
import type { ActionMeta } from 'react-select'

Expand Down Expand Up @@ -57,7 +57,7 @@ export interface SelectOption {
}

export const RadioSelect = ({ pipetteName, pipetteType }: any): JSX.Element => {
const { handleChange } = useFormikContext<any>()
const { handleChange, handleBlur } = useFormikContext<any>()
const allowlist = ({ value }: SelectOption): boolean => {
return !pipetteNameBlocklist.some(n => n === value)
}
Expand All @@ -68,12 +68,22 @@ export const RadioSelect = ({ pipetteName, pipetteType }: any): JSX.Element => {
...(gen1Options.length > 0 ? gen1Options : []),
]

const emptyMount = [
{ value: 'LEAVE_SECOND_EMPTY', name: 'Leave Second Empty' },
]

const newGroupedOptions =
pipetteName.split('.')[1] === pipetteSlot.right
? [...groupedOptions, ...emptyMount]
: groupedOptions

return (
<RadioGroup
name={pipetteName}
value={pipetteType}
options={groupedOptions}
options={newGroupedOptions}
onChange={handleChange}
onBlur={handleBlur}
/>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ interface SelectPipetteOptionProps {
pipetteName: string
}

interface formikContextProps {
pipettesByMount: any
pipette: any
}

export const SelectPipetteOption: React.FC<SelectPipetteOptionProps> = ({
pipetteName,
}) => {
const {
values: { pipettesByMount },
} = useFormikContext<any>()
const { values, errors } = useFormikContext<formikContextProps>()

const is96ChannelSelected = checkSelectedPipette(
pipettesByMount[pipetteName].pipetteName
values.pipettesByMount[pipetteName].pipetteName
)
const className = cx({ disable_mount_option: is96ChannelSelected })

Expand All @@ -31,25 +34,37 @@ export const SelectPipetteOption: React.FC<SelectPipetteOptionProps> = ({
: i18n.t('flex.pipette_selection.choose_second_pipette')
return (
<>
<StyledText as={'h1'}>{pipetteHeaderText}</StyledText>
<Flex className={styles.pb_10}>
<StyledText as={'h1'}>{pipetteHeaderText}</StyledText>
</Flex>
{
<>
<StyledText as={'p'}>
<StyledText as={'p'} className={styles.pb_10}>
{i18n.t('flex.pipette_selection.pipette_96_selection_note')}
</StyledText>
{/* Pipette Selection here */}
<RadioSelect
pipetteName={`pipettesByMount.${pipetteName}.pipetteName`}
pipetteType={pipettesByMount[pipetteName].pipetteName}
/>
<hr />
<Flex className={styles.pb_10}>
<RadioSelect
pipetteName={`pipettesByMount.${pipetteName}.pipetteName`}
pipetteType={values.pipettesByMount[pipetteName].pipetteName}
/>
</Flex>
{pipetteName === pipetteSlot.left && (
<StyledText as="label" className={styles.error_text}>
{errors.pipette && errors.pipette}
</StyledText>
)}

{/* Pipette Mount Selection here */}
<Flex className={styles[className]}>
<hr />
<Flex className={cx(styles[className], styles.ptb_10)}>
<SelectPipetteMount pipetteName={pipetteName} />
</Flex>
{channel96SelectionNote(is96ChannelSelected)}
<hr />
<TipRackOptions pipetteName={pipetteName} />
{channel96SelectionNote(is96ChannelSelected)}
<Flex className={styles.pb_10}>
<TipRackOptions pipetteName={pipetteName} />
</Flex>
</>
}
</>
Expand All @@ -65,7 +80,7 @@ const channel96SelectionNote = (
): JSX.Element | boolean => {
return (
is96ChannelSelected && (
<StyledText as={'p'}>
<StyledText as={'p'} className={styles.ptb_10}>
{i18n.t('flex.pipette_selection.pippette_ocuupies_both_mount')}
</StyledText>
)
Expand All @@ -76,6 +91,7 @@ const SelectPipetteMount = (props: { pipetteName: string }): JSX.Element => {
const {
values: { pipettesByMount, mountSide },
handleChange,
handleBlur,
} = useFormikContext<any>()

return (
Expand All @@ -87,6 +103,7 @@ const SelectPipetteMount = (props: { pipetteName: string }): JSX.Element => {
value={pipettesByMount[props.pipetteName].mount}
options={mountSide}
onChange={handleChange}
onBlur={handleBlur}
/>
}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
blockedTipRackListForFlex,
customTiprackOption,
fontSize14,
pipetteSlot,
} from '../constant'
import {
CheckboxField,
Expand All @@ -22,16 +23,22 @@ import styles from '../FlexComponents.css'
import { reduce } from 'lodash'
import { getLabwareDefURI, getLabwareDisplayName } from '@opentrons/shared-data'

interface formikContextProps {
pipettesByMount: any
tiprack: any
}

export const TipRackOptions = ({ pipetteName }: any): JSX.Element => {
const dispatch = useDispatch()
const allLabware = useSelector(getLabwareDefsByURI)
const tiprackOptions = getFlexTiprackOptions(allLabware)
const [selected, setSelected] = useState<string[]>([])
const [customTipRack, setCustomTipRack] = useState(false)
const {
values: { pipettesByMount },
values,
errors,
setFieldValue,
} = useFormikContext<any>()
} = useFormikContext<formikContextProps>()

const customTiprackFilteredData = [...tiprackOptions].filter(
(i: any) =>
Expand All @@ -45,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 Expand Up @@ -85,8 +92,15 @@ export const TipRackOptions = ({ pipetteName }: any): JSX.Element => {
{customTiprackFilteredData.length > 0 && (
<ShowCustomTiprackList customTipRackProps={customTiprackFilteredData} />
)}
{customTipRack &&
customFileUpload(customTipRack, customTiprackFilteredData, dispatch)}
<Flex>
{customTipRack &&
customFileUpload(customTipRack, customTiprackFilteredData, dispatch)}
</Flex>
{pipetteName === pipetteSlot.left && (
<StyledText as="label" className={styles.error_text}>
{errors.tiprack ? errors.tiprack : ''}
</StyledText>
)}
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
TEMPERATURE_MODULE_V2,
} from '@opentrons/shared-data'
import { Formik } from 'formik'
import * as Yup from 'yup'
import { i18n } from '../../localization'
import { StyledText } from './StyledText'
import styles from './FlexComponents.css'
Expand Down Expand Up @@ -155,6 +156,32 @@ function FlexProtocolEditor(): JSX.Element {
? i18n.t('flex.round_tabs.go_to_liquids_page')
: i18n.t('flex.round_tabs.next')

const InitialFormSchema = Yup.object().shape({
fields: Yup.object().shape({
name: Yup.string().matches(/^[a-zA-Z0-9]*$/),
}),
})

interface FormikErrors {
pipette?: string
tiprack?: string
}

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')}`
}

if (!pipettesByMount.left.tipRackList.length) {
errors.tiprack = `${i18n.t('flex.errors.tiprack_not_selected')}`
}

return errors
}

return (
<Flex flexDirection={DIRECTION_COLUMN}>
<Flex>
Expand All @@ -171,12 +198,14 @@ function FlexProtocolEditor(): JSX.Element {
<Formik
enableReinitialize
initialValues={getInitialValues}
validateOnChange={false}
validateOnChange={true}
validate={validateFields}
validationSchema={InitialFormSchema}
onSubmit={(values, actions) => {
console.log({ values })
}}
>
{(props: { handleSubmit: () => void }) => (
{(props: { errors: any; handleSubmit: () => void }) => (
<form onSubmit={props.handleSubmit}>
<section className={styles.editor_form}>
{selectComponent(selectedTab)}
Expand Down
13 changes: 10 additions & 3 deletions 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 All @@ -18,7 +18,10 @@ function LandingPageComponent(props: PageProps): JSX.Element {
return (
<div className={styles.pd_landing_page}>
<StyledText as="h1">{i18n.t('flex.landing_page.welcome')}</StyledText>
<Icon name={'ot-logo'} className={styles.ot_flex_logo} />
<img
className={styles.ot_flex_logo}
src={require('../images/ot_logo.png')}
/>
<div className={styles.flex_landing_buttons_wrapper}>
<OutlineButton
className={styles.flex_landing_button}
Expand Down Expand Up @@ -59,7 +62,11 @@ export const selectRobotPage = (
): JSX.Element | null => {
switch (page) {
case selectPageForms.newFlexFileForm:
return <CreateFlexFileForm setPageProps={setPage} />
return (
<ProtocolEditor>
<CreateFlexFileForm setPageProps={setPage} />
</ProtocolEditor>
)
case selectPageForms.protocolEditor:
return <ProtocolEditor />
case selectPageForms.defaultLandingPage:
Expand Down
Loading