feat(SessionsBy): add specific filter for FETCH metric
Added a conditional check to handle the FETCH metric in the SessionsBy component. When the metric is FETCH, a specific filter with key FETCH_URL, operator is, and value derived from data.name is applied. This ensures proper filtering behavior for FETCH-related metrics.
This commit is contained in:
parent
5190dc512a
commit
37e58e9b23
1 changed files with 13 additions and 12 deletions
|
|
@ -6,6 +6,7 @@ import CardSessionsByList from 'Components/Dashboard/Widgets/CardSessionsByList'
|
|||
import { useModal } from 'Components/ModalContext';
|
||||
import Widget from '@/mstore/types/widget';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { FilterKey } from 'Types/filter/filterType';
|
||||
|
||||
interface Props {
|
||||
metric?: any;
|
||||
|
|
@ -35,20 +36,20 @@ function SessionsBy(props: Props) {
|
|||
...filtersMap[metric.metricOf],
|
||||
value: [data.name],
|
||||
type: filtersMap[metric.metricOf].key,
|
||||
filters: filtersMap[metric.metricOf].filters?.map((f: any) => {
|
||||
const {
|
||||
key,
|
||||
operatorOptions,
|
||||
category,
|
||||
icon,
|
||||
label,
|
||||
options,
|
||||
...cleaned
|
||||
} = f;
|
||||
return { ...cleaned, type: f.key, value: [] };
|
||||
}),
|
||||
filters: [],
|
||||
};
|
||||
|
||||
if (metric.metricOf === FilterKey.FETCH) {
|
||||
baseFilter.filters = [
|
||||
{
|
||||
key: FilterKey.FETCH_URL,
|
||||
operator: 'is',
|
||||
value: [data.name],
|
||||
type: FilterKey.FETCH_URL,
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
const {
|
||||
key,
|
||||
operatorOptions,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue