Skip to content

Commit d2f1ad0

Browse files
author
Hwashiang Yu
committed
MC-5810: Improve naming of the critical variables/parameters in the code and configuration
- Renamed panel group to menu in folder structure and reference
1 parent e452651 commit d2f1ad0

File tree

7 files changed

+27
-49
lines changed

7 files changed

+27
-49
lines changed

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

Lines changed: 2 additions & 2 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/group.js renamed to app/code/Magento/PageBuilder/view/adminhtml/web/js/panel/menu.js

Lines changed: 13 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/registry.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import ContentTypeConfigInterface from "./content-type-config.types";
1515
import {hideDropIndicators, showDropIndicators} from "./drag-drop/drop-indicators";
1616
import {setDraggedContentTypeConfig} from "./drag-drop/registry";
1717
import PageBuilder from "./page-builder";
18-
import {Group} from "./panel/group";
19-
import {ContentType as GroupContentType} from "./panel/group/content-type";
18+
import {Menu} from "./panel/menu";
19+
import {ContentType as GroupContentType} from "./panel/menu/content-type";
2020
import {supportsPositionSticky} from "./utils/position-sticky";
2121

2222
/**
@@ -231,7 +231,7 @@ export default class Panel {
231231
// Iterate through the groups creating new instances with their associated content types
232232
_.each(groups, (group, id) => {
233233
// Push the group instance into the observable array to update the UI
234-
this.groups.push(new Group(
234+
this.groups.push(new Menu(
235235
id,
236236
group,
237237
_.map(

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/panel/group.ts renamed to app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/panel/menu.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import ko from "knockout";
77

8-
export class Group {
8+
export class Menu {
99
public hidden: KnockoutObservable<boolean> = ko.observable(false);
1010
public id: KnockoutObservable<number> = ko.observable();
1111
public code: KnockoutObservable<string> = ko.observable("");
@@ -17,25 +17,25 @@ export class Group {
1717
public stageId: string;
1818

1919
/**
20-
* Group constructor
20+
* Menu constructor
2121
*
2222
* @param id
23-
* @param group
23+
* @param menu
2424
* @param contentTypes
2525
* @param stageId
2626
*/
27-
constructor(id: number, group: any, contentTypes: any[] = [], stageId: string) {
27+
constructor(id: number, menu: any, contentTypes: any[] = [], stageId: string) {
2828
this.id(id);
29-
this.code(group.code);
30-
this.label(group.label);
31-
this.icon(group.icon);
32-
this.sort(group.sort);
29+
this.code(menu.code);
30+
this.label(menu.label);
31+
this.icon(menu.icon);
32+
this.sort(menu.sort);
3333
this.contentTypes(contentTypes);
3434
this.stageId = stageId;
3535
}
3636

3737
/**
38-
* Toggle the group
38+
* Toggle the menu
3939
*/
4040
public toggle() {
4141
this.active(!this.active());

0 commit comments

Comments
 (0)