From 15d2e6e341f9336f69cb3d23fbaf0c90c8acce3e Mon Sep 17 00:00:00 2001 From: dvenga <126671331+dvenga@users.noreply.github.com> Date: Thu, 11 Jan 2024 20:23:10 +0530 Subject: [PATCH] fix: revert customer module flag removal (#244) --- README.md | 4 ++++ config/FeatureFlag.json | 3 ++- src/entryPoints/hyperswitch/FeatureFlagUtils.res | 2 ++ src/entryPoints/hyperswitch/HyperSwitchApp.res | 16 +++++++++------- src/entryPoints/hyperswitch/SidebarValues.res | 9 ++++++--- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0b5987d27..de312d8d8 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,10 @@ The `production_access` feature flag enables a flow for users to request live pr The `quick_start` feature flag enables the simplified onboarding flow for new users, where they connect to processors, configure payment routing and test a payment, all in one flow. +#### Customers Module + +The `customers_module` feature flag enables the customers module in dashboard. Users can see the customers and their details via enabling this flag. + --- ## Deployment diff --git a/config/FeatureFlag.json b/config/FeatureFlag.json index ac79d7b7b..6067fb9b5 100644 --- a/config/FeatureFlag.json +++ b/config/FeatureFlag.json @@ -21,5 +21,6 @@ "generate_report": false, "forgot_password": false, "user_journey_analytics": false, - "surcharge": false + "surcharge": false, + "customers_module": false } diff --git a/src/entryPoints/hyperswitch/FeatureFlagUtils.res b/src/entryPoints/hyperswitch/FeatureFlagUtils.res index 6d79cd346..438bc3945 100644 --- a/src/entryPoints/hyperswitch/FeatureFlagUtils.res +++ b/src/entryPoints/hyperswitch/FeatureFlagUtils.res @@ -23,6 +23,7 @@ type featureFlag = { forgetPassword: bool, userJourneyAnalytics: bool, surcharge: bool, + customersModule: bool, } let featureFlagType = (featureFlags: Js.Json.t) => { @@ -53,6 +54,7 @@ let featureFlagType = (featureFlags: Js.Json.t) => { forgetPassword: dict->getBool("forgot_password", false), userJourneyAnalytics: dict->getBool("user_journey_analytics", false), surcharge: dict->getBool("surcharge", false), + customersModule: dict->getBool("customers_module", false), } typedFeatureFlag } diff --git a/src/entryPoints/hyperswitch/HyperSwitchApp.res b/src/entryPoints/hyperswitch/HyperSwitchApp.res index 00f98babe..795a31657 100644 --- a/src/entryPoints/hyperswitch/HyperSwitchApp.res +++ b/src/entryPoints/hyperswitch/HyperSwitchApp.res @@ -283,13 +283,15 @@ let make = () => { renderShow={id => } /> | list{"customers", ...remainingPath} => - } - renderShow={id => } - /> + + } + renderShow={id => } + /> + | list{"routing", ...remainingPath} => { +let operations = (isOperationsEnabled, customersModule) => { isOperationsEnabled ? Section({ name: "Operations", icon: "hswitch-operations", showSection: true, - links: [payments, refunds, disputes, customers], + links: customersModule + ? [payments, refunds, disputes, customers] + : [payments, refunds, disputes], }) : emptyComponent } @@ -328,11 +330,12 @@ let getHyperSwitchAppSidebars = ( userJourneyAnalytics: userJourneyAnalyticsFlag, surcharge: isSurchargeEnabled, isLiveMode, + customersModule, } = featureFlagDetails let sidebar = [ productionAccess->productionAccessComponent, default->home, - default->operations, + default->operations(customersModule), default->analytics(userJourneyAnalyticsFlag), default->connectors(isLiveMode), default->workflow(isSurchargeEnabled),