Skip to content

Commit 219b383

Browse files
committed
MC-4126: Duplicate row border after switching Row appearance
- Resolve further typing issues
1 parent a93d10e commit 219b383

24 files changed

+98
-86
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/tabs/preview.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/js/drag-drop/move-content-type.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/js/master-format/read/configurable.js

Lines changed: 20 additions & 19 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/property/link.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/ts/js/collection.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import { moveArrayItemIntoArray, removeArrayItem } from "./utils/array";
1212
* @api
1313
*/
1414
export default class Collection {
15-
public children: KnockoutObservableArray<any>;
15+
public children: KnockoutObservableArray<ContentTypeInterface | ContentTypeCollectionInterface>;
1616

17-
constructor(children?: KnockoutObservableArray<any>) {
17+
constructor(children?: KnockoutObservableArray<ContentTypeInterface | ContentTypeCollectionInterface>) {
1818
this.children = children ? children : ko.observableArray([]);
1919
}
2020

@@ -56,7 +56,7 @@ export default class Collection {
5656
*
5757
* @param children
5858
*/
59-
public setChildren(children: KnockoutObservableArray<any>) {
59+
public setChildren(children: KnockoutObservableArray<ContentTypeInterface | ContentTypeCollectionInterface>) {
6060
this.children = children;
6161
}
6262
}

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {getDragColumn, removeDragColumn, setDragColumn} from "./registry";
3838
* @api
3939
*/
4040
export default class Preview extends PreviewCollection {
41+
public parent: ContentTypeCollectionInterface<ColumnGroupPreview>;
4142
public resizing: KnockoutObservable<boolean> = ko.observable(false);
4243
public hasEmptyChild: KnockoutComputed<boolean> = ko.computed(() => {
4344
let empty: boolean = false;
@@ -347,9 +348,7 @@ export default class Preview extends PreviewCollection {
347348
const columnInstance: ContentTypeCollectionInterface = ko.dataFor($(event.target)[0]);
348349
// Use the global state as columns can be dragged between groups
349350
setDragColumn((columnInstance.parent as ContentTypeCollectionInterface<ColumnPreview>));
350-
this.dropPositions = calculateDropPositions(
351-
this.parent as ContentTypeCollectionInterface<ColumnGroupPreview>,
352-
);
351+
this.dropPositions = calculateDropPositions(this.parent);
353352

354353
events.trigger("column:dragStart", {
355354
column: columnInstance,
@@ -395,7 +394,7 @@ export default class Preview extends PreviewCollection {
395394
if (newGridSize !== this.resizeUtils.getGridSize()) {
396395
try {
397396
resizeGrid(
398-
(this.parent as ContentTypeCollectionInterface<Preview>),
397+
this.parent,
399398
newGridSize,
400399
this.gridSizeHistory,
401400
);
@@ -777,9 +776,7 @@ export default class Preview extends PreviewCollection {
777776
if (dragColumn) {
778777
// If the drop positions haven't been calculated for this group do so now
779778
if (this.dropPositions.length === 0) {
780-
this.dropPositions = calculateDropPositions(
781-
this.parent as ContentTypeCollectionInterface<ColumnGroupPreview>,
782-
);
779+
this.dropPositions = calculateDropPositions(this.parent);
783780
}
784781
const columnInstance = dragColumn;
785782
const currentX = event.pageX - groupPosition.left;

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/content-type-after-render-event-params.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ import ContentTypeInterface from "../content-type.d";
1212
export default interface ContentTypeAfterRenderEventParamsInterface {
1313
id: string;
1414
element: Element;
15-
contentType: ContentTypeInterface & ContentTypeCollectionInterface;
15+
contentType: ContentTypeInterface | ContentTypeCollectionInterface;
1616
}

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/content-type-before-move-event-params.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import ContentTypeInterface from "../content-type.d";
1010
* @api
1111
*/
1212
export interface ContentTypeBeforeMoveEventParams {
13-
contentType: ContentTypeInterface & ContentTypeCollectionInterface;
13+
contentType: ContentTypeInterface | ContentTypeCollectionInterface;
1414
sourceParent: ContentTypeCollectionInterface;
1515
targetParent: ContentTypeCollectionInterface;
1616
targetIndex: number;

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/content-type-create-event-params.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ import ContentTypeInterface from "../content-type.d";
1111
*/
1212
export default interface ContentTypeCreateEventParamsInterface {
1313
id: string;
14-
contentType: ContentTypeInterface & ContentTypeCollectionInterface;
14+
contentType: ContentTypeInterface | ContentTypeCollectionInterface;
1515
}

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/content-type-dropped-create-event-params.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ import ContentTypeInterface from "../content-type.d";
1111
*/
1212
export default interface ContentTypeDroppedCreateEventParamsInterface {
1313
id: string;
14-
contentType: ContentTypeInterface & ContentTypeCollectionInterface;
14+
contentType: ContentTypeInterface | ContentTypeCollectionInterface;
1515
}

0 commit comments

Comments
 (0)