Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: analytics table data display changes and distribution cols order change #1773

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module TableModule = {
let tableBorderClass = "border-2 border-solid border-jp-gray-940 border-collapse border-opacity-30 dark:border-jp-gray-dark_table_border_color dark:border-opacity-30"

let defaultCol = isSmartRetryEnbldForFailedPmtDist(isSmartRetryEnabled)
let visibleColumns = [defaultCol]->Array.concat([selectedTab->getColumn])
let visibleColumns = [selectedTab->getColumn]->Array.concat([defaultCol])
let tableData = getTableData(data)

<div className>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ module TableModule = {
}
let tableBorderClass = "border-collapse border border-jp-gray-940 border-solid border-2 border-opacity-30 dark:border-jp-gray-dark_table_border_color dark:border-opacity-30"
let {filterValueJson} = React.useContext(FilterContext.filterContext)
let paymentsProcessed = switch data->getArrayFromJson([])->Array.get(0) {
| Some(val) => val->getArrayDataFromJson(tableItemToObjMapper)
| _ => []
}->Array.map(Nullable.make)
let paymentsProcessed =
data
->Array.map(item => {
item->getDictFromJsonObject->tableItemToObjMapper
})
->Array.map(Nullable.make)

let isSmartRetryEnabled =
filterValueJson
Expand Down Expand Up @@ -154,6 +156,7 @@ let make = (
let (screenState, setScreenState) = React.useState(_ => PageLoaderWrapper.Loading)
let {filterValueJson} = React.useContext(FilterContext.filterContext)
let (paymentsProcessedData, setPaymentsProcessedData) = React.useState(_ => JSON.Encode.array([]))
let (paymentsProcessedTableData, setPaymentsProcessedTableData) = React.useState(_ => [])
let (paymentsProcessedMetaData, setPaymentsProcessedMetaData) = React.useState(_ =>
JSON.Encode.array([])
)
Expand Down Expand Up @@ -209,6 +212,7 @@ let make = (
let primaryData =
primaryResponse->getDictFromJsonObject->getArrayFromDict("queryData", [])->modifyQueryData
let primaryMetaData = primaryResponse->getDictFromJsonObject->getArrayFromDict("metaData", [])
setPaymentsProcessedTableData(_ => primaryData)

let (secondaryMetaData, secondaryModifiedData) = switch comparison {
| EnableComparison => {
Expand Down Expand Up @@ -315,7 +319,7 @@ let make = (
<LineGraph
entity={chartEntity} data={chartEntity.getObjects(~params)} className="mr-3"
/>
| Table => <TableModule data={paymentsProcessedData} className="mx-7" />
| Table => <TableModule data={paymentsProcessedTableData} className="mx-7" />
}}
</div>
</PageLoaderWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module TableModule = {
->getSmartRetryMetricType
let tableBorderClass = "border-2 border-solid border-jp-gray-940 border-collapse border-opacity-30 dark:border-jp-gray-dark_table_border_color dark:border-opacity-30"
let defaultCol = isSmartRetryEnabled->isSmartRetryEnbldForSuccessPmtDist
let visibleColumns = [defaultCol]->Array.concat([selectedTab->getColumn])
let visibleColumns = [selectedTab->getColumn]->Array.concat([defaultCol])
let tableData = getTableData(data)

<div className>
Expand Down
Loading