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 1 commit
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
Prev Previous commit
Next Next commit
Check js error resolved
  • Loading branch information
akshay-dighe committed May 22, 2023
commit a35893ac1a5130841426b571dc3ba625c3305e0e
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import styles from '../FlexFileDetails/FlexFileDetails.css'
import { InstrumentGroup } from '../FlexInstrument/InstrumentGroup'
import { FlexProtocolEditorComponent } from '../FlexProtocolEditor'
import { actions as navActions } from '../../../navigation'
import { UpdateConfirmation } from '../FlexUpdateConfirmation'
export interface Props {
formValues: FileMetadataFields
Expand All @@ -48,15 +49,15 @@
}

// TODO(mc, 2020-02-28): explore l10n for these dates
const DATE_ONLY_FORMAT = 'MMM dd, yyyy'
const DATETIME_FORMAT = 'MMM dd, yyyy | h:mm a'

Check warning on line 53 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L52-L53

Added lines #L52 - L53 were not covered by tests

export function FlexFileDetailsComponent(props: any): JSX.Element {
const [isEdit, setEdit] = useState(false)
const [selectedTabId, setTabId] = useState<number>(0)

Check warning on line 57 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L56-L57

Added lines #L56 - L57 were not covered by tests

if (isEdit) {
return (

Check warning on line 60 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L60

Added line #L60 was not covered by tests
<FlexProtocolEditorComponent
FlexFileDetails={{
isEditValue: isEdit,
Expand All @@ -66,7 +67,7 @@
/>
)
} else {
return (

Check warning on line 70 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L70

Added line #L70 was not covered by tests
<div>
{!Boolean(props.formValues) ? (
<NoFileSelection />
Expand All @@ -82,7 +83,7 @@
handleSubmit,
values,
}: FormikProps<FileMetadataFields>) => (
<form onSubmit={handleSubmit}>

Check warning on line 86 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L86

Added line #L86 was not covered by tests
<div className={styles.container}>
<FileProtocolInformation />
<div className={styles.line_separator} />
Expand Down Expand Up @@ -112,8 +113,8 @@
{Object.keys(props.instruments).length !== 1 && (
<SecondaryButton
onClick={e => {
e.preventDefault()
props.swapPipettes()

Check warning on line 117 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L116-L117

Added lines #L116 - L117 were not covered by tests
}}
>
{i18n.t('flex.file_tab.swap_pipette')}
Expand Down Expand Up @@ -164,24 +165,24 @@
}
}

const FileProtocolInformation = (): JSX.Element => {
const dispatch = useDispatch()
const [showConfirmation, setShowConfirmation] = useState(false)

Check warning on line 170 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L168-L170

Added lines #L168 - L170 were not covered by tests

const handleCancelClick = (): any => {
setShowConfirmation(false)

Check warning on line 173 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L172-L173

Added lines #L172 - L173 were not covered by tests
}
const handleConfirmClick = (): any => {

Check warning on line 175 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L175

Added line #L175 was not covered by tests
// handle the update action here
dispatch(navActions.navigateToPage('landing-page'))
setShowConfirmation(false)

Check warning on line 178 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L177-L178

Added lines #L177 - L178 were not covered by tests
}

function protocolCancelClick(e): any {
function protocolCancelClick(e: { preventDefault: () => void }): any {
e.preventDefault()
setShowConfirmation(true)

Check warning on line 183 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L182-L183

Added lines #L182 - L183 were not covered by tests
}
return (

Check warning on line 185 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L185

Added line #L185 was not covered by tests
<>
{Boolean(showConfirmation) && (
<>
Expand Down Expand Up @@ -212,16 +213,16 @@
)
}

export const FlexHeadingButtonGroup = (props: {

Check failure on line 216 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View workflow job for this annotation

GitHub Actions / js checks

Missing return type on function

Check failure on line 216 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View workflow job for this annotation

GitHub Actions / js checks

Missing return type on function

Check failure on line 216 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View workflow job for this annotation

GitHub Actions / js checks

Missing return type on function

Check warning on line 216 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L216

Added line #L216 was not covered by tests
protocolCancelClickProps: any
}) => {
const { protocolCancelClickProps } = props
return (

Check warning on line 220 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L219-L220

Added lines #L219 - L220 were not covered by tests
<div className={styles.right_buttons}>
<SecondaryButton>{i18n.t('flex.file_tab.export')}</SecondaryButton>
<SecondaryButton
className={styles.close_protocol_button}
onClick={e => protocolCancelClickProps(e)}

Check warning on line 225 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L225

Added line #L225 was not covered by tests
>
{i18n.t('flex.file_tab.close_export')}
</SecondaryButton>
Expand All @@ -229,8 +230,8 @@
)
}

const NoFileSelection = (): JSX.Element => {
return (

Check warning on line 234 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L233-L234

Added lines #L233 - L234 were not covered by tests
<div className={flexStyles.wrapper}>
<div className={styles.container}>
<StyledText as="h2">{i18n.t('flex.file_tab.heading')}</StyledText>
Expand All @@ -249,11 +250,11 @@
}

// File related information name and description etc.
const FileProtocolNameAndDescription = (props: {

Check warning on line 253 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L253

Added line #L253 was not covered by tests
nameDescriptionData: any
}): JSX.Element => {
const { nameDescriptionData } = props
return (

Check warning on line 257 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L256-L257

Added lines #L256 - L257 were not covered by tests
<div>
<Flex className={cx(styles.heading_container, styles.margin_bottom)}>
<StyledText as="h3" className={styles.margin_bottom}>
Expand Down Expand Up @@ -306,19 +307,19 @@
)
}

const EditButton = ({

Check warning on line 310 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L310

Added line #L310 was not covered by tests
editProps,
setTab,
setTabId,
addItems,
}: any): JSX.Element => {
return (

Check warning on line 316 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L316

Added line #L316 was not covered by tests
<SecondaryButton
style={{ height: 'max-content' }}
onClick={e => {
e.preventDefault()
editProps(true)
setTabId(setTab)

Check warning on line 322 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L320-L322

Added lines #L320 - L322 were not covered by tests
}}
>
{addItems
Expand All @@ -328,14 +329,14 @@
)
}

const SelectedModules = (props: { propsData: any }): JSX.Element => {
const { propsData } = props
const existingModules = getModuleData(propsData.modules)
return (

Check warning on line 335 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L332-L335

Added lines #L332 - L335 were not covered by tests
<>
{existingModules?.length > 0 ? (
existingModules.map((moduleType: any, i: number) => (
<div

Check warning on line 339 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L339

Added line #L339 was not covered by tests
className={` ${styles.card_width} ${styles.margin_bottom}`}
key={i}
>
Expand Down Expand Up @@ -374,15 +375,15 @@
}

export function getModuleData(modules: any): any {
const moduleData = []
for (const obj in modules) {

Check warning on line 379 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L378-L379

Added lines #L378 - L379 were not covered by tests
if (modules[obj] != null) moduleData.push(modules[obj])
}
return moduleData

Check warning on line 382 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L382

Added line #L382 was not covered by tests
}

const mapStateToProps = (state: BaseState): SP => {
return {

Check warning on line 386 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L385-L386

Added lines #L385 - L386 were not covered by tests
formValues: fileSelectors.getFileMetadata(state),
instruments: stepFormSelectors.getPipettesForInstrumentGroup(state),
modules: stepFormSelectors.getModulesForEditModulesCard(state),
Expand All @@ -396,16 +397,16 @@
dispatch: ThunkDispatch<any>
}
): Props {
const { _initialDeckSetup, ...passThruProps } = stateProps
const { dispatch } = dispatchProps
const swapPipetteUpdate = mapValues(_initialDeckSetup.pipettes, pipette => {

Check warning on line 402 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L400-L402

Added lines #L400 - L402 were not covered by tests
if (!pipette.mount) return pipette.mount
return pipette.mount === 'left' ? 'right' : 'left'
})
return {

Check warning on line 406 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L406

Added line #L406 was not covered by tests
...passThruProps,
swapPipettes: () =>
dispatch(

Check warning on line 409 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L409

Added line #L409 was not covered by tests
steplistActions.changeSavedStepForm({
stepId: INITIAL_DECK_SETUP_STEP_ID,
update: {
Expand All @@ -416,7 +417,7 @@
}
}

export const FlexFileDetails = connect(

Check warning on line 420 in protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexFileDetails/FlexFileDetails.tsx#L420

Added line #L420 was not covered by tests
mapStateToProps,
// @ts-expect-error(sa, 2021-6-21): TODO: refactor to use hooks api
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
} from '@opentrons/shared-data'
import { DropdownOption } from '@opentrons/components'
import { SPAN7_8_10_11_SLOT } from '../../../constants'
export const SUPPORTED_MODULE_TYPES: ModuleType[] = [

Check warning on line 10 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L10

Added line #L10 was not covered by tests
HEATERSHAKER_MODULE_TYPE,
MAGNETIC_MODULE_TYPE,
TEMPERATURE_MODULE_TYPE,
Expand All @@ -16,7 +16,7 @@

type SupportedSlotMap = Record<ModuleType, DropdownOption[]>

export const SUPPORTED_MODULE_SLOTS: SupportedSlotMap = {

Check warning on line 19 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L19

Added line #L19 was not covered by tests
[MAGNETIC_MODULE_TYPE]: [
{
name: 'Slot C1 (default)',
Expand All @@ -41,9 +41,10 @@
value: '1',
},
],
magneticBlockType: [],
}

const ALL_MODULE_SLOTS: DropdownOption[] = [

Check warning on line 47 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L47

Added line #L47 was not covered by tests
{
name: 'Slot A1',
value: '10',
Expand Down Expand Up @@ -90,7 +91,7 @@
},
]

const HEATER_SHAKER_SLOTS: DropdownOption[] = [

Check warning on line 94 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L94

Added line #L94 was not covered by tests
{
name: 'Slot A1',
value: '10',
Expand All @@ -117,7 +118,7 @@
},
]

const TEMPERATURE_MODULE_SLOTS: DropdownOption[] = [

Check warning on line 121 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L121

Added line #L121 was not covered by tests
{
name: 'Slot A1',
value: '10',
Expand Down Expand Up @@ -151,28 +152,28 @@
export function getAllFlexModuleSlotsByType(
moduleType: ModuleType
): DropdownOption[] {
const supportedSlotOption = SUPPORTED_MODULE_SLOTS[moduleType]

Check warning on line 155 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L155

Added line #L155 was not covered by tests

if (moduleType === THERMOCYCLER_MODULE_TYPE) {
return supportedSlotOption

Check warning on line 158 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L158

Added line #L158 was not covered by tests
}

if (moduleType === HEATERSHAKER_MODULE_TYPE) {
return supportedSlotOption.concat(
HEATER_SHAKER_SLOTS.filter(s => s.value !== supportedSlotOption[0].value)

Check warning on line 163 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L162-L163

Added lines #L162 - L163 were not covered by tests
)
}

if (moduleType === TEMPERATURE_MODULE_TYPE) {
return supportedSlotOption.concat(

Check warning on line 168 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L168

Added line #L168 was not covered by tests
TEMPERATURE_MODULE_SLOTS.filter(
s => s.value !== supportedSlotOption[0].value

Check warning on line 170 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L170

Added line #L170 was not covered by tests
)
)
}

const allOtherSlots = ALL_MODULE_SLOTS.filter(
s => s.value !== supportedSlotOption[0].value

Check warning on line 176 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L175-L176

Added lines #L175 - L176 were not covered by tests
)
return supportedSlotOption.concat(allOtherSlots)

Check warning on line 178 in protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexModules/FlexModuleData.ts#L178

Added line #L178 was not covered by tests
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@
import { connect, useDispatch } from 'react-redux'
import { actions as navActions } from '../../navigation'
import { reduce } from 'lodash'
import { PipetteOnDeck } from '../../step-forms'

Check failure on line 40 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View workflow job for this annotation

GitHub Actions / js checks

'PipetteOnDeck' is defined but never used

Check failure on line 40 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View workflow job for this annotation

GitHub Actions / js checks

'PipetteOnDeck' is defined but never used

Check failure on line 40 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View workflow job for this annotation

GitHub Actions / js checks

'PipetteOnDeck' is defined but never used
import assert from 'assert'
import { ModuleCreationArgs } from '../modals/FilePipettesModal'
import {
ModuleCreationArgs,
PipetteFieldsData,
} from '../modals/FilePipettesModal'
import { LabwareDefByDefURI } from '../../labware-defs'
import { NewProtocolFields } from '../../load-file'
import {
Expand Down Expand Up @@ -88,7 +91,7 @@
}) => void
}

const validationSchema = Yup.object().shape({

Check warning on line 94 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L94

Added line #L94 was not covered by tests
mountSide: Yup.string().required('Mount side is required'),
pipettesByMount: Yup.object().shape({
left: Yup.object().shape({
Expand All @@ -108,7 +111,7 @@
}),
})

const initialFormValues: InitialValues = {

Check warning on line 114 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L114

Added line #L114 was not covered by tests
fields: {
name: '',
author: '',
Expand Down Expand Up @@ -158,53 +161,53 @@
},
}

const getInitialValues = (formProps: any): InitialValues => {

Check warning on line 164 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L164

Added line #L164 was not covered by tests
if (formProps) {
if (formProps.formValues) {
const { protocolName, author, description } = formProps.formValues

Check warning on line 167 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L167

Added line #L167 was not covered by tests
initialFormValues.fields.name = protocolName || ''
initialFormValues.fields.author = author || ''
initialFormValues.fields.description = description || ''
}

if (Boolean(formProps.instruments)) {
const { left, right } = formProps.instruments

Check warning on line 174 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L174

Added line #L174 was not covered by tests
if (Boolean(left)) {
initialFormValues.pipettesByMount.left.pipetteName =

Check warning on line 176 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L176

Added line #L176 was not covered by tests
left.pipetteSpecs?.name || ''
initialFormValues.pipettesByMount.left.tiprackDefURI =

Check warning on line 178 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L178

Added line #L178 was not covered by tests
left?.tiprackModel || []
}
if (Boolean(right)) {
initialFormValues.pipettesByMount.right.pipetteName =

Check warning on line 182 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L182

Added line #L182 was not covered by tests
right.pipetteSpecs?.name || ''
initialFormValues.pipettesByMount.right.tiprackDefURI =

Check warning on line 184 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L184

Added line #L184 was not covered by tests
right?.tiprackModel || []
}
}

if (Boolean(formProps.modules)) {
if (formProps.modules.magneticModuleType !== null) {
initialFormValues.modulesByType[MAGNETIC_MODULE_TYPE] =

Check warning on line 191 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L191

Added line #L191 was not covered by tests
formProps.modules.magneticModuleType
}
if (formProps.modules.temperatureModuleType !== null) {
initialFormValues.modulesByType[TEMPERATURE_MODULE_TYPE] =

Check warning on line 195 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L195

Added line #L195 was not covered by tests
formProps.modules.temperatureModuleType
}
if (formProps.modules.thermocyclerModuleType !== null) {
initialFormValues.modulesByType[THERMOCYCLER_MODULE_TYPE] =

Check warning on line 199 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L199

Added line #L199 was not covered by tests
formProps.modules.thermocyclerModuleType
}
if (formProps.modules.heaterShakerModuleType !== null) {
initialFormValues.modulesByType[HEATERSHAKER_MODULE_TYPE] =

Check warning on line 203 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L203

Added line #L203 was not covered by tests
formProps.modules.heaterShakerModuleType
}
}

return initialFormValues

Check warning on line 208 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L208

Added line #L208 was not covered by tests
} else {
return initialFormValues

Check warning on line 210 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L210

Added line #L210 was not covered by tests
}
}

Expand All @@ -212,14 +215,14 @@
selectedTab: number
}

const SelectComponent = (selectedTab: number): JSX.Element | null => {
const [is96ChannelSelected, setIs96ChangeSelected] = useState(false)
const { left, right } = pipetteSlot

Check warning on line 220 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L218-L220

Added lines #L218 - L220 were not covered by tests
switch (selectedTab) {
case 0:
return <FlexProtocolName />

Check warning on line 223 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L223

Added line #L223 was not covered by tests
case 1:
return (

Check warning on line 225 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L225

Added line #L225 was not covered by tests
<Flex
flexDirection={DIRECTION_ROW}
justifyContent={JUSTIFY_SPACE_BETWEEN}
Expand All @@ -237,16 +240,16 @@
</Flex>
)
case 2:
return <FlexModules />

Check warning on line 243 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L243

Added line #L243 was not covered by tests
default:
return null

Check warning on line 245 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L245

Added line #L245 was not covered by tests
}
}

type PipetteFieldsData = Omit<
PipetteOnDeck,
'id' | 'spec' | 'tiprackLabwareDef'
>
// type PipetteFieldsData = Omit<
// PipetteOnDeck,
// 'id' | 'spec' | 'tiprackLabwareDef'
// >

function FlexProtocolEditor({
isEditValue,
Expand All @@ -254,40 +257,40 @@
formProps,
onSave,
}: FlexProtocolEditorComponentProps): JSX.Element {
const [selectedTab, setTab] = useState<number>(0)
const [redirectToDetails, setRedirectToDetails] = useState(false)
const dispatch = useDispatch()
const [isEdit, setEdit] = useState(false)

Check warning on line 263 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L260-L263

Added lines #L260 - L263 were not covered by tests
//On Redirction if page tab edit set to true

Check failure on line 264 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View workflow job for this annotation

GitHub Actions / js checks

Expected space or tab after '//' in comment

Check failure on line 264 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View workflow job for this annotation

GitHub Actions / js checks

Expected space or tab after '//' in comment

Check failure on line 264 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View workflow job for this annotation

GitHub Actions / js checks

Expected space or tab after '//' in comment
useEffect(() => {

Check warning on line 265 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L265

Added line #L265 was not covered by tests
if (isEditValue) {
setEdit(isEditValue)
setTab(tabIdValue)

Check warning on line 268 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L267-L268

Added lines #L267 - L268 were not covered by tests
}
}, [isEditValue, tabIdValue])

// Next button click
const handleNext = ({ selectedTab }: selectedTabProps): any => {

Check warning on line 273 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L273

Added line #L273 was not covered by tests
if (isEdit) {
//Redirect back to file details page

Check failure on line 275 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View workflow job for this annotation

GitHub Actions / js checks

Expected space or tab after '//' in comment

Check failure on line 275 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View workflow job for this annotation

GitHub Actions / js checks

Expected space or tab after '//' in comment

Check failure on line 275 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View workflow job for this annotation

GitHub Actions / js checks

Expected space or tab after '//' in comment
setRedirectToDetails(true)
return <FlexFileDetails />

Check warning on line 277 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L276-L277

Added lines #L276 - L277 were not covered by tests
} else {
const setTabNumber =
selectedTab >= 0 && selectedTab <= navPillTabListLength
? selectedTab + 1
: selectedTab
setTab(setTabNumber)

Check warning on line 283 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L283

Added line #L283 was not covered by tests
}
}

// Previous button click
const handlePrevious = ({ selectedTab }: selectedTabProps): void => {

Check warning on line 288 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L288

Added line #L288 was not covered by tests
const setTabNumber =
selectedTab > 0 && selectedTab <= navPillTabListLength
? selectedTab - 1
: selectedTab
setTab(setTabNumber)

Check warning on line 293 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L293

Added line #L293 was not covered by tests
}

const nextButton =
Expand All @@ -304,27 +307,27 @@
tiprack?: string
}

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

Check warning on line 312 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L310-L312

Added lines #L310 - L312 were not covered by tests
if (!pipettesByMount.left.pipetteName) {
errors.pipette = `${i18n.t('flex.errors.first_pipette_not_selected')}`

Check warning on line 314 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L314

Added line #L314 was not covered by tests
}

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

Check warning on line 318 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L318

Added line #L318 was not covered by tests
}

return errors

Check warning on line 321 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L321

Added line #L321 was not covered by tests
}

const handleSubmit = ({ values }: any): void => {
console.log('***Final OT3 JSON Data ***', values)
const newProtocolFields = values.fields

Check warning on line 326 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L324-L326

Added lines #L324 - L326 were not covered by tests

const pipettes = reduce<FormPipettesByMount, PipetteFieldsData[]>(

Check warning on line 328 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L328

Added line #L328 was not covered by tests
values.pipettesByMount,
(acc, formPipette: FormPipette, mount): PipetteFieldsData[] => {
(acc, formPipette: FormPipette, mount: string): PipetteFieldsData[] => {
assert(mount === 'left' || mount === 'right', `invalid mount: ${mount}`) // this is mostly for flow
// @ts-expect-error(sa, 2021-6-21): TODO validate that pipette names coming from the modal are actually valid pipette names on PipetteName type
return formPipette &&
Expand All @@ -347,11 +350,11 @@
// NOTE: this is extra-explicit for flow. Reduce fns won't cooperate
// with enum-typed key like `{[ModuleType]: ___}`
// @ts-expect-error(sa, 2021-6-21): TS not smart enough to take real type from Object.keys
const moduleTypes: ModuleType[] = Object.keys(values.modulesByType)
const modules: ModuleCreationArgs[] = moduleTypes.reduce<

Check warning on line 354 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L353-L354

Added lines #L353 - L354 were not covered by tests
ModuleCreationArgs[]
>((acc, moduleType) => {
const formModule = values.modulesByType[moduleType]

Check warning on line 357 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L357

Added line #L357 was not covered by tests
return formModule?.onDeck
? [
...acc,
Expand All @@ -364,8 +367,8 @@
: acc
}, [])

onSave({ modules, newProtocolFields, pipettes })
dispatch(navActions.navigateToPage('liquids'))

Check warning on line 371 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L370-L371

Added lines #L370 - L371 were not covered by tests
}

return redirectToDetails ? (
Expand Down Expand Up @@ -402,7 +405,7 @@
isValid: any
handleSubmit: () => void
}) => (
<form onSubmit={props.handleSubmit}>

Check warning on line 408 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L408

Added line #L408 was not covered by tests
<section className={styles.editor_form}>
{SelectComponent(selectedTab)}
</section>
Expand All @@ -410,7 +413,7 @@
{selectedTab !== 0 && !isEdit && (
<NewPrimaryBtn
tabIndex={5}
onClick={() => handlePrevious({ selectedTab })}

Check warning on line 416 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L416

Added line #L416 was not covered by tests
className={styles.flex_round_tabs_button_50p}
>
<StyledText as="h3">
Expand All @@ -421,7 +424,7 @@
<NewPrimaryBtn
tabIndex={4}
type="submit"
onClick={() => handleNext({ selectedTab })}

Check warning on line 427 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L427

Added line #L427 was not covered by tests
className={
selectedTab !== 0
? styles.flex_round_tabs_button_50p
Expand All @@ -446,13 +449,18 @@
pipettes: PipetteFieldsData[]
modules: ModuleCreationArgs[]
}

interface SP {
_customLabware: LabwareDefByDefURI
_hasUnsavedChanges?: boolean | null
}
interface DP {
onCancel: () => unknown
_createNewProtocol: (arg0: CreateNewProtocolArgs) => void
}
function mergeProps(stateProps: SP, dispatchProps: DP, ownProps: any): Props {
const { isEditValue, tabIdValue, formProps } = ownProps.FlexFileDetails
return {

Check warning on line 463 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L462-L463

Added lines #L462 - L463 were not covered by tests
isEditValue,
tabIdValue,
formProps,
Expand All @@ -461,7 +469,7 @@
!stateProps._hasUnsavedChanges ||
window.confirm(i18n.t('alert.window.confirm_create_new'))
) {
dispatchProps._createNewProtocol({

Check warning on line 472 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L472

Added line #L472 was not covered by tests
...fields,
customLabware: stateProps._customLabware,
})
Expand All @@ -470,7 +478,7 @@
}
}

export const FlexProtocolEditorComponent = connect(

Check warning on line 481 in protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/FlexProtocolEditor/FlexProtocolEditor.tsx#L481

Added line #L481 was not covered by tests
newModalFileMapStateToProps,
mapDispatchToProps,
mergeProps
Expand Down
15 changes: 13 additions & 2 deletions protocol-designer/src/components/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import styles from './FlexProtocolEditor/FlexComponents.css'
import { StyledText } from './FlexProtocolEditor/StyledText'
import { actions as loadFileActions } from '../load-file'
import { connect, useDispatch } from 'react-redux'
import { MapDispatchToPropsParam, connect, useDispatch } from 'react-redux'
import { ThunkDispatch } from '../types'
import { actions as navActions } from '../navigation'
import { setRobotName } from '../load-file/actions'
Expand All @@ -24,10 +24,10 @@
goToOT3FilePage: () => void
goToOT2FilePage: () => void
}): JSX.Element {
const { goToOT3FilePage, goToOT2FilePage } = props
const dispatch = useDispatch()

Check warning on line 28 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L27-L28

Added lines #L27 - L28 were not covered by tests

return (

Check warning on line 30 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L30

Added line #L30 was not covered by tests
<div className={styles.pd_landing_page}>
<StyledText as="h1">{i18n.t('flex.landing_page.welcome')}</StyledText>
<img
Expand All @@ -37,7 +37,7 @@
<div className={styles.flex_landing_buttons_wrapper}>
<OutlineButton
className={styles.flex_landing_button}
onClick={() => goToOT3FilePage()}

Check warning on line 40 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L40

Added line #L40 was not covered by tests
>
<StyledText as="h4">
{i18n.t('flex.landing_page.create_flex_protocol')}
Expand All @@ -45,7 +45,7 @@
</OutlineButton>
<OutlineButton
className={styles.flex_landing_button}
onClick={() => goToOT2FilePage()}

Check warning on line 48 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L48

Added line #L48 was not covered by tests
>
<StyledText as="h4">
{i18n.t('flex.landing_page.create_ot2_protocol')}
Expand All @@ -58,7 +58,7 @@
<input
type="file"
onChange={fileChangeEvent => {
dispatch(loadFileActions.loadProtocolFile(fileChangeEvent))

Check warning on line 61 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L61

Added line #L61 was not covered by tests
}}
/>
</OutlineButton>
Expand All @@ -67,29 +67,40 @@
)
}

const mapDispatchToProps: MapDispatchToPropsParam<
{ dispatch: ThunkDispatch<any> },
{}
> = dispatch => ({

Check warning on line 73 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L73

Added line #L73 was not covered by tests
dispatch,
})

function mergeProps(
stateProps: any,
dispatchProps: {
dispatch: ThunkDispatch<any>
}
): Props {
const { _initialDeckSetup, ...passThruProps } = stateProps
const { dispatch } = dispatchProps
return {

Check warning on line 85 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L83-L85

Added lines #L83 - L85 were not covered by tests
...passThruProps,
goToOT3FilePage: () => {
dispatch(

Check warning on line 88 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L88

Added line #L88 was not covered by tests
setRobotName({ model: OT3_STANDARD_MODEL, deckId: OT3_STANDARD_DECKID })
)
dispatch(navActions.navigateToPage('new-flex-file-form'))

Check warning on line 91 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L91

Added line #L91 was not covered by tests
},
goToOT2FilePage: () => {
dispatch(

Check warning on line 94 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L94

Added line #L94 was not covered by tests
setRobotName({ model: OT2_STANDARD_MODEL, deckId: OT2_STANDARD_DECKID })
)
dispatch(navActions.navigateToPage('file-splash'))

Check warning on line 97 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L97

Added line #L97 was not covered by tests
},
}
}

export const LandingPageComponent = connect(null, null, mergeProps)(LandingPage)
export const LandingPageComponent = connect(

Check warning on line 102 in protocol-designer/src/components/LandingPage.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/components/LandingPage.tsx#L102

Added line #L102 was not covered by tests
null,
mapDispatchToProps,
mergeProps
)(LandingPage)
6 changes: 6 additions & 0 deletions protocol-designer/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ export const MODELS_FOR_FLEX_MODULE_TYPE: Record<
value: HEATERSHAKER_MODULE_V1,
},
],
[MAGNETIC_BLOCK_TYPE]: [
{
name: i18n.t(`modules.model_display_name.${MAGNETIC_BLOCK_V1}`),
value: MAGNETIC_BLOCK_V1,
},
],
}

export const DEFAULT_MODEL_FOR_MODULE_TYPE: Record<ModuleType, ModuleModel> = {
Expand Down
Loading