Issue #3029061 by tim.plunkett, xjm, phenaproxima, alexpott, tacituseu: New layouts are missing config schema
parent
1022611bee
commit
1d83b5fe26
|
@ -64,3 +64,16 @@ inline_block:
|
||||||
|
|
||||||
block.settings.inline_block:*:
|
block.settings.inline_block:*:
|
||||||
type: 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
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
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: { }
|
|
@ -0,0 +1,6 @@
|
||||||
|
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 = [
|
protected static $modules = [
|
||||||
'layout_discovery',
|
'layout_discovery',
|
||||||
'layout_builder',
|
'layout_builder',
|
||||||
|
'layout_builder_defaults_test',
|
||||||
'entity_test',
|
'entity_test',
|
||||||
'field',
|
'field',
|
||||||
'system',
|
'system',
|
||||||
|
@ -44,13 +45,27 @@ class DefaultsSectionStorageTest extends KernelTestBase {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
|
entity_test_create_bundle('bundle_with_extra_fields');
|
||||||
$this->installSchema('system', ['key_value_expire']);
|
$this->installSchema('system', ['key_value_expire']);
|
||||||
$this->installEntitySchema('entity_test');
|
$this->installEntitySchema('entity_test');
|
||||||
$this->installEntitySchema('user');
|
$this->installEntitySchema('user');
|
||||||
|
$this->installConfig(['layout_builder_defaults_test']);
|
||||||
|
|
||||||
$this->plugin = DefaultsSectionStorage::create($this->container, [], 'defaults', new SectionStorageDefinition());
|
$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
|
* @covers ::access
|
||||||
* @dataProvider providerTestAccess
|
* @dataProvider providerTestAccess
|
||||||
|
|
Loading…
Reference in New Issue