ui: merge startpoint with widgetsessions mapper
This commit is contained in:
parent
305c7ae064
commit
aa07d41bb5
1 changed files with 10 additions and 4 deletions
|
|
@ -11,7 +11,7 @@ import { debounce } from 'App/utils';
|
||||||
import useIsMounted from 'App/hooks/useIsMounted';
|
import useIsMounted from 'App/hooks/useIsMounted';
|
||||||
import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG';
|
import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG';
|
||||||
import { numberWithCommas } from 'App/utils';
|
import { numberWithCommas } from 'App/utils';
|
||||||
import { HEATMAP } from 'App/constants/card';
|
import { HEATMAP, USER_PATH } from "App/constants/card";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
|
@ -107,10 +107,15 @@ function WidgetSessions(props: Props) {
|
||||||
};
|
};
|
||||||
debounceClickMapSearch(customFilter);
|
debounceClickMapSearch(customFilter);
|
||||||
} else {
|
} else {
|
||||||
const usedSeries = focusedSeries ? widget.series.filter((s) => s.name === focusedSeries) : widget.series;
|
const hasStartPoint = !!widget.startPoint && widget.metricType === USER_PATH
|
||||||
|
const activeSeries = focusedSeries ? widget.series.filter((s) => s.name === focusedSeries) : widget.series
|
||||||
|
const seriesJson = activeSeries.map((s) => s.toJson());
|
||||||
|
if (hasStartPoint) {
|
||||||
|
seriesJson[0].filter.filters.push(widget.startPoint.toJson());
|
||||||
|
}
|
||||||
debounceRequest(widget.metricId, {
|
debounceRequest(widget.metricId, {
|
||||||
...filter,
|
...filter,
|
||||||
series: usedSeries.map((s) => s.toJson()),
|
series: seriesJson,
|
||||||
page: metricStore.sessionsPage,
|
page: metricStore.sessionsPage,
|
||||||
limit: metricStore.sessionsPageSize
|
limit: metricStore.sessionsPageSize
|
||||||
});
|
});
|
||||||
|
|
@ -125,7 +130,8 @@ function WidgetSessions(props: Props) {
|
||||||
filter.filters,
|
filter.filters,
|
||||||
depsString,
|
depsString,
|
||||||
metricStore.clickMapSearch,
|
metricStore.clickMapSearch,
|
||||||
focusedSeries
|
focusedSeries,
|
||||||
|
widget.startPoint,
|
||||||
]);
|
]);
|
||||||
useEffect(loadData, [metricStore.sessionsPage]);
|
useEffect(loadData, [metricStore.sessionsPage]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue