diff --git a/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml index 827fe92..758420b 100644 --- a/core/config/schema/core.data_types.schema.yml +++ b/core/config/schema/core.data_types.schema.yml @@ -231,3 +231,42 @@ config_dependencies: label: 'Theme dependencies' sequence: - type: string + +block_settings: + type: mapping + label: 'Block settings' + mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Description' + label_display: + type: string + label: 'Display title' + cache: + type: mapping + label: 'Cache settings' + mapping: + max_age: + type: integer + label: 'Maximum age' + contexts: + type: sequence + label: 'Vary by context' + sequence: + - type: string + label: 'Context' + status: + type: boolean + label: 'Status' + info: + type: label + label: 'Admin info' + view_mode: + type: string + label: 'View mode' + provider: + type: string + label: 'Provider' diff --git a/core/modules/aggregator/config/schema/aggregator.schema.yml b/core/modules/aggregator/config/schema/aggregator.schema.yml index d4a93c5..db7c93a 100644 --- a/core/modules/aggregator/config/schema/aggregator.schema.yml +++ b/core/modules/aggregator/config/schema/aggregator.schema.yml @@ -36,3 +36,14 @@ aggregator.settings: list_max: type: integer label: 'Number of items shown in listing pages' + +block.settings.aggregator_feed_block: + type: block_settings + label: 'Aggregator feed block' + mapping: + block_count: + type: integer + label: 'Block count' + feed: + type: string + label: 'Feed' diff --git a/core/modules/block/config/schema/block.schema.yml b/core/modules/block/config/schema/block.schema.yml index 2e89fe7..9d6daa9 100644 --- a/core/modules/block/config/schema/block.schema.yml +++ b/core/modules/block/config/schema/block.schema.yml @@ -63,43 +63,13 @@ block.block.*: type: string label: 'Plugin' settings: - type: mapping - label: 'Block settings' - mapping: - label: - type: label - label: 'Description' - label_display: - type: string - label: 'Display title' - cache: - type: mapping - label: 'Cache settings' - mapping: - max_age: - type: integer - label: 'Maximum age' - contexts: - type: sequence - label: 'Vary by context' - sequence: - - type: string - label: 'Context' - status: - type: boolean - label: 'Status' - info: - type: label - label: 'Admin info' - view_mode: - type: string - label: 'View mode' - provider: - type: string - label: 'Provider' + type: block.settings.[%parent.plugin] langcode: type: string label: 'Default language' dependencies: type: config_dependencies label: 'Dependencies' + +block.settings.*: + type: block_settings diff --git a/core/modules/block/src/Tests/BlockConfigSchemaTest.php b/core/modules/block/src/Tests/BlockConfigSchemaTest.php new file mode 100644 index 0000000..54d20de --- /dev/null +++ b/core/modules/block/src/Tests/BlockConfigSchemaTest.php @@ -0,0 +1,86 @@ + 'Block config schema', + 'description' => '', + 'group' => 'Block', + ); + } + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + + $this->typedConfig = \Drupal::service('config.typed'); + $this->blockManager = \Drupal::service('plugin.manager.block'); + } + + /** + * Tests the block config schema for block plugins. + */ + public function testBlockConfigSchema() { + foreach ($this->blockManager->getDefinitions() as $block_id => $definition) { + $id = strtolower($this->randomName()); + $block = Block::create(array( + 'id' => $id, + 'theme' => 'stark', + 'weight' => 00, + 'status' => TRUE, + 'region' => 'content', + 'plugin' => $block_id, + 'settings' => array( + 'label' => $this->randomName(), + 'provider' => 'system', + 'label_display' => FALSE, + ), + 'visibility' => array(), + )); + $block->save(); + + $config = \Drupal::config("block.block.$id"); + $this->assertEqual($config->get('id'), $id); + $this->assertConfigSchema($this->typedConfig, $config->getName(), $config->get()); + } + } + +} diff --git a/core/modules/book/config/schema/book.schema.yml b/core/modules/book/config/schema/book.schema.yml index ea8bd33..20d18bc 100644 --- a/core/modules/book/config/schema/book.schema.yml +++ b/core/modules/book/config/schema/book.schema.yml @@ -24,3 +24,11 @@ book.settings: child_type: type: string label: 'Content type for child pages' + +block.settings.book_navigation: + type: block_settings + label: 'Book navigation block' + mapping: + block_mode: + type: string + label: 'Block display mode' diff --git a/core/modules/forum/config/schema/forum.schema.yml b/core/modules/forum/config/schema/forum.schema.yml index 9ca1ed8..f74587c 100644 --- a/core/modules/forum/config/schema/forum.schema.yml +++ b/core/modules/forum/config/schema/forum.schema.yml @@ -38,3 +38,29 @@ forum.settings: vocabulary: type: string label: 'Forum vocabulary ID' + +block.settings.forum_active_block: + type: block_settings + label: 'Active forum topics block' + mapping: + properties: + type: sequence + label: 'Properties' + sequence: + - type: string + block_count: + type: integer + label: 'Block count' + +block.settings.forum_new_block: + type: block_settings + label: 'New forum topics block' + mapping: + properties: + type: sequence + label: 'Properties' + sequence: + - type: string + block_count: + type: integer + label: 'Block count' diff --git a/core/modules/node/config/schema/node.schema.yml b/core/modules/node/config/schema/node.schema.yml index 452266e..1d23050 100644 --- a/core/modules/node/config/schema/node.schema.yml +++ b/core/modules/node/config/schema/node.schema.yml @@ -138,3 +138,11 @@ action.configuration.node_unpublish_by_keyword_action: sequence: - type: sequence label: 'Keyword' + +block.settings.node_syndicate_block: + type: block_settings + label: 'Syndicate block' + mapping: + block_count: + type: integer + label: 'Block count' diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.schema.yml index 690a3ec..fcf031d 100644 --- a/core/modules/system/config/schema/system.schema.yml +++ b/core/modules/system/config/schema/system.schema.yml @@ -390,3 +390,17 @@ system.mail: system.theme.global: type: theme_settings label: 'Theme global settings' + +block.settings.system_branding_block: + type: block_settings + label: 'Branding block' + mapping: + use_site_logo: + type: boolean + label: 'Use site logo' + use_site_name: + type: boolean + label: 'Use site name' + use_site_slogan: + type: boolean + label: 'Use site slogan'