Skip to content

Commit

Permalink
Changed node name to sponsorLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldlangeveld committed Feb 5, 2025
1 parent 8133332 commit a8157e9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class CallToActionNode extends generateDecoratorNode({
{name: 'buttonColor', default: ''},
{name: 'buttonTextColor', default: ''},
{name: 'hasSponsorLabel', default: true},
{name: 'customSponsorLabel', default: '<p>Sponsored</p>'},
{name: 'sponsorLabel', default: '<p>Sponsored</p>'},
{name: 'backgroundColor', default: 'grey'},
{name: 'hasImage', default: false},
{name: 'imageUrl', default: ''}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function ctaCardTemplate(dataset) {
` : ''}
${dataset.hasSponsorLabel ? `
<div class="kg-sponsor-label">
${dataset.customSponsorLabel}
${dataset.sponsorLabel}
</div>
` : ''}
</div>
Expand Down Expand Up @@ -48,7 +48,7 @@ function emailCTATemplate(dataset) {
` : ''}
${dataset.hasSponsorLabel ? `
<div class="sponsor-label" style="margin-top: 8px; font-size: 12px; color: #888;">
${dataset.customSponsorLabel}
${dataset.sponsorLabel}
</div>
` : ''}
</div>
Expand All @@ -69,7 +69,7 @@ export function renderCallToActionNode(node, options = {}) {
buttonTextColor: node.buttonTextColor,
hasSponsorLabel: node.hasSponsorLabel,
backgroundColor: node.backgroundColor,
customSponsorLabel: node.customSponsorLabel,
sponsorLabel: node.sponsorLabel,
hasImage: node.hasImage,
imageUrl: node.imageUrl,
textColor: node.textColor
Expand Down
20 changes: 10 additions & 10 deletions packages/kg-default-nodes/test/nodes/call-to-action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('CallToActionNode', function () {
dataset = {
layout: 'minimal',
textValue: 'This is a cool advertisement',
customSponsorLabel: '<p>Sponsored</p>',
sponsorLabel: '<p>Sponsored</p>',
showButton: true,
buttonText: 'click me',
buttonUrl: 'http://blog.com/post1',
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('CallToActionNode', function () {
callToActionNode.buttonColor.should.equal(dataset.buttonColor);
callToActionNode.buttonTextColor.should.equal(dataset.buttonTextColor);
callToActionNode.hasSponsorLabel.should.equal(dataset.hasSponsorLabel);
callToActionNode.customSponsorLabel.should.equal(dataset.customSponsorLabel);
callToActionNode.sponsorLabel.should.equal(dataset.sponsorLabel);
callToActionNode.backgroundColor.should.equal(dataset.backgroundColor);
callToActionNode.hasImage.should.equal(dataset.hasImage);
callToActionNode.imageUrl.should.equal(dataset.imageUrl);
Expand Down Expand Up @@ -92,9 +92,9 @@ describe('CallToActionNode', function () {
callToActionNode.buttonUrl = 'http://blog.com/post1';
callToActionNode.buttonUrl.should.equal('http://blog.com/post1');

callToActionNode.customSponsorLabel.should.equal('<p>Sponsored</p>');
callToActionNode.customSponsorLabel = 'This post is brought to you by our sponsors';
callToActionNode.customSponsorLabel.should.equal('This post is brought to you by our sponsors');
callToActionNode.sponsorLabel.should.equal('<p>Sponsored</p>');
callToActionNode.sponsorLabel = 'This post is brought to you by our sponsors';
callToActionNode.sponsorLabel.should.equal('This post is brought to you by our sponsors');

callToActionNode.buttonColor.should.equal('');
callToActionNode.buttonColor = 'red';
Expand Down Expand Up @@ -190,7 +190,7 @@ describe('CallToActionNode', function () {
buttonUrl: 'http://someblog.com/somepost',
hasImage: true,
hasSponsorLabel: true,
customSponsorLabel: '<p>Sponsored by</p>',
sponsorLabel: '<p>Sponsored by</p>',
imageUrl: '/content/images/2022/11/koenig-lexical.jpg',
layout: 'minimal',
showButton: true,
Expand Down Expand Up @@ -222,7 +222,7 @@ describe('CallToActionNode', function () {
buttonUrl: 'http://someblog.com/somepost',
hasImage: true,
hasSponsorLabel: true,
customSponsorLabel: '<p>Sponsored</p>',
sponsorLabel: '<p>Sponsored</p>',
imageUrl: '/content/images/2022/11/koenig-lexical.jpg',
layout: 'minimal',
showButton: true,
Expand Down Expand Up @@ -278,7 +278,7 @@ describe('CallToActionNode', function () {
buttonUrl: 'http://someblog.com/somepost',
hasImage: true,
hasSponsorLabel: true,
customSponsorLabel: '<p>This post is brought to you by our sponsors</p>',
sponsorLabel: '<p>This post is brought to you by our sponsors</p>',
imageUrl: '/content/images/2022/11/koenig-lexical.jpg',
layout: 'minimal',
showButton: true,
Expand All @@ -297,7 +297,7 @@ describe('CallToActionNode', function () {
buttonUrl: 'http://someblog.com/somepost',
hasImage: true,
hasSponsorLabel: true,
customSponsorLabel: '<p>This post is brought to you by our sponsors</p>',
sponsorLabel: '<p>This post is brought to you by our sponsors</p>',
imageUrl: '/content/images/2022/11/koenig-lexical.jpg',
layout: 'minimal',
showButton: true,
Expand Down Expand Up @@ -328,7 +328,7 @@ describe('CallToActionNode', function () {
buttonUrl: 'http://someblog.com/somepost',
hasImage: true,
hasSponsorLabel: true,
customSponsorLabel: '<p>This post is brought to you by our sponsors</p>',
sponsorLabel: '<p>This post is brought to you by our sponsors</p>',
imageUrl: '/content/images/2022/11/koenig-lexical.jpg',
layout: 'minimal',
showButton: true,
Expand Down

0 comments on commit a8157e9

Please sign in to comment.