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(app): fix remove Parameters header if a protocl is non-RTP #15036

Merged
merged 3 commits into from
May 1, 2024
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
12 changes: 12 additions & 0 deletions app/src/atoms/MenuList/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,24 @@ export interface DropdownOption {
export type DropdownBorder = 'rounded' | 'neutral'

export interface DropdownMenuProps {
/** dropdown options */
filterOptions: DropdownOption[]
/** click handler */
onClick: (value: string) => void
/** current selected option */
currentOption: DropdownOption
/** dropdown */
width?: string
/** dropdown style type */
dropdownType?: DropdownBorder
/** dropdown title */
title?: string
/** dropdown item caption */
caption?: string | null
/** text for tooltip */
tooltipText?: string
/** html tabindex property */
tabIndex?: number
}

// TODO: (smb: 4/15/22) refactor this to use html select for accessibility
Expand All @@ -50,6 +60,7 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element {
title,
caption,
tooltipText,
tabIndex = 0,
} = props
const [targetProps, tooltipProps] = useHoverTooltip()
const [showDropdownMenu, setShowDropdownMenu] = React.useState<boolean>(false)
Expand Down Expand Up @@ -130,6 +141,7 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element {
toggleSetShowDropdownMenu()
}}
css={DROPDOWN_STYLE}
tabIndex={tabIndex}
>
<StyledText
css={css`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,19 @@ export function ProtocolRunRuntimeParameters({
<>
<Flex
flexDirection={DIRECTION_COLUMN}
padding={SPACING.spacing16}
padding={hasRunTimeParameters ? SPACING.spacing16 : undefined}
gridGap={SPACING.spacing10}
>
<Flex
flexDirection={DIRECTION_ROW}
gridGap={SPACING.spacing8}
alignItems={ALIGN_CENTER}
>
<StyledText as="h3" fontWeight={TYPOGRAPHY.fontWeightSemiBold}>
{t('parameters')}
</StyledText>
{hasRunTimeParameters ? (
<StyledText as="h3" fontWeight={TYPOGRAPHY.fontWeightSemiBold}>
{t('parameters')}
</StyledText>
) : null}
{hasRunTimeParameters ? (
<StyledText as="label" color={COLORS.grey60}>
{hasCustomRunTimeParameterValues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ describe('ProtocolRunRuntimeParameters', () => {
runTimeParameters: [] as RunTimeParameter[],
} as CompletedProtocolAnalysis)
render(props)
screen.getByText('Parameters')
expect(screen.queryByText('Parameters')).not.toBeInTheDocument()
expect(screen.queryByText('Default values')).not.toBeInTheDocument()
screen.getByText('mock InfoScreen')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const ProtocolLiquidsDetails = (
borderRadius={BORDERS.borderRadius8}
>
<Icon
color={COLORS.grey50}
color={COLORS.grey60}
size="1.25rem"
name="ot-alert"
aria-label="ProtocolLIquidsDetails_noLiquidsIcon"
Expand Down
Loading