Skip to content

Commit 8b0e703

Browse files
author
Lukasz Borowiec
committed
#514: User sees content snapshot on Category Page in Admin Panel - fixed for funcional tests
1 parent 4dd6243 commit 8b0e703

File tree

9 files changed

+39
-3
lines changed

9 files changed

+39
-3
lines changed

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

Lines changed: 11 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: 3 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/page-builder.js

Lines changed: 1 addition & 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/panel.js

Lines changed: 2 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/ts/js/config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ export default class Config {
4545
Config.contentSnapshot = contentSnapshot;
4646
}
4747

48+
/**
49+
* Set the content snapshot flag to inform other components about fullscreen mode
50+
* when page builder is enabled
51+
*
52+
* @param flag
53+
*/
54+
public static setContentSnapshotFullScreenMode(flag: boolean): void
55+
{
56+
Config.contentSnapshot.isFullScreen = flag;
57+
}
58+
4859
/**
4960
* Retrieve the current instances mode
5061
*/

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type ContentSnapshot = true | false;
2424
export interface ContentSnapshotInterface
2525
{
2626
pageBuilderId: string;
27+
isFullScreen: boolean;
2728
contentSnapshotMode: ContentSnapshot;
2829
}
2930

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default class Preview implements PreviewInterface {
9191
"empty-placeholder-background": this.isPlaceholderVisible,
9292
});
9393

94-
if (Config.getContentSnapshot().contentSnapshotMode) {
94+
if (Config.getContentSnapshot().contentSnapshotMode && !Config.getContentSnapshot().isFullScreen) {
9595
this.accessibility(false);
9696
}
9797

@@ -652,6 +652,7 @@ export default class Preview implements PreviewInterface {
652652
{
653653
if (Config.getContentSnapshot().contentSnapshotMode) {
654654
this.accessibility(args.fullScreen);
655+
Config.setContentSnapshotFullScreenMode(args.fullScreen);
655656
}
656657
}
657658
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ export default class PageBuilder implements PageBuilderInterface {
4343
constructor(config: any, initialValue: string, contentSnapshot: boolean) {
4444
Config.setConfig(config);
4545
Config.setMode("Preview");
46-
Config.setContentSnapshot({pageBuilderId: this.id, contentSnapshotMode: contentSnapshot});
46+
Config.setContentSnapshot(
47+
{
48+
pageBuilderId: this.id,
49+
isFullScreen: config.isFullScreen,
50+
contentSnapshotMode: contentSnapshot
51+
}
52+
);
4753
this.preloadTemplates(config);
4854
this.initialValue = initialValue;
4955
this.isFullScreen(config.isFullScreen);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ export default class Panel {
288288
private toggleVisibility(args: any): void
289289
{
290290
if (Config.getContentSnapshot().contentSnapshotMode) {
291+
Config.setContentSnapshotFullScreenMode(args.fullScreen);
291292
this.isVisible(args.fullScreen);
292293
}
293294
}

0 commit comments

Comments
 (0)