Skip to content

Commit

Permalink
Merge branch 'main' into multiconnectorapicall
Browse files Browse the repository at this point in the history
  • Loading branch information
Muditbhatia12 authored Jan 20, 2025
2 parents f2352c6 + 4cf2c50 commit def361c
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 27 deletions.
1 change: 1 addition & 0 deletions src/components/Graphs/BarGraph/BarGraph.res
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
external barGraphOptionsToJson: BarGraphTypes.barGraphOptions => JSON.t = "%identity"

@react.component
let make = (~options: BarGraphTypes.barGraphOptions, ~className="") => {
<div className>
Expand Down
9 changes: 4 additions & 5 deletions src/components/Graphs/LineGraph/LineGraph.res
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
external lineGraphOptionsToJson: LineGraphTypes.lineGraphOptions => JSON.t = "%identity"

@react.component
let make = (~entity, ~data: LineGraphTypes.lineGraphPayload, ~className="") => {
open NewAnalyticsTypes
let options = data->entity.getChatOptions->lineGraphOptionsToJson

let make = (~options: LineGraphTypes.lineGraphOptions, ~className="") => {
<div className>
<Highcharts.Chart options highcharts={Highcharts.highcharts} />
<Highcharts.Chart
options={options->lineGraphOptionsToJson} highcharts={Highcharts.highcharts}
/>
</div>
}
12 changes: 6 additions & 6 deletions src/components/Graphs/SankyGraph/SankeyGraph.res
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
external sankeyGraphOptionsToJson: SankeyGraphTypes.sankeyGraphOptions => JSON.t = "%identity"

@react.component
let make = (~entity, ~data: SankeyGraphTypes.sankeyPayload) => {
open NewAnalyticsTypes
let make = (~options: SankeyGraphTypes.sankeyGraphOptions, ~className="") => {
Highcharts.sankeyChartModule(Highcharts.highchartsModule)
let options = entity.getChatOptions(data)

<Highcharts.Chart
options={options->sankeyGraphOptionsToJson} highcharts={Highcharts.highcharts}
/>
<div className>
<Highcharts.Chart
options={options->sankeyGraphOptionsToJson} highcharts={Highcharts.highcharts}
/>
</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ let make = (
comparison,
currency,
}

let options = chartEntity.getObjects(~params)->chartEntity.getChatOptions

<div>
<ModuleHeader title={entity.title} />
<Card>
Expand All @@ -287,10 +290,7 @@ let make = (
/>
<div className="mb-5">
{switch viewType {
| Graph =>
<LineGraph
entity={chartEntity} data={chartEntity.getObjects(~params)} className="mr-3"
/>
| Graph => <LineGraph options className="mr-3" />
| Table => <TableModule data={refundsProcessedTableData} className="mx-7" />
}}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ let make = (
comparison,
}

let options = chartEntity.getObjects(~params)->chartEntity.getChatOptions

<div>
<ModuleHeader title={entity.title} />
<Card>
Expand All @@ -179,7 +181,7 @@ let make = (
setGranularity
/>
<div className="mb-5">
<LineGraph entity={chartEntity} data={chartEntity.getObjects(~params)} className="mr-3" />
<LineGraph options className="mr-3" />
</div>
</PageLoaderWrapper>
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ let make = (
yKey: "",
}

let options = chartEntity.getChatOptions(chartEntity.getObjects(~params))

<div>
<ModuleHeader title={entity.title} />
<Card>
<PageLoaderWrapper
screenState customLoader={<Shimmer layoutId=entity.title />} customUI={<NoData />}>
<div className="mr-3 my-10">
<SankeyGraph entity={chartEntity} data={chartEntity.getObjects(~params)} />
<div className="my-10">
<SankeyGraph options={options} className="mr-3" />
</div>
</PageLoaderWrapper>
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ let make = (
comparison,
currency,
}

let options = chartEntity.getObjects(~params)->chartEntity.getChatOptions

<div>
<ModuleHeader title={entity.title} />
<Card>
Expand All @@ -308,10 +311,7 @@ let make = (
/>
<div className="mb-5">
{switch viewType {
| Graph =>
<LineGraph
entity={chartEntity} data={chartEntity.getObjects(~params)} className="mr-3"
/>
| Graph => <LineGraph options className="mr-3" />
| Table => <TableModule data={paymentsProcessedTableData} className="mx-7" />
}}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,16 @@ let make = (
mockDelay()->ignore
None
}, [isSmartRetryEnabled])

let params = {
data: paymentsSuccessRateData,
xKey: Payments_Success_Rate->getKeyForModule(~isSmartRetryEnabled),
yKey: Time_Bucket->getStringFromVariant,
comparison,
}

let options = chartEntity.getObjects(~params)->chartEntity.getChatOptions

<div>
<ModuleHeader title={entity.title} />
<Card>
Expand All @@ -213,7 +217,7 @@ let make = (
setGranularity
/>
<div className="mb-5">
<LineGraph entity={chartEntity} data={chartEntity.getObjects(~params)} className="mr-3" />
<LineGraph options className="mr-3" />
</div>
</PageLoaderWrapper>
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ let make = (
currency,
}

let options = chartEntity.getObjects(~params)->chartEntity.getChatOptions

<div>
<ModuleHeader title={entity.title} />
<Card>
Expand All @@ -300,10 +302,7 @@ let make = (
/>
<div className="mb-5">
{switch viewType {
| Graph =>
<LineGraph
entity={chartEntity} data={chartEntity.getObjects(~params)} className="mr-3"
/>
| Graph => <LineGraph options className="mr-3" />
| Table => <TableModule data={smartRetryPaymentsProcessedTableData} className="mx-7" />
}}
</div>
Expand Down

0 comments on commit def361c

Please sign in to comment.