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

refactor(labware-creator): Break out Grid and Volume sections #7768

Merged
merged 7 commits into from
May 6, 2021

Conversation

Kadee80
Copy link
Contributor

@Kadee80 Kadee80 commented May 4, 2021

Overview

Addresses #7707

Changelog

  • refactor(labware-creator): Break out Grid and Volume sections

Review requests

  • code review
  • volume instructions reads TUBES instead of wells when tuberack or aluminum block is selected
  • LC still generates working definitions

Risk assessment

Low, but we should check definition generation yet again

@Kadee80 Kadee80 requested review from a team, shlokamin and IanLondon and removed request for a team May 4, 2021 14:21
@Kadee80 Kadee80 marked this pull request as draft May 4, 2021 14:21
@Kadee80 Kadee80 force-pushed the lc_grid-section branch from 1a423dc to 8d69450 Compare May 4, 2021 14:30
@Kadee80 Kadee80 force-pushed the lc_grid-section branch from 8d69450 to fbb45a0 Compare May 4, 2021 16:28
@codecov
Copy link

codecov bot commented May 4, 2021

Codecov Report

❗ No coverage uploaded for pull request base (edge@2f2a558). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head fbb45a0 differs from pull request most recent head 7eeb78f. Consider uploading reports for the commit 7eeb78f to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             edge    #7768   +/-   ##
=======================================
  Coverage        ?   82.75%           
=======================================
  Files           ?      342           
  Lines           ?    22178           
  Branches        ?        0           
=======================================
  Hits            ?    18353           
  Misses          ?     3825           
  Partials        ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f2a558...7eeb78f. Read the comment docs.

@Kadee80 Kadee80 marked this pull request as ready for review May 4, 2021 19:58
Copy link
Contributor

@IanLondon IanLondon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some typing changes

'regularColumnSpacing',
]
const { values, errors, touched } = useFormikContext<LabwareFields>()
// @ts-expect-error `includes` doesn't want to take null/undefined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be return values.labwareType == null || ['aluminumBlock', 'tubeRack'].includes(values.labwareType) ? null : ( ... ). Otherwise it's kind of unintuitive to trace out the case for labwareType being null | undefined -- is it supposed to return null or return the div?

Also L36 needs to be export const Grid = (): JSX.Element | null => {

}
const Content = (props: ContentProps): JSX.Element => {
const { values } = props
// @ts-expect-error `includes` doesn't want to take null/undefined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both of these comments can be applied to the height section as well! happy to do it lemme know

}

const { container } = render(<FormAlerts {...props} />)
const warning = container.querySelector('[class="alert warning"]')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so testing library docs explicitly call out using class selectors as a bad thing, but i do think it's important to test that we're seeing a warning vs error here. idk if folks have a better alternative to this @Opentrons/js

Comment on lines -39 to +43
throw new Error(
`Text field should have been called with footprintXDimension or footprintYDimension, instead got ${args.name} `
)
return <div></div>
Copy link
Member

@shlokamin shlokamin May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per the testing discussion in this thread (it's long I'm sorry we should really document these opinions somewhere... perhaps in coda? @mcous), I'm removing throwing an error here because it exerts unnecessary design pressure. If someone interacts with this mock in some other way that would result in the test still passing, we should not stop it from doing so.

Comment on lines -42 to -46
if (numFieldsHidden === fieldList.length) {
// all fields are hidden, don't render this Section
return null
}
}
Copy link
Member

@shlokamin shlokamin May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this logic to the beginning of each section (where it should be). I mistakenly left it inside of FormAlerts on the first pass.

@Kadee80
Copy link
Contributor Author

Kadee80 commented May 5, 2021

smoke tested. LGTM

Copy link
Contributor

@IanLondon IanLondon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweeet 🥐

@Kadee80 Kadee80 merged commit 02622e8 into edge May 6, 2021
@Kadee80 Kadee80 deleted the lc_grid-section branch May 6, 2021 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants