Skip to content

Commit

Permalink
fix(protocol-designer): timeline errors/warnings show up in mixpanel (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader authored Dec 20, 2024
1 parent 3162131 commit 99da252
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ describe('reduxActionToAnalyticsEvent', () => {
id: 'stepId',
pipette: 'pipetteId',
otherField: 123,
aspirateFlowRate: undefined,
dispenseFlowRate: undefined,
aspirateAirGap: undefined,
aspirateFlowRate: 'default',
dispenseFlowRate: 'default',
aspirateAirGap: 'default',
dispenseAirGap: 'default',
nested: { inner: true },
// de-nested fields
__nested__inner: true,
Expand Down
17 changes: 12 additions & 5 deletions protocol-designer/src/analytics/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,14 @@ export const reduxActionToAnalyticsEvent = (
name: `${modifiedStepName}Step`,
properties: {
...stepArgModified,
aspirateAirGap: stepArgModified.aspirateAirGapVolume,
aspirateFlowRate: stepArgModified.aspirateFlowRateUlSec,
dispenseFlowRate: stepArgModified.dispenseFlowRateUlSec,
aspirateAirGap:
stepArgModified.aspirateAirGapVolume ?? DEFAULT_VALUE,
aspirateFlowRate:
stepArgModified.aspirateFlowRateUlSec ?? DEFAULT_VALUE,
dispenseFlowRate:
stepArgModified.dispenseFlowRateUlSec ?? DEFAULT_VALUE,
dispenseAirGap:
stepArgModified.dispenseAirGapVolume ?? DEFAULT_VALUE,
blowoutFlowRate: stepArgModified.blowoutFlowRateUlSec,
aspirateOffsetFromBottomMm:
stepArgModified.aspirateOffsetFromBottomMm ===
Expand Down Expand Up @@ -202,8 +207,10 @@ export const reduxActionToAnalyticsEvent = (
name: `mixStep`,
properties: {
...stepArgModified,
aspirateFlowRate: stepArgModified.aspirateFlowRateUlSec,
dispenseFlowRate: stepArgModified.dispenseFlowRateUlSec,
aspirateFlowRate:
stepArgModified.aspirateFlowRateUlSec ?? DEFAULT_VALUE,
dispenseFlowRate:
stepArgModified.dispenseFlowRateUlSec ?? DEFAULT_VALUE,
blowoutFlowRate: stepArgModified.blowoutFlowRateUlSec,
aspirateOffsetFromBottomMm:
stepArgModified.aspirateOffsetFromBottomMm ===
Expand Down
4 changes: 2 additions & 2 deletions protocol-designer/src/configureStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ export function configureStore(): StoreType {
/* preloadedState, */
composeEnhancers(
applyMiddleware(
trackEventMiddleware as Middleware<BaseState, Record<string, any>, any>,
thunk,
timelineMiddleware as Middleware<BaseState, Record<string, any>, any>,
thunk
trackEventMiddleware as Middleware<BaseState, Record<string, any>, any>
)
) as StoreEnhancer<unknown, unknown>
)
Expand Down

0 comments on commit 99da252

Please sign in to comment.