- Issue created by @lauriii
- Assigned to lauriii
- Status changed to Needs review
3 months ago 9:57am 30 August 2024 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
How about
diff --git a/tests/modules/sdc_test_all_props/components/all-props/all-props.component.yml b/tests/modules/sdc_test_all_props/components/all-props/all-props.component.yml index 1544192f..6e6e1643 100644 --- a/tests/modules/sdc_test_all_props/components/all-props/all-props.component.yml +++ b/tests/modules/sdc_test_all_props/components/all-props/all-props.component.yml @@ -11,10 +11,19 @@ props: examples: - true test_string: - title: 'String' + title: 'String — single line' type: string + # Implied pattern: + #pattern: '.'' examples: - Hello, world! + test_string_multiline: + title: 'String — multi-line' + type: string + # @see https://json-schema.org/understanding-json-schema/reference/regular_expressions + pattern: '(.|\r?\n)*' + examples: + - "Hello,\nworld!" test_REQUIRED_string: title: 'String' type: string
And we can make that simpler of course, for those who prefer that:
test_string_multiline_ref: title: 'String — multi-line ($ref)' type: string $ref: json-schema-definitions://experience_builder.module/multi-line-string examples: - "Hello,\nworld!"
or perhaps even multiple aliases, for example:
test_string_multiline_ref: title: 'String — multi-line ($ref, alias)' type: string $ref: json-schema-definitions://experience_builder.module/textarea examples: - "Hello,\nworld!"
- Issue was unassigned.
- Status changed to Needs work
3 months ago 10:55am 30 August 2024 - 🇫🇮Finland lauriii Finland
Something like
$ref: json-schema-definitions://experience_builder.module/textarea
would probably make sense 👍 - Merge request !232#3471171: Allow components to use textarea in favor of input → (Merged) created by wim leers
- Assigned to lauriii
- Status changed to Needs review
3 months ago 4:49pm 30 August 2024 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
- I added the new JSON schema definition: https://git.drupalcode.org/project/experience_builder/-/merge_requests/2...
- I updated the
all-props
test SDC: https://git.drupalcode.org/project/experience_builder/-/merge_requests/2... - I updated
\Drupal\experience_builder\SdcPropJsonSchemaType::computeStorablePropShape()
: https://git.drupalcode.org/project/experience_builder/-/merge_requests/2... - It shows up:
Less than 10 minutes 👍
Next step: updating
\Drupal\Tests\experience_builder\Kernel\SdcPropToFieldTypePropTest
to expect more results.@lauriii, is that sample in
all-props.component.yml
to your liking? 😊 - Assigned to tedbow
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
… and now I've actually finished implementing this completely, because:
- Update
StringLongItemOverride
to specify an additional validation constraint that conveys newlines are actually allowed, allowing it to match againstjson-schema-definitions://experience_builder.module/textarea
… is enough to make it all work 😊
Ready for final review now 😄 @tedbow is the only other person who's been delving into this area, so assigning to him.
- Update
- Assigned to wim leers
- Status changed to Needs work
3 months ago 5:48pm 30 August 2024 - 🇺🇸United States tedbow Ithaca, NY, USA
Looks good. 1 suggestion to make how this works clearer
- Status changed to RTBC
3 months ago 7:48pm 30 August 2024 -
tedbow →
committed 02b38bbb on 0.x authored by
Wim Leers →
Issue #3471171 by Wim Leers, lauriii: Allow components to use textarea...
-
tedbow →
committed 02b38bbb on 0.x authored by
Wim Leers →
- Status changed to Fixed
3 months ago 7:48pm 30 August 2024 - 🇫🇮Finland lauriii Finland
Really nice to see we were able to land this issue this quickly! 🚀 Great team work @Wim Leers and @tedbow! 💯 👏
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Note: the front-end does not yet allow typing in the
<textarea>
. Root cause TBD.We have 🌱 [META] Redux sync on ALL prop types, not just ones with a single [value] property Active for that, unless @lauriii decides to increase the scope of 📌 Component props form: map textarea, bool, and select elements to React components Fixed .
- Issue was unassigned.
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
Should there be a follow-up issue to add textarea schema refs to any of the existing XB components so there is an example?
Automatically closed - issue fixed for 2 weeks with no activity.