Skip to content

Commit 7713139

Browse files
committed
PB-108 styling fixes for column line -test stabilisation
1 parent a6f0f2e commit 7713139

File tree

5 files changed

+69
-29
lines changed

5 files changed

+69
-29
lines changed

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

Lines changed: 20 additions & 14 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: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,32 @@ function validateNewGridSize(columnGroup: ContentTypeCollectionInterface<ColumnG
7777
}
7878

7979
// Validate that the operation will be successful
80-
const numCols = columnGroup.getChildren()().length;
81-
const currentGridSize = columnGroup.preview.getResizeUtils().getInitialGridSize();
82-
if (newGridSize < currentGridSize && numCols > newGridSize) {
83-
let numEmptyColumns = 0;
84-
columnGroup.getChildren()().forEach(
85-
(column: ContentTypeCollectionInterface<ColumnPreview>) => {
86-
if (column.getChildren()().length === 0) {
87-
numEmptyColumns++;
80+
81+
82+
columnGroup.getChildren()().forEach(
83+
(columnLine: ContentTypeCollectionInterface<ColumnLinePreview>, index: number) => {
84+
let numEmptyColumns = 0;
85+
const numCols = columnLine.getChildren()().length;
86+
const currentGridSize = columnLine.preview.getResizeUtils().getInitialGridSize();
87+
if (newGridSize < currentGridSize && numCols > newGridSize) {
88+
columnLine.getChildren()().forEach(
89+
(column: ContentTypeCollectionInterface<ColumnPreview>) => {
90+
if (column.getChildren()().length === 0) {
91+
numEmptyColumns++;
92+
}
93+
});
94+
if (newGridSize < numCols - numEmptyColumns) {
95+
throw new GridSizeError(
96+
$t("Grid size cannot be smaller than the current total amount of columns, minus any empty columns."),
97+
);
8898
}
89-
});
90-
if (newGridSize < numCols - numEmptyColumns) {
91-
throw new GridSizeError(
92-
$t("Grid size cannot be smaller than the current total amount of columns, minus any empty columns."),
93-
);
94-
}
95-
}
99+
}
100+
});
101+
102+
columnGroup.getChildren()().forEach(
103+
(column: ContentTypeCollectionInterface<ColumnPreview>, index: number) => {
104+
updateColumnWidth(column, columnWidths[index]);
105+
});
96106
}
97107

98108
/**

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/_import.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
@import 'button-item/_import.less';
1414
@import 'column/_import.less';
1515
@import 'column-group/_import.less';
16+
@import 'column-line/_import.less';
1617
@import 'heading/_import.less';
1718
@import 'html/_import.less';
1819
@import 'image/_import.less';
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// /**
2+
// * Copyright © Magento, Inc. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
//
6+
// Mobile (style-m.css)
7+
// _____________________________________________
8+
9+
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
10+
.pagebuilder-column-line {
11+
flex-wrap: wrap;
12+
}
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// /**
2+
// * Copyright © Magento, Inc. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
//
7+
// _import imports all appearance less files
8+
// _____________________________________________
9+
10+
@import './_default.less';

0 commit comments

Comments
 (0)