Skip to content

Commit 86ac493

Browse files
authored
Merge pull request #46 from magento-obsessive-owls/cms-team-2-sprint-7
[CMS Team 2 - Sprint 7] File Restructure and Banner Placeholder Bug
2 parents f1dd583 + 5bb9b3f commit 86ac493

File tree

664 files changed

+4472
-6530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

664 files changed

+4472
-6530
lines changed

app/code/Magento/PageBuilder/Block/Adminhtml/System/Config/EnableField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private function getModalTitleText()
6666
private function getModalContentBody()
6767
{
6868
$templateFileName = $this->getTemplateFile(
69-
'Magento_PageBuilder::system/config/enableField/modalContentBody.phtml'
69+
'Magento_PageBuilder::system/config/enable_field/modal_content_body.phtml'
7070
);
7171

7272
return $this->fetchView($templateFileName);

app/code/Magento/PageBuilder/Component/Form/Element/Wysiwyg.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public function __construct(
5959
$data['config']['component'] = 'Magento_PageBuilder/js/form/element/wysiwyg';
6060

6161
// Override the templates to include our KnockoutJS code
62-
$data['config']['template'] = 'Magento_PageBuilder/wysiwyg';
63-
$data['config']['elementTmpl'] = 'Magento_PageBuilder/wysiwyg';
62+
$data['config']['template'] = 'Magento_PageBuilder/form/element/wysiwyg';
63+
$data['config']['elementTmpl'] = 'Magento_PageBuilder/form/element/wysiwyg';
6464
$wysiwygConfigData = $stageConfig->getConfig();
6565
$data['config']['wysiwygConfigData'] = isset($config['wysiwygConfigData']) ?
6666
array_replace_recursive($config['wysiwygConfigData'], $wysiwygConfigData) :

app/code/Magento/PageBuilder/Model/Config/ContentTypes/Converter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ private function convertHtml(\DOMElement $elementNode): array
358358
$htmlNode = $elementNode->getElementsByTagName('html')->item(0);
359359
if ($htmlNode) {
360360
$htmlData['var']= $this->getAttributeValue($htmlNode, 'var');
361-
$htmlData['placeholder'] = $this->getAttributeValue($htmlNode, 'placeholder');
362361
$htmlData['converter'] = $this->getAttributeValue($htmlNode, 'converter');
363362
$htmlData['preview_converter'] = $this->getAttributeValue($htmlNode, 'preview_converter');
364363
}

app/code/Magento/PageBuilder/Model/Stage/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
class Config
1111
{
12-
const DEFAULT_PREVIEW_COMPONENT = 'Magento_PageBuilder/js/preview';
13-
const DEFAULT_CONTENT_COMPONENT = 'Magento_PageBuilder/js/content';
12+
const DEFAULT_PREVIEW_COMPONENT = 'Magento_PageBuilder/js/content-type/preview';
13+
const DEFAULT_CONTENT_COMPONENT = 'Magento_PageBuilder/js/content-type/content';
1414

1515
/**
1616
* @var \Magento\PageBuilder\Model\Config\ConfigInterface

app/code/Magento/PageBuilder/Model/Wysiwyg/DefaultConfigProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function getConfig($config): \Magento\Framework\DataObject
6767
),
6868
'content_css' => [
6969
$this->assetRepo->getUrl('mage/adminhtml/wysiwyg/tiny_mce/themes/ui.css'),
70-
$this->assetRepo->getUrl('Magento_PageBuilder/css/source/wysiwyg/tinymce.css')
70+
$this->assetRepo->getUrl('Magento_PageBuilder/css/source/form/element/tinymce.css')
7171
]
7272
],
7373
'settings' => $this->additionalSettings

app/code/Magento/PageBuilder/Setup/DataConverter/Renderer/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function render(array $itemData, array $additionalData = [])
7474
}
7575

7676
$rootElementAttributes = [
77-
'data-role' => 'products',
77+
'data-role' => 'product',
7878
'data-appearance' => 'default',
7979
'class' => $eavData['css_classes'] ?? '',
8080
'data-view-mode' => $eavData['product_display'] ?? '',

app/code/Magento/PageBuilder/Setup/DataConverter/Renderer/ProductList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function render(array $itemData, array $additionalData = [])
4545
$eavData = $this->eavAttributeLoader->load($itemData['entityId']);
4646

4747
$rootElementAttributes = [
48-
'data-role' => 'products-list',
48+
'data-role' => 'product-list',
4949
'data-appearance' => 'default',
5050
'class' => $itemData['formData']['css_classes'] ?? '',
5151
'data-category-id' => $eavData['category_id'] ?? '',

app/code/Magento/PageBuilder/Setup/DataConverter/Renderer/Search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function render(array $itemData, array $additionalData = [])
5454
$searchPlaceHolder = $eavData['placeholder'] ?? '';
5555

5656
$searchHtml = "{{block class='Magento\Framework\View\Element\Template' " .
57-
"template='Magento_PageBuilder::pagebuilder/blocks/core/search.phtml' " .
57+
"template='Magento_PageBuilder::content_type/search.phtml' " .
5858
"placeholder=\"$searchPlaceHolder\" classes=\"$searchClasses\" styles=\"$searchStyles\"}}";
5959
$rootElementHtml = '<div data-role="html" data-appearance="default">';
6060

app/code/Magento/PageBuilder/docs/content-type-configuration.md

Lines changed: 62 additions & 61 deletions
Large diffs are not rendered by default.

app/code/Magento/PageBuilder/docs/additional-data.md renamed to app/code/Magento/PageBuilder/docs/custom-configuration.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To add customization to a Page Builder content type, you must:
1616

1717
## Add additional data to the XML config {#additional-data}
1818

19-
Use `additional_data` in your `/app/code/Magento/PageBuilder/etc/content_types/<your-content-type>.xml` XML config file to add custom configuration to a content type:
19+
Use `additional_data` in your `Vendor/ModuleName/etc/content_types/<your-content-type>.xml` XML config file to add custom configuration to a content type:
2020

2121
``` xml
2222
<additional_data>
@@ -30,8 +30,8 @@ Use `additional_data` in your `/app/code/Magento/PageBuilder/etc/content_types/<
3030
<item name="uploaderConfig" xsi:type="array">
3131
<item name="url" xsi:type="object">Magento\PageBuilder\Model\Config\ContentTypes\AdditionalData\Provider\Uploader\SaveUrl</item>
3232
</item>
33-
<item name="previewTmpl" xsi:type="string">Magento_PageBuilder/form/element/uploader/preview/image</item>
34-
<item name="template" xsi:type="string">Magento_PageBuilder/form/element/stage/preview/uploader/image</item>
33+
<item name="previewTmpl" xsi:type="string">Magento_PageBuilder/form/element/uploader/preview</item>
34+
<item name="template" xsi:type="string">Magento_PageBuilder/form/element/uploader/preview/image</item>
3535
<item name="mediaGallery" xsi:type="array">
3636
<item name="openDialogUrl" xsi:type="object">Magento\PageBuilder\Model\Config\ContentTypes\AdditionalData\Provider\Uploader\OpenDialogUrl</item>
3737
<item name="openDialogTitle" xsi:type="string" translate="true">Insert Images...</item>
@@ -86,25 +86,25 @@ In the `additional_data` XML config there is a `storeId` item with a `storeId` p
8686
<item name="storeId" xsi:type="object">\Magento\PageBuilder\Model\Config\ContentTypes\AdditionalData\Provider\StoreId</item>
8787
```
8888

89-
Custom configuration is injected into relevant content type block constructors (JS), such as for the image block shown here, and accessed in `config.additional_data` within the content block type in `/app/code/Magento/PageBuilder/view/adminhtml/web/js/component/block/<your-content-type>.js`:
89+
Custom configuration is injected into relevant content type block constructors, such as for the image block shown here, and accessed in `config.additional_data` within the content block type in `/app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/<your-content-type>/preview.js`:
9090

9191
``` js
9292
var uploaderConfiguration = Object.assign(
93-
{},
94-
config.additional_data.uploaderConfig,
95-
{
96-
value: this.stage.store.get(this.id).image,
97-
},
93+
{},
94+
config.additional_data.uploaderConfig,
95+
{
96+
value: this.dataStore.get().image,
97+
},
9898
);
9999

100100
// Create uploader
101101
this.uploader = new Uploader(
102-
this.id,
103-
"imageuploader_" + this.id,
104-
Object.assign({}, uploaderConfiguration, {
105-
value: this.stage.store.get(this.id).image,
106-
}),
107-
uploaderConfiguration,
102+
this.id,
103+
"imageuploader_" + this.id,
104+
Object.assign({}, uploaderConfiguration, {
105+
value: this.dataStore.get().image,
106+
}),
107+
uploaderConfiguration,
108108
);
109109
```
110110

0 commit comments

Comments
 (0)