Skip to content

Commit

Permalink
chore(app, api-client): remove mock RTP datafrom ProtocolDetails (#14791
Browse files Browse the repository at this point in the history
)

closes AUTH-266
  • Loading branch information
ncdiehl11 authored Apr 3, 2024
1 parent 6bf0579 commit 0f7d1ff
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 205 deletions.
54 changes: 53 additions & 1 deletion api-client/src/protocols/__fixtures__/simpleAnalysisFile.json
Original file line number Diff line number Diff line change
Expand Up @@ -3937,5 +3937,57 @@
"displayColor": "#b925ff"
}
],
"runTimeParameters": []
"runTimeParameters": [
{
"type": "int",
"displayName": "number of samples",
"variableName": "num_samples",
"description": "How many samples do you want to run?",
"value": 96,
"min": 1,
"max": 96,
"default": 96
},
{
"type": "float",
"displayName": "samples volume",
"variableName": "vol_sample",
"description": "What sample volume are you using?",
"value": 10.0,
"min": 1,
"max": 20.0,
"default": 10.0
},
{
"displayName": "Additional mix for reagent 2?",
"variableName": "extra_mix",
"description": "When on, we do an extra mix for reagent 2.",
"type": "bool",
"default": false,
"value": false
},
{
"displayName": "Number of PCR Cycles",
"variableName": "real_mode",
"description": "Cycle map",
"type": "int",
"unit": "cycles",
"default": 15,
"value": 15,
"choices": [
{
"displayName": "1 & 10ng (15 cycles)",
"value": 15
},
{
"displayName": "100ng (15 cycles)",
"value": 15
},
{
"displayName": "1ug (10 cycles)",
"value": 10
}
]
}
]
}
58 changes: 2 additions & 56 deletions app/src/organisms/ChooseRobotToRunProtocolSlideout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,62 +62,8 @@ export function ChooseRobotToRunProtocolSlideoutComponent(
)

// TODO: (nd: 3/20/24) remove stubs and pull parameters from analysis
// const runTimeParameters =
// storedProtocolData.mostRecentAnalysis?.runTimeParameters ?? []
const mockRunTimeParameters: RunTimeParameter[] = [
{
displayName: 'Dry Run',
value: false,
variableName: 'DRYRUN',
description: 'Is this a dry or wet run? Wet is true, dry is false',
type: 'bool',
default: false,
},
{
value: 4,
displayName: 'Columns of Samples',
variableName: 'COLUMNS',
description: 'How many columns do you want?',
type: 'int',
min: 1,
max: 14,
default: 4,
},
{
value: 6.5,
displayName: 'EtoH Volume',
variableName: 'ETOH_VOLUME',
description: '70% ethanol volume',
type: 'float',
suffix: 'mL',
min: 1.5,
max: 10.0,
default: 6.5,
},
{
value: 'none',
displayName: 'Default Module Offsets',
variableName: 'DEFAULT_OFFSETS',
description: 'default module offsets for temp, H-S, and none',
type: 'str',
choices: [
{
displayName: 'No offsets',
value: 'none',
},
{
displayName: 'temp offset',
value: '1',
},
{
displayName: 'heater-shaker offset',
value: '2',
},
],
default: 'none',
},
]
const runTimeParameters: RunTimeParameter[] = mockRunTimeParameters
const runTimeParameters =
storedProtocolData.mostRecentAnalysis?.runTimeParameters ?? []
const [
runTimeParametersOverrides,
setRunTimeParametersOverrides,
Expand Down
8 changes: 4 additions & 4 deletions app/src/organisms/ProtocolDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ import { ProtocolLabwareDetails } from './ProtocolLabwareDetails'
import { ProtocolLiquidsDetails } from './ProtocolLiquidsDetails'
import { RobotConfigurationDetails } from './RobotConfigurationDetails'
import { ProtocolParameters } from './ProtocolParameters'
import { useRunTimeParameters } from '../../pages/Protocols/hooks'

import type { JsonConfig, PythonConfig } from '@opentrons/shared-data'
import type { StoredProtocolData } from '../../redux/protocol-storage'
Expand Down Expand Up @@ -201,9 +200,12 @@ export function ProtocolDetails(
const { t, i18n } = useTranslation(['protocol_details', 'shared'])
const enableProtocolStats = useFeatureFlag('protocolStats')
const enableRunTimeParameters = useFeatureFlag('enableRunTimeParameters')
const runTimeParameters = mostRecentAnalysis?.runTimeParameters ?? []
const hasRunTimeParameters =
enableRunTimeParameters && runTimeParameters.length > 0
const [currentTab, setCurrentTab] = React.useState<
'robot_config' | 'labware' | 'liquids' | 'stats' | 'parameters'
>('robot_config')
>(hasRunTimeParameters ? 'parameters' : 'robot_config')
const [
showChooseRobotToRunProtocolSlideout,
setShowChooseRobotToRunProtocolSlideout,
Expand All @@ -218,8 +220,6 @@ export function ProtocolDetails(
getIsProtocolAnalysisInProgress(state, protocolKey)
)

const runTimeParameters = useRunTimeParameters(protocolKey)

const analysisStatus = getAnalysisStatus(isAnalyzing, mostRecentAnalysis)

if (analysisStatus === 'stale') {
Expand Down
145 changes: 1 addition & 144 deletions app/src/pages/Protocols/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,150 +200,7 @@ export const useRunTimeParameters = (
{ enabled: protocolData != null }
)

const mockData: RunTimeParameter[] = [
{
value: false,
displayName: 'Dry Run',
variableName: 'DRYRUN',
description: 'Is this a dry or wet run? Wet is true, dry is false',
type: 'bool',
default: false,
},
{
value: true,
displayName: 'Use Gripper',
variableName: 'USE_GRIPPER',
description: 'For using the gripper.',
type: 'bool',
default: true,
},
{
value: true,
displayName: 'Trash Tips',
variableName: 'TIP_TRASH',
description:
'to throw tip into the trash or to not throw tip into the trash',
type: 'bool',
default: true,
},
{
value: true,
displayName: 'Deactivate Temperatures',
variableName: 'DEACTIVATE_TEMP',
description: 'deactivate temperature on the module',
type: 'bool',
default: true,
},
{
value: 4,
displayName: 'Columns of Samples',
variableName: 'COLUMNS',
description: 'How many columns do you want?',
type: 'int',
min: 1,
max: 14,
default: 4,
},
{
value: 6,
displayName: 'PCR Cycles',
variableName: 'PCR_CYCLES',
description: 'number of PCR cycles on a thermocycler',
type: 'int',
min: 1,
max: 10,
default: 6,
},
{
value: 6.5,
displayName: 'EtoH Volume',
variableName: 'ETOH_VOLUME',
description: '70% ethanol volume',
type: 'float',
suffix: 'mL',
min: 1.5,
max: 10.0,
default: 6.5,
},
{
value: 'none',
displayName: 'Default Module Offsets',
variableName: 'DEFAULT_OFFSETS',
description: 'default module offsets for temp, H-S, and none',
type: 'str',
choices: [
{
displayName: 'No offsets',
value: 'none',
},
{
displayName: 'temp offset',
value: '1',
},
{
displayName: 'heater-shaker offset',
value: '2',
},
],
default: 'none',
},
{
value: 'left',
displayName: 'pipette mount',
variableName: 'mont',
description: 'pipette mount',
type: 'str',
choices: [
{
displayName: 'Left',
value: 'left',
},
{
displayName: 'Right',
value: 'right',
},
],
default: 'left',
},
{
value: 'flex',
displayName: 'short test case',
variableName: 'short 2 options',
description: 'this play 2 short options',
type: 'str',
choices: [
{
displayName: 'OT-2',
value: 'ot2',
},
{
displayName: 'Flex',
value: 'flex',
},
],
default: 'flex',
},
{
value: 'flex',
displayName: 'long test case',
variableName: 'long 2 options',
description: 'this play 2 long options',
type: 'str',
choices: [
{
displayName: 'I am kind of long text version',
value: 'ot2',
},
{
displayName: 'I am kind of long text version. Today is 3/15',
value: 'flex',
},
],
default: 'flex',
},
]
// TODO(jr, 3/14/24): remove the mockData
return analysis?.runTimeParameters ?? mockData
return analysis?.runTimeParameters ?? []
}

/**
Expand Down

0 comments on commit 0f7d1ff

Please sign in to comment.