Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Fixed filter parameters.
Mike Cao81a810bd7360
diff --git a/package.json b/package.jsonindex f2a5d9b9c..67211f13b 100644--- a/package.json+++ b/package.json@@ -97,7 +97,7 @@"node-fetch": "^3.2.8","npm-run-all": "^4.1.5","react": "^18.2.0",- "react-basics": "^0.102.0",+ "react-basics": "^0.105.0","react-beautiful-dnd": "^13.1.0","react-dom": "^18.2.0","react-error-boundary": "^4.0.4",diff --git a/src/app/(main)/reports/[id]/FieldAddForm.js b/src/app/(main)/reports/[id]/FieldAddForm.jsindex e88312478..6923bceb6 100644--- a/src/app/(main)/reports/[id]/FieldAddForm.js+++ b/src/app/(main)/reports/[id]/FieldAddForm.js@@ -7,7 +7,7 @@ import FieldAggregateForm from './FieldAggregateForm';import FieldFilterForm from './FieldFilterForm';import styles from './FieldAddForm.module.css';-export function FieldAddForm({ fields = [], group, element, onAdd, onClose }) {+export function FieldAddForm({ fields = [], group, onAdd, onClose }) {const [selected, setSelected] = useState();const handleSelect = value => {@@ -28,7 +28,7 @@ export function FieldAddForm({ fields = [], group, element, onAdd, onClose }) {};return createPortal(- <PopupForm className={styles.popup} element={element} onClose={onClose}>+ <PopupForm className={styles.popup}>{!selected && <FieldSelectForm fields={fields} onSelect={handleSelect} />}{selected && group === REPORT_PARAMETERS.fields && (<FieldAggregateForm {...selected} onSelect={handleSave} />diff --git a/src/app/(main)/reports/[id]/FilterSelectForm.js b/src/app/(main)/reports/[id]/FilterSelectForm.jsindex 6ecd77513..9ad4cd932 100644--- a/src/app/(main)/reports/[id]/FilterSelectForm.js+++ b/src/app/(main)/reports/[id]/FilterSelectForm.js@@ -1,20 +1,20 @@import { useState } from 'react';+import { Loading } from 'react-basics';+import { subDays } from 'date-fns';import FieldSelectForm from './FieldSelectForm';import FieldFilterForm from './FieldFilterForm';-import { useApi, useDateRange } from 'components/hooks';-import { Loading } from 'react-basics';+import { useApi } from 'components/hooks';function useValues(websiteId, type) {+ const now = Date.now();const { get, useQuery } = useApi();- const [dateRange] = useDateRange(websiteId);- const { startDate, endDate } = dateRange;const { data, error, isLoading } = useQuery(['websites:values', websiteId, type],() =>get(`/websites/${websiteId}/values`, {type,- startAt: +startDate,- endAt: +endDate,+ startAt: +subDays(now, 90),+ endAt: now,}),{ enabled: !!(websiteId && type) },);diff --git a/src/app/(main)/reports/event-data/EventDataParameters.js b/src/app/(main)/reports/event-data/EventDataParameters.jsindex fe9d1e003..6b9a03445 100644--- a/src/app/(main)/reports/event-data/EventDataParameters.js+++ b/src/app/(main)/reports/event-data/EventDataParameters.js@@ -74,7 +74,7 @@ export function EventDataParameters() {<Icons.Plus /></Icon><Popup position="bottom" alignment="start">- {(close, element) => {+ {close => {return (<FieldAddFormfields={data.map(({ eventKey, eventDataType }) => ({@@ -82,7 +82,6 @@ export function EventDataParameters() {type: DATA_TYPES[eventDataType],}))}group={group}- element={element}onAdd={handleAdd}onClose={close}/>diff --git a/src/app/(main)/reports/funnel/FunnelParameters.js b/src/app/(main)/reports/funnel/FunnelParameters.jsindex 0e96185f8..135b5db84 100644--- a/src/app/(main)/reports/funnel/FunnelParameters.js+++ b/src/app/(main)/reports/funnel/FunnelParameters.js@@ -52,14 +52,10 @@ export function FunnelParameters() {<Icon><Icons.Plus /></Icon>- <Popup position="bottom" alignment="start">- {(close, element) => {- return (- <PopupForm element={element} onClose={close}>- <UrlAddForm onAdd={handleAddUrl} />- </PopupForm>- );- }}+ <Popup position="right" alignment="start">+ <PopupForm>+ <UrlAddForm onAdd={handleAddUrl} />+ </PopupForm></Popup></PopupTrigger>);diff --git a/src/app/(main)/reports/insights/InsightsParameters.js b/src/app/(main)/reports/insights/InsightsParameters.jsindex d2ba144e8..91dd09f84 100644--- a/src/app/(main)/reports/insights/InsightsParameters.js+++ b/src/app/(main)/reports/insights/InsightsParameters.js@@ -81,26 +81,22 @@ export function InsightsParameters() {</Icon></TooltipPopup><Popup position="bottom" alignment="start" className={styles.popup}>- {close => {- return (- <PopupForm onClose={close}>- {id === 'fields' && (- <FieldSelectForm- items={fieldOptions}- onSelect={handleAdd.bind(null, id)}- showType={false}- />- )}- {id === 'filters' && (- <FilterSelectForm- websiteId={websiteId}- items={fieldOptions}- onSelect={handleAdd.bind(null, id)}- />- )}- </PopupForm>- );- }}+ <PopupForm>+ {id === 'fields' && (+ <FieldSelectForm+ items={fieldOptions}+ onSelect={handleAdd.bind(null, id)}+ showType={false}+ />+ )}+ {id === 'filters' && (+ <FilterSelectForm+ websiteId={websiteId}+ items={fieldOptions}+ onSelect={handleAdd.bind(null, id)}+ />+ )}+ </PopupForm></Popup></PopupTrigger>);diff --git a/src/components/layout/Page.module.css b/src/components/layout/Page.module.cssindex 73f219791..807893602 100644--- a/src/components/layout/Page.module.css+++ b/src/components/layout/Page.module.css@@ -5,7 +5,6 @@position: relative;width: 100%;max-width: 1320px;- min-height: calc(100vh - 60px);margin: 0 auto;padding: 0 20px;}diff --git a/src/queries/analytics/getValues.ts b/src/queries/analytics/getValues.tsindex 452504476..c270727e2 100644--- a/src/queries/analytics/getValues.ts+++ b/src/queries/analytics/getValues.ts@@ -22,6 +22,7 @@ async function relationalQuery(websiteId: string, column: string, startDate: Daton session.session_id = website_event.session_idwhere website_event.website_id = {{websiteId::uuid}}and website_event.created_at between {{startDate}} and {{endDate}}+ limit 100`,{websiteId,@@ -40,6 +41,7 @@ async function clickhouseQuery(websiteId: string, column: string, startDate: Datfrom website_eventwhere website_id = {websiteId:UUID}and created_at between {startDate:DateTime64} and {endDate:DateTime64}+ limit 100`,{websiteId,diff --git a/yarn.lock b/yarn.lockindex b0eeb778c..dfeb07a62 100644--- a/yarn.lock+++ b/yarn.lock@@ -7557,10 +7557,10 @@ rc@^1.2.7:minimist "^1.2.0"strip-json-comments "~2.0.1"-react-basics@^0.102.0:- version "0.102.0"- resolved "https://registry.yarnpkg.com/react-basics/-/react-basics-0.102.0.tgz#61dbc837963facb2d409044046eb55f7c689411e"- integrity sha512-MhLHgjVnOwdm1YX1Lwkyg37kPCTOk+b3NXWGORlh4dJThq/qq/s0lF09yqEq09Gye5yyTDbeNDPXlkXIPtadog==+react-basics@^0.105.0:+ version "0.105.0"+ resolved "https://registry.yarnpkg.com/react-basics/-/react-basics-0.105.0.tgz#94eda703b3c0728e817b6e9d086e5d1c6c68f25c"+ integrity sha512-iKYtfB0A2vsmO+X4jaX64XdmHE836w8TG2jFQ0pi5Qp0ktL0lAL9/q0IrWUjNr86hi0apg46aeJWxY+qQO+T1g==dependencies:"@react-spring/web" "^9.7.3"classnames "^2.3.1"