fix(ui): table charts checking the total and list
This commit is contained in:
parent
49c408f44e
commit
c59dbbc79d
2 changed files with 3 additions and 3 deletions
|
|
@ -20,7 +20,7 @@ function CardSessionsByList({ list, selected, paginated, onClickHandler = () =>
|
||||||
const params = { density: 35 };
|
const params = { density: 35 };
|
||||||
const metricParams = { ...params };
|
const metricParams = { ...params };
|
||||||
const [loading, setLoading] = React.useState(false);
|
const [loading, setLoading] = React.useState(false);
|
||||||
const data = paginated ? metric?.data[0]?.values : list;
|
const data = paginated ? metric?.data?.values : list;
|
||||||
|
|
||||||
const loadData = async (page: number) => {
|
const loadData = async (page: number) => {
|
||||||
const timestamps = drillDownPeriod.toTimestamps();
|
const timestamps = drillDownPeriod.toTimestamps();
|
||||||
|
|
@ -56,7 +56,7 @@ function CardSessionsByList({ list, selected, paginated, onClickHandler = () =>
|
||||||
title={(
|
title={(
|
||||||
<div className="m-0">
|
<div className="m-0">
|
||||||
<div className="flex justify-between m-0 p-0">
|
<div className="flex justify-between m-0 p-0">
|
||||||
<Typography.Text ellipsis={true} className='w-[95%]'>{row.displayName}</Typography.Text>
|
<Typography.Text ellipsis={true} className='w-[90%]'>{row.displayName}</Typography.Text>
|
||||||
<Typography.Text type="secondary"> {row.sessionCount}</Typography.Text>
|
<Typography.Text type="secondary"> {row.sessionCount}</Typography.Text>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -334,9 +334,9 @@ export default class Widget {
|
||||||
} else if (this.metricType === FUNNEL) {
|
} else if (this.metricType === FUNNEL) {
|
||||||
_data.funnel = new Funnel().fromJSON(data);
|
_data.funnel = new Funnel().fromJSON(data);
|
||||||
} else if (this.metricType === TABLE) {
|
} else if (this.metricType === TABLE) {
|
||||||
// const total = data[0]['total'];
|
|
||||||
const count = data[0]['count'];
|
const count = data[0]['count'];
|
||||||
_data['values'] = data[0]['values'].map((s: any) => new SessionsByRow().fromJson(s, count, this.metricOf));
|
_data['values'] = data[0]['values'].map((s: any) => new SessionsByRow().fromJson(s, count, this.metricOf));
|
||||||
|
_data['total'] = data[0]['total'];
|
||||||
} else {
|
} else {
|
||||||
if (data.hasOwnProperty('chart')) {
|
if (data.hasOwnProperty('chart')) {
|
||||||
_data['value'] = data.value;
|
_data['value'] = data.value;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue