From b031d18faa5b796735310f5bcb5fa4554f366b42 Mon Sep 17 00:00:00 2001 From: Connor Anderson Date: Fri, 5 May 2023 17:48:33 -0400 Subject: [PATCH] feedback --- hbshelpers/sdkAssetUrl.js | 6 ++++-- test-site/config/global_config.json | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hbshelpers/sdkAssetUrl.js b/hbshelpers/sdkAssetUrl.js index cc34b4364..bbb92acdd 100644 --- a/hbshelpers/sdkAssetUrl.js +++ b/hbshelpers/sdkAssetUrl.js @@ -2,6 +2,8 @@ const RELEASE_BRANCH_REGEX = /^release\/v[0-9.]+$/; const HOTFIX_BRANCH_REGEX = /^hotfix\/v[0-9.]+$/; const I18N_FEATURE_BRANCH_REGEX = /^feature\/.+-i18n$/; const SEM_VER_REGEX = /^[1-9]+$|^[1-9]+\.[0-9]+$|^[1-9]+\.[0-9]+\.[0-9]+$/; +const US = 'us'; +const EU = 'eu'; /** * Given a branch (or release) of the SDK and a locale, this helper provides the correct @@ -17,7 +19,7 @@ module.exports = function sdkAssetUrl( branch, locale, assetName, - cloudRegion = 'us' + cloudRegion = US ) { const isReleasedBranch = SEM_VER_REGEX.test(branch); @@ -42,7 +44,7 @@ module.exports = function sdkAssetUrl( `${locale}-${assetName}` : assetName; - const domain = cloudRegion === 'eu' + const domain = cloudRegion === EU ? 'assets.eu.sitescdn.net' : 'assets.sitescdn.net'; diff --git a/test-site/config/global_config.json b/test-site/config/global_config.json index be2b502c7..558b2887a 100644 --- a/test-site/config/global_config.json +++ b/test-site/config/global_config.json @@ -1,10 +1,10 @@ { - "sdkVersion": "1.15", // The version of the Answers SDK to use + "sdkVersion": "develop", // The version of the Answers SDK to use // "token": "", // The auth token to access Answers experience. "apiKey": "2d8c550071a64ea23e263118a2b0680b", // The answers api key found on the experiences page. This will be provided automatically by the Yext CI system // "experienceVersion": "", // the Answers Experience version to use for API requests. This will be provided automatically by the Yext CI system // "environment": "production", // The environment to run on for this Answers Experience. (i.e. 'production' or 'sandbox') - // "cloudRegion": "us", // The cloud region to use for this Answers Experience. (i.e. 'us' or 'eu') + "cloudRegion": "eu", // The cloud region to use for this Answers Experience. (i.e. 'us' or 'eu') "businessId": "3350634", // The business ID of the account. This will be provided automatically by the Yext CI system // "initializeManually": true, // If true, the experience must be started by calling AnswersExperience.init() or AnswersExperienceFrame.init() for iframe integrations. // "useJWT": true, // Whether or not to enable JWT. If true, the apiKey will be hidden from the build and the token must be specified through the runtime config.