Specialized elements
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3599006. -->
Reported by: [pfrenssen](https://www.drupal.org/user/382067)
Related to !92
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Part 8 of splitting <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/graphql_webform/-/work_items/3595219" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/graphql_webform/-/work_items/3595219</a></span>. This issue adds support for a set of <strong>standalone, special-purpose element types</strong> that are each self-contained and don't fit the options/numeric/date families:</p>
<ul>
<li><code>likert</code> — a question/answer matrix (questions, answers, optional N/A).</li>
<li><code>webform_terms_of_service</code> — terms acceptance with a link/modal.</li>
<li><code>webform_message</code> — an informational message element.</li>
<li><code>webform_same</code> — a "same as" toggle that copies another composite's values.</li>
<li><code>webform_computed_token</code> / <code>webform_computed_twig</code> — computed values.</li>
<li><code>view</code> — an embedded Views display.</li>
<li><code>webform_email_confirm</code> — an e-mail with confirmation field.</li>
</ul>
<p>None of these are exposed in 3.x today.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Add each element type to the schema (generated type + resolvers), with the enums and producers each needs:</p>
<ul>
<li><strong>likert</strong>: <code>webform_element_likert_items</code> and <code>webform_element_likert_na_answer</code> producers; <code>WebformLikertDescriptionDisplay</code> enum.</li>
<li><strong>terms_of_service</strong>: <code>WebformTermsType</code> and <code>WebformLinkTarget</code> enums.</li>
<li><strong>message</strong>: reuses the <code>WebformMessageType</code> enum.</li>
<li><strong>same</strong>: expose its fields and handle submission (<code>WebformSubmit.php</code>).</li>
<li><strong>computed</strong>: <code>WebformComputedMode</code> enum.</li>
<li><strong>view</strong>: expose the embedded view reference/display fields.</li>
<li><strong>email_confirm</strong>: expose fields (incl. required/description/help) and handle the confirmation submission.</li>
</ul>
<p>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.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>Add enums <code>WebformLikertDescriptionDisplay</code>, <code>WebformTermsType</code>, <code>WebformLinkTarget</code>, <code>WebformComputedMode</code> under <code>src/Enum/</code>; wire into <code>WebformSchemaBuilder.php</code>.</li>
<li>Add producers <code>WebformElementLikertItems.php</code>, <code>WebformElementLikertNaAnswer.php</code>; extend <code>WebformElementMetadata.php</code> / <code>WebformExtension.php</code> for each element.</li>
<li>Handle <code>webform_same</code> and <code>webform_email_confirm</code> submission in <code>WebformSubmit.php</code>.</li>
<li>Tests: <code>LikertTest</code>, <code>TermsOfServiceTest</code>, <code>MessageTest</code>, <code>SameTest</code> + <code>FormSubmissionSameTest</code>, <code>ComputedTest</code>, <code>ViewTest</code>, <code>EmailConfirmTest</code> + <code>FormSubmissionEmailConfirmTest</code>, plus the matching <code>tests/queries/*.gql</code> fixtures and shared test-form additions.</li>
</ul>
<h3 id="summary-api-changes">API changes</h3>
<p>Additive: new element types (likert, terms_of_service, message, same, computed, view, email_confirm) with their supporting enums and producers. No fields removed.</p>
<h3 id="summary-release-notes">Release notes snippet</h3>
<p>Support added for the likert, terms-of-service, message, "same as", computed, view and e-mail-confirm element types, including submission handling where applicable.</p>
issue
GitLab AI Context
Project: project/graphql_webform
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/graphql_webform/-/raw/8.x-1.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/graphql_webform
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD