From a51a91f225e18625855bcd0cea66add64e01dc92 Mon Sep 17 00:00:00 2001 From: Jeeva Ramachandran <120017870+JeevaRamu0104@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:53:34 +0530 Subject: [PATCH] chore: add down time feature flag (#1342) --- config/config.toml | 3 +- src/entryPoints/AuthModule/AuthEntry.res | 27 ++++++++++++------ .../AuthModule/UnderMaintenance.res | 28 +++++++++++++++++++ src/entryPoints/FeatureFlagUtils.res | 2 ++ 4 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 src/entryPoints/AuthModule/UnderMaintenance.res diff --git a/config/config.toml b/config/config.toml index 97079db08..c61b0070f 100644 --- a/config/config.toml +++ b/config/config.toml @@ -45,4 +45,5 @@ compliance_certificate=false user_management_revamp=false pm_authentication_processor=true performance_monitor=false -new_analytics=false \ No newline at end of file +new_analytics=false +down_time=false \ No newline at end of file diff --git a/src/entryPoints/AuthModule/AuthEntry.res b/src/entryPoints/AuthModule/AuthEntry.res index 71d1b2234..5b2ce3ff2 100644 --- a/src/entryPoints/AuthModule/AuthEntry.res +++ b/src/entryPoints/AuthModule/AuthEntry.res @@ -1,12 +1,21 @@ @react.component let make = () => { - - - - - - - - - + open HyperswitchAtom + let {downTime} = featureFlagAtom->Recoil.useRecoilValueFromAtom + <> + + + + + + + + + + + + + + + > } diff --git a/src/entryPoints/AuthModule/UnderMaintenance.res b/src/entryPoints/AuthModule/UnderMaintenance.res new file mode 100644 index 000000000..c050a3ba0 --- /dev/null +++ b/src/entryPoints/AuthModule/UnderMaintenance.res @@ -0,0 +1,28 @@ +@react.component +let make = () => { + open HeadlessUI + <> + + + + + {`Hyperswitch Control Center is under maintenance`->React.string} + + + + + + > +} diff --git a/src/entryPoints/FeatureFlagUtils.res b/src/entryPoints/FeatureFlagUtils.res index 9df8407bd..01651ea4b 100644 --- a/src/entryPoints/FeatureFlagUtils.res +++ b/src/entryPoints/FeatureFlagUtils.res @@ -33,6 +33,7 @@ type featureFlag = { pmAuthenticationProcessor: bool, performanceMonitor: bool, newAnalytics: bool, + downTime: bool, } let featureFlagType = (featureFlags: JSON.t) => { @@ -73,6 +74,7 @@ let featureFlagType = (featureFlags: JSON.t) => { pmAuthenticationProcessor: dict->getBool("pm_authentication_processor", false), performanceMonitor: dict->getBool("performance_monitor", false), newAnalytics: dict->getBool("new_analytics", false), + downTime: dict->getBool("down_time", false), } typedFeatureFlag }