-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): Display run setup task completion (#15889)
In the run page on both app and ODD, you get an indication of completion when you get all your instruments and modules and deck stuff present and calibrated. But those are just two of the steps presented equally in the run setup page, and the rest of the steps don't get anything similar. It leads people to wonder whether they've set things up properly. This PR adds similar styling and completion semantics for the other tasks in the run setup screen to fix this issue. Specifically, LPC gets a "confirm offsets" button (which will confirm offsets even if you haven't run LPC - makes it more apparent that that's a separate option) and labware and liquids get generic confirm buttons. There's also a couple other visual fixes: - On desktop, the "back to top" button in run setup is now where figma thinks it is, outside the run-setup content area. This allows some refactoring of component props - On desktop, there was an issue with the react-router upgrade (I think - it's also in the latest IR alpha) that means that if you had an ongoing run, you couldn't view anything but run details without getting instantly navigated back to run details This implements this figma: https://www.figma.com/design/Rwdt9R0aERFC55oTLDTlqY/8.0-September-Release-File?node-id=39-35830&t=l6vwJjQsfyVeovfC-4 ## To come out of draft - [x] implement for ODD - [x] rebase onto release - [x] "are you sure" modal on desktop - [x] "are you sure" modal on ODD ## Review requests - This is some pretty complex UI - do you agree with how I've done this? - Some of this is pretty ugly, in large part because this is old code that I'm cleaning up. There's some duplicated logic in the run details and some pretty ugly typing. What I'd like to do is merge this since it implements some features nicely and then follow up with a refactor to get the size of some of these files down and enforce nicer separation between everything. ## Testing - [x] Desktop green checks on flex - [x] Desktop green checks on OT-2 (yes, this has to be different because the steps can be different here) Closes RSQ-7
- Loading branch information
Showing
21 changed files
with
1,054 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
app/src/organisms/Devices/ProtocolRun/ConfirmMissingStepsModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import * as React from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { | ||
ALIGN_CENTER, | ||
DIRECTION_COLUMN, | ||
DIRECTION_ROW, | ||
Flex, | ||
JUSTIFY_FLEX_END, | ||
PrimaryButton, | ||
SecondaryButton, | ||
SPACING, | ||
LegacyStyledText, | ||
TYPOGRAPHY, | ||
} from '@opentrons/components' | ||
import { LegacyModal } from '../../../molecules/LegacyModal' | ||
|
||
interface ConfirmMissingStepsModalProps { | ||
onCloseClick: () => void | ||
onConfirmClick: () => void | ||
missingSteps: string[] | ||
} | ||
export const ConfirmMissingStepsModal = ( | ||
props: ConfirmMissingStepsModalProps | ||
): JSX.Element | null => { | ||
const { missingSteps, onCloseClick, onConfirmClick } = props | ||
const { t, i18n } = useTranslation(['protocol_setup', 'shared']) | ||
|
||
const confirmAttached = (): void => { | ||
onConfirmClick() | ||
onCloseClick() | ||
} | ||
|
||
return ( | ||
<LegacyModal | ||
title={t('are_you_sure_you_want_to_proceed')} | ||
type="warning" | ||
onClose={onCloseClick} | ||
> | ||
<Flex flexDirection={DIRECTION_COLUMN} fontSize={TYPOGRAPHY.fontSizeP}> | ||
<LegacyStyledText paddingBottom={SPACING.spacing4}> | ||
{t('you_havent_confirmed', { | ||
missingSteps: new Intl.ListFormat('en', { | ||
style: 'short', | ||
type: 'conjunction', | ||
}).format(missingSteps.map(step => t(step))), | ||
})} | ||
</LegacyStyledText> | ||
</Flex> | ||
<Flex | ||
flexDirection={DIRECTION_ROW} | ||
paddingTop={SPACING.spacing32} | ||
justifyContent={JUSTIFY_FLEX_END} | ||
alignItems={ALIGN_CENTER} | ||
gap={SPACING.spacing8} | ||
> | ||
<SecondaryButton onClick={onCloseClick}> | ||
{i18n.format(t('shared:go_back'), 'capitalize')} | ||
</SecondaryButton> | ||
<PrimaryButton onClick={confirmAttached}> | ||
{t('start_run')} | ||
</PrimaryButton> | ||
</Flex> | ||
</LegacyModal> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.