From 2e57fe5d4f7f2cfb015cf780d662ea71cff0ef73 Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Wed, 13 Jun 2018 10:15:36 -0700 Subject: [PATCH] UI-3067: Handle missing i18n feature code key (#67) --- submodules/featureCodes/featureCodes.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/submodules/featureCodes/featureCodes.js b/submodules/featureCodes/featureCodes.js index 74c0f71..1e13283 100644 --- a/submodules/featureCodes/featureCodes.js +++ b/submodules/featureCodes/featureCodes.js @@ -108,6 +108,7 @@ define(function(require) { // Some old callflows have been created with the feature code key, so we had the check to make sure they also have a name associated if (callflow.featurecode.hasOwnProperty('name')) { var category = 'misc', + i18nFeatureCode = self.i18n.active().featureCodes.labels[callflow.featurecode.name], hasStar = (callflow.hasOwnProperty('numbers') && callflow.numbers.length && callflow.numbers[0].substr(0, 1) === '*') || (callflow.hasOwnProperty('patterns') && callflow.patterns.length && callflow.patterns[0].substr(0, 3) === '^\\*'); _.find(self.categories, function(cat, key) { @@ -127,8 +128,12 @@ define(function(require) { featureCodes[category].codes.push({ key: callflow.featurecode.name, - name: self.i18n.active().featureCodes.labels[callflow.featurecode.name].label || callflow.featurecode.name, - tooltip: self.i18n.active().featureCodes.labels[callflow.featurecode.name].tooltip || undefined, + name: i18nFeatureCode + ? i18nFeatureCode.label + : _.capitalize(callflow.featurecode.name), + tooltip: i18nFeatureCode + ? i18nFeatureCode.tooltip + : undefined, number: callflow.featurecode.number ? callflow.featurecode.number.replace(/\\/g, '') : '', hasStar: hasStar });