Skip to content

Commit

Permalink
disabled the system metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarnaikjuspay committed Dec 1, 2023
1 parent 68decd1 commit 029ea7e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/entryPoints/hyperswitch/HyperSwitchApp.res
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ let make = () => {
| list{"monitoring"} => comingSoonPage
| list{"developer-api-keys"} => <KeyManagement.KeysManagement />
| list{"developer-system-metrics"} =>
<UIUtils.RenderIf condition={userRole->Js.String2.includes("internal_")}>
<UIUtils.RenderIf
condition={userRole->Js.String2.includes("internal_") &&
featureFlagDetails.systemMetrics}>
<AnalyticsUrlUpdaterContext key="SystemMetrics">
<SystemMetricsAnalytics />
</AnalyticsUrlUpdaterContext>
Expand Down
20 changes: 15 additions & 5 deletions src/entryPoints/hyperswitch/SidebarValues.res
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -210,15 +210,17 @@ let webhooks = SubLevelLink({
searchOptions: [("View Webhooks", "")],
})

let developers = (isDevelopersEnabled, ~userRole) => {
let developers = (isDevelopersEnabled, userRole, systemMetrics) => {
let isInternalUser = userRole->Js.String2.includes("internal_")

isDevelopersEnabled
? Section({
name: "Developers",
icon: "developer",
showSection: true,
links: isInternalUser ? [apiKeys, webhooks, systemMetrics] : [apiKeys, webhooks],
links: isInternalUser && systemMetrics
? [apiKeys, webhooks, systemMetric]
: [apiKeys, webhooks],
})
: emptyComponent
}
Expand Down Expand Up @@ -282,15 +284,23 @@ 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,
default->operations(userManagement),
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,20 @@ module OverviewInfo = {

@react.component
let make = () => {
let {systemMetrics} =
HyperswitchAtom.featureFlagAtom
->Recoil.useRecoilValueFromAtom
->LogicUtils.safeParse
->FeatureFlagUtils.featureFlagType

<div className="flex flex-col gap-4">
<p className=headingStyle> {"Overview"->React.string} </p>
<div className="grid grid-cols-1 md:grid-cols-3 w-full gap-4">
<ConnectorOverview />
<PaymentOverview />
<SystemMetricsInsights />
<UIUtils.RenderIf condition={systemMetrics}>
<SystemMetricsInsights />
</UIUtils.RenderIf>
</div>
<OverviewInfo />
</div>
Expand Down

0 comments on commit 029ea7e

Please sign in to comment.