File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
components/src/organisms/CommandText/useCommandTextString/utils/commandText
shared-data/command/types Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export function getMoveToWellCommandText({
17
17
x : xOffsetUnformatted ,
18
18
y : yOffsetUnformatted ,
19
19
z : zOffsetUnformatted ,
20
- } = wellLocation . offset
20
+ } = wellLocation ? .offset ?? { x : '' , y : '' , z : '' }
21
21
const allPreviousCommands = commandTextData ?. commands . slice (
22
22
0 ,
23
23
commandTextData . commands . findIndex ( c => c . id === command . id )
@@ -36,6 +36,13 @@ export function getMoveToWellCommandText({
36
36
t,
37
37
} )
38
38
39
+ const xOffset =
40
+ typeof xOffsetUnformatted === 'number' ? xOffsetUnformatted ?. toFixed ( 2 ) : ''
41
+ const yOffset =
42
+ typeof yOffsetUnformatted === 'number' ? yOffsetUnformatted ?. toFixed ( 2 ) : ''
43
+ const zOffset =
44
+ typeof zOffsetUnformatted === 'number' ? zOffsetUnformatted ?. toFixed ( 2 ) : ''
45
+
39
46
return t ( 'move_to_well' , {
40
47
wellName,
41
48
labware :
@@ -46,10 +53,10 @@ export function getMoveToWellCommandText({
46
53
allRunDefs,
47
54
} )
48
55
: null ,
49
- xOffset : xOffsetUnformatted . toFixed ( 2 ) ,
50
- yOffset : yOffsetUnformatted . toFixed ( 2 ) ,
51
- zOffset : zOffsetUnformatted . toFixed ( 2 ) ,
52
- positionRelative : wellLocation . origin ,
56
+ xOffset,
57
+ yOffset,
58
+ zOffset,
59
+ positionRelative : wellLocation ? .origin ,
53
60
displayLocation,
54
61
} )
55
62
}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ export interface WellOffset {
5
5
y ?: number
6
6
z ?: number
7
7
}
8
+ // TODO(jh, 06-27-25): Origin and offset should be required. Mark them as so and fix all the type errors.
8
9
export interface WellLocation {
9
10
origin ?: WellOrigin
10
11
offset ?: WellOffset
You can’t perform that action at this time.
0 commit comments