Skip to content

Commit b3f6dd4

Browse files
committed
feat(protocol-designer): introduce new -locationUpdates
closes AUTH-1396
1 parent ada684f commit b3f6dd4

12 files changed

+916
-610
lines changed

protocol-designer/cypress/support/import.ts

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,32 +104,51 @@ export const migrateAndMatchSnapshot = ({
104104
savedFile.designerApplication.version as string
105105
)
106106
assert(version !== null, 'PD version is not valid semver')
107+
const isBelowVersion850 = semver.lt(version ?? '', '8.5.0')
107108

108109
const files = [savedFile, expectedFile]
109110
files.forEach(f => {
110111
f.metadata.lastModified = 123
111112
f.designerApplication.data._internalAppBuildDate = 'Foo Date'
112113
f.designerApplication.version = 'x.x.x'
113114

114-
Object.values(
115-
f.designerApplication.data.savedStepForms as Record<string, unknown>
116-
).forEach(stepForm => {
117-
const stepFormTyped = stepForm as {
118-
stepType: string
119-
dropTip_location?: string
120-
blowout_location?: string
115+
const savedStepForms = f.designerApplication.data.savedStepForms
116+
const initialDeckSetupStep = '__INITIAL_DECK_SETUP_STEP__'
117+
118+
// a uuid is randomly generated each time you upload a protocol that is less than version 8_5_0
119+
// which is the migration version that adds these keys. Due to this, we need to ignore
120+
// the uuids
121+
if (savedStepForms[initialDeckSetupStep] && isBelowVersion850) {
122+
savedStepForms[initialDeckSetupStep].trashBinLocationUpdate = {
123+
trashBin: 'trashLocation',
124+
}
125+
savedStepForms[initialDeckSetupStep].gripperLocationUpdate = {
126+
gripper: 'gripperLocation',
121127
}
122-
if (stepFormTyped.stepType === 'moveLiquid') {
123-
stepFormTyped.dropTip_location = 'trash drop tip location'
124-
if (stepFormTyped.blowout_location?.includes('trashBin') ?? false) {
128+
}
129+
130+
Object.values(savedStepForms as Record<string, unknown>).forEach(
131+
stepForm => {
132+
const stepFormTyped = stepForm as {
133+
stepType: string
134+
dropTip_location?: string
135+
blowout_location?: string
136+
}
137+
if (stepFormTyped.stepType === 'moveLiquid') {
138+
stepFormTyped.dropTip_location = 'trash drop tip location'
139+
if (
140+
stepFormTyped.blowout_location?.includes('trashBin') ??
141+
false
142+
) {
143+
stepFormTyped.blowout_location = 'trash blowout location'
144+
}
145+
}
146+
if (stepFormTyped.stepType === 'mix') {
147+
stepFormTyped.dropTip_location = 'trash drop tip location'
125148
stepFormTyped.blowout_location = 'trash blowout location'
126149
}
127150
}
128-
if (stepFormTyped.stepType === 'mix') {
129-
stepFormTyped.dropTip_location = 'trash drop tip location'
130-
stepFormTyped.blowout_location = 'trash blowout location'
131-
}
132-
})
151+
)
133152

134153
f.commands.forEach((command: { key: string }) => {
135154
if ('key' in command) command.key = '123'

0 commit comments

Comments
 (0)