Skip to content
Snippets Groups Projects
Commit 1d83b5fe authored by Jess's avatar Jess
Browse files

Issue #3029061 by tim.plunkett, xjm, phenaproxima, alexpott, tacituseu: New...

Issue #3029061 by tim.plunkett, xjm, phenaproxima, alexpott, tacituseu: New layouts are missing config schema
parent 1022611b
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -64,3 +64,16 @@ inline_block:
block.settings.inline_block:*:
type: inline_block
layout_builder_multi_width:
type: layout_plugin.settings
mapping:
column_widths:
type: string
label: 'Column widths'
layout_plugin.settings.layout_twocol_section:
type: layout_builder_multi_width
layout_plugin.settings.layout_threecol_section:
type: layout_builder_multi_width
langcode: en
status: true
dependencies:
module:
- layout_builder
third_party_settings:
layout_builder:
sections:
-
layout_id: layout_twocol_section
layout_settings:
column_widths: '50-50'
components:
1445597a-c674-431d-ac0a-277d99347a7f:
uuid: 1445597a-c674-431d-ac0a-277d99347a7f
region: first
configuration:
label_display: '0'
context_mapping:
entity: layout_builder.entity
id: 'extra_field_block:entity_test:bundle_with_extra_fields:display_extra_field'
additional: { }
weight: 1
allow_custom: false
enabled: true
id: entity_test.bundle_with_extra_fields.default
targetEntityType: entity_test
bundle: bundle_with_extra_fields
mode: default
content:
display_extra_field:
weight: 100
settings: { }
third_party_settings: { }
region: content
hidden: { }
name: 'Layout Builder defaults test'
type: module
description: 'Support module for testing layout building defaults.'
package: Testing
version: VERSION
core: 8.x
......@@ -25,6 +25,7 @@ class DefaultsSectionStorageTest extends KernelTestBase {
protected static $modules = [
'layout_discovery',
'layout_builder',
'layout_builder_defaults_test',
'entity_test',
'field',
'system',
......@@ -44,13 +45,27 @@ class DefaultsSectionStorageTest extends KernelTestBase {
protected function setUp() {
parent::setUp();
entity_test_create_bundle('bundle_with_extra_fields');
$this->installSchema('system', ['key_value_expire']);
$this->installEntitySchema('entity_test');
$this->installEntitySchema('user');
$this->installConfig(['layout_builder_defaults_test']);
$this->plugin = DefaultsSectionStorage::create($this->container, [], 'defaults', new SectionStorageDefinition());
}
/**
* Tests installing defaults via config install.
*/
public function testConfigInstall() {
/** @var \Drupal\layout_builder\Entity\LayoutEntityDisplayInterface $display */
$display = LayoutBuilderEntityViewDisplay::load('entity_test.bundle_with_extra_fields.default');
$section = $display->getSection(0);
$this->assertInstanceOf(Section::class, $section);
$this->assertEquals('layout_twocol_section', $section->getLayoutId());
$this->assertEquals(['column_widths' => '50-50'], $section->getLayoutSettings());
}
/**
* @covers ::access
* @dataProvider providerTestAccess
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment