nuvoleweb / ui_patterns

[NOTE] Development has moved to https://drupal.org/project/ui_patterns
https://drupal.org/project/ui_patterns
GNU General Public License v2.0
85 stars 56 forks source link

Allow patterns without fields #181

Closed DuaelFr closed 6 years ago

DuaelFr commented 6 years ago

Patterns are a great way to package markup, CSS and JS together. While using it for big bunch of markup with a lot of variables, I'd like to also be able to use it to manage some atoms like a really simple static button. I could use another method but I like consistency and it seem to me totally legit to use a Pattern to do that. The thing is that it's not allowed to create a pattern without any field.

To change this we just have to edit \Drupal\ui_patterns\TypedData\PatternDataDefinition::getPropertyDefinitions() and remove the setRequired() call for the fields.

What do you think about this ?

ademarco commented 6 years ago

@DuaelFr something like that?

DuaelFr commented 6 years ago

Hi! I'm so sorry I didn't answer in about a month. It's perfect, thanks a lot :)