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

fix(protocol-designer): various DQA fixes #17440

Merged
merged 3 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading