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

Named types #13

Draft
wants to merge 4 commits into
base: 1.0
Choose a base branch
from
Draft

Named types #13

wants to merge 4 commits into from

Conversation

bdunogier
Copy link
Member

@bdunogier bdunogier commented Dec 22, 2019

See doc/research/named_field_types.md for more details.

This introduces a new layer on top of the query field: named query field types. Using named configuration directives, extra query field types can be made available.

ezplatform:
  queries:
    children:
      query_type: eZ:Children
      default_parameters:
        location: 'mainLocation'
        type: 'returnedType'
    relating:
      query_type: AppBundle:RelatedToContent
      default_parameters:
        to_content: 'content'
        type: 'returnedType'
      preset_parameters:
        sort_by: name

image

image

Benefits

  • When adding those fields types, no query type needs to be selected, as it is built into the named type
  • It is easier to change / rename query types that are mapped that way
  • Default parameters are often sufficient, and make it much faster to create a new field
  • 3rd party extensions can provide their own named types with a few lines of configuration

Details

Since the query type for named fields is predefined:

  • they can be assigned default parameters
  • a custom form can be generated depending on the supported parameters

Notes and tasks

  • Consider renaming the "Query field type" to "Content list type". You don't care if it uses a query or something else when modelling content. Named types are then more natural: "Content list: children", "Content list: relating"
  • Consider adding an option to set predefined values for parameters, that aren't editable using the backoffice
  • Find a convenient way to make the field type configurable and translatable
  • Integrate the query field form branch (Prototyped a more advanced query type parameters UI #7).
  • Refactor the extension code that creates the named types so that it is testable and easier to maintain
  • Queries semantic configuration

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

Successfully merging this pull request may close these issues.

1 participant