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

feat(app, shared-data, components): implement base CSV file RTP UI #15410

Merged
merged 13 commits into from
Jun 13, 2024
Prev Previous commit
Next Next commit
fix types and lint
  • Loading branch information
ncdiehl11 committed Jun 13, 2024
commit e71b21957be64288f97ab1d766d1163dafdfcba0
11 changes: 9 additions & 2 deletions api-client/src/runs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,16 @@ export interface LabwareOffsetCreateData {
vector: VectorOffset
}

export interface RunTimeParameterCreateData {
[key: string]: string | boolean | number
interface FileRunTimeParameterCreateData {
[key: string]: string | number | boolean
ncdiehl11 marked this conversation as resolved.
Show resolved Hide resolved
}
interface ValueRunTimeParameterCreateData {
[key: string]: { id: string }
}
ncdiehl11 marked this conversation as resolved.
Show resolved Hide resolved

export type RunTimeParameterCreateData =
| FileRunTimeParameterCreateData
| ValueRunTimeParameterCreateData

export interface CommandData {
data: RunTimeCommand
Expand Down
2 changes: 1 addition & 1 deletion app/src/organisms/Devices/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function getRunTimeParameterValuesForRun(
): RunTimeParameterCreateData {
return runTimeParameters.reduce((acc, param) => {
if (param.type === 'csv_file') {
return { ...acc, [param.variableName]: param.file?.id }
return { ...acc, [param.variableName]: { id: param.file?.id } }
} else {
return param.value !== param.default
? { ...acc, [param.variableName]: param.value }
Expand Down
7 changes: 2 additions & 5 deletions app/src/organisms/ProtocolSetupParameters/ChooseEnum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import {
import { RadioButton } from '../../atoms/buttons'
import { useToaster } from '../ToasterOven'
import { ChildNavigation } from '../ChildNavigation'
import type { RunTimeParameter } from '@opentrons/shared-data'
import type { ChoiceParameter } from '@opentrons/shared-data'

interface ChooseEnumProps {
handleGoBack: () => void
parameter: RunTimeParameter
parameter: ChoiceParameter
setParameter: (value: boolean | string | number, variableName: string) => void
rawValue: number | string | boolean
}
Expand All @@ -33,9 +33,6 @@ export function ChooseEnum({
const handleOnClick = (newValue: string | number | boolean): void => {
setParameter(newValue, parameter.variableName)
}
if (!('default' in parameter)) {
return null
}
const resetValueDisabled = parameter.default === rawValue

return (
Expand Down
2 changes: 1 addition & 1 deletion components/src/molecules/ParametersTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import {
} from '@opentrons/shared-data'
import { BORDERS, COLORS } from '../../helix-design-system'
import { SPACING, TYPOGRAPHY } from '../../ui-style-constants/index'
import { Chip } from '../../atoms/Chip'
import { StyledText } from '../../atoms/StyledText'
import { Tooltip, useHoverTooltip } from '../../tooltips'
import { Icon } from '../../icons'
import { Flex } from '../../primitives'
import { DISPLAY_INLINE, FLEX_MAX_CONTENT } from '../../styles'

import type { RunTimeParameter } from '@opentrons/shared-data'
import { Chip } from '../../atoms'

interface ProtocolParameterItemsProps {
runTimeParameters: RunTimeParameter[]
Expand Down
Loading