Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.2 KB
Raw Blame
import { MakeLogicType, connect, kea, path, props } from 'kea'

import { activityLogLogic } from 'lib/components/ActivityLog/activityLogLogic'

import { ActivityScope } from '~/types'

import type { HumanizedActivityLogItem } from '../../../lib/components/ActivityLog/humanizeActivity'
import type { PaginationManual } from '../../../lib/lemon-ui/PaginationControl/index'

export type QueryHistoryLogicProps = {
    id: string
}

// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface queryHistoryLogicValues {
    activityLoading: boolean // activityLogLogic
    humanizedActivity: HumanizedActivityLogItem[] // activityLogLogic
    pagination: PaginationManual // activityLogLogic
}

export type queryHistoryLogicType = MakeLogicType<queryHistoryLogicValues, {}, QueryHistoryLogicProps>

export const queryHistoryLogic = kea<queryHistoryLogicType>([
    path(['scenes', 'data-warehouse', 'editor', 'queryHistoryLogic']),
    props({} as QueryHistoryLogicProps),
    connect(({ id }: QueryHistoryLogicProps) => ({
        values: [
            activityLogLogic({ scope: ActivityScope.DATA_WAREHOUSE_SAVED_QUERY, id: id }),
            ['humanizedActivity', 'activityLoading', 'pagination'],
        ],
    })),
])