Skip to content

Commit c424e0b

Browse files
committed
#557: User access Row action panel with 2+ level nesting - Static tests fixes
1 parent a1a685e commit c424e0b

File tree

7 files changed

+24
-20
lines changed

7 files changed

+24
-20
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/_var.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,9 @@
7777
@pagebuilder-transition: @pagebuilder-transition-duration ease-in-out;
7878
@pagebuilder-animation: .35s ease-in-out both;
7979

80+
//
81+
// Affordance
82+
// ---------------------------------------------
83+
84+
@pagebuilder-affordance-box-shadow: 0 0 0 1px rgba(197, 197, 197, 0.34);
85+
@pagebuilder-affordance-box-shadow-active: 0 0 0 1px @color-pagebuilder-light-silver;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
.pagebuilder-system-border-hover;
3131

3232
&.pagebuilder-content-type-affordance {
33-
box-shadow: 0 0 0 1px @color-pagebuilder-light-silver;
33+
box-shadow: @pagebuilder-affordance-box-shadow-active;
3434
}
3535
}
3636

@@ -189,7 +189,7 @@
189189

190190
.pagebuilder-content-type-affordance {
191191
border: 15px solid @color-gray98;
192-
box-shadow: 0 0 0 1px rgba(197, 197, 197, 0.34); // #ebebeb
192+
box-shadow: @pagebuilder-affordance-box-shadow; // #ebebeb
193193
padding: 0;
194194

195195
&:before {

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
ko-style="data.main.style"
1010
css="data.main.css">
1111
<div class="pagebuilder-content-type pagebuilder-content-type-affordance"
12-
ko-style="getStyle('inner', ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
12+
ko-style="getStyle(data.inner, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
1313
event="{ mouseover: onMouseOver, mouseout: onMouseOut }, mouseoverBubble: false">
1414
<div class="pagebuilder-content-type no-system-border type-container pagebuilder-row children-min-height"
1515
attr="data.inner.attributes"
16-
ko-style="getStyleWithout('inner', ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
16+
ko-style="getStyleWithout(data.inner, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
1717
css="Object.assign(data.inner.css(), {
1818
'empty-container': contentType.children().length == 0,
1919
'jarallax': data.inner.attributes()['data-enable-parallax'] == 1 || data.inner.attributes()['data-background-type'] == 'video'

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
-->
77

88
<div class="pagebuilder-content-type pagebuilder-content-type-affordance"
9-
ko-style="getStyle('main', ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
9+
ko-style="getStyle(data.main, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
1010
event="{ mouseover: onMouseOver, mouseout: onMouseOut }, mouseoverBubble: false">
1111
<div class="pagebuilder-content-type type-container no-system-border pagebuilder-row children-min-height"
1212
attr="data.main.attributes"
13-
ko-style="getStyleWithout('main', ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
13+
ko-style="getStyleWithout(data.main, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
1414
css="Object.assign(data.main.css(), {
1515
'empty-container': contentType.children().length == 0,
1616
'jarallax': data.main.attributes()['data-enable-parallax'] == 1 || data.main.attributes()['data-background-type'] == 'video'

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
-->
77

88
<div class="pagebuilder-content-type pagebuilder-content-type-affordance"
9-
ko-style="getStyle('main', ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
9+
ko-style="getStyle(data.main, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
1010
event="{ mouseover: onMouseOver, mouseout: onMouseOut }, mouseoverBubble: false">
1111
<div class="pagebuilder-content-type pagebuilder-row type-container no-system-border children-min-height"
1212
attr="data.main.attributes"
13-
ko-style="getStyleWithout('main', ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
13+
ko-style="getStyleWithout(data.main, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])"
1414
css="Object.assign(data.main.css(), {
1515
'empty-container': contentType.children().length == 0,
1616
'jarallax': data.main.attributes()['data-enable-parallax'] == 1 || data.main.attributes()['data-background-type'] == 'video'

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,24 +213,23 @@ export default class Preview extends PreviewCollection {
213213
/**
214214
* Return selected element styles
215215
*
216-
* @param {String} element
216+
* @param {Object} element
217217
* @param {Array} styleProperties
218218
*/
219-
public getStyle(element: String, styleProperties: Array<string>) {
220-
let stylesObject = (element === 'main' ? this.data.main.style() : this.data.inner.style());
219+
public getStyle(element: {[key: string]: any}, styleProperties: Array<string>) {
220+
let stylesObject = element.style();
221221

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

225-
226225
/**
227226
* Return element styles without selected
228227
*
229-
* @param {String} element
228+
* @param {Object} element
230229
* @param {Array} styleProperties
231230
*/
232-
public getStyleWithout(element: String, styleProperties: Array<string>) {
233-
let stylesObject = (element === 'main' ? this.data.main.style() : this.data.inner.style());
231+
public getStyleWithout(element: {[key: string]: any}, styleProperties: Array<string>) {
232+
let stylesObject = element.style();
234233

235234
return Object.keys(stylesObject)
236235
.filter(key => !styleProperties.includes(key))
@@ -241,5 +240,4 @@ export default class Preview extends PreviewCollection {
241240
};
242241
}, {});
243242
}
244-
245243
}

0 commit comments

Comments
 (0)