🚸 (editor) Remove blocks pointer events only in analytics
This commit is contained in:
@ -49,7 +49,7 @@ export const AnalyticsGraphContainer = ({ stats }: { stats?: Stats }) => {
|
||||
justifyContent="center"
|
||||
>
|
||||
{publishedTypebot && stats ? (
|
||||
<GraphProvider isReadOnly>
|
||||
<GraphProvider isReadOnly isAnalytics>
|
||||
<EventsCoordinatesProvider events={publishedTypebot?.events}>
|
||||
<Graph
|
||||
flex="1"
|
||||
|
@ -69,6 +69,7 @@ export const BlockNode = ({
|
||||
setFocusedGroupId,
|
||||
previewingEdge,
|
||||
isReadOnly,
|
||||
isAnalytics,
|
||||
previewingBlock,
|
||||
} = useGraph()
|
||||
const { mouseOverBlock, setMouseOverBlock } = useBlockDnd()
|
||||
@ -215,7 +216,7 @@ export const BlockNode = ({
|
||||
data-testid={`block ${block.id}`}
|
||||
w="full"
|
||||
className="prevent-group-drag"
|
||||
pointerEvents={isReadOnly || isDraggingGraph ? 'none' : 'auto'}
|
||||
pointerEvents={isAnalytics || isDraggingGraph ? 'none' : 'auto'}
|
||||
>
|
||||
<HStack
|
||||
flex="1"
|
||||
|
@ -32,6 +32,7 @@ const graphContext = createContext<{
|
||||
openedItemId?: string
|
||||
setOpenedItemId: Dispatch<SetStateAction<string | undefined>>
|
||||
isReadOnly: boolean
|
||||
isAnalytics: boolean
|
||||
focusedGroupId?: string
|
||||
setFocusedGroupId: Dispatch<SetStateAction<string | undefined>>
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
@ -44,9 +45,11 @@ const graphContext = createContext<{
|
||||
export const GraphProvider = ({
|
||||
children,
|
||||
isReadOnly = false,
|
||||
isAnalytics = false,
|
||||
}: {
|
||||
children: ReactNode
|
||||
isReadOnly?: boolean
|
||||
isAnalytics?: boolean
|
||||
}) => {
|
||||
const [graphPosition, setGraphPosition] = useState(
|
||||
graphPositionDefaultValue({ x: 0, y: 0 })
|
||||
@ -76,6 +79,7 @@ export const GraphProvider = ({
|
||||
setFocusedGroupId,
|
||||
setPreviewingBlock,
|
||||
previewingBlock,
|
||||
isAnalytics,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
@ -36,6 +36,16 @@ const inspectTypebot = async () => {
|
||||
id: true,
|
||||
name: true,
|
||||
plan: true,
|
||||
members: {
|
||||
select: {
|
||||
role: true,
|
||||
user: {
|
||||
select: {
|
||||
email: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -24,7 +24,11 @@ const inspectWorkspace = async () => {
|
||||
},
|
||||
include: {
|
||||
typebots: {
|
||||
orderBy: {
|
||||
updatedAt: 'desc',
|
||||
},
|
||||
select: {
|
||||
updatedAt: true,
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
|
Reference in New Issue
Block a user