mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-24 00:47:50 +01:00
Add minor tweaks
This commit is contained in:
parent
53150254b8
commit
cb04d8831a
@ -8,7 +8,7 @@ from typing import Literal, Optional, TypedDict, Union, cast
|
||||
from pydantic import BaseModel, Field, RootModel
|
||||
|
||||
from ee.hogai.taxonomy import CORE_FILTER_DEFINITIONS_BY_GROUP
|
||||
from posthog.hogql.database.schema.channel_type import POSSIBLE_CHANNEL_TYPES
|
||||
from posthog.hogql.database.schema.channel_type import DEFAULT_CHANNEL_TYPES
|
||||
from posthog.hogql_queries.ai.actors_property_taxonomy_query_runner import ActorsPropertyTaxonomyQueryRunner
|
||||
from posthog.hogql_queries.ai.event_taxonomy_query_runner import EventTaxonomyQueryRunner
|
||||
from posthog.hogql_queries.query_runner import ExecutionMode
|
||||
@ -353,7 +353,7 @@ class TaxonomyAgentToolkit(ABC):
|
||||
|
||||
sample_values: list[str | int | float]
|
||||
if property_name == "$channel_type":
|
||||
sample_values = cast(list[str | int | float], POSSIBLE_CHANNEL_TYPES.copy())
|
||||
sample_values = cast(list[str | int | float], DEFAULT_CHANNEL_TYPES.copy())
|
||||
sample_count = len(sample_values)
|
||||
is_str = True
|
||||
elif (
|
||||
|
@ -1,5 +1,3 @@
|
||||
import './styles.scss'
|
||||
|
||||
import {
|
||||
closestCenter,
|
||||
CollisionDetection,
|
||||
|
@ -1,21 +0,0 @@
|
||||
.VerticalNestedDNDContainer {
|
||||
box-sizing: initial;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: var(--bg-light);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
|
||||
.VerticalNestedDNDItem {
|
||||
box-sizing: initial;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: var(--bg-light);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
}
|
@ -138,7 +138,9 @@ export function CustomChannelTypes(): JSX.Element {
|
||||
Object.values(DefaultChannelTypes).forEach((channelType) => {
|
||||
optionsSet.add(channelType)
|
||||
})
|
||||
return Array.from(optionsSet).map((channelType) => ({ label: channelType, key: channelType }))
|
||||
return Array.from(optionsSet)
|
||||
.filter(Boolean)
|
||||
.map((channelType) => ({ label: channelType, key: channelType }))
|
||||
}, [customChannelTypeRules])
|
||||
|
||||
return (
|
||||
|
@ -8,6 +8,7 @@ from posthog.schema import (
|
||||
CustomChannelRule,
|
||||
CustomChannelOperator,
|
||||
CustomChannelField,
|
||||
DefaultChannelTypes,
|
||||
)
|
||||
|
||||
|
||||
@ -288,23 +289,4 @@ multiIf(
|
||||
return builtin_rules
|
||||
|
||||
|
||||
POSSIBLE_CHANNEL_TYPES = [
|
||||
"Cross Network",
|
||||
"Paid Search",
|
||||
"Paid Social",
|
||||
"Paid Video",
|
||||
"Paid Shopping",
|
||||
"Paid Unknown",
|
||||
"Direct",
|
||||
"Organic Search",
|
||||
"Organic Social",
|
||||
"Organic Video",
|
||||
"Organic Shopping",
|
||||
"Push",
|
||||
"SMS",
|
||||
"Audio",
|
||||
"Email",
|
||||
"Referral",
|
||||
"Affiliate",
|
||||
"Unknown",
|
||||
]
|
||||
DEFAULT_CHANNEL_TYPES = [entry.value for entry in DefaultChannelTypes]
|
||||
|
@ -20,6 +20,7 @@ from posthog.hogql.database.models import (
|
||||
from posthog.hogql.database.schema.channel_type import (
|
||||
create_channel_type_expr,
|
||||
ChannelTypeExprs,
|
||||
DEFAULT_CHANNEL_TYPES,
|
||||
)
|
||||
from posthog.hogql.database.schema.util.where_clause_extractor import SessionMinTimestampWhereClauseExtractorV1
|
||||
from posthog.hogql.errors import ResolutionError
|
||||
@ -29,7 +30,7 @@ from posthog.models.sessions.sql import (
|
||||
SELECT_SESSION_PROP_STRING_VALUES_SQL,
|
||||
)
|
||||
from posthog.queries.insight import insight_sync_execute
|
||||
from posthog.schema import BounceRatePageViewMode, DefaultChannelTypes
|
||||
from posthog.schema import BounceRatePageViewMode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from posthog.models.team import Team
|
||||
@ -410,9 +411,7 @@ def get_lazy_session_table_values_v1(key: str, search_term: Optional[str], team:
|
||||
|
||||
if key == "$channel_type":
|
||||
return [
|
||||
[entry.value]
|
||||
for entry in DefaultChannelTypes
|
||||
if not search_term or search_term.lower() in entry.value.lower()
|
||||
[entry] for entry in DEFAULT_CHANNEL_TYPES if not search_term or search_term.lower() in entry.value.lower()
|
||||
]
|
||||
|
||||
field_definition = LAZY_SESSIONS_FIELDS.get(key)
|
||||
|
@ -20,6 +20,7 @@ from posthog.hogql.database.models import (
|
||||
from posthog.hogql.database.schema.channel_type import (
|
||||
create_channel_type_expr,
|
||||
ChannelTypeExprs,
|
||||
DEFAULT_CHANNEL_TYPES,
|
||||
)
|
||||
from posthog.hogql.database.schema.sessions_v1 import null_if_empty
|
||||
from posthog.hogql.database.schema.util.where_clause_extractor import SessionMinTimestampWhereClauseExtractorV2
|
||||
@ -31,7 +32,7 @@ from posthog.models.raw_sessions.sql import (
|
||||
RAW_SELECT_SESSION_PROP_STRING_VALUES_SQL_WITH_FILTER,
|
||||
)
|
||||
from posthog.queries.insight import insight_sync_execute
|
||||
from posthog.schema import BounceRatePageViewMode, CustomChannelRule, DefaultChannelTypes
|
||||
from posthog.schema import BounceRatePageViewMode, CustomChannelRule
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from posthog.models.team import Team
|
||||
@ -502,9 +503,7 @@ def get_lazy_session_table_values_v2(key: str, search_term: Optional[str], team:
|
||||
else:
|
||||
custom_channel_types = []
|
||||
default_channel_types = [
|
||||
entry.value
|
||||
for entry in DefaultChannelTypes
|
||||
if not search_term or search_term.lower() in entry.value.lower()
|
||||
entry for entry in DEFAULT_CHANNEL_TYPES if not search_term or search_term.lower() in entry.value.lower()
|
||||
]
|
||||
# merge the list, keep the order, and remove duplicates
|
||||
return [[name] for name in list(dict.fromkeys(custom_channel_types + default_channel_types))]
|
||||
|
Loading…
Reference in New Issue
Block a user