Skip to content

Commit 0dec73a

Browse files
committed
MC-5474: Anchor tag name is used on banner/slide/image wrapper when no link is specified by admin
Add empty_link element
1 parent 7049462 commit 0dec73a

File tree

16 files changed

+37
-21
lines changed

16 files changed

+37
-21
lines changed

app/code/Magento/PageBuilder/view/adminhtml/pagebuilder/content_type/banner.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
<attribute name="virtual_link_target" storage_key="link_url" source="target" converter="Magento_PageBuilder/js/converter/attribute/link-target" persistence_mode="write"/>
237237
<attribute name="virtual_link_type" storage_key="link_url" source="data-link-type" converter="Magento_PageBuilder/js/converter/attribute/link-type" persistence_mode="write"/>
238238
</element>
239+
<element name="empty_link"/>
239240
<element name="wrapper">
240241
<style name="background_color" source="background_color"/>
241242
<style name="background_image" source="background_image" converter="Magento_PageBuilder/js/converter/style/background-image" preview_converter="Magento_PageBuilder/js/converter/style/preview/background-image" persistence_mode="write"/>

app/code/Magento/PageBuilder/view/adminhtml/pagebuilder/content_type/button_item.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@
4848
<attribute name="virtual_link_type" storage_key="button_link" source="data-link-type" converter="Magento_PageBuilder/js/converter/attribute/link-type" persistence_mode="write"/>
4949
<css name="button_type"/>
5050
</element>
51+
<element name="empty_link">
52+
<style name="text_align" source="text_align"/>
53+
<style name="border" source="border_style" converter="Magento_PageBuilder/js/converter/style/border-style"/>
54+
<style name="border_color" source="border_color"/>
55+
<style name="border_width" source="border_width" converter="Magento_PageBuilder/js/converter/style/border-width"/>
56+
<style name="border_radius" source="border_radius" converter="Magento_PageBuilder/js/converter/style/remove-px"/>
57+
<style name="margins" storage_key="margins_and_padding" reader="Magento_PageBuilder/js/property/margins" converter="Magento_PageBuilder/js/converter/style/margins"/>
58+
<style name="padding" storage_key="margins_and_padding" reader="Magento_PageBuilder/js/property/paddings" converter="Magento_PageBuilder/js/converter/style/paddings"/>
59+
<css name="button_type"/>
60+
</element>
5161
<element name="link_text">
5262
<html name="button_text" converter="Magento_PageBuilder/js/converter/html/tag-escaper"/>
5363
</element>

app/code/Magento/PageBuilder/view/adminhtml/pagebuilder/content_type/image.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
<attribute name="virtual_link_type" storage_key="link_url" source="data-link-type" converter="Magento_PageBuilder/js/converter/attribute/link-type" persistence_mode="write"/>
6262
<attribute name="title_attribute" source="title"/>
6363
</element>
64+
<element name="empty_link"/>
6465
<element name="caption">
6566
<html name="image_caption"/>
6667
</element>

app/code/Magento/PageBuilder/view/adminhtml/pagebuilder/content_type/slide.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<attribute name="virtual_link_target" storage_key="link_url" source="target" converter="Magento_PageBuilder/js/converter/attribute/link-target" persistence_mode="write"/>
4242
<attribute name="virtual_link_type" storage_key="link_url" source="data-link-type" converter="Magento_PageBuilder/js/converter/attribute/link-type" persistence_mode="write"/>
4343
</element>
44+
<element name="empty_link"/>
4445
<element name="overlay">
4546
<style name="background_color" source="background_color" converter="Magento_PageBuilder/js/content-type/slide/converter/style/overlay-background-color" persistence_mode="write"/>
4647
<attribute name="overlay_color" source="data-overlay-color" converter="Magento_PageBuilder/js/content-type/slide/converter/attribute/overlay-color" persistence_mode="read"/>

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/banner/collage-centered/master.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</div>
2727
</div>
2828
</a>
29-
<div ifnot="data.link.attributes().href" attr="_.omit(data.link.attributes(), ['href', 'target'])" ko-style="data.link.style" css="data.link.css">
29+
<div ifnot="data.link.attributes().href" attr="data.empty_link.attributes" ko-style="data.empty_link.style" css="data.empty_link.css">
3030
<div css="data.wrapper.css"
3131
attr="data.wrapper.attributes"
3232
ko-style="data.wrapper.style"

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/banner/collage-left/master.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</div>
2727
</div>
2828
</a>
29-
<div ifnot="data.link.attributes().href" attr="_.omit(data.link.attributes(), ['href', 'target'])" ko-style="data.link.style" css="data.link.css">
29+
<div ifnot="data.link.attributes().href" attr="data.empty_link.attributes" ko-style="data.empty_link.style" css="data.empty_link.css">
3030
<div attr="data.wrapper.attributes"
3131
ko-style="data.wrapper.style"
3232
css="data.wrapper.css"

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/banner/collage-right/master.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</div>
2727
</div>
2828
</a>
29-
<div ifnot="data.link.attributes().href" attr="_.omit(data.link.attributes(), ['href', 'target'])" ko-style="data.link.style" css="data.link.css">
29+
<div ifnot="data.link.attributes().href" attr="data.empty_link.attributes" ko-style="data.empty_link.style" css="data.empty_link.css">
3030
<div attr="data.wrapper.attributes"
3131
ko-style="data.wrapper.style"
3232
css="data.wrapper.css"

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/banner/poster/master.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
</div>
2525
</a>
26-
<div ifnot="data.link.attributes().href" data-bind="attr: _.omit(data.link.attributes(), ['href', 'target']), style: data.link.style, css: data.link.css">
26+
<div ifnot="data.link.attributes().href" data-bind="attr: data.empty_link.attributes, style: data.empty_link.style, css: data.empty_link.css">
2727
<div class="pagebuilder-banner-wrapper" attr="data.wrapper.attributes" ko-style="data.wrapper.style" css="data.wrapper.css">
2828
<div class="pagebuilder-overlay pagebuilder-poster-overlay" attr="data.overlay.attributes" ko-style="data.overlay.style" css="data.overlay.css">
2929
<div class="pagebuilder-poster-content">

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/button-item/default/master.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<a if="data.link.attributes().href" attr="data.link.attributes" ko-style="data.link.style" css="data.link.css">
1010
<span attr="data.link_text.attributes" html="data.link_text.html"></span>
1111
</a>
12-
<div ifnot="data.link.attributes().href" attr="_.omit(data.link.attributes(), ['href', 'target'])" ko-style="data.link.style" css="data.link.css">
12+
<div ifnot="data.link.attributes().href" attr="data.empty_link.attributes" ko-style="data.empty_link.style" css="data.empty_link.css">
1313
<span attr="data.link_text.attributes" html="data.link_text.html"></span>
1414
</div>
1515
</div>

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/slide/collage-centered/master.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
</div>
3838
</div>
3939
</a>
40-
<div ifnot="data.link.attributes().href" attr="_.omit(data.link.attributes(), ['href', 'target'])"
41-
ko-style="data.link.style"
42-
css="data.link.css">
40+
<div ifnot="data.link.attributes().href" attr="data.empty_link.attributes"
41+
ko-style="data.empty_link.style"
42+
css="data.empty_link.css">
4343
<div class="pagebuilder-slide-wrapper"
4444
css="data.wrapper.css"
4545
attr="data.wrapper.attributes"

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/slide/collage-left/master.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
</div>
3838
</div>
3939
</a>
40-
<div ifnot="data.link.attributes().href" attr="_.omit(data.link.attributes(), ['href', 'target'])"
41-
ko-style="data.link.style"
42-
css="data.link.css">
40+
<div ifnot="data.link.attributes().href" attr="data.empty_link.attributes"
41+
ko-style="data.empty_link.style"
42+
css="data.empty_link.css">
4343
<div class="pagebuilder-slide-wrapper"
4444
attr="data.wrapper.attributes"
4545
ko-style="data.wrapper.style"

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/slide/collage-right/master.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
</div>
3737
</div>
3838
</a>
39-
<div ifnot="data.link.attributes().href" attr="_.omit(data.link.attributes(), ['href', 'target'])"
40-
ko-style="data.link.style"
41-
css="data.link.css">
39+
<div ifnot="data.link.attributes().href" attr="data.empty_link.attributes"
40+
ko-style="data.empty_link.style"
41+
css="data.empty_link.css">
4242
<div attr="data.wrapper.attributes"
4343
ko-style="data.wrapper.style"
4444
css="data.wrapper.css"

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/slide/poster/master.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
</div>
3838
</div>
3939
</a>
40-
<div ifnot="data.link.attributes().href" attr="_.omit(data.link.attributes(), ['href', 'target'])"
41-
ko-style="data.link.style"
42-
css="data.link.css">
40+
<div ifnot="data.link.attributes().href" attr="data.empty_link.attributes"
41+
ko-style="data.empty_link.style"
42+
css="data.empty_link.css">
4343
<div class="pagebuilder-slide-wrapper"
4444
attr="data.wrapper.attributes"
4545
ko-style="data.wrapper.style"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// Default appearance styles
88
// _____________________________________________
99

10-
[data-role='banner'] > [data-element='link'] {
10+
[data-role='banner'] > [data-element='link'],
11+
[data-role='banner'] > [data-element='empty_link'] {
1112
color: inherit;
1213
text-decoration: inherit;
1314

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/button-item/_default.less

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99

1010
[data-role='button-item'] {
1111
max-width: 100%;
12-
[data-element='link'] {
12+
[data-element='link'],
13+
[data-element='empty_link'] {
1314
max-width: 100%;
1415
word-wrap: break-word;
1516
}
16-
div[data-element='link'] {
17+
[data-element='empty_link'] {
1718
cursor: default;
1819
}
1920
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
box-sizing: border-box;
1212
overflow: hidden;
1313

14-
> [data-element='link'] {
14+
> [data-element='link'],
15+
> [data-element='empty_link'] {
1516
color: inherit;
1617
text-decoration: inherit;
1718

0 commit comments

Comments
 (0)