From 0507d34b2d1d8cabcf608f61e4b236b5bbf4b845 Mon Sep 17 00:00:00 2001 From: Brian Miller Date: Thu, 15 Feb 2024 08:33:34 -0600 Subject: [PATCH 1/4] add modal as valid type --- .../utils/site-idx-newsletter-menu-props.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js b/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js index f069a5cab..dbe063978 100644 --- a/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js +++ b/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js @@ -12,7 +12,7 @@ module.exports = ({ out, input }) => { const source = defaultValue(input.source, 'newsletterSignup'); const configName = defaultValue(input.configName, 'signupBanner'); const newsletterSignupType = defaultValue(input.type, 'default'); - const validTypes = ['inlineContent', 'inlineSection', 'footer']; + const validTypes = ['inlineContent', 'inlineSection', 'footer', 'modal']; const withImage = defaultValue(input.withImage, true); if (!validTypes.includes(newsletterSignupType)) { From 57bf691f25bf2c50c9ac6ac03424d0712481e5fc Mon Sep 17 00:00:00 2001 From: Brian Miller Date: Thu, 15 Feb 2024 08:34:00 -0600 Subject: [PATCH 2/4] Correcly conditionally spread the imgSrc & imgSrcset --- .../utils/site-idx-newsletter-menu-props.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js b/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js index dbe063978..de79f2a13 100644 --- a/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js +++ b/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js @@ -31,8 +31,8 @@ module.exports = ({ out, input }) => { const imageSrcset = imageSrc ? `${imageSrc}&dpr=2 2x` : null; return { - imageSrc: withImage && imageSrc, - imageSrcset: withImage && imageSrcset, + ...((withImage && imageSrc) && { imageSrc }), + ...((withImage && imageSrcset) && { imageSrcset }), siteName: config.website('name'), name, description, From 01f1ba3a3ac244848c1dcad8ea61e1b96c6b9486 Mon Sep 17 00:00:00 2001 From: Brian Miller Date: Thu, 15 Feb 2024 08:34:27 -0600 Subject: [PATCH 3/4] add modal to inline type prop validation --- .../browser/idx-newsletter-form/inline.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/marko-web-theme-monorail/browser/idx-newsletter-form/inline.vue b/packages/marko-web-theme-monorail/browser/idx-newsletter-form/inline.vue index 16fdaff00..eeb6a1cec 100644 --- a/packages/marko-web-theme-monorail/browser/idx-newsletter-form/inline.vue +++ b/packages/marko-web-theme-monorail/browser/idx-newsletter-form/inline.vue @@ -81,7 +81,7 @@ export default { modifiers: { type: Array, default: () => ['large'], - validator: (v) => v.every((val) => ['large', 'footer'].includes(val)), + validator: (v) => v.every((val) => ['large', 'footer', 'modal'].includes(val)), }, disabled: { type: Boolean, From 50794c8abfbd52fc5684b15a030dd7519b57ac99 Mon Sep 17 00:00:00 2001 From: Brian Miller Date: Thu, 15 Feb 2024 10:12:46 -0600 Subject: [PATCH 4/4] Allow for modifiers to be passed through --- .../utils/site-idx-newsletter-menu-props.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js b/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js index de79f2a13..291437c83 100644 --- a/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js +++ b/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js @@ -47,6 +47,7 @@ module.exports = ({ out, input }) => { redirect: input.redirect, loginEmailPlaceholder, loginEmailLabel: input.loginEmailLabel, + modifiers: input.modifiers, actionText: input.actionText, consentPolicy: input.consentPolicy || get(application, 'organization.consentPolicy'), emailConsentRequest: get(application, 'organization.emailConsentRequest'),