mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
2f5e69229c
2 changed files with 18 additions and 7 deletions
|
|
@ -36,8 +36,8 @@ export function AttributionPage({ websiteId }: { websiteId: string }) {
|
|||
defaultValue={type}
|
||||
onChange={setType}
|
||||
>
|
||||
<ListItem id="path">{formatMessage(labels.page)}</ListItem>
|
||||
<ListItem id="event">{formatMessage(labels.event)}</ListItem>
|
||||
<ListItem id="path">{formatMessage(labels.viewedPage)}</ListItem>
|
||||
<ListItem id="event">{formatMessage(labels.triggeredEvent)}</ListItem>
|
||||
</Select>
|
||||
</Column>
|
||||
<Column>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { useState } from 'react';
|
||||
import { Column, Tabs, TabList, Tab, TabPanel, Row, Button } from '@umami/react-zen';
|
||||
import { useFilters, useMessages, useNavigation } from '@/components/hooks';
|
||||
import { FieldFilters } from '@/components/input/FieldFilters';
|
||||
import { SegmentFilters } from '@/components/input/SegmentFilters';
|
||||
import { Button, Column, Row, Tab, TabList, TabPanel, Tabs } from '@umami/react-zen';
|
||||
import { useState } from 'react';
|
||||
|
||||
export interface FilterEditFormProps {
|
||||
websiteId?: string;
|
||||
|
|
@ -13,6 +13,7 @@ export interface FilterEditFormProps {
|
|||
export function FilterEditForm({ websiteId, onChange, onClose }: FilterEditFormProps) {
|
||||
const {
|
||||
query: { segment, cohort },
|
||||
pathname,
|
||||
} = useNavigation();
|
||||
const { filters } = useFilters();
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
|
@ -22,6 +23,7 @@ export function FilterEditForm({ websiteId, onChange, onClose }: FilterEditFormP
|
|||
const panelProps = {
|
||||
style: { height: 500 },
|
||||
};
|
||||
const excludeFilters = pathname.includes('/pixels') || pathname.includes('/links');
|
||||
|
||||
const handleReset = () => {
|
||||
setCurrentFilters([]);
|
||||
|
|
@ -48,11 +50,20 @@ export function FilterEditForm({ websiteId, onChange, onClose }: FilterEditFormP
|
|||
<Tabs>
|
||||
<TabList>
|
||||
<Tab id="fields">{formatMessage(labels.fields)}</Tab>
|
||||
<Tab id="segments">{formatMessage(labels.segments)}</Tab>
|
||||
<Tab id="cohorts">{formatMessage(labels.cohorts)}</Tab>
|
||||
{!excludeFilters && (
|
||||
<>
|
||||
<Tab id="segments">{formatMessage(labels.segments)}</Tab>
|
||||
<Tab id="cohorts">{formatMessage(labels.cohorts)}</Tab>
|
||||
</>
|
||||
)}
|
||||
</TabList>
|
||||
<TabPanel id="fields" {...panelProps}>
|
||||
<FieldFilters websiteId={websiteId} value={currentFilters} onChange={setCurrentFilters} />
|
||||
<FieldFilters
|
||||
websiteId={websiteId}
|
||||
value={currentFilters}
|
||||
onChange={setCurrentFilters}
|
||||
exclude={excludeFilters ? ['path', 'title', 'hostname', 'tag', 'event'] : []}
|
||||
/>
|
||||
</TabPanel>
|
||||
<TabPanel id="segments" {...panelProps}>
|
||||
<SegmentFilters
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue