Skip to content

Commit

Permalink
fix(protocol-designer): various DQA fixes (#17440)
Browse files Browse the repository at this point in the history
This PR provides DQA fixes for 8.4.0 alpha.1.

Closes RQA-3929, Closes RQA-3930, Closes RQA-3931, Closes RQA-3933,
Closes RQA-3934
  • Loading branch information
ncdiehl11 authored Feb 6, 2025
1 parent cea40c2 commit 9c70e65
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('ListButton', () => {
it('should render correct style - noActive', () => {
render(props)
const listButton = screen.getByTestId('ListButton_noActive')
expect(listButton).toHaveStyle(`backgroundColor: ${COLORS.grey30}`)
expect(listButton).toHaveStyle(`backgroundColor: ${COLORS.grey20}`)
})
it('should render correct style - connected', () => {
props.type = 'connected'
Expand Down
4 changes: 2 additions & 2 deletions components/src/atoms/ListButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const LISTBUTTON_PROPS_BY_TYPE: Record<
{ backgroundColor: string; hoverBackgroundColor: string }
> = {
noActive: {
backgroundColor: COLORS.grey30,
hoverBackgroundColor: COLORS.grey35,
backgroundColor: COLORS.grey20,
hoverBackgroundColor: COLORS.grey30,
},
connected: {
backgroundColor: COLORS.green30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export function StepFormToolbox(props: StepFormToolboxProps): JSX.Element {
numErrors,
stepTypeDisplayName: i18n.format(
t(`stepType.${formData.stepType}`),
'capitalize'
'titleCase'
),
t,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
Tooltip,
useHoverTooltip,
} from '@opentrons/components'
import { LINK_BUTTON_STYLE } from '../../../../../../atoms'
import {
ABSORBANCE_READER_MAX_WAVELENGTH_NM,
ABSORBANCE_READER_MIN_WAVELENGTH_NM,
Expand Down Expand Up @@ -244,6 +245,7 @@ function IntializationEditor(props: InitializationEditorProps): JSX.Element {
text={t('step_edit_form.absorbanceReader.add_wavelength.label')}
textAlignment="left"
disabled={numWavelengths === MAX_WAVELENGTHS}
iconName="plus"
/>
</Flex>
) : null}
Expand Down Expand Up @@ -337,13 +339,12 @@ function WavelengthItem(props: WavelengthItemProps): JSX.Element {
onClick={() => {
handleDeleteWavelength(index)
}}
alignSelf={ALIGN_FLEX_END}
padding={SPACING.spacing4}
css={LINK_BUTTON_STYLE}
alignSelf={ALIGN_FLEX_END}
textDecoration={TEXT_DECORATION_UNDERLINE}
>
<StyledText
desktopStyle="bodyDefaultRegular"
textDecoration={TEXT_DECORATION_UNDERLINE}
>
<StyledText desktopStyle="bodyDefaultRegular">
{t('step_edit_form.absorbanceReader.delete')}
</StyledText>
</Btn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function AddStepOverflowButton(
<StyledText desktopStyle="bodyDefaultRegular">
{i18n.format(
t(`application:stepType.${stepType}`, stepType),
'capitalize'
'titleCase'
)}
</StyledText>
</MenuButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function ConnectedStepInfo(props: ConnectedStepInfoProps): JSX.Element {
setOpenedOverflowMenuId,
sidebarWidth,
} = props
const { t } = useTranslation('application')
const { i18n, t } = useTranslation('application')
const dispatch = useDispatch<ThunkDispatch<BaseState, any, any>>()
const stepIds = useSelector(getOrderedStepIds)
const step = useSelector(stepFormSelectors.getSavedStepForms)[stepId]
Expand Down Expand Up @@ -227,7 +227,8 @@ export function ConnectedStepInfo(props: ConnectedStepInfoProps): JSX.Element {
onMouseEnter={highlightStep}
iconName={hasError || hasWarnings ? 'alert-circle' : iconName}
title={`${stepNumber}. ${
step.stepName || t(`stepType.${step.stepType}`)
i18n.format(step.stepName, 'titleCase') ||
t(`stepType.${step.stepType}`)
}`}
dragHovered={dragHovered}
sidebarWidth={sidebarWidth}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('AddStepButton', () => {
screen.getByText('Mix')
screen.getByText('Pause')
screen.getByText('Thermocycler')
screen.getByText('Heater-shaker')
screen.getByText('Heater-Shaker')
screen.getByText('Temperature')
screen.getByText('Magnet')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@ describe('ProtocolSteps', () => {

it('renders the current step name', () => {
render()
screen.getByText('Custom pause')
screen.getByText('Custom Pause')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function ProtocolSteps(): JSX.Element {
>
{currentStep != null && hoveredTerminalItem == null ? (
<StyledText desktopStyle="headingSmallBold">
{i18n.format(currentStep.stepName, 'capitalize')}
{i18n.format(currentStep.stepName, 'titleCase')}
</StyledText>
) : null}
{(hoveredTerminalItem != null || selectedTerminalItem != null) &&
Expand Down

0 comments on commit 9c70e65

Please sign in to comment.