Skip to content

Commit

Permalink
fix(protocol-designer): blowout field checkbox properly populating (#…
Browse files Browse the repository at this point in the history
…17093)

closes RQA-3792

This was a weird bug only affecting the UI and not any commands being
generated. Basically, the blowout checkbox was incorrectly not being
selected because there was logic in place to hardcode it
to false due to the disposal volume checkbox being true. IDK why the
disposal volume checkbox is true -- seems like something we allowed for
all move liquid steps back in the day. So for a UI fix, I added the
field to be dependent on the disposal volume fields and removed the
useEffect in place.
  • Loading branch information
jerader authored Dec 12, 2024
1 parent 5c411b6 commit 187ba1a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useEffect } from 'react'
import { useSelector } from 'react-redux'
import { useTranslation } from 'react-i18next'
import {
Expand Down Expand Up @@ -134,13 +133,6 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element {

const mappedErrorsToField = getFormErrorsMappedToField(visibleFormErrors)

// auto-collapse blowout field if disposal volume is checked
useEffect(() => {
if (formData.disposalVolume_checkbox) {
propsForFields.blowout_checkbox.updateValue(false)
}
}, [formData.disposalVolume_checkbox])

return toolboxStep === 0 ? (
<Flex
flexDirection={DIRECTION_COLUMN}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ const updatePatchDisposalVolumeFields = (
...patch,
disposalVolume_checkbox: true,
disposalVolume_volume: recommendedMinimumDisposalVol,
blowout_checkbox: false,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ describe('disposal volume should update...', () => {
dispense_mix_checkbox: false,
dispense_mix_times: null,
dispense_mix_volume: null,
blowout_checkbox: false,
})
})

Expand Down

0 comments on commit 187ba1a

Please sign in to comment.