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(protocol-designer): fix when add liquid hint is shown #2787

Merged
merged 1 commit into from
Dec 6, 2018
Merged
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
13 changes: 10 additions & 3 deletions protocol-designer/src/labware-ingred/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import mapValues from 'lodash/mapValues'
import max from 'lodash/max'
import pickBy from 'lodash/pickBy'
import reduce from 'lodash/reduce'
import isEmpty from 'lodash/isEmpty'

import {sortedSlotnames, FIXED_TRASH_ID} from '../../constants.js'
import {uuid} from '../../utils'
Expand Down Expand Up @@ -285,6 +284,11 @@ export const ingredLocations = handleActions({
mapValues(labwareContents, well =>
omit(well, liquidGroupId)))
},
DELETE_CONTAINER: (
state: LocationsState,
action: ActionType<typeof actions.deleteContainer>
): LocationsState =>
omit(state, action.payload.containerId),
LOAD_FILE: (state: LocationsState, action: LoadFileAction): LocationsState =>
getPDMetadata(action.payload).ingredLocations,
}, {})
Expand Down Expand Up @@ -488,8 +492,6 @@ const getLabwareSelectionMode: Selector<boolean> = createSelector(

const getSlotToMoveFrom = (state: BaseState) => rootSelector(state).moveLabwareMode

const getDeckHasLiquid = (state: BaseState) => !isEmpty(getLiquidGroupsById(state))

const getLiquidGroupsOnDeck: Selector<Array<string>> = createSelector(
getLiquidsByLabwareId,
(ingredLocationsByLabware) => {
Expand All @@ -507,6 +509,11 @@ const getLiquidGroupsOnDeck: Selector<Array<string>> = createSelector(
}
)

const getDeckHasLiquid: Selector<boolean> = createSelector(
getLiquidGroupsOnDeck,
(liquidGroups) => liquidGroups.length > 0
)

// TODO: prune selectors
export const selectors = {
rootSelector,
Expand Down