Files
fleet/website/api/controllers/view-pricing.js
T
Mike McNeilandEric 53139842f4 Website: Heading looks weird without tabs (#46413)
<img width="1048" height="205" alt="image"
src="https://github.com/user-attachments/assets/8f72da4d-d898-41ec-94bd-79f747eedda5"
/>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Reorganized pricing table: device-related features are now grouped
under "Device management" for clearer, more consistent categorization.
* **Bug Fixes**
* Pricing page grouping updated so the new category displays correctly.
* **Chores**
* Build/validation updated to accept the "Device management" category,
preventing misclassification during site builds.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/fleetdm/fleet/pull/46413?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Eric <eashaw@sailsjs.com>
2026-06-01 11:38:55 -05:00

56 lines
1.4 KiB
JavaScript
Vendored

module.exports = {
friendlyName: 'View pricing',
description: 'Display "Pricing" page.',
exits: {
success: {
viewTemplatePath: 'pages/pricing'
},
badConfig: {
responseType: 'badConfig'
},
},
fn: async function () {
if(!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.pricingTable)) {
throw {badConfig: 'builtStaticContent.pricingTable'};
}
let pricingTableFeatures = sails.config.builtStaticContent.pricingTable;
let pricingTable = [];
let pricingTableCategories = ['Device management', 'Deployment', 'Configuration', 'Integrations', 'Support'];
for(let category of pricingTableCategories) {
// Get all the features in that have a pricingTableFeatures array that contains this category.
let featuresInThisCategory = _.filter(pricingTableFeatures, (feature)=>{
return _.contains(feature.pricingTableCategories, category);
});
// Build a dictionary containing the category name, and all features in the category, sorting premium features to the bottom of the list.
let allFeaturesInThisCategory = {
categoryName: category,
features: featuresInThisCategory,
};
// Add the dictionaries to the arrays that we'll use to build the features table.
pricingTable.push(allFeaturesInThisCategory);
}
// Respond with view.
return {
pricingTable
};
}
};