- Issue created by @pdureau
- 🇫🇷France just_like_good_vibes PARIS
Answer : no we won't add
typed_data: ['machine_name']
to the MachineNamePropType,
instead we will add machine_name to the typed_data of StringPropType.
This mechanism is only used for source derivers.
typed_data
value in PHP Attributes of prop types, allow to declare that a Drupal typed data value, can be put in the prop type that is declaring the typed data. Here we have a machine_name drupal typed data that can go into a string prop type.
Furthermore, with the mechanism in place, specifyingmachine_name
intyped_data
array values of StringPropType, will allow each machine_name field property to be available as a source plugin and declared as a string. - Merge request !237Resolve #3477287 "2.0.0 beta4 machinename prop" → (Merged) created by just_like_good_vibes
- 🇫🇷France just_like_good_vibes PARIS
Now about HTML IDs. After some web search queries and reading:
- HTML ids could be any unicode character without spaces according to the supposed "standard". See [this link](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) for example.
- In practice, we want html ids to be used as CSS identifiers with CSS or JS. this adds some restrictions. See [this other link](https://developer.mozilla.org/en-US/docs/Web/CSS/ident) for example.i pushed the work :
- The regex has been extended.
- I did a rapid check of unhandled simple typed data from core, and i found 'machine_name' and 'filter_format'. I added them to the string prop type php attributes, allowing for more derived field prop than before. - 🇫🇷France pdureau Paris
So,
machine_name
types data was added toStringPropType
instead ofMachineNamePropType
.I will have a look.
- 🇫🇷France pdureau Paris
Let's rename
machine_name
byidentifier
andMachineNamePropType
byIdentifierPropType
.This prop type comply with: https://developer.mozilla.org/en-US/docs/Web/CSS/ident
See also: https://developer.mozilla.org/en-US/docs/Glossary/IdentifierIt would be nice to mention those URL in description and/or comment.
And update the converter:
--- a/modules/ui_patterns_legacy/src/PropConverter.php +++ b/modules/ui_patterns_legacy/src/PropConverter.php @@ -25,7 +25,7 @@ class PropConverter { '$ref' => 'ui-patterns://links', ], 'machine_name' => [ - '$ref' => 'ui-patterns://machine_name', + '$ref' => 'ui-patterns://identifier', ], 'number' => $this->convertNumber($setting), 'radios' => $this->convertEnum($setting),
And update the tests in:
- modules/ui_patterns_devel/tests/themes/ui_patterns_devel_theme_test/components/all_errors
- tests/modules/ui_patterns_test/components/
this will be a breaking change
Used in some theme. Example:
$ grep -r machine_name */components/* ui_suite_uswds/components/nav/nav.component.yml: $ref: 'ui-patterns://machine_name' ui_suite_uswds/components/nav_footer/nav_footer.component.yml: $ref: 'ui-patterns://machine_name'
-
pdureau →
committed b8f0fe19 on 2.0.x authored by
just_like_good_vibes →
Issue #3477287 by just_like_good_vibes: Rename MachineName to...
-
pdureau →
committed b8f0fe19 on 2.0.x authored by
just_like_good_vibes →
Automatically closed - issue fixed for 2 weeks with no activity.