Skip to content

Commit

Permalink
fix(app): enable about plate reader button when run is in progress (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 authored Nov 13, 2024
1 parent f2adaab commit 20c98e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/organisms/ModuleCard/ModuleOverflowMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export const ModuleOverflowMenu = (
<Fragment key={`${index}_${String(module.moduleType)}`}>
<MenuItem
onClick={() => item.onClick(item.isSecondary)}
disabled={item.disabledReason || isDisabled}
disabled={item.isSettingDisabled}
whiteSpace={NO_WRAP}
>
{item.setSetting}
Expand Down
7 changes: 7 additions & 0 deletions app/src/organisms/ModuleCard/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export function useLatchControls(module: AttachedModule): LatchControls {
export type MenuItemsByModuleType = {
[moduleType in AttachedModule['moduleType']]: Array<{
setSetting: string
isSettingDisabled: boolean
isSecondary: boolean
menuButtons: JSX.Element[] | null
onClick: (isSecondary: boolean) => void
Expand Down Expand Up @@ -267,6 +268,7 @@ export function useModuleOverflowMenu(
module.data.lidTargetTemperature != null
? t('overflow_menu_deactivate_lid')
: t('overflow_menu_lid_temp'),
isSettingDisabled: isDisabled,
isSecondary: true,
menuButtons: null,
onClick:
Expand All @@ -285,6 +287,7 @@ export function useModuleOverflowMenu(
module.data.lidStatus === 'open'
? t('close_lid')
: t('open_lid'),
isSettingDisabled: isDisabled,
isSecondary: false,
menuButtons: [thermoSetBlockTempBtn, aboutModuleBtn],
onClick: controlTCLid,
Expand All @@ -298,6 +301,7 @@ export function useModuleOverflowMenu(
? t('overflow_menu_deactivate_temp')
: t('overflow_menu_mod_temp'),
isSecondary: false,
isSettingDisabled: isDisabled,
menuButtons: [aboutModuleBtn],
onClick:
module.data.status !== 'idle'
Expand All @@ -317,6 +321,7 @@ export function useModuleOverflowMenu(
? t('overflow_menu_disengage')
: t('overflow_menu_engage'),
isSecondary: false,
isSettingDisabled: isDisabled,
menuButtons: [aboutModuleBtn],
onClick:
module.data.status !== 'disengaged'
Expand All @@ -336,6 +341,7 @@ export function useModuleOverflowMenu(
? t('heater_shaker:deactivate_heater')
: t('heater_shaker:set_temperature'),
isSecondary: false,
isSettingDisabled: isDisabled,
menuButtons: [
labwareLatchBtn,
aboutModuleBtn,
Expand All @@ -358,6 +364,7 @@ export function useModuleOverflowMenu(
{
setSetting: t('overflow_menu_about'),
isSecondary: false,
isSettingDisabled: false,
menuButtons: [],
onClick: handleAboutClick,
},
Expand Down

0 comments on commit 20c98e6

Please sign in to comment.