Skip to content

Commit ee70dcb

Browse files
committed
PB-108 static test fixes
1 parent e6b56b8 commit ee70dcb

File tree

4 files changed

+23
-29
lines changed

4 files changed

+23
-29
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/column-group/grid-size.js

Lines changed: 3 additions & 3 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/column-line/preview.js

Lines changed: 7 additions & 8 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/column-group/grid-size.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function redistributeColumnWidths(
160160
);
161161

162162
columnGroup.getChildren()().forEach(
163-
(columnLine: ContentTypeCollectionInterface<ColumnLinePreview>, index: number) => {
163+
(columnLine: ContentTypeCollectionInterface<ColumnLinePreview>, columnLineIndex: number) => {
164164
let totalNewWidths = 0;
165165
let remainingWidth: number = 0;
166166
const numColumns = columnLine.getChildren()().length;
@@ -209,8 +209,8 @@ function redistributeColumnWidths(
209209
remainingWidth += (existingWidth - parseFloat(newWidth));
210210

211211
/**
212-
* Determine if we have enough remaining width, and apply it to the current column, this results in a
213-
* subsequent column always receiving any additional width from the previous column
212+
* Determine if we have enough remaining width, and apply it to the current column, this results in
213+
* a subsequent column always receiving any additional width from the previous column
214214
*/
215215
if (resizeUtils.getSmallestColumnWidth(newGridSize)
216216
=== resizeUtils.getAcceptedColumnWidth(remainingWidth.toString(), newGridSize)

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

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ export default class Preview extends PreviewCollection {
360360
}
361361

362362
// Move the content type
363-
if (this.columnLineDropPlaceholder.hasClass('active')
364-
|| this.columnLineBottomDropPlaceholder.hasClass('active')) {
363+
if (this.columnLineDropPlaceholder.hasClass("active")
364+
|| this.columnLineBottomDropPlaceholder.hasClass("active")) {
365365
// if new column line placeholders are visible, add new column line and move column there
366366
createColumnLine(
367367
this.contentType.parentContentType,
@@ -378,7 +378,7 @@ export default class Preview extends PreviewCollection {
378378

379379
});
380380
} else {
381-
//@todo evaluate if this else is needed
381+
// @todo evaluate if this else is needed
382382
moveContentType(column, movePosition.insertIndex, this.contentType);
383383
if (modifyOldNeighbour) {
384384
updateColumnWidth(modifyOldNeighbour, oldNeighbourWidth);
@@ -491,14 +491,12 @@ export default class Preview extends PreviewCollection {
491491
*/
492492
private handleMouseUp(): void {
493493

494-
let index = -1;
495494
const self = this;
496495
const dragColumn = getDragColumn();
497496
if ((this.columnLineDropPlaceholder.hasClass("active")
498497
|| this.columnLineBottomDropPlaceholder.hasClass("active"))
499498
&& !dragColumn) {
500499

501-
502500
createColumnLine(
503501
this.contentType.parentContentType,
504502
this.resizeUtils.getSmallestColumnWidth(),
@@ -1193,7 +1191,7 @@ export default class Preview extends PreviewCollection {
11931191
const self = this;
11941192
for (const child of this.contentType.parentContentType.children()) {
11951193
index++;
1196-
if (child.id == self.contentType.id) {
1194+
if (child.id === self.contentType.id) {
11971195
break;
11981196
}
11991197
}
@@ -1204,28 +1202,25 @@ export default class Preview extends PreviewCollection {
12041202
return index;
12051203
}
12061204

1207-
12081205
private isColumnBeingMovedToAnotherColumnLine(): boolean {
1209-
let column = getDragColumn();
1206+
const column = getDragColumn();
12101207
if (!column) {
1211-
//if no move position, column is not being moved.
1208+
// if no move position, column is not being moved.
12121209
return false;
12131210
}
12141211

12151212
if (column.parentContentType !== this.contentType) {
1216-
//if the parent content type is not same as this column line, column is being moved to new column line
1213+
// if the parent content type is not same as this column line, column is being moved to new column line
12171214
return true;
12181215
}
12191216

12201217
if (column.parentContentType === this.contentType
1221-
&& (this.columnLineDropPlaceholder.hasClass('active')
1222-
|| this.columnLineBottomDropPlaceholder.hasClass('active'))) {
1223-
//since new column line drop placeholder is visible, column move will introduce a new column line
1218+
&& (this.columnLineDropPlaceholder.hasClass("active")
1219+
|| this.columnLineBottomDropPlaceholder.hasClass("active"))) {
1220+
// since new column line drop placeholder is visible, column move should introduce a new column line
12241221
return true;
12251222
}
12261223

12271224
return false;
12281225
}
1229-
1230-
12311226
}

0 commit comments

Comments
 (0)