From 029ea7e5f62c0afb7969ae408c262faf50ff715d Mon Sep 17 00:00:00 2001 From: Sagar Naik Date: Fri, 1 Dec 2023 18:16:41 +0530 Subject: [PATCH] disabled the system metrics --- .../hyperswitch/HyperSwitchApp.res | 4 +++- src/entryPoints/hyperswitch/SidebarValues.res | 20 ++++++++++++++----- .../HomePageOverviewComponent.res | 10 +++++++++- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/entryPoints/hyperswitch/HyperSwitchApp.res b/src/entryPoints/hyperswitch/HyperSwitchApp.res index e6a3c48a5..98f767eae 100644 --- a/src/entryPoints/hyperswitch/HyperSwitchApp.res +++ b/src/entryPoints/hyperswitch/HyperSwitchApp.res @@ -323,7 +323,9 @@ let make = () => { | list{"monitoring"} => comingSoonPage | list{"developer-api-keys"} => | list{"developer-system-metrics"} => - Js.String2.includes("internal_")}> + Js.String2.includes("internal_") && + featureFlagDetails.systemMetrics}> diff --git a/src/entryPoints/hyperswitch/SidebarValues.res b/src/entryPoints/hyperswitch/SidebarValues.res index 95747840f..35f4ecf5b 100644 --- a/src/entryPoints/hyperswitch/SidebarValues.res +++ b/src/entryPoints/hyperswitch/SidebarValues.res @@ -195,7 +195,7 @@ let apiKeys = SubLevelLink({ searchOptions: [("View API Keys", "")], }) -let systemMetrics = SubLevelLink({ +let systemMetric = SubLevelLink({ name: "System Metrics", link: `/developer-system-metrics`, access: ReadWrite, @@ -210,7 +210,7 @@ let webhooks = SubLevelLink({ searchOptions: [("View Webhooks", "")], }) -let developers = (isDevelopersEnabled, ~userRole) => { +let developers = (isDevelopersEnabled, userRole, systemMetrics) => { let isInternalUser = userRole->Js.String2.includes("internal_") isDevelopersEnabled @@ -218,7 +218,9 @@ let developers = (isDevelopersEnabled, ~userRole) => { name: "Developers", icon: "developer", showSection: true, - links: isInternalUser ? [apiKeys, webhooks, systemMetrics] : [apiKeys, webhooks], + links: isInternalUser && systemMetrics + ? [apiKeys, webhooks, systemMetric] + : [apiKeys, webhooks], }) : emptyComponent } @@ -282,7 +284,15 @@ let getHyperSwitchAppSidebars = ( ~userRole, (), ) => { - let {productionAccess, frm, payOut, recon, default, userManagement} = featureFlagDetails + let { + productionAccess, + frm, + payOut, + recon, + default, + userManagement, + systemMetrics, + } = featureFlagDetails let sidebar = [ productionAccess->productionAccessComponent, default->home, @@ -290,7 +300,7 @@ let getHyperSwitchAppSidebars = ( default->analytics, default->connectors, default->workflow, - default->developers(~userRole), + default->developers(userRole, systemMetrics), default->settings, [frm, payOut, recon]->Js.Array2.includes(true)->proFeatures, frm->fraudAndRisk, diff --git a/src/screens/HyperSwitch/Analytics/HomePageOverview/HomePageOverviewComponent.res b/src/screens/HyperSwitch/Analytics/HomePageOverview/HomePageOverviewComponent.res index c341829a4..03f95e8de 100644 --- a/src/screens/HyperSwitch/Analytics/HomePageOverview/HomePageOverviewComponent.res +++ b/src/screens/HyperSwitch/Analytics/HomePageOverview/HomePageOverviewComponent.res @@ -245,12 +245,20 @@ module OverviewInfo = { @react.component let make = () => { + let {systemMetrics} = + HyperswitchAtom.featureFlagAtom + ->Recoil.useRecoilValueFromAtom + ->LogicUtils.safeParse + ->FeatureFlagUtils.featureFlagType +

{"Overview"->React.string}

- + + +