feat(ui): improve session count display and filter logic
- Added `flex-shrink-0` class to session count text in `CardSessionsByList` for better layout handling. - Introduced conditional filter logic in `SessionsBy` to handle `FETCH` metric with specific `FETCH_URL` filter. - Removed unused filter mapping logic for cleaner code. This improves UI consistency and enhances filter functionality.
This commit is contained in:
parent
6e7a3b22ab
commit
41b9e38085
2 changed files with 16 additions and 5 deletions
|
|
@ -57,7 +57,7 @@ function CardSessionsByList({ list, selected, paginated, onClickHandler = () =>
|
|||
<div className="m-0">
|
||||
<div className="flex justify-between m-0 p-0">
|
||||
<Typography.Text ellipsis={true}>{row.displayName}</Typography.Text>
|
||||
<Typography.Text type="secondary"> {row.sessionCount}</Typography.Text>
|
||||
<Typography.Text type="secondary" className="flex-shrink-0"> {row.sessionCount}</Typography.Text>
|
||||
</div>
|
||||
|
||||
<Progress
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { ArrowRight } from 'lucide-react';
|
|||
import CardSessionsByList from 'Components/Dashboard/Widgets/CardSessionsByList';
|
||||
import { useModal } from 'Components/ModalContext';
|
||||
import Widget from '@/mstore/types/widget';
|
||||
import { FilterKey } from 'Types/filter/filterType';
|
||||
|
||||
interface Props {
|
||||
metric?: any;
|
||||
|
|
@ -27,12 +28,22 @@ 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, category, icon, label, options, ...finalFilter } = baseFilter;
|
||||
|
||||
setSelected(data.name);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue