From 2140715e1e498464689cf92db2b260367c96c059 Mon Sep 17 00:00:00 2001 From: Sampfluger88 <108141731+Sampfluger88@users.noreply.github.com> Date: Sat, 7 Oct 2023 16:11:49 -0500 Subject: [PATCH] Update build-static-content.js --- website/scripts/build-static-content.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/website/scripts/build-static-content.js b/website/scripts/build-static-content.js index 97fde84599da..fae01f1bb71e 100644 --- a/website/scripts/build-static-content.js +++ b/website/scripts/build-static-content.js @@ -798,18 +798,22 @@ module.exports = { } // Validate all features in a category. for(let feature of category.features){ - if(!feature.name) { // Throw an error if a feature is missing a `name`. - throw new Error('Could not build pricing table config from pricing-features-table.yml. A feature in the "'+category.categoryName+'" category is missing a "name". To resolve, add a "name" to this feature '+feature); + if(feature.name) { + throw new Error('Could not build pricing table config from pricing-features-table.yml. A feature in the "'+category.categoryName+'" category has a "name" which is no longer supported. To resolve, add a "industryName" to this feature '+feature); + } + feature.name = feature.industryName; // Alias FUTURE: update code to use industryName everywhere + if(!feature.industryName) { // Throw an error if a feature is missing an `industryName`. + throw new Error('Could not build pricing table config from pricing-features-table.yml. A feature in the "'+category.categoryName+'" category is missing a "industryName". To resolve, add a "industryName" to this feature '+feature); } if(!feature.tier) { // Throw an error if a feature is missing a `tier`. - throw new Error('Could not build pricing table config from pricing-features-table.yml. The "'+feature.name+'" feature is missing a "tier". To resolve, add a "tier" (either "Free" or "Premium") to this feature.'); + throw new Error('Could not build pricing table config from pricing-features-table.yml. The "'+feature.industryName+'" feature is missing a "tier". To resolve, add a "tier" (either "Free" or "Premium") to this feature.'); } else if(!_.contains(['Free', 'Premium'], feature.tier)){ // Throw an error if a feature's `tier` is not "Free" or "Premium". - throw new Error('Could not build pricing table config from pricing-features-table.yml. The "'+feature.name+'" feature has an invalid "tier". to resolve, change the value of this features "tier" (currently set to '+feature.tier+') to be either "Free" or "Premium".'); + throw new Error('Could not build pricing table config from pricing-features-table.yml. The "'+feature.industryName+'" feature has an invalid "tier". to resolve, change the value of this features "tier" (currently set to '+feature.tier+') to be either "Free" or "Premium".'); } if(feature.comingSoon === undefined) { // Throw an error if a feature is missing a `comingSoon` value - throw new Error('Could not build pricing table config from pricing-features-table.yml. The "'+feature.name+'" feature is missing a "comingSoon" value (boolean). To resolve, add a comingSoon value to this feature.'); + throw new Error('Could not build pricing table config from pricing-features-table.yml. The "'+feature.industryName+'" feature is missing a "comingSoon" value (boolean). To resolve, add a comingSoon value to this feature.'); } else if(typeof feature.comingSoon !== 'boolean'){ // Throw an error if the `comingSoon` value is not a boolean. - throw new Error('Could not build pricing table config from pricing-features-table.yml. The "'+feature.name+'" feature has an invalid "comingSoon" value (currently set to '+feature.comingSoon+'). To resolve, change the value of "comingSoon" for this feature to be either "true" or "false".'); + throw new Error('Could not build pricing table config from pricing-features-table.yml. The "'+feature.industryName+'" feature has an invalid "comingSoon" value (currently set to '+feature.comingSoon+'). To resolve, change the value of "comingSoon" for this feature to be either "true" or "false".'); } } }