From 806c88f00661434d759bb99c6b13ac18a1844fd3 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 1 May 2024 18:22:47 -0500 Subject: [PATCH] Website: Add steps for users who deploy Fleet to /start questionnaire (#18661) Changes: - Added two steps to the /start questionnaire for users who select "I want to deploy Fleet in my environment" on the "What did you think" question. - Updated save-questionnaire-progress to set psychologicalStage based on selected answers to the new questions --- .../save-questionnaire-progress.js | 29 ++- website/assets/js/pages/start.page.js | 53 +++++- website/views/pages/start.ejs | 177 ++++++++++++++---- 3 files changed, 210 insertions(+), 49 deletions(-) diff --git a/website/api/controllers/save-questionnaire-progress.js b/website/api/controllers/save-questionnaire-progress.js index 1846c4daee..586182357e 100644 --- a/website/api/controllers/save-questionnaire-progress.js +++ b/website/api/controllers/save-questionnaire-progress.js @@ -26,6 +26,8 @@ module.exports = { 'deploy-fleet-in-your-environment', 'managed-cloud-for-growing-deployments', 'self-hosted-deploy', + 'whats-left-to-get-you-set-up', + 'how-was-your-deployment', ] }, formData: { @@ -99,6 +101,18 @@ module.exports = { // - deploy-fleet-in-environment » Stage 5 // - let-me-think-about-it » Stage 2 // - host-fleet-for-me » N/A (currently not selectable, but should set the user's psychologicalStage to stage 5) + // 'how-was-your-deployment' + // - up-and-running » Stage 6 + // - kinda-stuck » No change (Stage 5) + // - havent-gotten-to-it » No change (Stage 5) + // - changed-mind-want-managed-deployment » No change (Stage 5) + // - decided-to-not-use-fleet » Stage 2 + // 'whats-left-to-get-you-set-up' + // - need-premium-license-key » No change (Stage 6) + // - help-show-fleet-to-my-team » No change (Stage 6) + // - procurement-wants-some-stuff » No change (Stage 6) + // - nothing » No change (Stage 6) + let psychologicalStage = userRecord.psychologicalStage; // Get the value of the submitted formData, we do this so we only need to check one variable, instead of (formData.attribute === 'foo'); @@ -156,14 +170,19 @@ module.exports = { // FUTURE: check previous answers for other selected buying situations. } } else if(currentStep === 'what-did-you-think') { - // If the user is ready to deploy Fleet in their work environemnt, then they're ready to get buy-in from their team, so set their psyStage to 5. - if(valueFromFormData === 'deploy-fleet-in-environment') { - psychologicalStage = '5 - Personally confident'; - } else if(valueFromFormData === 'let-me-think-about-it') { - // If the user selects "Let me think about it", their stage change to 2 + // If the user selects "Let me think about it", set their psyStage to 2. + if(valueFromFormData === 'let-me-think-about-it') { psychologicalStage = '2 - Aware'; + } else {// If the user is ready to deploy Fleet in their work environemnt, then they're ready to get buy-in from their team, so set their psyStage to 5. + psychologicalStage = '5 - Personally confident'; } // If the user selects "I’d like you to host Fleet for me", the form is not submitted, and they are taken to the /contact page instead. FUTURE: set stage to stage 5. + } else if(currentStep === 'how-was-your-deployment') { + if(valueFromFormData === 'decided-to-not-use-fleet') { + psychologicalStage = '2 - Aware'; + } else if(valueFromFormData === 'up-and-running'){ + psychologicalStage = '6 - Has team buy-in'; + } } else if(currentStep === 'how-many-hosts') { // If they have Fleet deployed, they have team buy-in psychologicalStage = '6 - Has team buy-in'; diff --git a/website/assets/js/pages/start.page.js b/website/assets/js/pages/start.page.js index 47dfe0bc98..edb2b1f43a 100644 --- a/website/assets/js/pages/start.page.js +++ b/website/assets/js/pages/start.page.js @@ -20,6 +20,9 @@ parasails.registerPage('start', { 'what-do-you-manage-mdm': {}, 'is-it-any-good': {stepCompleted: true}, 'what-did-you-think': {}, + 'deploy-fleet-in-your-environment': {stepCompleted: true}, + 'how-was-your-deployment': {}, + 'whats-left-to-get-you-set-up': {}, }, // For tracking client-side validation errors in our form. // > Has property set to `true` for each invalid property in `formData`. @@ -56,6 +59,12 @@ parasails.registerPage('start', { endpointOpsSecurityWhatDidYouThinkFormRules: { whatDidYouThink: {required: true} }, + howWasYourDeploymentFormRules: { + howWasYourDeployment: {required: true} + }, + whatsLeftToGetYouSetUpFormRules: { + whatsLeftToGetSetUp: {required: true} + }, previouslyAnsweredQuestions: {}, // Server error state for the forms @@ -94,8 +103,12 @@ parasails.registerPage('start', { formData: formDataForThisStep, }); this.previouslyAnsweredQuestions[this.currentStep] = getStartedProgress[this.currentStep]; - this.syncing = false; - this.currentStep = nextStep; + if(_.startsWith(nextStep, '/')){ + window.location = nextStep; + } else { + this.syncing = false; + this.currentStep = nextStep; + } }, clickGoToPreviousStep: async function() { switch(this.currentStep) { @@ -150,6 +163,12 @@ parasails.registerPage('start', { case 'what-do-you-manage-mdm': this.currentStep = 'have-you-ever-used-fleet'; break; + case 'how-was-your-deployment': + this.currentStep = 'deploy-fleet-in-your-environment'; + break; + case 'whats-left-to-get-you-set-up': + this.currentStep = 'how-was-your-deployment'; + break; } }, getNextStep: function() { @@ -210,11 +229,36 @@ parasails.registerPage('start', { break; case 'what-did-you-think': if(this.formData['what-did-you-think'].whatDidYouThink === 'let-me-think-about-it'){ - nextStepInForm = 'is-it-any-good'; + nextStepInForm = '/announcements'; } else { nextStepInForm = 'deploy-fleet-in-your-environment'; } break; + case 'deploy-fleet-in-your-environment': + nextStepInForm = 'how-was-your-deployment'; + break; + case 'how-was-your-deployment': + if(this.formData['how-was-your-deployment'].howWasYourDeployment === 'up-and-running') { + nextStepInForm = 'whats-left-to-get-you-set-up'; + } else if(this.formData['how-was-your-deployment'].howWasYourDeployment === 'kinda-stuck'){ + nextStepInForm = '/contact'; + } else if(this.formData['how-was-your-deployment'].howWasYourDeployment === 'havent-gotten-to-it') { + nextStepInForm = 'deploy-fleet-in-your-environment'; + } else if(this.formData['how-was-your-deployment'].howWasYourDeployment === 'changed-mind-want-managed-deployment'){ + nextStepInForm = 'what-did-you-think'; + } else if(this.formData['how-was-your-deployment'].howWasYourDeployment === 'decided-to-not-use-fleet'){ + nextStepInForm = '/'; + } + break; + case 'whats-left-to-get-you-set-up': + if(this.formData['whats-left-to-get-you-set-up'].whatsLeftToGetSetUp === 'need-premium-license-key') { + nextStepInForm = '/new-license'; + } else if(this.formData['whats-left-to-get-you-set-up'].whatsLeftToGetSetUp === 'nothing'){ + nextStepInForm = '/swag'; + } else { + nextStepInForm = '/contact'; + } + break; } return nextStepInForm; }, @@ -235,6 +279,9 @@ parasails.registerPage('start', { this.formData[step] = this.previouslyAnsweredQuestions[step]; } this.currentStep = this.getNextStep(); + if(_.startsWith(this.currentStep, '/')){ + this.currentStep = this.me.lastSubmittedGetStartedQuestionnaireStep; + } } }, } diff --git a/website/views/pages/start.ejs b/website/views/pages/start.ejs index 174ca9f4b8..65ddbf33ea 100644 --- a/website/views/pages/start.ejs +++ b/website/views/pages/start.ejs @@ -9,7 +9,7 @@

Let’s get started

To see whether Fleet’s right for your team, let's have a look at your hosts and what you're trying to do.

You can come back at any time and pick up where you left off.

- +
Start
@@ -21,11 +21,11 @@ // └┴┘┴ ┴┴ ┴ ┴ ┴ ┴┴└─└─┘ ┴ └─┘└─┘ └─┘└─┘┴┘└┘└─┘ └ ┴─┘└─┘└─┘ ┴ └ └─┘┴└─%>
-
+
🏆

What will you use Fleet for?

- +