Skip to content

Commit c1a69ba

Browse files
authored
fix(formbuilder): skip "add a condition" for 9 unhandled question types DEV-1283 DEV-1284 (#6468)
### 📣 Summary In formbuilder, hide the not working "add a condition" button for 9 affect question types - Select One, Select Many, Point, Photo, Audio, Video, Line, Area, Acknowledge. ### 💭 Notes Regression since #5982 - redefining that constructor was important. But because redefining constructors should be impossible in the first place, fixed the problem in another way. The button should work and not be hidden for Select One and Select Many question types but fixing that is out of scope of this PR. ### 👀 Preview steps 1. create a new form or edit existing one 2. go to "settings" for affect question type 1. ▶️ go to "validation criteria" tab 2. 🔴 [on main] arrive in the choice step between "add a condition" and "Manually enter your validation logic in XLSForm code" 3. ▶️ [on main] click "Manually enter your validation logic in XLSForm code" 4. 🔴 [on main] arrive in manual step, and see a red trash icon on right 5. 🟢 [on PR] arrive directly in the manual step 6. 🟢 [on PR] don't see the red trash icon on right there 3. go to "settings" for unaffected question type 1. ▶️ go to "validation criteria" tab 2. 🟢 arrive in the choice step 3. ▶️ click "Manually enter your validation logic in XLSForm code" 4. 🟢 see the trash icon
1 parent 284c224 commit c1a69ba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

jsapp/xlform/src/mv.validationLogicHelpers.coffee

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ module.exports = do ->
4646

4747
class validationLogicHelpers.ValidationLogicHelperContext extends $skipLogicHelpers.SkipLogicHelperContext
4848
use_mode_selector_helper: () ->
49-
@state = new validationLogicHelpers.ValidationLogicModeSelectorHelper @view_factory, @
50-
@render @destination
49+
if @questionTypeHasNoValidationOperators()
50+
@use_hand_code_helper()
51+
else
52+
@state = new validationLogicHelpers.ValidationLogicModeSelectorHelper @view_factory, @
53+
@render @destination
54+
return
5155
use_hand_code_helper: () ->
5256
@state = new validationLogicHelpers.ValidationLogicHandCodeHelper(@state.serialize(), @builder, @view_factory, @)
5357
if @questionTypeHasNoValidationOperators()

0 commit comments

Comments
 (0)