From d16b7ec59a98256df2197cf5587029a094f5bd00 Mon Sep 17 00:00:00 2001 From: Jethary Rader <66035149+jerader@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:34:43 -0400 Subject: [PATCH] feat(protocol-designer): wire up staging areas to loadFixture commands (#13759) closes RAUT-744 RAUT-770 --- .../src/file-data/selectors/fileCreator.ts | 12 ++- .../src/step-forms/reducers/index.ts | 94 +++++++++---------- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/protocol-designer/src/file-data/selectors/fileCreator.ts b/protocol-designer/src/file-data/selectors/fileCreator.ts index b7761db26a5..e530cabb52f 100644 --- a/protocol-designer/src/file-data/selectors/fileCreator.ts +++ b/protocol-designer/src/file-data/selectors/fileCreator.ts @@ -14,8 +14,6 @@ import { SPAN7_8_10_11_SLOT, Cutout, } from '@opentrons/shared-data' -import { getFileMetadata, getRobotType } from './fileFields' -import { getInitialRobotState, getRobotStateTimeline } from './commands' import { selectors as dismissSelectors } from '../../dismiss' import { selectors as labwareDefSelectors, @@ -27,12 +25,16 @@ import { selectors as stepFormSelectors } from '../../step-forms' import { selectors as uiLabwareSelectors } from '../../ui/labware' import { getLoadLiquidCommands } from '../../load-file/migration/utils/getLoadLiquidCommands' import { swatchColors } from '../../components/swatchColors' +import { getAdditionalEquipmentEntities } from '../../step-forms/selectors' import { DEFAULT_MM_FROM_BOTTOM_ASPIRATE, DEFAULT_MM_FROM_BOTTOM_DISPENSE, DEFAULT_MM_TOUCH_TIP_OFFSET_FROM_TOP, DEFAULT_MM_BLOWOUT_OFFSET_FROM_TOP, } from '../../constants' +import { getFileMetadata, getRobotType } from './fileFields' +import { getInitialRobotState, getRobotStateTimeline } from './commands' + import type { PipetteEntity, LabwareEntities, @@ -44,14 +46,14 @@ import type { CreateCommand, ProtocolFile, } from '@opentrons/shared-data/protocol/types/schemaV7' -import type { Selector } from '../../types' import type { LoadLabwareCreateCommand, LoadModuleCreateCommand, LoadPipetteCreateCommand, LoadFixtureCreateCommand, } from '@opentrons/shared-data/protocol/types/schemaV7/command/setup' -import { getAdditionalEquipmentEntities } from '../../step-forms/selectors' +import type { Selector } from '../../types' + // TODO: BC: 2018-02-21 uncomment this assert, causes test failures // assert(!isEmpty(process.env.OT_PD_VERSION), 'Could not find application version!') if (isEmpty(process.env.OT_PD_VERSION)) @@ -290,7 +292,7 @@ export const createFile: Selector = createSelector( [] ) - // TODO(jr, 10/3/23): add staging area, standard slot, and trash bin loadFixtures + // TODO(jr, 10/3/23): add standard slot, and trash bin loadFixtures const loadFixtureCommands = reduce< AdditionalEquipmentEntity, LoadFixtureCreateCommand[] diff --git a/protocol-designer/src/step-forms/reducers/index.ts b/protocol-designer/src/step-forms/reducers/index.ts index 8d881bf638d..e5d1fecc018 100644 --- a/protocol-designer/src/step-forms/reducers/index.ts +++ b/protocol-designer/src/step-forms/reducers/index.ts @@ -1,5 +1,6 @@ import assert from 'assert' import { handleActions } from 'redux-actions' +import { Reducer } from 'redux' import mapValues from 'lodash/mapValues' import cloneDeep from 'lodash/cloneDeep' import merge from 'lodash/merge' @@ -20,7 +21,6 @@ import { PipetteName, THERMOCYCLER_MODULE_TYPE, LoadFixtureCreateCommand, - STAGING_AREA_LOAD_NAME, STANDARD_SLOT_LOAD_NAME, TRASH_BIN_LOAD_NAME, } from '@opentrons/shared-data' @@ -34,17 +34,7 @@ import { handleFormChange, } from '../../steplist/formLevel' import { PRESAVED_STEP_ID } from '../../steplist/types' -import { - _getPipetteEntitiesRootState, - _getLabwareEntitiesRootState, - _getInitialDeckSetupRootState, -} from '../selectors' import { getLabwareIsCompatible } from '../../utils/labwareModuleCompatibility' -import { - createPresavedStepForm, - getDeckItemIdInSlot, - getIdsInRange, -} from '../utils' import { createInitialProfileCycle, createInitialProfileStep, @@ -52,28 +42,41 @@ import { import { getLabwareOnModule } from '../../ui/modules/utils' import { nestedCombineReducers } from './nestedCombineReducers' import { PROFILE_CYCLE, PROFILE_STEP } from '../../form-types' -import { Reducer } from 'redux' import { NormalizedAdditionalEquipmentById, NormalizedPipetteById, } from '@opentrons/step-generation' import { LoadFileAction } from '../../load-file' -import { - CreateContainerAction, - DeleteContainerAction, - DuplicateLabwareAction, - SwapSlotContentsAction, -} from '../../labware-ingred/actions' +import { SaveStepFormAction } from '../../ui/steps/actions/thunks' import { ReplaceCustomLabwareDef } from '../../labware-defs/actions' -import type { - FormData, - StepIdType, - StepType, - ProfileItem, - ProfileCycleItem, - ProfileStepItem, -} from '../../form-types' import { + _getPipetteEntitiesRootState, + _getLabwareEntitiesRootState, + _getInitialDeckSetupRootState, +} from '../selectors' +import { + CreateDeckFixtureAction, + DeleteDeckFixtureAction, + ToggleIsGripperRequiredAction, +} from '../actions/additionalItems' +import { + createPresavedStepForm, + getDeckItemIdInSlot, + getIdsInRange, +} from '../utils' +import { + CreateModuleAction, + CreatePipettesAction, + DeleteModuleAction, + DeletePipettesAction, + EditModuleAction, + SubstituteStepFormPipettesAction, + ChangeBatchEditFieldAction, + ResetBatchEditFieldChangesAction, + SaveStepFormsMultiAction, +} from '../actions' + +import type { CancelStepFormAction, ChangeFormInputAction, ChangeSavedStepFormAction, @@ -89,7 +92,21 @@ import { EditProfileStepAction, FormPatch, } from '../../steplist/actions' -import { +import type { + FormData, + StepIdType, + StepType, + ProfileItem, + ProfileCycleItem, + ProfileStepItem, +} from '../../form-types' +import type { + CreateContainerAction, + DeleteContainerAction, + DuplicateLabwareAction, + SwapSlotContentsAction, +} from '../../labware-ingred/actions' +import type { AddStepAction, DuplicateStepAction, DuplicateMultipleStepsAction, @@ -98,28 +115,12 @@ import { SelectTerminalItemAction, SelectMultipleStepsAction, } from '../../ui/steps/actions/types' -import { SaveStepFormAction } from '../../ui/steps/actions/thunks' -import { +import type { NormalizedLabware, NormalizedLabwareById, ModuleEntities, } from '../types' -import { - CreateModuleAction, - CreatePipettesAction, - DeleteModuleAction, - DeletePipettesAction, - EditModuleAction, - SubstituteStepFormPipettesAction, - ChangeBatchEditFieldAction, - ResetBatchEditFieldChangesAction, - SaveStepFormsMultiAction, -} from '../actions' -import { - CreateDeckFixtureAction, - DeleteDeckFixtureAction, - ToggleIsGripperRequiredAction, -} from '../actions/additionalItems' + type FormState = FormData | null const unsavedFormInitialState = null // the `unsavedForm` state holds temporary form info that is saved or thrown away with "cancel". @@ -1329,10 +1330,7 @@ export const additionalEquipmentInvariantProperties = handleActions { const { fixtureId, loadName, location } = command.params const id = fixtureId ?? '' - // TODO(jr, 10/03/23): filtering out staging area for now - // until it is supported if ( - loadName === STAGING_AREA_LOAD_NAME || loadName === STANDARD_SLOT_LOAD_NAME || loadName === TRASH_BIN_LOAD_NAME ) {