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