Repository navigation
Plain words in rule errors and the submit API docs - #278
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at a781985, CI green. Two shoulds inline.
The new test fails with main's messages, and "condition 1" is the first condition, as the editor numbers them. The other messages match the editor: question, comparison, and/or, hide/show/go to. The API docs still build with Scribe.
| For single choice, checkbox and consent questions, the payload is an array of payload-objects. | ||
| DESC, example: [ | ||
| '7j' => ['payload' => 'Secret', 'actionId' => '59R'], | ||
| '4x1' => ['payload' => 'mail@example.com', 'actionId' => 'pQ6'], | ||
| // For multiple choice questions, the payload is an array of the selected options | ||
| // For single choice and checkbox questions, the payload is an array of the selected choices |
There was a problem hiding this comment.
Should: single choice sends one payload-object, not a list. The public form uses setResponse for single choice and toggleResponse (a list) only for checkbox and consent (ButtonAction.vue:150, ConsentAction.vue:68). The server takes both shapes, so nothing breaks, but the docs say otherwise, and two picks in the example fit only checkboxes.
| For single choice, checkbox and consent questions, the payload is an array of payload-objects. | |
| DESC, example: [ | |
| '7j' => ['payload' => 'Secret', 'actionId' => '59R'], | |
| '4x1' => ['payload' => 'mail@example.com', 'actionId' => 'pQ6'], | |
| // For multiple choice questions, the payload is an array of the selected options | |
| // For single choice and checkbox questions, the payload is an array of the selected choices | |
| For checkbox and consent questions, the payload is an array of payload-objects, one for each ticked choice or policy. A single choice question sends one payload-object for the picked choice. | |
| DESC, example: [ | |
| '7j' => ['payload' => 'Secret', 'actionId' => '59R'], | |
| '4x1' => ['payload' => 'mail@example.com', 'actionId' => 'pQ6'], | |
| // For checkbox questions, the payload is an array of the ticked choices |
| 'name.required' => 'Give the rule a name.', | ||
| 'conditions.required' => 'Add at least one condition.', | ||
| 'conditions.*.source.required' => 'Pick a question for condition :position.', | ||
| 'conditions.*.value.required' => 'Enter a value for condition :position.', |
There was a problem hiding this comment.
Should: the wording table renames this field from "Enter a value" to "Pick an answer" (choices) and "Answer" (text). The rule editor in #274 labels it "Answer for condition 1" and sends an empty answer to the server, so this message shows next to that field. Test line 123 changes with it (I ran it: 9 of 9 pass).
| 'conditions.*.value.required' => 'Enter a value for condition :position.', | |
| 'conditions.*.value.required' => 'Add an answer for condition :position.', |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ords # Conflicts: # CHANGELOG.md # tests/Feature/FormBlockLogicTest.php
PhilReinking
left a comment
There was a problem hiding this comment.
OK at 8b02c1a, CI green. The merge of main changes only CHANGELOG.md and the test order in FormBlockLogicTest.php by hand; both sides stay whole. The PR's own diff against main is the reviewed one from 0aa6a12 plus 8b02c1a. The new message fits the rule: it fails for a question that was deleted or is in another form, and the test checks the full text.
The rule errors the editor shows now use the editor's words ("question", "rule", "condition") instead of field names like "source block" or "evaluate". The API docs for submitting a form no longer say "multiple choice".
Part of BITS-287
Tested: full PHP suite on MariaDB, and in CI after the main merge. The new test lines fail with the old texts.
🤖 Generated with Claude Code