From 68decd1b57307ad10c0b777752829a768f62f1e3 Mon Sep 17 00:00:00 2001 From: Sagar Naik Date: Fri, 1 Dec 2023 17:48:59 +0530 Subject: [PATCH 1/4] logs change --- src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res b/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res index 25f62e929..66fd66662 100644 --- a/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res +++ b/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res @@ -18,10 +18,10 @@ module PrettyPrintJson = { let parseJsonValue = () => { try { - let parsedValue = Window.getParsedJson(jsonToDisplay)->Js.Json.stringifyWithSpace(3) + let parsedValue = jsonToDisplay->Js.Json.parseExn->Js.Json.stringifyWithSpace(3) setParsedJson(_ => parsedValue) } catch { - | _ => setParsedJson(_ => "") + | _ => setParsedJson(_ => jsonToDisplay) } } React.useEffect1(() => { From 029ea7e5f62c0afb7969ae408c262faf50ff715d Mon Sep 17 00:00:00 2001 From: Sagar Naik Date: Fri, 1 Dec 2023 18:16:41 +0530 Subject: [PATCH 2/4] 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}

- + + +
From 4a848c1349c2e421af70eccf10aa3fddde3a821a Mon Sep 17 00:00:00 2001 From: Sagar Naik Date: Fri, 1 Dec 2023 18:32:08 +0530 Subject: [PATCH 3/4] payment logs title fix --- .env | 2 +- config/FeatureFlag.json | 2 +- src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 321b79a39..dd73c712c 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -apiBaseUrl=https://sandbox.hyperswitch.io +apiBaseUrl=https://integ-api.hyperswitch.io sdkBaseUrl=https://beta.hyperswitch.io/v1/HyperLoader.js \ No newline at end of file diff --git a/config/FeatureFlag.json b/config/FeatureFlag.json index bbe5ac822..fc9955a86 100644 --- a/config/FeatureFlag.json +++ b/config/FeatureFlag.json @@ -8,7 +8,7 @@ "woocommerce": false, "open_sdk": false, "switch_merchant": false, - "audit_trail": false, + "audit_trail": true, "system_metrics": false, "sample_data": false, "frm": false, diff --git a/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res b/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res index 66fd66662..c7de1280b 100644 --- a/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res +++ b/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res @@ -97,7 +97,7 @@ module ApiDetailsComponent = { let headerStyle = "text-fs-13 font-medium text-grey-700 break-all" let logType = paymentDetailsValue->Js.Dict.get("request_id")->Belt.Option.isSome ? Payment : Sdk let apiName = switch logType { - | Payment => paymentDetailsValue->getString("api_name", "default value") + | Payment => paymentDetailsValue->getString("api_flow", "default value")->camelCaseToTitle | Sdk => paymentDetailsValue->getString("event_name", "default value") }->PaymentUtils.nameToURLMapper(~payment_id=paymentId, ()) let createdTime = paymentDetailsValue->getString("created_at", "00000") From 8045a5c0b26cee5187bf808403516902a77d84ab Mon Sep 17 00:00:00 2001 From: Sagar Naik Date: Fri, 1 Dec 2023 19:06:02 +0530 Subject: [PATCH 4/4] code celanup --- .env | 2 +- config/FeatureFlag.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index dd73c712c..321b79a39 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -apiBaseUrl=https://integ-api.hyperswitch.io +apiBaseUrl=https://sandbox.hyperswitch.io sdkBaseUrl=https://beta.hyperswitch.io/v1/HyperLoader.js \ No newline at end of file diff --git a/config/FeatureFlag.json b/config/FeatureFlag.json index fc9955a86..bbe5ac822 100644 --- a/config/FeatureFlag.json +++ b/config/FeatureFlag.json @@ -8,7 +8,7 @@ "woocommerce": false, "open_sdk": false, "switch_merchant": false, - "audit_trail": true, + "audit_trail": false, "system_metrics": false, "sample_data": false, "frm": false,