Draft: Issue #3508641 by pdureau, grimreaper: Define form elements from SDC
Draft: Issue #3508641 by pdureau, grimreaper: Define form elements from SDC
3 open threads
3 open threads
Closes #3508641
Merge request reports
Activity
added 135 commits
-
218fee3b...ed28d46c - 134 commits from branch
project:11.x
- 7c98d39f - Issue #3508641 by pdureau, grimreaper: Define form elements from SDC
-
218fee3b...ed28d46c - 134 commits from branch
added 1 commit
- b20a07e2 - Update regarding MR https://git.drupalcode.org/project/drupal/-/merge_requests/11345
added 70 commits
-
b20a07e2...3b308073 - 65 commits from branch
project:11.x
- de407ba0 - Issue #3508641 by pdureau, grimreaper: Define form elements from SDC
- 1098b4c5 - No more gathering value based on #name.
- 86b735eb - Update regarding MR https://git.drupalcode.org/project/drupal/-/merge_requests/11345
- ec9fa230 - Add a sdc form input component for testing purpose
- 841bfa87 - Add test to check usage of sdc component as form element
Toggle commit list-
b20a07e2...3b308073 - 65 commits from branch
- Resolved by Théodore Biadala
21 */ 22 protected static $modules = [ 23 'system', 24 'sdc_test', 25 ]; 26 27 /** 28 * {@inheritdoc} 29 */ 30 protected static $themes = ['sdc_theme_test']; 31 32 /** 33 * {@inheritdoc} 34 */ 35 public function getFormId(): string { 36 return 'component_in_form_test'; changed this line in version 6 of the diff
1 {% set id = id|default('test-sdc-text-field-' ~ random()) %} 2 3 {% set input_attributes = create_attribute({ 4 type: 'text', 5 name: form_state.value.name, 6 id: id, 7 value: form_state.value.value, 8 }) %} 9 10 {% if form_state.value.required is not empty %} 11 {% set input_attributes = input_attributes.setAttribute('required', true) %} 12 {% endif %} 13 14 <div{{ attributes }}> 15 <label class="form-label" for="{{ id }}"> changed this line in version 6 of the diff
added 1 commit
- 189ae98f - Add a test for element_validate for sdc form element
161 176 '#slots' => [], 162 177 '#propsAlter' => [], 163 178 '#slotsAlter' => [], 179 '#process' => [ 180 [static::class, 'processAjaxForm'], I was adding tests for ajax support for component. I realized that adding
#ajax
was not enough. The Element class needs to subscribe to the corresponding processor as well. In order to support processing of#ajax
, we would have to explicitly inject a processor[static::class, 'processAjaxForm']
like this. This opens up the question about what should be default set (if any) be there on ComponentElement? Should it behave more like FormElement where it doesn't have any processors, or should it be opinionated and implement some?
Please register or sign in to reply