From ef965d66de2dcd9325ac731022a1bf0930aca9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Fri, 30 Sep 2022 10:45:34 +0200 Subject: [PATCH] feat: Open-Source Strategy Constraints (#2112) This commits lift the flags and makes Strategy Constraints available to all users of Unleash. Read more in the docs: https://docs.getunleash.io/advanced/strategy_constraints Enjoy! @ivarconr Author and maintainer --- .../FeatureStrategyForm.tsx | 22 +++++-------------- .../__snapshots__/routes.test.tsx.snap | 3 --- frontend/src/component/menu/routes.ts | 5 +---- .../SplashPageRedirect/SplashPageRedirect.tsx | 14 +----------- frontend/yarn.lock | 13 ++++------- 5 files changed, 12 insertions(+), 45 deletions(-) diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyForm.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyForm.tsx index 83d96c97a0..7e9f6ba9a7 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyForm.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyForm.tsx @@ -141,23 +141,13 @@ export const FeatureStrategyForm = ({ /> } /> - - } - /> - } + +
{ // Find the splash page to show (if any). const showSplashId = activeSplashIds.find(splashId => { - return ( - isSplashRelevant(splashId, uiConfig.flags) && - !hasSeenSplashId(splashId, splash) - ); + return !hasSeenSplashId(splashId, splash); }); if (!showSplashId) { @@ -47,11 +43,3 @@ export const SplashPageRedirect = () => { const hasSeenSplashId = (splashId: SplashId, splash: IAuthSplash): boolean => { return Boolean(splash[splashId]); }; - -const isSplashRelevant = (splashId: SplashId, flags: IFlags): boolean => { - if (splashId === 'operators') { - return Boolean(flags.C || flags.CO); - } - - return true; -}; diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 6ff67e6bc3..e8397b4dea 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -3070,15 +3070,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001317: - version "1.0.30001325" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001325.tgz#2b4ad19b77aa36f61f2eaf72e636d7481d55e606" - integrity sha512-sB1bZHjseSjDtijV1Hb7PB2Zd58Kyx+n/9EotvZ4Qcz2K3d0lWB8dB4nb8wN/TsOGFq3UuAm0zQZNQ4SoR7TrQ== - -caniuse-lite@^1.0.30001332: - version "1.0.30001339" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001339.tgz#f9aece4ea8156071613b27791547ba0b33f176cf" - integrity sha512-Es8PiVqCe+uXdms0Gu5xP5PF2bxLR7OBp3wUzUnuO7OHzhOfCyg3hdiGWVPVxhiuniOzng+hTc1u3fEQ0TlkSQ== +caniuse-lite@^1.0.30001317, caniuse-lite@^1.0.30001332: + version "1.0.30001414" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001414.tgz" + integrity sha512-t55jfSaWjCdocnFdKQoO+d2ct9C59UZg4dY3OnUlSZ447r8pUtIKdp0hpAzrGFultmTC+Us+KpKi4GZl/LXlFg== caseless@~0.12.0: version "0.12.0"