fix(dashboard): pagination and login
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { useAppParams } from '@/hooks/use-app-params';
|
||||
import { useEventQueryFilters } from '@/hooks/use-event-query-filters';
|
||||
import { eventQueryFiltersParser } from '@/hooks/use-event-query-filters';
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { useTRPC } from '@/integrations/trpc/react';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useNavigate } from '@tanstack/react-router';
|
||||
import { Widget, WidgetBody } from '../widget';
|
||||
import { WidgetFooter, WidgetHeadSearchable } from './overview-widget';
|
||||
import {
|
||||
@@ -23,7 +26,9 @@ export default function OverviewTopEvents({
|
||||
shareId,
|
||||
}: OverviewTopEventsProps) {
|
||||
const { range, startDate, endDate } = useOverviewOptions();
|
||||
const [filters, setFilter] = useEventQueryFilters();
|
||||
const [filters] = useEventQueryFilters();
|
||||
const { organizationId } = useAppParams();
|
||||
const navigate = useNavigate();
|
||||
const trpc = useTRPC();
|
||||
const { data: conversions } = useQuery(
|
||||
trpc.overview.topConversions.queryOptions({ projectId, shareId }),
|
||||
@@ -162,11 +167,23 @@ export default function OverviewTopEvents({
|
||||
<OverviewWidgetTableEvents
|
||||
data={filteredData}
|
||||
onItemClick={(name) => {
|
||||
if (widget.meta?.type === 'linkOut') {
|
||||
setFilter('properties.href', name);
|
||||
} else {
|
||||
setFilter('name', name);
|
||||
}
|
||||
const filterName =
|
||||
widget.meta?.type === 'linkOut'
|
||||
? 'properties.href'
|
||||
: 'name';
|
||||
const f = eventQueryFiltersParser.serialize([
|
||||
{
|
||||
id: filterName,
|
||||
name: filterName,
|
||||
operator: 'is',
|
||||
value: [name],
|
||||
},
|
||||
]);
|
||||
navigate({
|
||||
to: '/$organizationId/$projectId/events/events',
|
||||
params: { organizationId, projectId },
|
||||
search: { f },
|
||||
});
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user