[2.0.0-beta2] ContextHelper cleaning

Created on 12 August 2024, about 1 month ago
Updated 15 September 2024, 1 day ago

Problem/Motivation

Following πŸ“Œ [2.0.0-beta1] No entity context in layout builder. Needs review let's check those issues in ContextHelper

Helpers naming and structure

It is a class called "helpers" which may be controversial. However, it is also a service (ui_patterns.context_helper) which is used in:

  • ComponentLayout
  • ComponentBlock
  • ComponentFormatterBase

And doesn't seem that different from our other specific utilities services, like the ones from Drupal\ui_patterns\SchemaManager:

  • Canonicalizer
  • CompatibilityChecker
  • ReferencesResolver
  • StreamWrapper

So, what can we do?

  • Keep the current class and the current service, but rename it?
  • Or make a trait instead?

Lets' not forget to also change ContextHelperInterface if needed.

Dependency to layout_builder and field_layout module

use Drupal\field_layout\Entity\FieldLayoutEntityFormDisplay;
use Drupal\field_layout\Entity\FieldLayoutEntityViewDisplay;
use Drupal\field_layout\Form\FieldLayoutEntityFormDisplayEditForm;
use Drupal\field_layout\Form\FieldLayoutEntityViewDisplayEditForm;
use Drupal\layout_builder\DefaultsSectionStorageInterface;
use Drupal\layout_builder\Form\ConfigureSectionForm;
use Drupal\layout_builder\OverridesSectionStorageInterface;
use Drupal\layout_builder\SectionStorageInterface;

They are not listed in https://git.drupalcode.org/project/ui_patterns/-/blob/2.0.x/ui_patterns.... and we don't want to add them.

So, let's remove them.

Proposed resolution

Can we do something before releasing beta1 today?

πŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024