-
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): feat add open door check during running a protocol for odd (…
…#13613) add open door status check to display open door alert modal for odd and fix protocol run header banner rendering bugin desktop app fix RQA-1604
- Loading branch information
Showing
8 changed files
with
117 additions
and
28 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
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
21 changes: 21 additions & 0 deletions
21
app/src/organisms/OpenDoorAlertModal/__tests__/OpenDoorAlertModal.test.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,21 @@ | ||
import * as React from 'react' | ||
|
||
import { renderWithProviders } from '@opentrons/components' | ||
|
||
import { i18n } from '../../../i18n' | ||
|
||
import { OpenDoorAlertModal } from '..' | ||
|
||
const render = () => { | ||
return renderWithProviders(<OpenDoorAlertModal />, { | ||
i18nInstance: i18n, | ||
}) | ||
} | ||
|
||
describe('OpenDoorAlertModal', () => { | ||
it('should render text', () => { | ||
const [{ getByText }] = render() | ||
getByText('Robot door is open') | ||
getByText('Close robot door to resume run') | ||
}) | ||
}) |
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,55 @@ | ||
import * as React from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { | ||
ALIGN_CENTER, | ||
BORDERS, | ||
COLORS, | ||
DIRECTION_COLUMN, | ||
Flex, | ||
Icon, | ||
JUSTIFY_CENTER, | ||
SPACING, | ||
TYPOGRAPHY, | ||
} from '@opentrons/components' | ||
import { Portal } from '../../App/portal' | ||
import { StyledText } from '../../atoms/text' | ||
import { Modal } from '../../molecules/Modal' | ||
|
||
export function OpenDoorAlertModal(): JSX.Element { | ||
const { t } = useTranslation('run_details') | ||
return ( | ||
<Portal level="top"> | ||
<Modal> | ||
<Flex | ||
backgroundColor={COLORS.darkBlack20} | ||
borderRadius={BORDERS.borderRadiusSize3} | ||
flexDirection={DIRECTION_COLUMN} | ||
padding={SPACING.spacing24} | ||
alignItems={ALIGN_CENTER} | ||
gridGap={SPACING.spacing16} | ||
width="100%" | ||
justifyContent={JUSTIFY_CENTER} | ||
> | ||
<Icon name="ot-alert" size="2.5rem" /> | ||
<Flex | ||
flexDirection={DIRECTION_COLUMN} | ||
gridGap={SPACING.spacing4} | ||
alignItems={ALIGN_CENTER} | ||
width="100%" | ||
> | ||
<StyledText as="h4" fontWeight={TYPOGRAPHY.fontWeightBold}> | ||
{t('door_is_open')} | ||
</StyledText> | ||
<StyledText | ||
as="p" | ||
textAlign={TYPOGRAPHY.textAlignCenter} | ||
color={COLORS.darkBlack90} | ||
> | ||
{t('close_door_to_resume')} | ||
</StyledText> | ||
</Flex> | ||
</Flex> | ||
</Modal> | ||
</Portal> | ||
) | ||
} |
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
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
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
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