-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/actors conditions #19139
base: main
Are you sure you want to change the base?
Feature/actors conditions #19139
Conversation
c9c1be8
to
6657833
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR enhances the form handling functionality by adding support for array values in form answers and incorporating extra question data into the editor state. Key changes include:
- Updating the condition engine to support array values.
- Adding a utility to extract extra question data in the editor controller.
- Updating documentation of form questions to include extra_data.
Reviewed Changes
File | Description |
---|---|
js/modules/Forms/Condition/Engine.js | Added support for handling array answers and refined key checking logic. |
js/modules/Forms/EditorController.js | Introduced #getQuestionExtraData to capture additional question input data. |
js/modules/Forms/ConditionEditorController.js | Updated JSDoc type for extra_data in form questions. |
Copilot reviewed 40 out of 40 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
js/modules/Forms/Condition/Engine.js:82
- Changing the condition to check for keys that strictly start with 'answers_' may inadvertently skip valid keys if 'answers_' appears later in the string. Consider verifying whether this change is intentional or if a different condition should be applied.
if (key.indexOf('answers_') !== 0) {
6657833
to
67c2862
Compare
{# Get condition handler's input template #} | ||
{{ manager.getInputTemplateForCondition(condition, "_conditions[" ~ loop.index0 ~ "][value]")|raw }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to avoid inline twig as it is not linted.
I would prefer an elseif
case here keeping the original behavior OR to use dedicated twig files for each types (in this case getInputTemplateForCondition
would return the file name instead of an enum key).
For the specific parameters, you can probably add a second getInputTemplateParametersForCondition
method, for which its results would be passed to the template ?
Checklist before requesting a review
Please delete options that are not relevant.
Description