Skip to content

Commit 0e31e0d

Browse files
Merge branch 'MAGETWO-49195' into MAGETWO-48913
2 parents 39b168f + d3f5065 commit 0e31e0d

File tree

4 files changed

+30
-161
lines changed

4 files changed

+30
-161
lines changed

app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/WysiwygTest.php

Lines changed: 0 additions & 65 deletions
This file was deleted.

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
use Magento\Framework\App\RequestInterface;
2222
use Magento\Framework\Filter\Translit;
2323
use Magento\Store\Model\StoreManagerInterface;
24-
use Magento\Ui\Component\Form\Element\Checkbox;
2524
use Magento\Ui\Component\Form\Field;
2625
use Magento\Ui\Component\Form\Fieldset;
2726
use Magento\Ui\DataProvider\EavValidationRules;
2827
use Magento\Ui\DataProvider\Mapper\FormElement as FormElementMapper;
2928
use Magento\Ui\DataProvider\Mapper\MetaProperties as MetaPropertiesMapper;
29+
use Magento\Ui\Component\Form\Element\Wysiwyg as WysiwygElement;
3030

3131
/**
3232
* Class Eav
@@ -225,7 +225,7 @@ protected function getAttributesMeta(array $attributes, $groupCode)
225225

226226
$child = $this->setupMetaProperties($attribute);
227227

228-
$meta['container_' . $code] = [
228+
$meta[static::CONTAINER_PREFIX . $code] = [
229229
'arguments' => [
230230
'data' => [
231231
'config' => [
@@ -240,6 +240,11 @@ protected function getAttributesMeta(array $attributes, $groupCode)
240240
],
241241
];
242242

243+
if ($attribute->getIsWysiwygEnabled()) {
244+
$meta[static::CONTAINER_PREFIX . $code]['arguments']['data']['config']['component'] =
245+
'Magento_Ui/js/form/components/group';
246+
}
247+
243248
$child['arguments']['data']['config']['code'] = $code;
244249
$child['arguments']['data']['config']['source'] = $groupCode;
245250
$child['arguments']['data']['config']['scopeLabel'] = $this->getScopeLabel($attribute);
@@ -456,6 +461,27 @@ protected function setupMetaProperties(ProductAttributeInterface $attribute)
456461
$meta['arguments']['data']['config']['options'] = $attributeModel->getSource()->getAllOptions();
457462
}
458463

464+
$meta = $this->addWysiwyg($attribute, $meta);
465+
466+
return $meta;
467+
}
468+
469+
/**
470+
* Add wysiwyg properties
471+
*
472+
* @param ProductAttributeInterface $attribute
473+
* @param array $meta
474+
* @return array
475+
*/
476+
private function addWysiwyg(ProductAttributeInterface $attribute, array $meta)
477+
{
478+
if (!$attribute->getIsWysiwygEnabled()) {
479+
return $meta;
480+
}
481+
482+
$meta['arguments']['data']['config']['formElement'] = WysiwygElement::NAME;
483+
$meta['arguments']['data']['config']['wysiwyg'] = true;
484+
459485
return $meta;
460486
}
461487

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Wysiwyg.php

Lines changed: 0 additions & 88 deletions
This file was deleted.

app/code/Magento/Catalog/etc/adminhtml/di.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,13 @@
129129
<item name="class" xsi:type="string">Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Images</item>
130130
<item name="sortOrder" xsi:type="number">100</item>
131131
</item>
132-
<item name="wysiwyg" xsi:type="array">
133-
<item name="class" xsi:type="string">Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Wysiwyg</item>
134-
<item name="sortOrder" xsi:type="number">110</item>
135-
</item>
136132
<item name="related" xsi:type="array">
137133
<item name="class" xsi:type="string">Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related</item>
138-
<item name="sortOrder" xsi:type="number">120</item>
134+
<item name="sortOrder" xsi:type="number">110</item>
139135
</item>
140136
<item name="attributes" xsi:type="array">
141137
<item name="class" xsi:type="string">Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Attributes</item>
142-
<item name="sortOrder" xsi:type="number">130</item>
138+
<item name="sortOrder" xsi:type="number">120</item>
143139
</item>
144140
</argument>
145141
</arguments>

0 commit comments

Comments
 (0)