@gooddata/js-utils
Advanced tools
Comparing version 3.10.1-alpha-khanh.le-kl-GD-1226-2020-04-06T09-41-13-641Z to 3.10.1-alpha-khanh.le-kl-SD-912-featureFlags-utils-2020-04-07T07-16-16-392Z
interface IFeatureFlags { | ||
disablePPExperience?: boolean; | ||
enablePPExperience?: boolean; | ||
hidePixelPerfectExperience?: boolean; | ||
platformEdition?: string; | ||
[key: string]: number | boolean | string; | ||
} | ||
export declare function shouldHidePPExperience(featureFlags: IFeatureFlags): boolean; | ||
export declare function isFreemiumEdition(platformEdition: string | undefined): boolean; | ||
export declare function isFreemiumEdition(platformEdition: string): boolean; | ||
export {}; |
@@ -7,5 +7,7 @@ "use strict"; | ||
function shouldHidePPExperience(featureFlags) { | ||
var disablePPExperience = featureFlags.disablePPExperience, enablePPExperience = featureFlags.enablePPExperience, hidePixelPerfectExperience = featureFlags.hidePixelPerfectExperience, platformEdition = featureFlags.platformEdition; | ||
var enablePPExperience = featureFlags.enablePPExperience; | ||
var hidePixelPerfectExperience = featureFlags.hidePixelPerfectExperience; | ||
var platformEdition = featureFlags.platformEdition; | ||
var isFreemiumUser = isFreemiumEdition(platformEdition); | ||
return hidePixelPerfectExperience || disablePPExperience || (isFreemiumUser && !enablePPExperience); | ||
return hidePixelPerfectExperience || (isFreemiumUser && !enablePPExperience); | ||
} | ||
@@ -12,0 +14,0 @@ exports.shouldHidePPExperience = shouldHidePPExperience; |
{ | ||
"name": "@gooddata/js-utils", | ||
"version": "3.10.1-alpha-khanh.le-kl-GD-1226-2020-04-06T09-41-13-641Z", | ||
"version": "3.10.1-alpha-khanh.le-kl-SD-912-featureFlags-utils-2020-04-07T07-16-16-392Z", | ||
"description": "Various utils shared on GoodData frontend", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -6,16 +6,15 @@ // (C) 2020 GoodData Corporation | ||
interface IFeatureFlags { | ||
disablePPExperience?: boolean; | ||
enablePPExperience?: boolean; | ||
hidePixelPerfectExperience?: boolean; | ||
platformEdition?: string; | ||
[key: string]: number | boolean | string; | ||
} | ||
export function shouldHidePPExperience(featureFlags: IFeatureFlags): boolean { | ||
const {disablePPExperience, enablePPExperience, hidePixelPerfectExperience, platformEdition } = featureFlags; | ||
const isFreemiumUser = isFreemiumEdition(platformEdition); | ||
const enablePPExperience = featureFlags.enablePPExperience as boolean; | ||
const hidePixelPerfectExperience = featureFlags.hidePixelPerfectExperience as boolean; | ||
const platformEdition = featureFlags.platformEdition as string; | ||
const isFreemiumUser = isFreemiumEdition(platformEdition as string); | ||
return hidePixelPerfectExperience || disablePPExperience || (isFreemiumUser && !enablePPExperience); | ||
return hidePixelPerfectExperience || (isFreemiumUser && !enablePPExperience); | ||
} | ||
export function isFreemiumEdition(platformEdition: string | undefined): boolean { | ||
export function isFreemiumEdition(platformEdition: string): boolean { | ||
if (!platformEdition) { | ||
@@ -22,0 +21,0 @@ return false; |
Sorry, the diff of this file is not supported yet
61661
56
1212