Problem/Motivation
Part 8 of splitting #3595219: 3.0 Exploration. This issue adds support for a set of standalone, special-purpose element types that are each self-contained and don't fit the options/numeric/date families:
likert— a question/answer matrix (questions, answers, optional N/A).webform_terms_of_service— terms acceptance with a link/modal.webform_message— an informational message element.webform_same— a "same as" toggle that copies another composite's values.webform_computed_token/webform_computed_twig— computed values.view— an embedded Views display.webform_email_confirm— an e-mail with confirmation field.
None of these are exposed in 3.x today.
Proposed resolution
Add each element type to the schema (generated type + resolvers), with the enums and producers each needs:
- likert:
webform_element_likert_itemsandwebform_element_likert_na_answerproducers;WebformLikertDescriptionDisplayenum. - terms_of_service:
WebformTermsTypeandWebformLinkTargetenums. - message: reuses the
WebformMessageTypeenum. - same: expose its fields and handle submission (
WebformSubmit.php). - computed:
WebformComputedModeenum. - view: expose the embedded view reference/display fields.
- email_confirm: expose fields (incl. required/description/help) and handle the confirmation submission.
These are largely independent of each other and could be reviewed/landed separately if preferred; they are grouped here to keep the issue count manageable. Each is small on its own.
Remaining tasks
- Add enums
WebformLikertDescriptionDisplay,WebformTermsType,WebformLinkTarget,WebformComputedModeundersrc/Enum/; wire intoWebformSchemaBuilder.php. - Add producers
WebformElementLikertItems.php,WebformElementLikertNaAnswer.php; extendWebformElementMetadata.php/WebformExtension.phpfor each element. - Handle
webform_sameandwebform_email_confirmsubmission inWebformSubmit.php. - Tests:
LikertTest,TermsOfServiceTest,MessageTest,SameTest+FormSubmissionSameTest,ComputedTest,ViewTest,EmailConfirmTest+FormSubmissionEmailConfirmTest, plus the matchingtests/queries/*.gqlfixtures and shared test-form additions.
API changes
Additive: new element types (likert, terms_of_service, message, same, computed, view, email_confirm) with their supporting enums and producers. No fields removed.
Release notes snippet
Support added for the likert, terms-of-service, message, "same as", computed, view and e-mail-confirm element types, including submission handling where applicable.
Issue fork graphql_webform-3599006
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
pfrenssen