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

feat(app): usb connection and moam modal functionality in module setup #8257

Merged
merged 39 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c6b2b14
create module setup component and test
jerader Aug 6, 2021
eaf9892
create multiple modules modal and edit styles
jerader Aug 9, 2021
fd5e406
create module info and edited MoaM modal
jerader Aug 10, 2021
1e2f00d
address pr comments
jerader Aug 12, 2021
dc80ed7
fix test and deck view box
jerader Aug 12, 2021
090ce8d
fix styling and svg tag
jerader Aug 16, 2021
6441bdb
fix margin error
jerader Aug 16, 2021
296ba27
add poll the robot modules ever 5 seconds
jerader Aug 16, 2021
25c156a
add some usb info
jerader Aug 16, 2021
472558b
fix connected and not connected
jerader Aug 16, 2021
b9b783d
add button styling
jerader Aug 17, 2021
88e4e9b
begin to add usb detection
jerader Aug 18, 2021
aa0a4ff
add frontend port and module connection
jerader Aug 18, 2021
8875e36
modify css file
jerader Aug 19, 2021
522e112
fix module variable
jerader Aug 19, 2021
c5e984a
remove styles file and edit usb and hub
jerader Aug 19, 2021
866799b
add port and mode features
jerader Aug 23, 2021
1d9bfcb
style fix on labware setup file
jerader Aug 23, 2021
fb91ff7
fix hub and port connection
jerader Aug 23, 2021
5daa14c
add isAttached and fix usb and hub
jerader Aug 23, 2021
b8496f5
fix for both port and no port info compatibility
jerader Aug 24, 2021
9e35078
add labware setup step btn function
jerader Aug 24, 2021
2942f2f
add moam modal functionality
jerader Aug 24, 2021
377d8b3
reorg
jerader Aug 24, 2021
e04e11d
modify tests and fix labware setup button fxn
jerader Aug 25, 2021
eec117d
modify tests
jerader Aug 25, 2021
d0b08a8
feat(app): usb connection and moam modal functionality in module setup
jerader Aug 25, 2021
d21e5cc
clean up code
jerader Aug 26, 2021
111e4af
fix prettier formatting
jerader Aug 26, 2021
9263ca3
add test and fix robotname functionality
jerader Aug 26, 2021
a26d83c
remove unnecessary imports
jerader Aug 26, 2021
a02cd01
address comments and rework moduleInfo test
jerader Aug 27, 2021
133bde6
add expect corresponding matcher call to moduleInfo test
jerader Aug 27, 2021
2c3581f
fix import
jerader Aug 30, 2021
a52334c
address Emilys comment
jerader Aug 30, 2021
dc64a67
correct prettier formatting
jerader Aug 30, 2021
52696fe
address comments
jerader Sep 1, 2021
7109e2f
utilize i18n plural capabilities
jerader Sep 3, 2021
e8334fb
fix prettier formatting
jerader Sep 3, 2021
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
Prev Previous commit
Next Next commit
clean up code
  • Loading branch information
jerader committed Aug 30, 2021
commit d21e5cc40ff1c0d29b15017c6c31f3636e32750b
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function ModuleSetup(props: ModuleSetupProps): JSX.Element {
)
const attachedModulesModels = map(attachedModules, ({ model }) => model)
const combinedModules = attachedModulesModels.concat(moduleModels)
let uniqueModules = [...new Set(combinedModules)];
const uniqueModules = [...new Set(combinedModules)];
const [
showMultipleModulesModal,
setShowMultipleModulesModal,
Expand Down
32 changes: 18 additions & 14 deletions app/src/organisms/ProtocolSetup/RunSetupCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type { State } from '../../../redux/types'
import { getConnectedRobot } from '../../../redux/discovery/selectors'

export function RunSetupCard(): JSX.Element | null {
const { t } = useTranslation('protocol_setup')
const protocolData = useSelector((state: State) => getProtocolData(state))
const moduleRenderCoords = getModuleRenderCoords(
protocolData,
Expand All @@ -33,31 +34,34 @@ export function RunSetupCard(): JSX.Element | null {
)
const robot = useSelector((state: State) => getConnectedRobot(state))

if (
protocolData == null ||
robot == null ||
('metadata' in protocolData && Object.keys(protocolData).length === 1)
)
return null

if (Object.values(moduleRenderCoords).length > 1) {
var MODULE_SETUP_KEY = 'modules_setup_step'
} else {
var MODULE_SETUP_KEY = 'module_setup_step'
}
const ROBOT_CALIBRATION_STEP_KEY = 'robot_calibration_step' as const
const LABWARE_SETUP_KEY = 'labware_setup_step' as const

let MODULE_SETUP_KEY = 'module_setup_step'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come this isn't a const too?

if (
protocolData != null &&
robot != null &&
'metadata' in protocolData &&
Object.keys(protocolData).length !== 1 &&
Object.values(moduleRenderCoords).length > 1
) {
MODULE_SETUP_KEY = 'modules_setup_step'
}

type StepKey =
| typeof ROBOT_CALIBRATION_STEP_KEY
| typeof MODULE_SETUP_KEY
| typeof LABWARE_SETUP_KEY

const { t } = useTranslation('protocol_setup')
const [expandedStepKey, setExpandedStepKey] = React.useState<StepKey | null>(
ROBOT_CALIBRATION_STEP_KEY
)

if (
protocolData == null ||
robot == null ||
('metadata' in protocolData && Object.keys(protocolData).length === 1)
)
return null

let stepsKeysInOrder: StepKey[] = [ROBOT_CALIBRATION_STEP_KEY]
if (protocolHasModules(protocolData as JsonProtocolFile)) {
Expand Down
2 changes: 0 additions & 2 deletions app/src/pages/Robots/ModuleSettings/AttachedModulesCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export function AttachedModulesCard(props: Props): JSX.Element {
const modules = useSelector((state: State) =>
getAttachedModules(state, robotName)
)
console.log(modules, 'and', robotName)
const controlDisabledReason = useSelector((state: State) =>
getModuleControlsDisabled(state, robotName)
)
Expand All @@ -98,7 +97,6 @@ export function AttachedModulesCard(props: Props): JSX.Element {
? legacyModuleList(modules, controlDisabledReason)
: moduleListWithUSBInfo(modulesByPort, controlDisabledReason)

console.log('modulesList are', modulesList)
// if robot is connected, the modules epic will poll /modules automatically,
// but we need to poll ourselves if we're viewing this robot without
// connecting to its RPC server
Expand Down