diff --git a/CHANGELOG.md b/CHANGELOG.md index 134dc2f90..08acea23a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [conven - - - +## 2025.01.20.1 + +### Features + +- New analytics filters feature flag ([#2084](https://github.com/juspay/hyperswitch-control-center/pull/2084)) ([`b60da23`](https://github.com/juspay/hyperswitch-control-center/commit/b60da231df1ad01e073e9f2d6334e7a0724ab739)) + +**Full Changelog:** [`2025.01.20.0...2025.01.20.1`](https://github.com/juspay/hyperswitch-control-center/compare/2025.01.20.0...2025.01.20.1) + +- - - + +## 2025.01.20.0 + +### Features + +- Sidebar changes for modularity ([#2063](https://github.com/juspay/hyperswitch-control-center/pull/2063)) ([`5073b70`](https://github.com/juspay/hyperswitch-control-center/commit/5073b70bd0515f5ea0d78411845fd10b0142fee2)) + +### Bug Fixes + +- Invitation error message ([#2076](https://github.com/juspay/hyperswitch-control-center/pull/2076)) ([`08cfdf9`](https://github.com/juspay/hyperswitch-control-center/commit/08cfdf9f5c43e9d6bdf436390e2de18e4fc275a3)) + +### Refactors + +- Moved Graphs folder to components ([#2079](https://github.com/juspay/hyperswitch-control-center/pull/2079)) ([`6dda7ad`](https://github.com/juspay/hyperswitch-control-center/commit/6dda7ad09b17b1c3d2710f9732c485efaa8b3f56)) + +### Miscellaneous Tasks + +- Change Bar graph component ([#2081](https://github.com/juspay/hyperswitch-control-center/pull/2081)) ([`280bb72`](https://github.com/juspay/hyperswitch-control-center/commit/280bb72fc88d2f53c0a90dd8923f877efa25e964)) + +**Full Changelog:** [`2025.01.17.0...2025.01.20.0`](https://github.com/juspay/hyperswitch-control-center/compare/2025.01.17.0...2025.01.20.0) + +- - - + ## 2025.01.17.0 ### Features diff --git a/config/config.toml b/config/config.toml index 7fbfd83b8..27cd8ae9b 100644 --- a/config/config.toml +++ b/config/config.toml @@ -47,6 +47,7 @@ performance_monitor=false new_analytics=false new_analytics_smart_retries=false new_analytics_refunds=false +new_analytics_filters=false down_time=false dev_theme_feature=false tax_processor=true diff --git a/src/components/CardTable.res b/src/components/CardTable.res index 5fa972f3b..9b8e7b919 100644 --- a/src/components/CardTable.res +++ b/src/components/CardTable.res @@ -1,9 +1,11 @@ module TextCard = { @react.component let make = (~text) => { - if String.length(String.trim(text)) > 0 { + if text->LogicUtils.isNonEmptyString {

- {React.string(String.length(String.trim(text)) > 0 ? text : "N/A")} + LogicUtils.isNonEmptyString ? text : "N/A"} showCopy=false + />

} else { React.string("-") diff --git a/src/components/Graphs/BarGraph/BarGraph.res b/src/components/Graphs/BarGraph/BarGraph.res new file mode 100644 index 000000000..60dd0b38d --- /dev/null +++ b/src/components/Graphs/BarGraph/BarGraph.res @@ -0,0 +1,7 @@ +external barGraphOptionsToJson: BarGraphTypes.barGraphOptions => JSON.t = "%identity" +@react.component +let make = (~options: BarGraphTypes.barGraphOptions, ~className="") => { +
+ barGraphOptionsToJson} highcharts={Highcharts.highcharts} /> +
+} diff --git a/src/screens/NewAnalytics/Graphs/BarGraph/BarGraphTypes.res b/src/components/Graphs/BarGraph/BarGraphTypes.res similarity index 100% rename from src/screens/NewAnalytics/Graphs/BarGraph/BarGraphTypes.res rename to src/components/Graphs/BarGraph/BarGraphTypes.res diff --git a/src/screens/NewAnalytics/Graphs/BarGraph/BarGraphUtils.res b/src/components/Graphs/BarGraph/BarGraphUtils.res similarity index 99% rename from src/screens/NewAnalytics/Graphs/BarGraph/BarGraphUtils.res rename to src/components/Graphs/BarGraph/BarGraphUtils.res index 9bccf73e8..f83911805 100644 --- a/src/screens/NewAnalytics/Graphs/BarGraph/BarGraphUtils.res +++ b/src/components/Graphs/BarGraph/BarGraphUtils.res @@ -2,7 +2,6 @@ let fontFamily = "Arial, sans-serif" let darkGray = "#666666" let gridLineColor = "#e6e6e6" - open BarGraphTypes let getBarGraphOptions = (barGraphOptions: barGraphPayload) => { let {categories, data, title, tooltipFormatter} = barGraphOptions diff --git a/src/screens/NewAnalytics/Graphs/LineGraph/LineGraph.res b/src/components/Graphs/LineGraph/LineGraph.res similarity index 100% rename from src/screens/NewAnalytics/Graphs/LineGraph/LineGraph.res rename to src/components/Graphs/LineGraph/LineGraph.res diff --git a/src/screens/NewAnalytics/Graphs/LineGraph/LineGraphTypes.res b/src/components/Graphs/LineGraph/LineGraphTypes.res similarity index 100% rename from src/screens/NewAnalytics/Graphs/LineGraph/LineGraphTypes.res rename to src/components/Graphs/LineGraph/LineGraphTypes.res diff --git a/src/screens/NewAnalytics/Graphs/LineGraph/LineGraphUtils.res b/src/components/Graphs/LineGraph/LineGraphUtils.res similarity index 100% rename from src/screens/NewAnalytics/Graphs/LineGraph/LineGraphUtils.res rename to src/components/Graphs/LineGraph/LineGraphUtils.res diff --git a/src/screens/NewAnalytics/Graphs/SankyGraph/SankeyGraph.res b/src/components/Graphs/SankyGraph/SankeyGraph.res similarity index 100% rename from src/screens/NewAnalytics/Graphs/SankyGraph/SankeyGraph.res rename to src/components/Graphs/SankyGraph/SankeyGraph.res diff --git a/src/screens/NewAnalytics/Graphs/SankyGraph/SankeyGraphTypes.res b/src/components/Graphs/SankyGraph/SankeyGraphTypes.res similarity index 100% rename from src/screens/NewAnalytics/Graphs/SankyGraph/SankeyGraphTypes.res rename to src/components/Graphs/SankyGraph/SankeyGraphTypes.res diff --git a/src/screens/NewAnalytics/Graphs/SankyGraph/SankeyGraphUtils.res b/src/components/Graphs/SankyGraph/SankeyGraphUtils.res similarity index 100% rename from src/screens/NewAnalytics/Graphs/SankyGraph/SankeyGraphUtils.res rename to src/components/Graphs/SankyGraph/SankeyGraphUtils.res diff --git a/src/components/LoadedTable.res b/src/components/LoadedTable.res index 7a0069caf..05979bab0 100644 --- a/src/components/LoadedTable.res +++ b/src/components/LoadedTable.res @@ -896,15 +896,13 @@ let make = ( }} - - {switch tableActions { - | Some(actions) => - LoadedTableContext.toInfoData}> -
actions
-
- | None => React.null - }} -
+ {switch tableActions { + | Some(actions) => + LoadedTableContext.toInfoData}> +
actions
+
+ | None => React.null + }} let addDataAttributesClass = if isHighchartLegend { @@ -988,10 +986,10 @@ let make = ( : tableDataBackgroundClass}`}> paginationUI { - let topBottomActions = if bottomActions->Option.isSome || !isMobileView { + let topBottomActions = if bottomActions->Option.isSome{ bottomActions } else { - tableActions + None } switch topBottomActions { diff --git a/src/entryPoints/FeatureFlagUtils.res b/src/entryPoints/FeatureFlagUtils.res index f587950f3..0eba1e69e 100644 --- a/src/entryPoints/FeatureFlagUtils.res +++ b/src/entryPoints/FeatureFlagUtils.res @@ -39,6 +39,7 @@ type featureFlag = { newAnalytics: bool, newAnalyticsSmartRetries: bool, newAnalyticsRefunds: bool, + newAnalyticsFilters: bool, downTime: bool, taxProcessor: bool, xFeatureRoute: bool, @@ -90,6 +91,7 @@ let featureFlagType = (featureFlags: JSON.t) => { newAnalytics: dict->getBool("new_analytics", false), newAnalyticsSmartRetries: dict->getBool("new_analytics_smart_retries", false), newAnalyticsRefunds: dict->getBool("new_analytics_refunds", false), + newAnalyticsFilters: dict->getBool("new_analytics_filters", false), downTime: dict->getBool("down_time", false), taxProcessor: dict->getBool("tax_processor", false), xFeatureRoute: dict->getBool("x_feature_route", false), diff --git a/src/screens/Developer/APIKeys/KeyManagement.res b/src/screens/Developer/APIKeys/KeyManagement.res index 1d6557b0b..2e621dfe8 100644 --- a/src/screens/Developer/APIKeys/KeyManagement.res +++ b/src/screens/Developer/APIKeys/KeyManagement.res @@ -181,6 +181,8 @@ module ApiKeyAddBtn = { let (showModal, setShowModal) = React.useState(_ => false) let initialValues = Dict.make() initialValues->Dict.set("expiration", Never->getStringFromRecordType->JSON.Encode.string) + let isMobileView = MatchMedia.useMobileChecker() + <> @@ -188,7 +190,9 @@ module ApiKeyAddBtn = { text="Create New API Key" leftIcon={CustomIcon( , )} // TODO: Remove `MerchantDetailsManage` permission in future @@ -197,7 +201,8 @@ module ApiKeyAddBtn = { userHasAccess(~groupAccess=AccountManage), )} buttonType=Secondary - buttonSize=Small + buttonSize={isMobileView ? XSmall : Small} + customTextSize={isMobileView ? "text-xs" : ""} onClick={_ => { mixpanelEvent(~eventName="create_new_api_key") setShowModal(_ => true) @@ -354,7 +359,7 @@ module ApiKeysTable = { {

+ className="font-bold absolute top-2 md:top-6 left-0 text-xl text-black text-opacity-75 dark:text-white dark:text-opacity-75"> {"API Keys"->React.string}

Array.length} - tableActions={
+ tableActions={
} /> diff --git a/src/screens/Developer/APIKeys/PublishableAndHashKeySection.res b/src/screens/Developer/APIKeys/PublishableAndHashKeySection.res index bd9706538..562a3a100 100644 --- a/src/screens/Developer/APIKeys/PublishableAndHashKeySection.res +++ b/src/screens/Developer/APIKeys/PublishableAndHashKeySection.res @@ -37,7 +37,7 @@ let make = () => {
-
+
{"Publishable Key"->React.string} @@ -59,18 +59,18 @@ let make = () => {
String.length !== 0}> -
+
{"Payment Response Hash Key"->React.string}
diff --git a/src/screens/Helpers/HelperComponents.res b/src/screens/Helpers/HelperComponents.res index bd85b8af0..4ace0bc92 100644 --- a/src/screens/Helpers/HelperComponents.res +++ b/src/screens/Helpers/HelperComponents.res @@ -72,11 +72,13 @@ module EllipsisText = {

{`${displayValue->String.slice(~start=0, ~end=endValue)}`->React.string}

- handleClick(ev)}> - {"..."->React.string} - + String.length > endValue}> + handleClick(ev)}> + {"..."->React.string} + +
diff --git a/src/screens/NewAnalytics/Graphs/BarGraph/BarGraph.res b/src/screens/NewAnalytics/Graphs/BarGraph/BarGraph.res deleted file mode 100644 index 0285698e3..000000000 --- a/src/screens/NewAnalytics/Graphs/BarGraph/BarGraph.res +++ /dev/null @@ -1,10 +0,0 @@ -external barGraphOptionsToJson: BarGraphTypes.barGraphOptions => JSON.t = "%identity" -@react.component -let make = (~entity, ~object, ~className="") => { - open NewAnalyticsTypes - let options = entity.getChatOptions(object)->barGraphOptionsToJson - -
- -
-} diff --git a/src/screens/NewAnalytics/NewRefundsAnalytics/FailedRefundsDistribution/FailedRefundsDistribution.res b/src/screens/NewAnalytics/NewRefundsAnalytics/FailedRefundsDistribution/FailedRefundsDistribution.res index 1763c490a..22e265c17 100644 --- a/src/screens/NewAnalytics/NewRefundsAnalytics/FailedRefundsDistribution/FailedRefundsDistribution.res +++ b/src/screens/NewAnalytics/NewRefundsAnalytics/FailedRefundsDistribution/FailedRefundsDistribution.res @@ -144,6 +144,8 @@ let make = ( yKey: Connector->getStringFromVariant, } + let options = chartEntity.getChatOptions(chartEntity.getObjects(~params)) +
@@ -152,10 +154,7 @@ let make = (
{switch viewType { - | Graph => - + | Graph => | Table => }}
diff --git a/src/screens/NewAnalytics/NewRefundsAnalytics/NewRefundsAnalytics.res b/src/screens/NewAnalytics/NewRefundsAnalytics/NewRefundsAnalytics.res index fbffac260..bd2174b30 100644 --- a/src/screens/NewAnalytics/NewRefundsAnalytics/NewRefundsAnalytics.res +++ b/src/screens/NewAnalytics/NewRefundsAnalytics/NewRefundsAnalytics.res @@ -1,11 +1,14 @@ @react.component let make = () => { open NewRefundsAnalyticsEntity + let {newAnalyticsFilters} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
-
- -
+ +
+ +
+
getStringFromVariant, } + let options = chartEntity.getChatOptions(chartEntity.getObjects(~params)) +
@@ -129,10 +131,7 @@ let make = (
{switch viewType { - | Graph => - + | Graph => | Table => }}
diff --git a/src/screens/NewAnalytics/PaymentAnalytics/FailedPaymentsDistribution/FailedPaymentsDistribution.res b/src/screens/NewAnalytics/PaymentAnalytics/FailedPaymentsDistribution/FailedPaymentsDistribution.res index 1cded5c19..64ec3e517 100644 --- a/src/screens/NewAnalytics/PaymentAnalytics/FailedPaymentsDistribution/FailedPaymentsDistribution.res +++ b/src/screens/NewAnalytics/PaymentAnalytics/FailedPaymentsDistribution/FailedPaymentsDistribution.res @@ -4,6 +4,7 @@ open NewPaymentAnalyticsEntity open BarGraphTypes open FailedPaymentsDistributionUtils open NewPaymentAnalyticsUtils + module TableModule = { @react.component let make = (~data, ~className="", ~selectedTab: string) => { @@ -137,11 +138,15 @@ let make = ( } None }, [startTimeVal, endTimeVal, groupBy.value, currency]) + let params = { data: failedPaymentsDistribution, xKey: Payments_Failure_Rate_Distribution->getKeyForModule(~isSmartRetryEnabled), yKey: groupBy.value, } + + let options = chartEntity.getChatOptions(chartEntity.getObjects(~params)) +
@@ -150,10 +155,7 @@ let make = (
{switch viewType { - | Graph => - + | Graph => | Table => { open NewPaymentAnalyticsEntity + let {newAnalyticsFilters} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
- + + +
@@ -150,10 +153,7 @@ let make = (
{switch viewType { - | Graph => - + | Graph => | Table => }} diff --git a/src/screens/NewAnalytics/SmartRetryAnalytics/FailureSmartRetryDistribution/FailureSmartRetryDistribution.res b/src/screens/NewAnalytics/SmartRetryAnalytics/FailureSmartRetryDistribution/FailureSmartRetryDistribution.res index 941b5e4b7..07c65d060 100644 --- a/src/screens/NewAnalytics/SmartRetryAnalytics/FailureSmartRetryDistribution/FailureSmartRetryDistribution.res +++ b/src/screens/NewAnalytics/SmartRetryAnalytics/FailureSmartRetryDistribution/FailureSmartRetryDistribution.res @@ -126,11 +126,15 @@ let make = ( } None }, [startTimeVal, endTimeVal, groupBy.value, currency]) + let params = { data: paymentsDistribution, xKey: Payments_Failure_Rate_Distribution_With_Only_Retries->getStringFromVariant, yKey: groupBy.value, } + + let options = chartEntity.getChatOptions(chartEntity.getObjects(~params)) +
@@ -139,10 +143,7 @@ let make = (
{switch viewType { - | Graph => - + | Graph => | Table => }} diff --git a/src/screens/NewAnalytics/SmartRetryAnalytics/NewSmartRetryAnalytics.res b/src/screens/NewAnalytics/SmartRetryAnalytics/NewSmartRetryAnalytics.res index 34f20413d..af1d6d9f8 100644 --- a/src/screens/NewAnalytics/SmartRetryAnalytics/NewSmartRetryAnalytics.res +++ b/src/screens/NewAnalytics/SmartRetryAnalytics/NewSmartRetryAnalytics.res @@ -1,11 +1,14 @@ @react.component let make = () => { open NewSmartRetryAnalyticsEntity + let {newAnalyticsFilters} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
-
- -
+ +
+ +
+
getStringFromVariant, yKey: groupBy.value, } + + let options = chartEntity.getChatOptions(chartEntity.getObjects(~params)) +
@@ -139,10 +143,7 @@ let make = (
{switch viewType { - | Graph => - + | Graph => | Table => }}