From b325d8803369bf197847d9e32750d100bda33d37 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Fri, 28 Jun 2024 10:10:30 +0200 Subject: [PATCH 1/6] MWPW-146962 [milo] Text link behaving like button in FAQ section --- libs/blocks/merch/merch.js | 1 + test/blocks/merch/merch.test.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/blocks/merch/merch.js b/libs/blocks/merch/merch.js index 8cce3dfed0..508b874a3d 100644 --- a/libs/blocks/merch/merch.js +++ b/libs/blocks/merch/merch.js @@ -452,6 +452,7 @@ export async function buildCta(el, params) { const cta = service.createCheckoutLink(context, text); if (el.href.includes('#_tcl')) { el.href = el.href.replace('#_tcl', ''); + cta.removeAttribute('is'); } else { cta.classList.add('con-button'); cta.classList.toggle('button-l', large); diff --git a/test/blocks/merch/merch.test.js b/test/blocks/merch/merch.test.js index 991134d7c5..96d3780e6a 100644 --- a/test/blocks/merch/merch.test.js +++ b/test/blocks/merch/merch.test.js @@ -402,7 +402,7 @@ describe('Merch Block', () => { const { href, textContent } = await el.onceSettled(); expect(href.includes('#_tcl')).to.be.false; expect(textContent).to.equal('40% off'); - expect(el.getAttribute('is')).to.equal('checkout-link'); + expect(el.getAttribute('is')).to.be.null; expect(el.classList.contains('con-button')).to.be.false; expect(el.classList.contains('button-l')).to.be.false; expect(el.classList.contains('blue')).to.be.false; From aeff4ba184113d52f915a8157cd5d121501c6d4c Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Fri, 28 Jun 2024 12:10:21 +0200 Subject: [PATCH 2/6] MWPW-146962 [milo] Text link behaving like button in FAQ section --- libs/blocks/merch/merch.css | 2 +- libs/blocks/merch/merch.js | 2 +- test/blocks/merch/merch.test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/blocks/merch/merch.css b/libs/blocks/merch/merch.css index e4a89dad3c..9a24893454 100644 --- a/libs/blocks/merch/merch.css +++ b/libs/blocks/merch/merch.css @@ -15,7 +15,7 @@ span.placeholder-resolved[data-template="strikethrough"], span.price.price-strik visibility: inherit; } -a[is='checkout-link'] > span { +a[is='checkout-link']:not(.text-link) > span { display: inline-block; text-align: center; width: 100%; diff --git a/libs/blocks/merch/merch.js b/libs/blocks/merch/merch.js index 508b874a3d..22deca84ff 100644 --- a/libs/blocks/merch/merch.js +++ b/libs/blocks/merch/merch.js @@ -452,7 +452,7 @@ export async function buildCta(el, params) { const cta = service.createCheckoutLink(context, text); if (el.href.includes('#_tcl')) { el.href = el.href.replace('#_tcl', ''); - cta.removeAttribute('is'); + cta.classList.add('text-link'); } else { cta.classList.add('con-button'); cta.classList.toggle('button-l', large); diff --git a/test/blocks/merch/merch.test.js b/test/blocks/merch/merch.test.js index 96d3780e6a..991134d7c5 100644 --- a/test/blocks/merch/merch.test.js +++ b/test/blocks/merch/merch.test.js @@ -402,7 +402,7 @@ describe('Merch Block', () => { const { href, textContent } = await el.onceSettled(); expect(href.includes('#_tcl')).to.be.false; expect(textContent).to.equal('40% off'); - expect(el.getAttribute('is')).to.be.null; + expect(el.getAttribute('is')).to.equal('checkout-link'); expect(el.classList.contains('con-button')).to.be.false; expect(el.classList.contains('button-l')).to.be.false; expect(el.classList.contains('blue')).to.be.false; From 27152800ac2b5717a68f66448923ed4e35e5530e Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Fri, 28 Jun 2024 12:21:46 +0200 Subject: [PATCH 3/6] MWPW-146962 [milo] Text link behaving like button in FAQ section --- test/blocks/merch/merch.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/blocks/merch/merch.test.js b/test/blocks/merch/merch.test.js index 991134d7c5..e613444b50 100644 --- a/test/blocks/merch/merch.test.js +++ b/test/blocks/merch/merch.test.js @@ -406,6 +406,7 @@ describe('Merch Block', () => { expect(el.classList.contains('con-button')).to.be.false; expect(el.classList.contains('button-l')).to.be.false; expect(el.classList.contains('blue')).to.be.false; + expect(el.classList.contains('text-link')).to.be.true; }); it('renders large CTA inside a marquee', async () => { From 5d7db3ec14b57dd642580f65f0d50d452839ab5f Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Fri, 28 Jun 2024 12:49:03 +0200 Subject: [PATCH 4/6] Trigger Build From 439b394743cd1516c9791d8a86a03dbd4d619313 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Fri, 28 Jun 2024 13:29:30 +0200 Subject: [PATCH 5/6] MWPW-146962 [milo] Text link behaving like button in FAQ section --- libs/blocks/merch/merch.css | 2 +- libs/blocks/merch/merch.js | 1 - test/blocks/merch/merch.test.js | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/blocks/merch/merch.css b/libs/blocks/merch/merch.css index 9a24893454..907fd8ef61 100644 --- a/libs/blocks/merch/merch.css +++ b/libs/blocks/merch/merch.css @@ -15,7 +15,7 @@ span.placeholder-resolved[data-template="strikethrough"], span.price.price-strik visibility: inherit; } -a[is='checkout-link']:not(.text-link) > span { +a[is='checkout-link'].con-button > span { display: inline-block; text-align: center; width: 100%; diff --git a/libs/blocks/merch/merch.js b/libs/blocks/merch/merch.js index 22deca84ff..8cce3dfed0 100644 --- a/libs/blocks/merch/merch.js +++ b/libs/blocks/merch/merch.js @@ -452,7 +452,6 @@ export async function buildCta(el, params) { const cta = service.createCheckoutLink(context, text); if (el.href.includes('#_tcl')) { el.href = el.href.replace('#_tcl', ''); - cta.classList.add('text-link'); } else { cta.classList.add('con-button'); cta.classList.toggle('button-l', large); diff --git a/test/blocks/merch/merch.test.js b/test/blocks/merch/merch.test.js index e613444b50..991134d7c5 100644 --- a/test/blocks/merch/merch.test.js +++ b/test/blocks/merch/merch.test.js @@ -406,7 +406,6 @@ describe('Merch Block', () => { expect(el.classList.contains('con-button')).to.be.false; expect(el.classList.contains('button-l')).to.be.false; expect(el.classList.contains('blue')).to.be.false; - expect(el.classList.contains('text-link')).to.be.true; }); it('renders large CTA inside a marquee', async () => { From b00c9102df5d28f6091d46e7db5c8b6efa9081de Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Fri, 12 Jul 2024 12:10:01 +0200 Subject: [PATCH 6/6] Trigger Build