From 37682f20475bc7876a7ff567ff8f73ed243f2e08 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 9 Jun 2023 16:52:39 -0500 Subject: [PATCH] Website: Change pricing table based on selected use case (#12148) Closes #11965 Changes: - Updated the pricing table on the pricing page to be rendered by the server. - Updated the pricing page's view action to create another version of the pricing table that does not have the "Device management" category and that has security features sorted to the top of the table. - Moved two features from the "Device management" category to "Security and compliance" in `pricing-features-table.yml`. --- handbook/product/pricing-features-table.yml | 12 +- website/api/controllers/view-pricing.js | 34 +++- website/assets/js/pages/pricing.page.js | 2 +- website/views/pages/pricing.ejs | 172 +++++++++++++++----- 4 files changed, 170 insertions(+), 50 deletions(-) diff --git a/handbook/product/pricing-features-table.yml b/handbook/product/pricing-features-table.yml index 9858361bac..df7684cdce 100644 --- a/handbook/product/pricing-features-table.yml +++ b/handbook/product/pricing-features-table.yml @@ -1,8 +1,5 @@ - categoryName: Device management features: - - name: Report on disk encryption status (FileVault) - tier: Free - comingSoon: false - name: User-initiated enrollment of macOS computers tier: Free comingSoon: false @@ -33,9 +30,6 @@ - name: Remotely lock and wipe macOS computers tier: Premium comingSoon: false - - name: Trigger a workflow based on a failing policy - tier: Premium - comingSoon: true - name: Update apps on macOS computers tier: Premium comingSoon: true @@ -95,6 +89,9 @@ - name: Single sign on (SSO, SAML) tier: Free comingSoon: false + - name: Report on disk encryption status (FileVault) + tier: Free + comingSoon: false - name: Audit queries and user activities tier: Free comingSoon: false @@ -119,6 +116,9 @@ - name: Vanta integration tier: Premium comingSoon: false + - name: Trigger a workflow based on a failing policy + tier: Premium + comingSoon: true - name: Granular role-based access control tier: Premium comingSoon: false diff --git a/website/api/controllers/view-pricing.js b/website/api/controllers/view-pricing.js index 1f65d22a11..8bd760dd68 100644 --- a/website/api/controllers/view-pricing.js +++ b/website/api/controllers/view-pricing.js @@ -27,8 +27,40 @@ module.exports = { } let pricingTable = sails.config.builtStaticContent.pricingTable; + // Create a filtered version of the pricing table array that does not have the "Device management" category that will be used for the security-focused pricing table. + let pricingTableForSecurity = pricingTable.filter((category)=>{ + return category.categoryName !== 'Device management'; + }); + + // Create an array used to sort the pricing table for secuirty focused buyers + // To change the order of the pricing table for the security focused buyers, rearrange the values in the array below. + // Note: The category names must match existing categories in the pricing-features-table.yml file. + let categoryOrderForSecurityPricingTable = [ + 'Security and compliance', + 'Monitoring', + 'Inventory management', + 'Collaboration', + 'Support', + 'Data outputs', + 'Deployment' + ]; + + // Sort the security-focused pricing table from the order of the elements in the categoryOrderForSecurityPricingTable array. + pricingTableForSecurity.sort((a, b)=>{ + // If there is a category that is not in the list above, sort it to the end of the list. + if(categoryOrderForSecurityPricingTable.indexOf(a.categoryName) === -1){ + return 1; + } else if(categoryOrderForSecurityPricingTable.indexOf(b.categoryName) === -1) { + return -1; + } + return categoryOrderForSecurityPricingTable.indexOf(a.categoryName) - categoryOrderForSecurityPricingTable.indexOf(b.categoryName); + }); + // Respond with view. - return { pricingTable }; + return { + pricingTable, + pricingTableForSecurity, + }; } diff --git a/website/assets/js/pages/pricing.page.js b/website/assets/js/pages/pricing.page.js index e46e227f45..442a96eb7b 100644 --- a/website/assets/js/pages/pricing.page.js +++ b/website/assets/js/pages/pricing.page.js @@ -3,7 +3,7 @@ parasails.registerPage('pricing', { // ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣ // ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝ data: { - displaySecurityPricingMode: false, // For pricing mode switch + displaySecurityPricingMode: false,// For pricing mode switch }, // ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗ diff --git a/website/views/pages/pricing.ejs b/website/views/pages/pricing.ejs index 9ed8d260b3..acb7d71789 100644 --- a/website/views/pages/pricing.ejs +++ b/website/views/pages/pricing.ejs @@ -128,55 +128,143 @@ - - <%// Features table %> -
+ <%// IT-focused features table %> +

Compare plans

- <%// Desktop features tables %> + <%// Desktop IT-focused features tables %>
- - - - - - - - - - - - - - - - - - -

{{category.categoryName}}

- Free - - Premium -
{{feature.name}}{{feature.comingSoon ? '*' : ''}}checkmarkcheckmark
+ <% for(let category of pricingTable) {%> + + + + + <%if(pricingTable.indexOf(category) === 0) {%> + + <%}else {%> + + <%}%> + <%if(pricingTable.indexOf(category) === 0) {%> + + <%}else {%> + + <%}%> + + + + <% for( let feature of category.features){ %> + + + <%if(feature.tier === 'Free') {%> + + <%} else {%> + + <%}%> + + + <% }%> + +

<%- category.categoryName %>

+ Free + + Premium +
<%- feature.name %><%- feature.comingSoon ? '*' : '' %>checkmarkcheckmark
+ <% }%>

* Coming soon

- <%// Mobile features tables %> -
-

{{category.categoryName}}

-
-
- {{feature.name}}{{feature.comingSoon ? '*' : ''}} -
-
- Free - checkmark -
-
- Premium - checkmark -
+ <%// Mobile IT-focused features tables %> + <% for(let category of pricingTable) {%> +
+

<%- category.categoryName %>

+ <% for( let feature of category.features){ %> +
+
+ <%- feature.name %><%- feature.comingSoon ? '*' : '' %> +
+
+ Free + <%if(feature.tier === 'Free') {%> + checkmark + <% } %> +
+
+ Premium + checkmark +
+
+ <% }%>
+ <% }%> +

* Coming soon

+
+
+ <%// Security-focused features table %> +
+

Compare plans

+
+ <%// Desktop security-focused features tables %> +
+ <% for(let category of pricingTableForSecurity) {%> + + + + + <%if(pricingTable.indexOf(category) === 0) {%> + + <%}else {%> + + <%}%> + <%if(pricingTable.indexOf(category) === 0) {%> + + <%}else {%> + + <%}%> + + + + <% for( let feature of category.features){ %> + + + <%if(feature.tier === 'Free') {%> + + <%} else {%> + + <%}%> + + + <% }%> + +

<%- category.categoryName %>

+ Free + + Premium +
<%- feature.name %><%- feature.comingSoon ? '*' : '' %>checkmarkcheckmark
+ <% }%> +

* Coming soon

+ <%// Mobile security-focused features tables %> + <% for(let category of pricingTableForSecurity) {%> +
+

<%- category.categoryName %>

+ <% for( let feature of category.features){ %> +
+
+ <%- feature.name %><%- feature.comingSoon ? '*' : '' %> +
+
+ Free + <%if(feature.tier === 'Free') {%> + checkmark + <% } %> +
+
+ Premium + checkmark +
+
+ <% }%> +
+ <% }%>

* Coming soon