Skip to content

Commit 4098141

Browse files
committed
MC-35104: Tracking Page Builder content type
- Trigger specific event for edit
1 parent 674bd06 commit 4098141

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

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

Lines changed: 4 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: 4 additions & 4 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/content-type-menu/edit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class Edit {
2929
*/
3030
public open(): void {
3131
const contentTypeData = this.dataStore.getState();
32-
32+
events.trigger("contentType:editBefore", { contentType: this.instance } );
3333
events.trigger("form:renderAfter", {
3434
data: contentTypeData,
3535
appearances: this.instance.config.appearances,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,20 +500,20 @@ export default class Preview implements PreviewInterface {
500500
/**
501501
* Dispatch content type visibility events
502502
*
503-
* @param {ContentTypeInterface | ContentTypeCollectionInterface} originalContentType
503+
* @param {ContentTypeInterface | ContentTypeCollectionInterface} contentType
504504
* @param {boolean} visibility
505505
*/
506506
protected dispatchContentTypeVisibilityEvents(
507-
originalContentType: ContentTypeInterface | ContentTypeCollectionInterface,
507+
contentType: ContentTypeInterface | ContentTypeCollectionInterface,
508508
visibility: boolean,
509509
) {
510510
const visibilityEventParams = {
511-
originalContentType,
511+
contentType,
512512
visibility,
513513
};
514514

515515
events.trigger("contentType:visibilityAfter", visibilityEventParams);
516-
events.trigger(originalContentType.config.name + ":visibilityAfter", visibilityEventParams);
516+
events.trigger(contentType.config.name + ":visibilityAfter", visibilityEventParams);
517517
}
518518

519519
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ define(['underscore'], function (_) {
3434
action = 'create';
3535
break;
3636

37-
case 'renderAfter':
37+
case 'editBefore':
3838
action = 'edit';
3939
break;
4040

0 commit comments

Comments
 (0)