Skip to content
Snippets Groups Projects
Commit 844644e2 authored by Aliaksei Linich's avatar Aliaksei Linich Committed by Sascha Grossenbacher
Browse files

Issue #3445936 by linichalexey: Add description to paragraphs selection in reference fields

parent f002e6c3
No related branches found
No related tags found
1 merge request!111Issue #3445936: Add description to paragraphs selection in reference field configuration
Pipeline #246020 passed with warnings
......@@ -47,6 +47,8 @@ class ParagraphSelection extends DefaultSelection {
$bundle_options_simple[$bundle_name] = $bundle_info['label'];
$bundle_options[$bundle_name] = array(
'label' => $bundle_info['label'],
'description' => $this->entityTypeManager->getStorage('paragraphs_type')
->load($bundle_name)?->getDescription(),
'enabled' => $this->configuration['target_bundles_drag_drop'][$bundle_name]['enabled'] ?? FALSE,
'weight' => $this->configuration['target_bundles_drag_drop'][$bundle_name]['weight'] ?? $weight,
);
......@@ -78,6 +80,7 @@ class ParagraphSelection extends DefaultSelection {
'#type' => 'table',
'#header' => [
$this->t('Type'),
$this->t('Description'),
$this->t('Weight'),
],
'#attributes' => [
......@@ -114,6 +117,10 @@ class ParagraphSelection extends DefaultSelection {
'#default_value' => $bundle_info['enabled'],
);
$form['target_bundles_drag_drop'][$bundle_name]['description'] = [
'#markup' => $bundle_info['description'],
];
$form['target_bundles_drag_drop'][$bundle_name]['weight'] = array(
'#type' => 'weight',
'#default_value' => (int) $bundle_info['weight'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment