Skip to content

Commit 72c8191

Browse files
Merge branch '510_content-snapshot-cms-admin-page' of github.com:magento/magento2-page-builder into 510_7_content-snapshot-cms-admin-page
2 parents 0efe4a4 + cae2fb7 commit 72c8191

9 files changed

+24
-43
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/StageActionGroup/ValidatePageBuilderPreviewActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</arguments>
1717
<waitForElementVisible selector="{{pageBuilderArea}}{{PageBuilderStage.editWithPageBuilderButton}}" stepKey="waitForEditWithPageBuilderButton"/>
1818
<see userInput="Edit with Page Builder" selector="{{pageBuilderArea}}{{PageBuilderStage.editWithPageBuilderButton}}" stepKey="seeEditWithPageBuilderButton"/>
19-
<dontSeeElementInDOM selector="{{PageBuilderPanel.leftPanel}}" stepKey="dontSeePageBuilderContentTypePanel"/>
19+
<dontSeeElement selector="{{PageBuilderPanel.leftPanel}}" stepKey="dontSeePageBuilderContentTypePanel"/>
2020
<dontSeeElementInDOM selector="{{pageBuilderArea}}{{PageBuilderStage.applyTemplateButton}}" stepKey="dontSeePageBuilderApplyTemplateButton"/>
2121
<dontSeeElementInDOM selector="{{pageBuilderArea}}{{PageBuilderStage.saveAsTemplateButton}}" stepKey="dontSeePageBuilderSaveAsTemplateButton"/>
2222
<waitForElementVisible selector="{{PageBuilderStage.stageOverlay}}" stepKey="waitForStageOverlay"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminCatalogProductPageBuilderTest/PageBuilderCatalogProductCreateProductWithFullWidthPageBuilderAttributeTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<actionGroup ref="openPageBuilderForAttribute" stepKey="openPageBuilderForAttribute">
5757
<argument name="attributeCode" value="$$createWysiwygAttribute.attribute_code$$"/>
5858
</actionGroup>
59-
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
59+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage">
6060
<argument name="contentType" value="PageBuilderRowContentType"/>
6161
</actionGroup>
6262
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterBackgroundColor">
@@ -76,8 +76,9 @@
7676
<actionGroup ref="openPageBuilderForAttribute" stepKey="openPageBuilderForDescription">
7777
<argument name="attributeCode" value="description"/>
7878
</actionGroup>
79-
<actionGroup ref="openPageBuilderEditPanel" stepKey="openDescriptionEditMenuOnStage">
79+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openDescriptionEditMenuOnStage">
8080
<argument name="contentType" value="PageBuilderRowContentType"/>
81+
<argument name="contentTypeIndex" value="2"/>
8182
</actionGroup>
8283
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterDescriptionRowBackgroundColor">
8384
<argument name="property" value="PageBuilderBackgroundColor_HSV_Orange"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminCatalogProductPageBuilderTest/PageBuilderCatalogProductProductFullWidthValidateAttributeOrderTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<actionGroup ref="openPageBuilderForAttribute" stepKey="openPageBuilderForAttribute1">
6868
<argument name="attributeCode" value="$$createPageBuilderAttribute1.attribute_code$$"/>
6969
</actionGroup>
70-
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
70+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage">
7171
<argument name="contentType" value="PageBuilderRowContentType"/>
7272
</actionGroup>
7373
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterBackgroundColor">
@@ -86,8 +86,9 @@
8686
<actionGroup ref="openPageBuilderForAttribute" stepKey="openPageBuilderForAttribute2">
8787
<argument name="attributeCode" value="$$createPageBuilderAttribute2.attribute_code$$"/>
8888
</actionGroup>
89-
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage1">
89+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage1">
9090
<argument name="contentType" value="PageBuilderRowContentType"/>
91+
<argument name="contentTypeIndex" value="2"/>
9192
</actionGroup>
9293
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterBackgroundColor1">
9394
<argument name="property" value="PageBuilderBackgroundColor_Plaintext_Green"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminCatalogProductPageBuilderTest/PageBuilderCatalogProductStorefrontPageBuilderFullWidthProductsContentsAreOrderedCorrectlyTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<actionGroup ref="openPageBuilderForAttribute" stepKey="openPageBuilderForAttribute1">
6161
<argument name="attributeCode" value="$$createPageBuilderAttribute.attribute_code$$"/>
6262
</actionGroup>
63-
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
63+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage">
6464
<argument name="contentType" value="PageBuilderRowContentType"/>
6565
</actionGroup>
6666
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterBackgroundColor">
@@ -83,8 +83,9 @@
8383
</actionGroup>
8484
<!-- Set background color of row -->
8585
<comment userInput="Set background color of row" stepKey="commentSetRowBackgroundColor"/>
86-
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage1">
86+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage1">
8787
<argument name="contentType" value="PageBuilderRowContentType"/>
88+
<argument name="contentTypeIndex" value="2"/>
8889
</actionGroup>
8990
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterBackgroundColor1">
9091
<argument name="property" value="PageBuilderBackgroundColorProperty_3C3C3C"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminCatalogProductPageBuilderTest/PageBuilderWorksForEachCatalogProductAttributeTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
<actionGroup ref="dragContentTypeToContainer" stepKey="dragButtonsToRow">
113113
<argument name="contentType" value="PageBuilderButtonsContentType"/>
114114
<argument name="containerTargetType" value="PageBuilderRowContentType"/>
115+
<argument name="containerTargetIndex" value="2"/>
115116
<argument name="pageBuilderArea" value="{{PageBuilderProductAttribute.PageBuilderArea('description')}}"/>
116117
</actionGroup>
117118
<!-- Edit Button Item -->
@@ -153,6 +154,7 @@
153154
<actionGroup ref="dragContentTypeToContainer" stepKey="dragDividerIntoRow">
154155
<argument name="contentType" value="PageBuilderDividerContentType"/>
155156
<argument name="containerTargetType" value="PageBuilderRowContentType"/>
157+
<argument name="containerTargetIndex" value="3"/>
156158
<argument name="pageBuilderArea" value="{{PageBuilderProductAttribute.PageBuilderArea('short_description')}}"/>
157159
</actionGroup>
158160
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuForDivider">

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

Lines changed: 4 additions & 17 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/template/page-builder.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
attr="{title: isFullScreen() ? $t('Close Full Screen') : $t('Open in Full Screen')}">
1818
</i>
1919
</div>
20-
<with args="panel" if="!isSnapshot()">
20+
<with args="panel">
2121
<render/>
2222
</with>
2323
<if args="isStageReady">

app/code/Magento/PageBuilder/view/adminhtml/web/template/panel.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66
-->
77

8-
<div id="pagebuilder-panel-wrapper" class="pagebuilder-panel-wrapper"
9-
css="visible: isVisible, 'sticky-top': isStickyTop, 'sticky-bottom': isStickyBottom, 'transition-out': pageBuilder.isSnapshotTransition"
10-
afterRender="afterRender">
8+
<div id="pagebuilder-panel-wrapper" class="pagebuilder-panel-wrapper" visible="!pageBuilder.isSnapshot()"
9+
css="visible: isVisible(), 'sticky-top': isStickyTop, 'sticky-bottom': isStickyBottom, 'transition-out': pageBuilder.isSnapshotTransition"
10+
afterRender="afterRender">
1111
<div id="pagebuilder-panel" class="pagebuilder-panel">
1212
<div class="search-content-types">
1313
<label for="search-content-types-input"></label>

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ export default class PageBuilder implements PageBuilderInterface {
4949
this.preloadTemplates(config);
5050
this.initialValue = initialValue;
5151
this.isFullScreen(config.isFullScreen);
52-
this.isSnapshot(config.pagebuilder_content_snapshot);
52+
this.isSnapshot(!!config.pagebuilder_content_snapshot);
5353
this.isSnapshotTransition(false);
54-
this.snapshot = config.pagebuilder_content_snapshot;
54+
this.snapshot = !!config.pagebuilder_content_snapshot;
5555
this.config = config;
5656

5757
this.isAllowedTemplateApply = isAllowed(resources.TEMPLATE_APPLY);
@@ -84,7 +84,6 @@ export default class PageBuilder implements PageBuilderInterface {
8484
*/
8585
public initListeners() {
8686
events.on(`stage:${ this.id }:toggleFullscreen`, this.toggleFullScreen.bind(this));
87-
events.on(`stage:fullScreenModeChangeAfter`, this.toggleStage.bind(this));
8887
this.isFullScreen.subscribe(() => this.onFullScreenChange());
8988
}
9089

@@ -109,8 +108,6 @@ export default class PageBuilder implements PageBuilderInterface {
109108

110109
if (!this.isFullScreen()) {
111110
pageBuilderWrapper.css("height", pageBuilderWrapper.outerHeight());
112-
this.previousPanelHeight = panel.outerHeight();
113-
panel.css("height", this.previousPanelHeight + "px");
114111
/**
115112
* Fix the stage in the exact place it is when it's part of the content and allow it to transition to full
116113
* screen.
@@ -130,6 +127,8 @@ export default class PageBuilder implements PageBuilderInterface {
130127
this.isSnapshot(false);
131128
this.stageStyles(this.previousStyles);
132129
} else {
130+
this.previousPanelHeight = panel.outerHeight();
131+
panel.css("height", this.previousPanelHeight + "px");
133132
this.wrapperStyles(this.previousStyles);
134133
}
135134

@@ -257,14 +256,4 @@ export default class PageBuilder implements PageBuilderInterface {
257256
require(previewTemplates);
258257
});
259258
}
260-
261-
/**
262-
* Renders only active stages.
263-
* @param args
264-
*/
265-
private toggleStage(args: any): void {
266-
if (Config.getConfig("pagebuilder_content_snapshot")) {
267-
this.isStageReady(args.pageBuilderId === this.id && this.isFullScreen() || !args.fullScreen);
268-
}
269-
}
270259
}

0 commit comments

Comments
 (0)