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_items and webform_element_likert_na_answer producers; WebformLikertDescriptionDisplay enum.
  • terms_of_service: WebformTermsType and WebformLinkTarget enums.
  • message: reuses the WebformMessageType enum.
  • same: expose its fields and handle submission (WebformSubmit.php).
  • computed: WebformComputedMode enum.
  • 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, WebformComputedMode under src/Enum/; wire into WebformSchemaBuilder.php.
  • Add producers WebformElementLikertItems.php, WebformElementLikertNaAnswer.php; extend WebformElementMetadata.php / WebformExtension.php for each element.
  • Handle webform_same and webform_email_confirm submission in WebformSubmit.php.
  • Tests: LikertTest, TermsOfServiceTest, MessageTest, SameTest + FormSubmissionSameTest, ComputedTest, ViewTest, EmailConfirmTest + FormSubmissionEmailConfirmTest, plus the matching tests/queries/*.gql fixtures 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.

Command icon 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

pfrenssen created an issue. See original summary.

  • pfrenssen committed 4c10692d on 3.x
    feat: #3599006 Specialized elements
    
    By: dulnan
    By: pfrenssen
    
pfrenssen’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.