Skip to content

Commit 79c5241

Browse files
author
Lukasz Borowiec
authored
Merge pull request #549 from magento/514_3_content-snapshot-category-admin-page
#514: User sees content snapshot on Cate…
2 parents 4302e70 + 9c44921 commit 79c5241

File tree

17 files changed

+251
-91
lines changed

17 files changed

+251
-91
lines changed

app/code/Magento/PageBuilder/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Page,Page
1616
"Page with ID: %s doesn't exist","Page with ID: %s doesn't exist"
1717
"ID: %s","ID: %s"
1818
Condition,Condition
19+
Photo upload is available in full screen mode,Photo upload is available in full screen mode
1920
"This will change your Admin and storefront by:","This will change your Admin and storefront by:"
2021
"Removing PageBuilder's advanced content tools","Removing PageBuilder's advanced content tools"
2122
"from their assigned text fields and adding a basic text editor as replacement.","from their assigned text fields and adding a basic text editor as replacement."

app/code/Magento/PageBuilder/view/adminhtml/ui_component/category_form.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<item name="is_pagebuilder_enabled" xsi:type="boolean">true</item>
1515
<item name="pagebuilder_content_snapshot" xsi:type="boolean">true</item>
1616
<item name="pagebuilder_button" xsi:type="boolean">true</item>
17-
<item name="pagebuilder_stage_overlay" xsi:type="boolean">true</item>
1817
</item>
1918
</item>
2019
</argument>

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/_page-builder.less

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,26 @@
139139
}
140140
}
141141

142-
.pagebuilder-stage-overlay {
143-
display: none;
144-
height: 0;
145-
left: 0;
146-
position: absolute;
147-
top: 0;
148-
visibility: hidden;
149-
width: 0;
150-
151-
&.active {
152-
cursor: pointer;
153-
display: block;
154-
height: 100%;
155-
visibility: visible;
156-
width: 100%;
157-
z-index: @z-index-2;
142+
.page-builder-wysiwyg-wrapper {
143+
position: relative;
144+
145+
.pagebuilder-wysiwyg-overlay {
146+
display: none;
147+
height: 0;
148+
left: 0;
149+
position: absolute;
150+
top: 0;
151+
visibility: hidden;
152+
width: 0;
153+
154+
&.active {
155+
cursor: pointer;
156+
display: block;
157+
height: 100%;
158+
visibility: visible;
159+
width: 100%;
160+
z-index: @z-index-2;
161+
}
158162
}
159163
}
160164

app/code/Magento/PageBuilder/view/adminhtml/web/js/config.js

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/preview.js

Lines changed: 20 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/element/wysiwyg.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ define([
7979
initPageBuilder: function () {
8080
if (!this.isComponentInitialized()) {
8181
this.loading(true);
82-
this.pageBuilder = new PageBuilder(this.wysiwygConfigData(), this.initialValue);
82+
this.pageBuilder = new PageBuilder(
83+
this.wysiwygConfigData(),
84+
this.initialValue,
85+
Boolean(this.wysiwygConfigData()['pagebuilder_content_snapshot'])
86+
);
8387
events.trigger('pagebuilder:register', {
8488
ns: this.ns,
8589
instance: this.pageBuilder
@@ -93,8 +97,8 @@ define([
9397
selector: this.stageSelector
9498
}, this.disableDomObserver.bind(this));
9599

96-
if (this.wysiwygConfigData()['pagebuilder_stage_overlay']) {
97-
this.pageBuilder.hasStageOverlay(true);
100+
if (!this.wysiwygConfigData()['pagebuilder_button']) {
101+
this.visiblePageBuilder(true);
98102
}
99103

100104
if (!this.wysiwygConfigData()['pagebuilder_button'] ||

app/code/Magento/PageBuilder/view/adminhtml/web/js/page-builder.js

Lines changed: 26 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/panel.js

Lines changed: 22 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/utils/editor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/template/form/element/uploader/preview/image.html

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66
-->
7-
87
<div class="pagebuilder-image-uploader-container" data-role="drop-zone" css="_loading: isLoading, 'has-data': hasData()">
98
<div class="pagebuilder-options" data-bind="visible: hasData() || isShowImageUploadOptions">
109
<div class="pagebuilder-options-wrapper">
@@ -15,7 +14,7 @@
1514
class="file-uploader-button action-default"
1615
attr="for: uid"
1716
disable="disabled"
18-
translate="translations.uploadNewImage" />
17+
translate="translations.uploadNewImage"/>
1918
</li>
2019
<li class="pagebuilder-options-link">
2120
<label
@@ -31,34 +30,44 @@
3130
</div>
3231
<div class="file-uploader-spinner"></div>
3332
<div class="preview-image-container-loading-overlay"></div>
34-
<div class="pagebuilder-image-uploader-container-dropzone-overlay">
35-
<span class="dropzone-placeholder-text" translate="translations.dropHere"></span>
36-
</div>
33+
<if args="$parent.accessibility()">
34+
<div class="pagebuilder-image-uploader-container-dropzone-overlay">
35+
<span class="dropzone-placeholder-text" translate="translations.dropHere"></span>
36+
</div>
37+
</if>
3738
<div class="pagebuilder-image-empty-preview" data-bind="visible: !hasData() && isShowImageUploadInstructions">
3839
<div class="admin__field-control">
3940
<div class="file-uploader image-uploader">
40-
<div class="file-uploader-area">
41-
<p class="image-upload-instructions" translate="translations.dragImageHere"></p>
42-
<input type="file" afterRender="onElementRender" attr="id: uid, name: inputName, multiple: isMultipleFiles" disable="disabled" />
43-
<label class="file-uploader-button action-default" attr="for: uid" disable="disabled" translate="translations.uploadImage" />
44-
<span translate="translations.or"></span>
45-
<label
46-
data-bind="event: {change: addFileFromMediaGallery, click: openMediaBrowserDialog}"
47-
class="file-uploader-button action-default"
48-
attr="id: mediaGalleryUid, 'data-id': getFileId()"
49-
disable="disabled"
50-
data-force_static_path="1"
51-
translate="translations.selectFromGallery"/>
52-
<render args="fallbackResetTpl" if="$data.showFallbackReset && $data.isDifferedFromDefault"/>
53-
<p class="image-upload-requirements">
54-
<span if="$data.maxFileSize">
55-
<span translate="translations.maximumFileSize" />: <text args="formatSize($data.maxFileSize)"/>.
56-
</span>
57-
<span if="$data.allowedExtensions">
58-
<span translate="translations.allowedFileTypes" />: <text args="getAllowedFileExtensionsInCommaDelimitedFormat()"/>.
59-
</span>
60-
</p>
61-
</div>
41+
<if args="$parent.accessibility()">
42+
<div class="file-uploader-area">
43+
<p class="image-upload-instructions" translate="translations.dragImageHere"></p>
44+
<input type="file" afterRender="onElementRender" attr="id: uid, name: inputName, multiple: isMultipleFiles" disable="disabled"/>
45+
<label class="file-uploader-button action-default" attr="for: uid" disable="disabled" translate="translations.uploadImage"/>
46+
<span translate="translations.or"></span>
47+
<label
48+
data-bind="event: {change: addFileFromMediaGallery, click: openMediaBrowserDialog}"
49+
class="file-uploader-button action-default"
50+
attr="id: mediaGalleryUid, 'data-id': getFileId()"
51+
disable="disabled"
52+
data-force_static_path="1"
53+
translate="translations.selectFromGallery"/>
54+
<render args="fallbackResetTpl" if="$data.showFallbackReset && $data.isDifferedFromDefault"/>
55+
<p class="image-upload-requirements">
56+
<span if="$data.maxFileSize">
57+
<span translate="translations.maximumFileSize"/>: <text args="formatSize($data.maxFileSize)"/>.
58+
</span>
59+
<span if="$data.allowedExtensions">
60+
<span translate="translations.allowedFileTypes"/>: <text args="getAllowedFileExtensionsInCommaDelimitedFormat()"/>.
61+
</span>
62+
</p>
63+
</div>
64+
</if>
65+
<ifnot args="$parent.accessibility()">
66+
<div class="image-uploader-preview-information">
67+
<h4 class="title" translate="'Preview Mode'"></h4>
68+
<p class="description" translate="'Photo upload is available in full screen mode'"></p>
69+
</div>
70+
</ifnot>
6271
</div>
6372
</div>
6473
</div>

0 commit comments

Comments
 (0)