Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

add new props

kruzhambuscab3cd94b513
diff --git a/src/pages/Project/View/Panels.tsx b/src/pages/Project/View/Panels.tsx
index 07d544ce7..2b932deb0 100644
--- a/src/pages/Project/View/Panels.tsx
+++ b/src/pages/Project/View/Panels.tsx
@@ -669,7 +669,7 @@ CustomEvents.propTypes = {
}
const Panel = ({
- name, data, rowMapper, valueMapper, capitalize, linkContent, t, icon, id, hideFilters, onFilter, customTabs,
+ name, data, rowMapper, valueMapper, capitalize, linkContent, t, icon, id, hideFilters, onFilter, customTabs, pid, period, timeBucket, from, to, timezone,
}: {
name: string
data: any
@@ -683,6 +683,12 @@ const Panel = ({
hideFilters: boolean
onFilter: any
customTabs?: any
+ pid?: string | null
+ period?: string | null
+ timeBucket?: string | null
+ from?: string | null
+ to?: string | null
+ timezone?: string | null
}): JSX.Element => {
const [page, setPage] = useState(0)
const currentIndex = page * ENTRIES_PER_PANEL
@@ -766,7 +772,15 @@ const Panel = ({
openModal={() => setModal(true)}
customTabs={customTabs}
>
- <SankeyChart disableLegend />
+ <SankeyChart
+ disableLegend
+ pid={pid}
+ period={period}
+ timeBucket={timeBucket}
+ from={from}
+ to={to}
+ timezone={timezone}
+ />
<Modal
onClose={() => setModal(false)}
closeText={t('common.close')}
@@ -781,7 +795,14 @@ const Panel = ({
)}
message={(
<div className='h-96 dark:text-gray-800'>
- <SankeyChart />
+ <SankeyChart
+ pid={pid}
+ period={period}
+ timeBucket={timeBucket}
+ from={from}
+ to={to}
+ timezone={timezone}
+ />
</div>
)}
size='large'
@@ -1005,6 +1026,12 @@ Panel.defaultProps = {
hideFilters: false,
icon: null,
customTabs: [],
+ to: null,
+ from: null,
+ timezone: null,
+ timeBucket: null,
+ period: null,
+ pid: null,
}
const PanelMemo = memo(Panel)
diff --git a/src/pages/Project/View/ViewProject.tsx b/src/pages/Project/View/ViewProject.tsx
index e0f7068a0..aa8801d62 100644
--- a/src/pages/Project/View/ViewProject.tsx
+++ b/src/pages/Project/View/ViewProject.tsx
@@ -1881,6 +1881,27 @@ const ViewProject = ({
)
}
+ if (type === 'pg') {
+ return (
+ <Panel
+ t={t}
+ key={type}
+ icon={panelIcon}
+ id={type}
+ onFilter={filterHandler}
+ name={panelName}
+ data={panelsData.data[type]}
+ customTabs={customTabs}
+ period={activePeriod?.period}
+ pid={id}
+ timeBucket={timeBucket}
+ from={dateRange ? getFormatDate(dateRange[0]) : null}
+ to={dateRange ? getFormatDate(dateRange[1]) : null}
+ timezone={timezone}
+ />
+ )
+ }
+
return (
<Panel
t={t}
diff --git a/src/pages/Project/View/components/SankeyChart.tsx b/src/pages/Project/View/components/SankeyChart.tsx
index 52023fb00..e3cf4bab1 100644
--- a/src/pages/Project/View/components/SankeyChart.tsx
+++ b/src/pages/Project/View/components/SankeyChart.tsx
@@ -1,7 +1,9 @@
import React from 'react'
import { ResponsiveSankey } from '@nivo/sankey'
import { connect } from 'react-redux'
-import { StateType } from 'redux/store'
+import { StateType, AppDispatch } from 'redux/store'
+import UIActions from 'redux/reducers/ui'
+import { IUserFlow } from 'redux/models/IUserFlow'
const dataTest = {
nodes: [
@@ -74,9 +76,24 @@ const dataTest = {
],
}
-const SankeyChart = ({ data, disableLegend }: {
+const mapStateToProps = (state: StateType) => ({
+ userFlowAscending: state.ui.cache.userFlowAscending,
+ userFlowDescending: state.ui.cache.userFlowDescending,
+})
+
+const SankeyChart = ({
+ data, disableLegend, pid, period, timeBucket, from, to, timezone, userFlowAscending, userFlowDescending,
+}: {
data?: any
disableLegend?: boolean
+ pid: string
+ userFlowAscending: IUserFlow[]
+ userFlowDescending: IUserFlow[]
+ period: string
+ timezone: string
+ timeBucket: string
+ from: string
+ to: string
}) => (
<ResponsiveSankey
data={dataTest}
@@ -143,7 +160,6 @@ const SankeyChart = ({ data, disableLegend }: {
SankeyChart.defaultProps = {
data: {},
disableLegend: false,
- height: null,
}
export default SankeyChart
diff --git a/src/redux/models/IUserFlow.ts b/src/redux/models/IUserFlow.ts
index 1f307da48..58b0be152 100644
--- a/src/redux/models/IUserFlow.ts
+++ b/src/redux/models/IUserFlow.ts
@@ -9,4 +9,4 @@ interface UserFlow {
}[]
}
-export type IUserFLow = UserFlow | {}
+export type IUserFlow = UserFlow | {}