Allow linking integer timestamps to `type: string, format: date`: allow `DynamicPropSource` to optionally use a single-input adapter plugin
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3563380. --> Reported by: [effulgentsia](https://www.drupal.org/user/78040) Related to !433 >>> <h3 id="overview">Overview</h3> <p>Need to be able to link a component's date prop (<code>type: string, format: date</code>) to <code>$node-&gt;created</code> or <code>$node-&gt;changed</code>.</p> <h3 id="proposed-resolution">Proposed resolution</h3> <p><del>See <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3548298" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3548298</a></span></del></p> <p>See #5.</p> <p>Note that this does NOT move us further away from <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3555229" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3555229</a></span> &mdash; if anything, it makes that more clear!</p> <p>Out of scope:</p> <ol> <li>making this work for <em>all</em> <code>timestamp|created|changed</code> fields<br> &rarr; <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-1"><a href="https://www.drupal.org/project/canvas/issues/3563960" title="Status: Active">#3563960: When generating suggestions for ContentTemplates, for any entity field property not appearing in any suggested `EntityFieldPropSource`, try to find an adapter to suggest it anyway</a></span></li> <li>making this work for <em>all</em> adapters<br> &rarr; <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-1"><a href="https://www.drupal.org/project/canvas/issues/3563960" title="Status: Active">#3563960: When generating suggestions for ContentTemplates, for any entity field property not appearing in any suggested `EntityFieldPropSource`, try to find an adapter to suggest it anyway</a></span></li> <li>ensuring the suggested <code>DynamicPropSource</code>'s <code>adapter</code> plugin (if any) actually exists, because that can only happen through config validation, which this issue specifically avoided (see #5). In order to make points 1 and 2 above work reliably, we'll <em>probably</em> need to update <code>Component</code> config entities to track viable adapters, per prop, per component version. TBD, because <a href="https://git.drupalcode.org/project/canvas/-/merge_requests/433#note_647747">it's debatable whether we truly need to validate this</a>, and it'd introduce potentially painful/unnecessary component version updates.<br> &rarr; <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-4"><a href="https://www.drupal.org/project/canvas/issues/3566387" title="Status: Postponed">#3566387: [later phase] Track ContentTemplate adapter plugin dependencies to automatically detect developers breaking system/data integrity</a></span></li> <li>test coverage for testing this against required <code>type: string, format: date</code> props, because the unrelated <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3530808" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3530808</a></span> bug prevents this (this issue is about shape matching, that bug is about Component Source infrastructure: a source-specific setting in a <code>Component</code> entity) </li></ol> <h3 id="ui-changes">User interface changes</h3> <p>(While editing content template)</p> <dl> <dt><code>all-props</code> SDC</dt> <dd> <img src="https://www.drupal.org/files/issues/2025-12-18/first%20adapted%20dynamic%20prop%20source%20ever.gif"><br> </dd> <dt>Newly added <code>canvas_test_sdc:date</code> SDC</dt> <dd>(This much better reflects real-world scenarios.)<br> <img src="https://www.drupal.org/files/issues/2026-01-07/first%20adapted%20dynamic%20prop%20source%20in%20a%20content%20template.gif"><br> </dd> </dl> > Related issue: [Issue #3453152](https://www.drupal.org/node/3453152)
issue