From 257f7768a8a81034c07dc90d0efda1c6ee878269 Mon Sep 17 00:00:00 2001 From: Alex Birdsall Date: Tue, 29 Nov 2022 15:04:41 -0800 Subject: [PATCH] s/overwrite/enabled/ in the new LD flag payloads The purpose of the value and the contextual meaning of `true` and `false` just read more easily with this phrasing. --- .../launchdarkly/LDExperimentService.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/airbyte-webapp/src/packages/cloud/services/thirdParty/launchdarkly/LDExperimentService.tsx b/airbyte-webapp/src/packages/cloud/services/thirdParty/launchdarkly/LDExperimentService.tsx index 1c6a7336eba1..f30becf73f6c 100644 --- a/airbyte-webapp/src/packages/cloud/services/thirdParty/launchdarkly/LDExperimentService.tsx +++ b/airbyte-webapp/src/packages/cloud/services/thirdParty/launchdarkly/LDExperimentService.tsx @@ -33,14 +33,14 @@ import { rejectAfter } from "utils/promises"; * states LaunchDarkly can provide for a user/feature pair: * |--------------------------+-----------------------------------------------| * | `{}` | use the application's default feature setting | - * | `{ "overwrite": true }` | enable the feature | - * | `{ "overwrite": false }` | disable the feature | + * | `{ "enabled": true }` | enable the feature | + * | `{ "enabled": false }` | disable the feature | * |--------------------------+-----------------------------------------------| */ const FEATURE_FLAG_PREFIX = "featureService"; type LDFeatureName = `${typeof FEATURE_FLAG_PREFIX}.${FeatureItem}`; interface LDFeatureToggle { - overwrite?: boolean; + enabled?: boolean; } type LDFeatureFlagResponse = Record; type LDInitState = "initializing" | "failed" | "initialized"; @@ -93,18 +93,18 @@ const LDInitializationWrapper: React.FC { const allFlags = (ldClient.current?.allFlags() ?? {}) as LDFeatureFlagResponse; const featureSet: FeatureSet = Object.fromEntries( Object.entries(allFlags) .filter(([flagName]) => flagName.startsWith(FEATURE_FLAG_PREFIX)) - .map(([flagName, { overwrite }]) => [flagName.replace(`${FEATURE_FLAG_PREFIX}.`, ""), overwrite]) - .filter(([_, overwrite]) => typeof overwrite !== "undefined") + .map(([flagName, { enabled }]) => [flagName.replace(`${FEATURE_FLAG_PREFIX}.`, ""), enabled]) + .filter(([_, enabled]) => typeof enabled !== "undefined") ); setFeatureOverwrites(featureSet);