diff --git a/package.json b/package.json index f2a5d9b9..67211f13 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.js index e8831247..6923bceb 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( - + {!selected && } {selected && group === REPORT_PARAMETERS.fields && ( diff --git a/src/app/(main)/reports/[id]/FilterSelectForm.js b/src/app/(main)/reports/[id]/FilterSelectForm.js index 6ecd7751..9ad4cd93 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.js index fe9d1e00..6b9a0344 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() { - {(close, element) => { + {close => { return ( ({ @@ -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.js index 0e96185f..135b5db8 100644 --- a/src/app/(main)/reports/funnel/FunnelParameters.js +++ b/src/app/(main)/reports/funnel/FunnelParameters.js @@ -52,14 +52,10 @@ export function FunnelParameters() { - - {(close, element) => { - return ( - - - - ); - }} + + + + ); diff --git a/src/app/(main)/reports/insights/InsightsParameters.js b/src/app/(main)/reports/insights/InsightsParameters.js index d2ba144e..91dd09f8 100644 --- a/src/app/(main)/reports/insights/InsightsParameters.js +++ b/src/app/(main)/reports/insights/InsightsParameters.js @@ -81,26 +81,22 @@ export function InsightsParameters() { - {close => { - return ( - - {id === 'fields' && ( - - )} - {id === 'filters' && ( - - )} - - ); - }} + + {id === 'fields' && ( + + )} + {id === 'filters' && ( + + )} + ); diff --git a/src/components/layout/Page.module.css b/src/components/layout/Page.module.css index 73f21979..80789360 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.ts index 45250447..c270727e 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: Dat on session.session_id = website_event.session_id where 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: Dat from website_event where website_id = {websiteId:UUID} and created_at between {startDate:DateTime64} and {endDate:DateTime64} + limit 100 `, { websiteId, diff --git a/yarn.lock b/yarn.lock index b0eeb778..dfeb07a6 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"