Skip to content

Commit 2a73c37

Browse files
authored
Merge branch 'edge' into stacker_evt-script-test-axes
2 parents 175d100 + 54a4017 commit 2a73c37

File tree

23 files changed

+838
-149
lines changed

23 files changed

+838
-149
lines changed

components/src/atoms/ListButton/ListButtonChildren/ListButtonAccordionContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function ListButtonAccordionContainer(
1616
const { id, children } = props
1717

1818
return (
19-
<Flex key={id} flexDirection={DIRECTION_COLUMN}>
19+
<Flex key={id} flexDirection={DIRECTION_COLUMN} width="100%">
2020
{children}
2121
</Flex>
2222
)

protocol-designer/src/assets/localization/en/starting_deck_state.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"adapter_compatible_lab": "Adapter compatible labware",
3-
"adapter": "Adapter",
3+
"adapter": "Adapters",
44
"add_fixture": "Add a fixture",
55
"add_hardware_labware": "Add hardware/labware",
66
"add_hw_lw": "Add hardware/labware",
@@ -9,7 +9,7 @@
99
"add_module": "Add a module",
1010
"add_rest": "Add labware and liquids to complete deck setup",
1111
"alter_pause": "You may also need to alter the time you pause while your magnet is engaged.",
12-
"aluminumBlock": "Aluminum block",
12+
"aluminumBlock": "Aluminum blocks",
1313
"clear_labware": "Clear labware",
1414
"clear_slot": "Clear slot",
1515
"clear": "Clear",
@@ -47,16 +47,16 @@
4747
"protocol_starting_deck": "Protocol starting deck",
4848
"read_more_gen1_gen2": "Read more about the differences between GEN1 and GEN2 Magnetic Modules",
4949
"rename_lab": "Rename labware",
50-
"reservoir": "Reservoir",
50+
"reservoir": "Reservoirs",
5151
"shift_click_to_select_all": "Shift + Click to select all",
5252
"starting_deck_state": "Starting deck state",
5353
"tc_slots_occupied_flex": "The Thermocycler needs slots A1 and B1. Slot A1 is occupied",
5454
"tc_slots_occupied_ot2": "The Thermocycler needs slots 7, 8, 10, and 11. One or more of those slots is occupied",
55-
"tipRack": "Tip rack",
55+
"tipRack": "Tip racks",
5656
"trash_required": "A trash bin or waste chute is required",
57-
"tubeRack": "Tube rack",
57+
"tubeRack": "Tube racks",
5858
"untitled_protocol": "Untitled protocol",
5959
"upload_custom_labware": "Upload custom labware",
6060
"we_added_hardware": "We've added your deck hardware!",
61-
"wellPlate": "Well plate"
61+
"wellPlate": "Well plates"
6262
}

protocol-designer/src/pages/CreateNewProtocolWizard/PDListItemCustomize.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ interface PDListItemCustomizeProps {
2727
label?: string
2828
dropdown?: DropdownMenuProps
2929
tag?: TagProps
30-
forceDirection?: boolean
3130
}
3231

3332
export function PDListItemCustomize({
@@ -38,7 +37,6 @@ export function PDListItemCustomize({
3837
label,
3938
dropdown,
4039
tag,
41-
forceDirection = false,
4240
}: PDListItemCustomizeProps): JSX.Element {
4341
const responsiveType = useResponsiveBreakpoints()
4442
const isLargeScreen = responsiveType === 'xl' || responsiveType === 'lg'
@@ -53,7 +51,7 @@ export function PDListItemCustomize({
5351
)}
5452
{dropdown != null && (
5553
<Flex paddingBottom={SPACING.spacing8}>
56-
<DropdownMenu {...dropdown} forceDirection={forceDirection} />
54+
<DropdownMenu {...dropdown} menuPlacement="bottom" />
5755
</Flex>
5856
)}
5957
{tag != null && <Tag {...tag} />}

protocol-designer/src/pages/CreateNewProtocolWizard/SelectFixtures.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ export function SelectFixtures(props: WizardTileProps): JSX.Element | null {
158158
return (
159159
<ListItem type="noActive" key={ae}>
160160
<ListItemCustomize
161-
menuPlacement="bottom"
162161
linkText={t('remove')}
163162
onClick={() => {
164163
setValue(

protocol-designer/src/pages/CreateNewProtocolWizard/SelectModules.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ export function SelectModules(props: WizardTileProps): JSX.Element | null {
258258
return (
259259
<ListItem type="noActive" key={`${module.model}`}>
260260
<ListItemCustomize
261-
menuPlacement="bottom"
262261
dropdown={
263262
MOAM_MODULE_TYPES.includes(module.type) &&
264263
robotType === FLEX_ROBOT_TYPE

protocol-designer/src/pages/Designer/DeckSetup/DeckSetupDetails.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ export function DeckSetupDetails(props: DeckSetupDetailsProps): JSX.Element {
200200
}
201201
const isLabwareOccludedByThermocyclerLid =
202202
moduleOnDeck.type === THERMOCYCLER_MODULE_TYPE &&
203-
(moduleOnDeck.moduleState as ThermocyclerModuleState).lidOpen !== true
203+
(moduleOnDeck.moduleState as ThermocyclerModuleState).lidOpen !==
204+
true &&
205+
tab === 'protocolSteps'
204206

205207
const tempInnerProps = getModuleInnerProps(moduleOnDeck.moduleState)
206208
const innerProps =

protocol-designer/src/pages/Designer/DeckSetup/DeckSetupTools.tsx

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ import { getDismissedHints } from '../../../tutorial/selectors'
5252
import { createContainerAboveModule } from '../../../step-forms/actions/thunks'
5353
import { ConfirmDeleteStagingAreaModal } from '../../../organisms'
5454
import { BUTTON_LINK_STYLE } from '../../../atoms'
55-
import { FIXTURES, MOAM_MODELS } from './constants'
5655
import { getSlotInformation } from '../utils'
57-
import { getModuleModelsBySlot, getDeckErrors } from './utils'
58-
import { MagnetModuleChangeContent } from './MagnetModuleChangeContent'
56+
import { ALL_ORDERED_CATEGORIES, FIXTURES, MOAM_MODELS } from './constants'
5957
import { LabwareTools } from './LabwareTools'
58+
import { MagnetModuleChangeContent } from './MagnetModuleChangeContent'
59+
import { getModuleModelsBySlot, getDeckErrors } from './utils'
6060

6161
import type { ModuleModel } from '@opentrons/shared-data'
6262
import type { ThunkDispatch } from '../../../types'
@@ -71,6 +71,8 @@ interface DeckSetupToolsProps {
7171
} | null
7272
}
7373

74+
export type CategoryExpand = Record<string, boolean>
75+
7476
export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
7577
const { onCloseClick, setHoveredLabware, onDeckProps } = props
7678
const { t, i18n } = useTranslation(['starting_deck_state', 'shared'])
@@ -117,13 +119,41 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
117119
const [tab, setTab] = useState<'hardware' | 'labware'>(
118120
moduleModels?.length === 0 || slot === 'offDeck' ? 'labware' : 'hardware'
119121
)
122+
123+
const setAllCategories = (state: boolean): Record<string, boolean> =>
124+
ALL_ORDERED_CATEGORIES.reduce<Record<string, boolean>>(
125+
(acc, category) => ({ ...acc, [category]: state }),
126+
{}
127+
)
128+
const allCategoriesExpanded = setAllCategories(true)
129+
const allCategoriesCollapsed = setAllCategories(false)
130+
const [
131+
areCategoriesExpanded,
132+
setAreCategoriesExpanded,
133+
] = useState<CategoryExpand>(allCategoriesCollapsed)
134+
const [searchTerm, setSearchTerm] = useState<string>('')
135+
136+
useEffect(() => {
137+
if (searchTerm !== '') {
138+
setAreCategoriesExpanded(allCategoriesExpanded)
139+
} else {
140+
setAreCategoriesExpanded(allCategoriesCollapsed)
141+
}
142+
}, [searchTerm])
143+
120144
const hasMagneticModule = Object.values(deckSetup.modules).some(
121145
module => module.type === MAGNETIC_MODULE_TYPE
122146
)
123147
const moduleOnSlotIsMagneticModuleV1 =
124148
Object.values(deckSetup.modules).find(module => module.slot === slot)
125149
?.model === MAGNETIC_MODULE_V1
126150

151+
const handleCollapseAllCategories = (): void => {
152+
setAreCategoriesExpanded(allCategoriesCollapsed)
153+
}
154+
const handleResetSearchTerm = (): void => {
155+
setSearchTerm('')
156+
}
127157
const changeModuleWarning = useBlockingHint({
128158
hintKey: 'change_magnet_module_model',
129159
handleCancel: () => {
@@ -207,6 +237,11 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
207237
)
208238
}
209239

240+
const handleResetLabwareTools = (): void => {
241+
handleCollapseAllCategories()
242+
handleResetSearchTerm()
243+
}
244+
210245
const handleClear = (): void => {
211246
onDeckProps?.setHoveredModule(null)
212247
onDeckProps?.setHoveredFixture(null)
@@ -242,7 +277,11 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
242277
}
243278
}
244279
handleResetToolbox()
280+
handleResetLabwareTools()
245281
setSelectedHardware(null)
282+
if (selectedHardware != null) {
283+
setTab('hardware')
284+
}
246285
}
247286
const handleConfirm = (): void => {
248287
// clear entities first before recreating them
@@ -548,7 +587,15 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
548587
)}
549588
</Flex>
550589
) : (
551-
<LabwareTools setHoveredLabware={setHoveredLabware} slot={slot} />
590+
<LabwareTools
591+
setHoveredLabware={setHoveredLabware}
592+
slot={slot}
593+
searchTerm={searchTerm}
594+
setSearchTerm={setSearchTerm}
595+
areCategoriesExpanded={areCategoriesExpanded}
596+
setAreCategoriesExpanded={setAreCategoriesExpanded}
597+
handleReset={handleResetLabwareTools}
598+
/>
552599
)}
553600
</Flex>
554601
</Toolbox>

0 commit comments

Comments
 (0)