Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add element definition api (based on PageLayout definitions) #1986

Merged
merged 3 commits into from
Dec 22, 2020

Conversation

stockime
Copy link
Contributor

What is this pull request for?

Adds a ElementDefinition repository class (like PageLayout) that allows elements to be registered outside of the elements.yml file.

This is intended to be used in modules or extensions so that elements offered don't have to be added to the elements.yml manually.

Notable changes

To ensure backwards compatability, the Element::Definitions API is largely unchanged and just delegates to ElementDefinition. ElementDefinition is an adjusted version of the concern with the general API of PageLayout on top.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@stockime stockime force-pushed the feature/element_definitions branch from 45fff46 to 7d5d316 Compare December 21, 2020 16:17
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This is a very great feature. Especially keeping the existing API the same 👌🏻

There is just one code formatting "issue" that is bothering me. Do you mind to address it?

app/models/alchemy/element/definitions.rb Outdated Show resolved Hide resolved
@tvdeyen tvdeyen added this to the 5.2 milestone Dec 21, 2020
@stockime
Copy link
Contributor Author

Prettier for Ruby just reached 1.0 and that's how it wanted to format this part ;)

@stockime stockime force-pushed the feature/element_definitions branch from 043c7fd to eae9bcf Compare December 21, 2020 18:44
Co-authored-by: Thomas von Deyen <[email protected]>
@tvdeyen
Copy link
Member

tvdeyen commented Dec 22, 2020

Prettier for Ruby just reached 1.0 and that's how it wanted to format this part ;)

Guessed that. Personally I am using Rufu, but that also sometimes messes up long strings like that :)

@tvdeyen tvdeyen merged commit 75d3cd6 into AlchemyCMS:main Dec 22, 2020
@tvdeyen
Copy link
Member

tvdeyen commented Dec 22, 2020

Merged! Thank you for the contribution 👏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants