@gooddata/js-utils
Advanced tools
Comparing version 3.10.2 to 3.10.3
interface IFeatureFlags { | ||
[key: string]: number | boolean | string; | ||
hidePixelPerfectExperience: boolean; | ||
enablePixelPerfectExperience: string; | ||
platformEdition: string; | ||
} | ||
@@ -7,0 +4,0 @@ interface INormalizedFeatureFlagContent { |
@@ -16,5 +16,7 @@ "use strict"; | ||
function shouldHidePPExperience(featureFlags) { | ||
var hidePixelPerfectExperience = featureFlags.hidePixelPerfectExperience, enablePixelPerfectExperience = featureFlags.enablePixelPerfectExperience, platformEdition = featureFlags.platformEdition; | ||
var hidePPExperience = featureFlags.hidePixelPerfectExperience; | ||
var enablePPExperience = featureFlags.enablePixelPerfectExperience; | ||
var platformEdition = featureFlags.platformEdition; | ||
var isFreemiumUser = isFreemiumEdition(platformEdition); | ||
return hidePixelPerfectExperience || (isFreemiumUser && enablePixelPerfectExperience !== 'true'); | ||
return hidePPExperience || (isFreemiumUser && enablePPExperience !== 'true'); | ||
} | ||
@@ -21,0 +23,0 @@ exports.shouldHidePPExperience = shouldHidePPExperience; |
{ | ||
"name": "@gooddata/js-utils", | ||
"version": "3.10.2", | ||
"version": "3.10.3", | ||
"description": "Various utils shared on GoodData frontend", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -14,5 +14,2 @@ // (C) 2020 GoodData Corporation | ||
[key: string]: number | boolean | string; | ||
hidePixelPerfectExperience: boolean; | ||
enablePixelPerfectExperience: string; | ||
platformEdition: string; | ||
} | ||
@@ -40,6 +37,8 @@ | ||
export function shouldHidePPExperience(featureFlags: IFeatureFlags): boolean { | ||
const { hidePixelPerfectExperience, enablePixelPerfectExperience, platformEdition } = featureFlags; | ||
const hidePPExperience = featureFlags.hidePixelPerfectExperience as boolean; | ||
const enablePPExperience = featureFlags.enablePixelPerfectExperience as string; | ||
const platformEdition = featureFlags.platformEdition as string; | ||
const isFreemiumUser = isFreemiumEdition(platformEdition); | ||
return hidePixelPerfectExperience || (isFreemiumUser && enablePixelPerfectExperience !== 'true'); | ||
return hidePPExperience || (isFreemiumUser && enablePPExperience !== 'true'); | ||
} | ||
@@ -46,0 +45,0 @@ |
Sorry, the diff of this file is not supported yet
67030
1340