Exclude SDCs with "noUi" from the component list
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3588860. --> Reported by: [lostcarpark](https://www.drupal.org/user/346773) Related to !14 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Currently the module includes all components on the site. However, some components are not intended to be used by front end users, so should be excluded.</p> <p>Components excluded from front end will have "noUi: true".</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>N/A</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>The fix is very simple: in ComponentRow::buildOptionsForm, we loop through components returned by <code>getDefinitions()</code>. This should check for the presence of the <code>$definition['noUI']</code>, and if present, should exclude the component.</p> <p>We should also add a test case. This should also be simple:</p> <ul> <li>Clone <code>/tests/modules/views_row_sdc_test/components/test_card</code>.</li> <li>Rename the copy to "hidden_card".</li> <li>We need minimal props and slots, so delete the Subtitle prop and the Media slot from the .component.yml and the .</li> <li>Add the line "noUi: true" to the component.</li> <li>In "tests/src/Kernel/ComponentRowTest.php", duplicate the "testOptionsFormHasComponentSelect" function.</li> <li>Modify to check the component "hidden_card" is now shown.</li> </ul> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <ul> <li>Add check to exclude hidden components from drop-down.</li> <li>Create hidden test card component.</li> <li>Add test to verify hidden card does not appear in drop-down.</li> </ul> <h3 id="summary-ui-changes">User interface changes</h3> <p>None.</p> <h3 id="summary-api-changes">API changes</h3> <p>None.</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>None.</p>
issue