-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(forms): adding comment block #17153
Conversation
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.
I am unsure about the "Block" name to represent Question + Comment.
I think it is a bit ambiguous as the form main details and the sections also looks like "blocks" in the interface and thus someone might think they are a "Block" too.
With that being said, I do not have any better suggestion.
If someone else has one, please let us know :)
Co-authored-by: Adrien Clairembault <42734840+AdrienClairembault@users.noreply.github.com>
if ($comment_data["_use_uuid_for_sections_id"]) { | ||
// This question was added to a newly created section | ||
// We need to find the correct section id using the temporary UUID | ||
$uuid = $comment_data['forms_sections_id']; | ||
$comment_data['forms_sections_id'] = $_SESSION['form_editor_sections_uuid'][$uuid] ?? 0; | ||
} |
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.
This is the kind of logic that will be hard to maintain. It requires additionnal inputs on the form side and a temporary storage in session data.
Maybe it could be handled in a simplier way by nesting data in the POST payload, for instance
_sections[0]=[...]
_comments[0]=[...]
may be changed to
_sections[0]=[
...
_comments[0]=[...]
]
The comment would be part of the section payload and it would be therefore easier to attach it to the section. Also, the payload would probably be easier to read.
As this logic is already used by questions, it is not a blocker for the current PR, but I think it could be interesting to simplify this.
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.
This was the original behavior in the first forms iteration (nested arrays).
There was some issues with it but I don't remember exactly what.
I agree the uuid stuff is not ideal too, a better solution would be welcome.
Adds a new comment block feature to the form editor.
The comment block allows users to add comments to a form section.
In the form editor :
In the form editor (focused) :
In the form preview :