Skip to content

Commit

Permalink
Merge branch 'master' into feat/annotations-in-data-management
Browse files Browse the repository at this point in the history
# Conflicts:
#	frontend/__snapshots__/scenes-app-insights--trends-line-edit.png
  • Loading branch information
benjackwhite committed Nov 8, 2023
2 parents 6b165bf + a6fccbe commit 3771faf
Show file tree
Hide file tree
Showing 58 changed files with 3,092 additions and 352 deletions.
36 changes: 36 additions & 0 deletions ee/clickhouse/models/test/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,42 @@ def test_numerical(self):
events = _filter_events(filter, self.team)
self.assertEqual(events[0]["id"], event1_uuid)

def test_numerical_person_properties(self):
_create_person(team_id=self.team.pk, distinct_ids=["p1"], properties={"$a_number": 4})
_create_person(team_id=self.team.pk, distinct_ids=["p2"], properties={"$a_number": 5})
_create_person(team_id=self.team.pk, distinct_ids=["p3"], properties={"$a_number": 6})

filter = Filter(
data={
"properties": [
{
"type": "person",
"key": "$a_number",
"value": 4,
"operator": "gt",
}
]
}
)
self.assertEqual(len(_filter_persons(filter, self.team)), 2)

filter = Filter(data={"properties": [{"type": "person", "key": "$a_number", "value": 5}]})
self.assertEqual(len(_filter_persons(filter, self.team)), 1)

filter = Filter(
data={
"properties": [
{
"type": "person",
"key": "$a_number",
"value": 6,
"operator": "lt",
}
]
}
)
self.assertEqual(len(_filter_persons(filter, self.team)), 2)

def test_contains(self):
_create_event(team=self.team, distinct_id="test", event="$pageview")
event2_uuid = _create_event(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions frontend/src/exporter/Exporter.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ const Template: StoryFn<typeof Exporter> = (props) => {
export const TrendsLineInsight: Story = Template.bind({})
TrendsLineInsight.args = { insight: require('../mocks/fixtures/api/projects/team_id/insights/trendsLine.json') }

export const TrendsLineMultiInsight: Story = Template.bind({})
TrendsLineMultiInsight.args = {
insight: require('../mocks/fixtures/api/projects/team_id/insights/trendsLineMulti.json'),
}
TrendsLineMultiInsight.parameters = {
mockDate: '2023-07-10',
}

export const TrendsLineBreakdownInsight: Story = Template.bind({})
TrendsLineBreakdownInsight.args = {
insight: require('../mocks/fixtures/api/projects/team_id/insights/trendsLineBreakdown.json'),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/layout/navigation/navigationLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { sceneLogic } from 'scenes/sceneLogic'
import { teamLogic } from 'scenes/teamLogic'
import { userLogic } from 'scenes/userLogic'
import type { navigationLogicType } from './navigationLogicType'
import { membersLogic } from 'scenes/organization/Settings/membersLogic'
import { membersLogic } from 'scenes/organization/membersLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { Scene } from 'scenes/sceneTypes'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expectLogic } from 'kea-test-utils'
import { inviteLogic } from 'scenes/organization/Settings/inviteLogic'
import { membersLogic } from 'scenes/organization/Settings/membersLogic'
import { membersLogic } from 'scenes/organization/membersLogic'
import { pluginsLogic } from 'scenes/plugins/pluginsLogic'
import { teamLogic } from 'scenes/teamLogic'
import { navigationLogic } from '~/layout/navigation/navigationLogic'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { router, urlToAction } from 'kea-router'
import api from 'lib/api'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { inviteLogic } from 'scenes/organization/Settings/inviteLogic'
import { membersLogic } from 'scenes/organization/Settings/membersLogic'
import { membersLogic } from 'scenes/organization/membersLogic'
import { pluginsLogic } from 'scenes/plugins/pluginsLogic'
import { teamLogic } from 'scenes/teamLogic'
import { navigationLogic } from '~/layout/navigation/navigationLogic'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ChartDisplayType, InsightColor, InsightModel, InsightShortId, TrendsFil
import { InsightCard as InsightCardComponent } from './index'

import EXAMPLE_TRENDS from '../../../../mocks/fixtures/api/projects/team_id/insights/trendsLine.json'
import EXAMPLE_TRENDS_MULTI from '../../../../mocks/fixtures/api/projects/team_id/insights/trendsLineMulti.json'
import EXAMPLE_TRENDS_HORIZONTAL_BAR from '../../../../mocks/fixtures/api/projects/team_id/insights/trendsValue.json'
import EXAMPLE_TRENDS_TABLE from '../../../../mocks/fixtures/api/projects/team_id/insights/trendsTable.json'
import EXAMPLE_TRENDS_PIE from '../../../../mocks/fixtures/api/projects/team_id/insights/trendsPie.json'
Expand All @@ -18,6 +19,7 @@ import EXAMPLE_DATA_TABLE_NODE_EVENTS_QUERY from '../../../../mocks/fixtures/api

const examples = [
EXAMPLE_TRENDS,
EXAMPLE_TRENDS_MULTI,
EXAMPLE_TRENDS_HORIZONTAL_BAR,
EXAMPLE_TRENDS_TABLE,
EXAMPLE_TRENDS_PIE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { KeyMapping, UserBasicType, PropertyDefinition } from '~/types'
import { Owner } from 'scenes/events/Owner'
import { dayjs } from 'lib/dayjs'
import { Divider, DividerProps, Select } from 'antd'
import { membersLogic } from 'scenes/organization/Settings/membersLogic'
import { membersLogic } from 'scenes/organization/membersLogic'
import { Link } from 'lib/lemon-ui/Link'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useMemo } from 'react'
import { useActions, useValues } from 'kea'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { membersLogic } from 'scenes/organization/Settings/membersLogic'
import { membersLogic } from 'scenes/organization/membersLogic'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { Field } from 'lib/forms/Field'
import { dayjs } from 'lib/dayjs'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,22 @@
"name": "",
"derived_name": "Pageview count",
"filters": {
"display": "ActionsLineGraph",
"events": [
{
"id": "$pageview",
"name": "$pageview",
"type": "events",
"order": 0
},
{
"id": "$geoip_country_name",
"name": "$geoip_country_name",
"type": "events",
"order": 0
"order": 0,
"name": "$pageview",
"custom_name": null,
"math": null,
"math_property": null,
"math_group_type_index": null,
"properties": {}
}
],
"actions": [],
"display": "ActionsLineGraph",
"insight": "TRENDS",
"interval": "day",
"properties": {
"type": "AND",
"values": [
{
"type": "AND",
"values": [
{ "key": "$browser", "value": ["Chrome"], "operator": "exact", "type": "event" },
{ "key": "utm_source", "value": ["google"], "operator": "exact", "type": "event" }
]
}
]
},
"filter_test_accounts": false
"interval": "day"
},
"filters_hash": "cache_42127776c1709f7c4209cea8925faefd",
"order": null,
Expand Down Expand Up @@ -163,8 +148,6 @@
}
],
"filter": {
"date_from": "2022-03-04T00:00:00+00:00",
"date_to": "2022-03-11T01:44:36.488058+00:00",
"display": "ActionsLineGraph",
"events": [
{
Expand Down
Loading

0 comments on commit 3771faf

Please sign in to comment.