Problem/Motivation

Following meeting of Friday 14 August.

In Admin UI, a pattern preset is editable only with a textarea showing the source tree YAML representation. It is not friendly and error prone.

Can we make pattern preset easily buildable with our "normal" UI?

Proposed resolution

  • Add a new pattern_preset buildable plugin in display_builder_ui
  • Add a new entity.pattern_preset.display_builder route to access display builder for pattern presets
  • Add a profile property in PatternPreset entity
  • Add DisplayBuildableInterface::buildInstanceForm() to EntityForm.

Other tasks

Careful not creating a situation where things are breaking when display_builder_ui is not activated.

Careful with context management: It is OK if the context sensitive sources are missing form block library, but at least the ones already in the source tree must work. Do we still see the expected previews for example?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pdureau created an issue. See original summary.

pdureau’s picture

Title: Make patter presets buildables » Make pattern presets buildables

pdureau’s picture

Status: Active » Needs work

Started. It goes as well as planned.

Other point of attention:

We also need to update doc.

pdureau’s picture

The pattern presets are now displayed in the InstancesPanel. Is it something we want?

✅ Not anymore. Maybe because of the addition of the no_ui attributes.

It is OK if the context sensitive sources are missing form block library, but at least the ones already in the source tree must work. Do we still see the expected previews for example?

PatternPresetnterface::getContexts() is returning proper contexts:

  • when we create a pattern from admin UI, it is always context agnostic.
  • when we create a pattern from another display, it inherit the the context of the initial display ⚠️ It works maybe "too" well: the sources are working properly with the proper context, but we have access to context aware block in the library. Is it too much?
  • we can use a pattern preset in the display of a pattern preset
  • we can create a pattern preset while editing a pattern preset. ⚠️ this new pattern will be context agnostic, it is OK or do we keep transferring the initial context?

Maybe we will be able to close #3546964: Better context management in presets as duplicate or outdated.

Next steps, the usual:

  • Documentation
  • Tests
pdureau’s picture

Title: Make pattern presets buildables » Make pattern presets buildable
pdureau’s picture

Status: Needs work » Postponed

Some of the changes form here have been moved to #3618100: Pattern presets fix & clean-up, so lets wait the previous one is merged before resuming our work.

pdureau’s picture

Status: Postponed » Active

#3618100: Pattern presets fix & clean-up has been merged to 1.0.x. Lets 'resume.

pdureau’s picture

Issue summary: View changes

(i remove from ticket description the work already done in #3618100: Pattern presets fix & clean-up)