diff --git a/website/api/hooks/custom/index.js b/website/api/hooks/custom/index.js index 0e4f592f05..d8107a4655 100644 --- a/website/api/hooks/custom/index.js +++ b/website/api/hooks/custom/index.js @@ -225,8 +225,15 @@ will be disabled and/or hidden in the UI. return next(); } - // Not logged in? Proceed as usual. - if (!req.session.userId) { return next(); } + // Not logged in? Set local variables for the start flow CTA. + if (!req.session.userId) { + res.locals.showStartCta = true; + res.locals.collapseStartCta = false; + if(req.session.expandCtaAt && req.session.expandCtaAt > Date.now()) { + res.locals.collapseStartCta = true; + } + return next(); + } // Otherwise, look up the logged-in user. var loggedInUser = await User.findOne({ diff --git a/website/config/policies.js b/website/config/policies.js index 862cf77448..f3823bd89a 100644 --- a/website/config/policies.js +++ b/website/config/policies.js @@ -67,4 +67,5 @@ module.exports.policies = { 'view-meetups': true, 'view-os-settings': true, 'get-llm-generated-configuration-profile': true, + 'account/update-start-cta-visibility': true, }; diff --git a/website/config/routes.js b/website/config/routes.js index 3f60616618..7dcd59373a 100644 --- a/website/config/routes.js +++ b/website/config/routes.js @@ -263,6 +263,7 @@ module.exports.routes = { action: 'entrance/view-signup', locals: { hideFooterLinks: true, + hideStartCTA: true, pageTitleForMeta: 'Sign up', pageDescriptionForMeta: 'Sign up for a Fleet account.', } @@ -271,6 +272,7 @@ module.exports.routes = { action: 'entrance/view-login', locals: { hideFooterLinks: true, + hideStartCTA: true, pageTitleForMeta: 'Log in', pageDescriptionForMeta: 'Log in to Fleet.', } diff --git a/website/views/partials/continue.partial.ejs b/website/views/partials/continue.partial.ejs index 0b40f49ffa..fee6250c63 100644 --- a/website/views/partials/continue.partial.ejs +++ b/website/views/partials/continue.partial.ejs @@ -1,14 +1,17 @@ -<%if(typeof me !== 'undefined' && showStartCta){%> +<%if(showStartCta){%>
Get started with Fleet
+ <% } else if(['2 - Aware', '3 - Intrigued'].includes(me.psychologicalStage)) { %> Tried Fleet yet?Get started with Fleet
<% } else if(me.psychologicalStage === '4 - Has use case') { %> @@ -19,6 +22,15 @@Let’s get you set up!
<% } %>