Skip to content

Commit

Permalink
fix(app): ensure ApplyHistoricOffsets renders on non-RTP protocols (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ncdiehl11 authored and Carlos-fernandez committed May 20, 2024
1 parent 41ea773 commit e180631
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,4 +403,18 @@ describe('ChooseRobotToRunProtocolSlideout', () => {
})
expect(proceedButton).toBeDisabled()
})

it('renders labware offset data selection and learn more button launches help modal', () => {
render({
storedProtocolData: storedProtocolDataFixture,
onCloseClick: vi.fn(),
showSlideout: true,
})
screen.getByText('No offset data available')
const learnMoreLink = screen.getByText('Learn more')
fireEvent.click(learnMoreLink)
screen.getByText(
'Labware offset data references previous protocol run labware locations to save you time. If all the labware in this protocol have been checked in previous runs, that data will be applied to this run.'
)
})
})
27 changes: 17 additions & 10 deletions app/src/organisms/ChooseRobotToRunProtocolSlideout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export function ChooseRobotToRunProtocolSlideoutComponent(
? mostRecentAnalysis?.robotType ?? null
: null

const SinglePageButtonWithoutFF = (
const singlePageButton = (
<PrimaryButton
disabled={
isCreatingRun ||
Expand All @@ -176,6 +176,17 @@ export function ChooseRobotToRunProtocolSlideoutComponent(
</PrimaryButton>
)

const offsetsComponent = (
<ApplyHistoricOffsets
offsetCandidates={offsetCandidates}
shouldApplyOffsets={shouldApplyOffsets}
setShouldApplyOffsets={setShouldApplyOffsets}
commands={mostRecentAnalysis?.commands ?? []}
labware={mostRecentAnalysis?.labware ?? []}
modules={mostRecentAnalysis?.modules ?? []}
/>
)

const resetRunTimeParameters = (): void => {
setRunTimeParametersOverrides(
runTimeParametersOverrides?.map(parameter => ({
Expand Down Expand Up @@ -214,14 +225,7 @@ export function ChooseRobotToRunProtocolSlideoutComponent(
{hasRunTimeParameters ? (
currentPage === 1 ? (
<>
<ApplyHistoricOffsets
offsetCandidates={offsetCandidates}
shouldApplyOffsets={shouldApplyOffsets}
setShouldApplyOffsets={setShouldApplyOffsets}
commands={mostRecentAnalysis?.commands ?? []}
labware={mostRecentAnalysis?.labware ?? []}
modules={mostRecentAnalysis?.modules ?? []}
/>
{offsetsComponent}
<PrimaryButton
onClick={() => setCurrentPage(2)}
width="100%"
Expand Down Expand Up @@ -253,7 +257,10 @@ export function ChooseRobotToRunProtocolSlideoutComponent(
</Flex>
)
) : (
SinglePageButtonWithoutFF
<>
{offsetsComponent}
{singlePageButton}
</>
)}
</Flex>
}
Expand Down

0 comments on commit e180631

Please sign in to comment.