Skip to content

Commit 60444fe

Browse files
author
Hanna Hnida
committed
#557: User access Row action panel with 2+ level nesting - Fixed label overflow, static errors
1 parent 5bd1351 commit 60444fe

File tree

8 files changed

+33
-33
lines changed

8 files changed

+33
-33
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/content-type/_preview.less

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@
198198

199199
> .pagebuilder-content-type.type-container.pagebuilder-row {
200200
box-shadow: none;
201+
}
201202

202-
> .pagebuilder-display-label {
203-
background-color: @color-gray98;
204-
color: @color-pagebuilder-silver;
205-
line-height: 13px;
206-
padding: 1px 0 0;
207-
transform: translate(-50%, -15px);
208-
}
203+
> .pagebuilder-display-label {
204+
background-color: transparent;
205+
color: @color-pagebuilder-silver;
206+
line-height: 13px;
207+
padding: 1px 0 0;
208+
transform: translate(-50%, -15px);
209209
}
210210
}
211211

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/column-group/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/content-type/row/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/template/content-type/row/contained/preview.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
<div attr="data.main.attributes"
99
ko-style="data.main.style"
1010
css="data.main.css">
11-
<div class="pagebuilder-content-type pagebuilder-content-type-affordance pagebuilder-row-affordance"
11+
<div class="pagebuilder-content-type pagebuilder-content-type-affordance pagebuilder-affordance-row"
1212
ko-style="getStyle(data.inner, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
1313
event="{ mouseover: onMouseOver, mouseout: onMouseOut }, mouseoverBubble: false">
14+
<div class="pagebuilder-display-label"
15+
text="function () { return displayLabel().toUpperCase(); }()"></div>
1416
<div class="pagebuilder-content-type no-system-border type-container pagebuilder-row children-min-height"
1517
attr="data.inner.attributes"
1618
ko-style="getStyleWithout(data.inner, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
@@ -33,8 +35,6 @@
3335
<div class="pagebuilder-drop-indicator"></div>
3436
</if>
3537
</div>
36-
<div class="pagebuilder-display-label"
37-
text="function () { return displayLabel().toUpperCase(); }()"></div>
3838
<div class="pagebuilder-empty-container empty-placeholder"
3939
css="placeholderCss()"
4040
translate="'Drag content types or columns here'"/>

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/row/full-bleed/preview.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*/
66
-->
77

8-
<div class="pagebuilder-content-type pagebuilder-content-type-affordance pagebuilder-row-affordance"
8+
<div class="pagebuilder-content-type pagebuilder-content-type-affordance pagebuilder-affordance-row"
99
ko-style="getStyle(data.main, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
1010
event="{ mouseover: onMouseOver, mouseout: onMouseOut }, mouseoverBubble: false">
11+
<div class="pagebuilder-display-label"
12+
text="function () { return displayLabel().toUpperCase(); }()"></div>
1113
<div class="pagebuilder-content-type type-container no-system-border pagebuilder-row children-min-height"
1214
attr="data.main.attributes"
1315
ko-style="getStyleWithout(data.main, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
@@ -30,8 +32,6 @@
3032
<div class="pagebuilder-drop-indicator"></div>
3133
</if>
3234
</div>
33-
<div class="pagebuilder-display-label"
34-
text="function () { return displayLabel().toUpperCase(); }()"></div>
3535
<div class="pagebuilder-empty-container empty-placeholder"
3636
css="placeholderCss()"
3737
translate="'Drag content types or columns here'"/>

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/row/full-width/preview.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*/
66
-->
77

8-
<div class="pagebuilder-content-type pagebuilder-content-type-affordance pagebuilder-row-affordance"
8+
<div class="pagebuilder-content-type pagebuilder-content-type-affordance pagebuilder-affordance-row"
99
ko-style="getStyle(data.main, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
1010
event="{ mouseover: onMouseOver, mouseout: onMouseOut }, mouseoverBubble: false">
11+
<div class="pagebuilder-display-label"
12+
text="function () { return displayLabel().toUpperCase(); }()"></div>
1113
<div class="pagebuilder-content-type pagebuilder-row type-container no-system-border children-min-height"
1214
attr="data.main.attributes"
1315
ko-style="getStyleWithout(data.main, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
@@ -30,8 +32,6 @@
3032
<div class="pagebuilder-drop-indicator"></div>
3133
</if>
3234
</div>
33-
<div class="pagebuilder-display-label"
34-
text="function () { return displayLabel().toUpperCase(); }()"></div>
3535
<div class="pagebuilder-empty-container empty-placeholder"
3636
css="placeholderCss()"
3737
translate="'Drag content types or columns here'"/>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ import Resize, {
2727
} from "../column/resize";
2828
import {ContentTypeRemovedEventParamsInterface} from "../content-type-events.types";
2929
import ObservableUpdater from "../observable-updater";
30+
import pageBuilderHeaderHeight from "../../utils/pagebuilder-header-height";
3031
import PreviewCollection from "../preview-collection";
3132
import {calculateDropPositions, DropPosition} from "./drag-and-drop";
3233
import {createColumn} from "./factory";
3334
import {getMaxGridSize, GridSizeError, resizeGrid} from "./grid-size";
3435
import {getDragColumn, removeDragColumn, setDragColumn} from "./registry";
35-
import pageBuilderHeaderHeight from "../../utils/pagebuilder-header-height";
3636

3737
/**
3838
* @api
@@ -468,7 +468,7 @@ export default class Preview extends PreviewCollection {
468468
this.gridSizeHistory = new Map();
469469
this.recordGridResize(this.gridSize());
470470
// inline tooltip out of bounds
471-
let tooltipClientRectTop = tooltip[0].getBoundingClientRect().top
471+
const tooltipClientRectTop = tooltip[0].getBoundingClientRect().top
472472
- pageBuilderHeaderHeight(this.contentType.stageId);
473473

474474
if (checkStageFullScreen(this.contentType.stageId)

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,30 +213,30 @@ export default class Preview extends PreviewCollection {
213213
/**
214214
* Return selected element styles
215215
*
216-
* @param {Object} element
217-
* @param {Array} styleProperties
216+
* @param element
217+
* @param styleProperties
218218
*/
219-
public getStyle(element: {[key: string]: any}, styleProperties: Array<string>) {
220-
let stylesObject = element.style();
219+
public getStyle(element: {[key: string]: any}, styleProperties: string[]) {
220+
const stylesObject = element.style();
221221

222222
return styleProperties.reduce((obj, key) => ({ ...obj, [key]: stylesObject[key] }), {});
223223
}
224224

225225
/**
226226
* Return element styles without selected
227227
*
228-
* @param {Object} element
229-
* @param {Array} styleProperties
228+
* @param element
229+
* @param styleProperties
230230
*/
231-
public getStyleWithout(element: {[key: string]: any}, styleProperties: Array<string>) {
232-
let stylesObject = element.style();
231+
public getStyleWithout(element: {[key: string]: any}, styleProperties: string[]) {
232+
const stylesObject = element.style();
233233

234234
return Object.keys(stylesObject)
235-
.filter(key => !styleProperties.includes(key))
235+
.filter((key) => !styleProperties.includes(key))
236236
.reduce((obj, key) => {
237237
return {
238238
...obj,
239-
[key]: stylesObject[key]
239+
[key]: stylesObject[key],
240240
};
241241
}, {});
242242
}

0 commit comments

Comments
 (0)