Skip to content

Commit

Permalink
Rename TaxonomicFilterGroupType.Sessions to TaxonomicFilterGroupType.…
Browse files Browse the repository at this point in the history
…SessionProperties
  • Loading branch information
robbie-c committed Apr 25, 2024
1 parent f5ef830 commit 350f046
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function Example({ value }: { value?: string }): JSX.Element {
type === TaxonomicFilterGroupType.PersonProperties ||
type === TaxonomicFilterGroupType.GroupsPrefix ||
type === TaxonomicFilterGroupType.Metadata ||
type === TaxonomicFilterGroupType.Sessions
type === TaxonomicFilterGroupType.SessionProperties
) {
data = getCoreFilterDefinition(value, type)
} else if (type === TaxonomicFilterGroupType.Elements) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,16 @@ export const definitionPopoverLogic = kea<definitionPopoverLogicType>([
[
TaxonomicFilterGroupType.PersonProperties,
TaxonomicFilterGroupType.EventProperties,
TaxonomicFilterGroupType.Sessions,
TaxonomicFilterGroupType.SessionProperties,
TaxonomicFilterGroupType.EventFeatureFlags,
TaxonomicFilterGroupType.NumericalEventProperties,
TaxonomicFilterGroupType.Metadata,
].includes(type) || type.startsWith(TaxonomicFilterGroupType.GroupsPrefix),
],
hasSentAs: [
(s) => [s.type, s.isProperty, s.isEvent],
(type, isProperty, isEvent) => isEvent || (isProperty && type !== TaxonomicFilterGroupType.Sessions),
(type, isProperty, isEvent) =>
isEvent || (isProperty && type !== TaxonomicFilterGroupType.SessionProperties),
],
isCohort: [(s) => [s.type], (type) => type === TaxonomicFilterGroupType.Cohorts],
isDataWarehouse: [(s) => [s.type], (type) => type === TaxonomicFilterGroupType.DataWarehouse],
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/DefinitionPopover/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function getSingularType(type: TaxonomicFilterGroupType): string {
case TaxonomicFilterGroupType.EventProperties:
case TaxonomicFilterGroupType.PersonProperties:
case TaxonomicFilterGroupType.GroupsPrefix: // Group properties
case TaxonomicFilterGroupType.Sessions:
case TaxonomicFilterGroupType.SessionProperties:
return 'property'
case TaxonomicFilterGroupType.EventFeatureFlags:
return 'feature'
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/components/PropertyFilters/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('propertyFilterTypeToTaxonomicFilterType()', () => {
...baseFilter,
type: PropertyFilterType.Session,
} as SessionPropertyFilter)
).toEqual(TaxonomicFilterGroupType.Sessions)
).toEqual(TaxonomicFilterGroupType.SessionProperties)
expect(propertyFilterTypeToTaxonomicFilterType({ ...baseFilter, type: PropertyFilterType.HogQL })).toEqual(
TaxonomicFilterGroupType.HogQLExpression
)
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('breakdownFilterToTaxonomicFilterType()', () => {
TaxonomicFilterGroupType.EventProperties
)
expect(breakdownFilterToTaxonomicFilterType({ ...baseFilter, breakdown_type: 'session' })).toEqual(
TaxonomicFilterGroupType.Sessions
TaxonomicFilterGroupType.SessionProperties
)
expect(breakdownFilterToTaxonomicFilterType({ ...baseFilter, breakdown_type: 'hogql' })).toEqual(
TaxonomicFilterGroupType.HogQLExpression
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/components/PropertyFilters/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const PROPERTY_FILTER_TYPE_TO_TAXONOMIC_FILTER_GROUP_TYPE: Omit<
[PropertyFilterType.Feature]: TaxonomicFilterGroupType.EventFeatureFlags,
[PropertyFilterType.Cohort]: TaxonomicFilterGroupType.Cohorts,
[PropertyFilterType.Element]: TaxonomicFilterGroupType.Elements,
[PropertyFilterType.Session]: TaxonomicFilterGroupType.Sessions,
[PropertyFilterType.Session]: TaxonomicFilterGroupType.SessionProperties,
[PropertyFilterType.HogQL]: TaxonomicFilterGroupType.HogQLExpression,
[PropertyFilterType.Group]: TaxonomicFilterGroupType.GroupsPrefix,
[PropertyFilterType.DataWarehouse]: TaxonomicFilterGroupType.DataWarehouse,
Expand Down Expand Up @@ -268,7 +268,7 @@ const propertyFilterMapping: Partial<Record<PropertyFilterType, TaxonomicFilterG
[PropertyFilterType.Feature]: TaxonomicFilterGroupType.EventFeatureFlags,
[PropertyFilterType.Cohort]: TaxonomicFilterGroupType.Cohorts,
[PropertyFilterType.Element]: TaxonomicFilterGroupType.Elements,
[PropertyFilterType.Session]: TaxonomicFilterGroupType.Sessions,
[PropertyFilterType.Session]: TaxonomicFilterGroupType.SessionProperties,
[PropertyFilterType.HogQL]: TaxonomicFilterGroupType.HogQLExpression,
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/components/TaxonomicFilter/InfiniteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const renderItemContents = ({
listGroupType === TaxonomicFilterGroupType.Events ||
listGroupType === TaxonomicFilterGroupType.CustomEvents ||
listGroupType === TaxonomicFilterGroupType.Metadata ||
listGroupType === TaxonomicFilterGroupType.Sessions ||
listGroupType === TaxonomicFilterGroupType.SessionProperties ||
listGroupType.startsWith(TaxonomicFilterGroupType.GroupsPrefix) ? (
<>
<div className={clsx('taxonomic-list-row-contents', isStale && 'text-muted')}>
Expand Down Expand Up @@ -161,7 +161,7 @@ const selectedItemHasPopover = (
TaxonomicFilterGroupType.Cohorts,
TaxonomicFilterGroupType.CohortsWithAllUsers,
TaxonomicFilterGroupType.Metadata,
TaxonomicFilterGroupType.Sessions,
TaxonomicFilterGroupType.SessionProperties,
].includes(listGroupType) ||
listGroupType.startsWith(TaxonomicFilterGroupType.GroupsPrefix))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('taxonomicFilterLogic', () => {
TaxonomicFilterGroupType.Events,
TaxonomicFilterGroupType.Actions,
TaxonomicFilterGroupType.Elements,
TaxonomicFilterGroupType.Sessions,
TaxonomicFilterGroupType.SessionProperties,
],
}
logic = taxonomicFilterLogic(logicProps)
Expand All @@ -62,7 +62,7 @@ describe('taxonomicFilterLogic', () => {
infiniteListLogic({ ...logic.props, listGroupType: TaxonomicFilterGroupType.Events }),
infiniteListLogic({ ...logic.props, listGroupType: TaxonomicFilterGroupType.Actions }),
infiniteListLogic({ ...logic.props, listGroupType: TaxonomicFilterGroupType.Elements }),
infiniteListLogic({ ...logic.props, listGroupType: TaxonomicFilterGroupType.Sessions }),
infiniteListLogic({ ...logic.props, listGroupType: TaxonomicFilterGroupType.SessionProperties }),
])
expect(
infiniteListLogic({ ...logic.props, listGroupType: TaxonomicFilterGroupType.Cohorts }).isMounted()
Expand All @@ -76,7 +76,7 @@ describe('taxonomicFilterLogic', () => {
[TaxonomicFilterGroupType.Events]: 1,
[TaxonomicFilterGroupType.Actions]: 0,
[TaxonomicFilterGroupType.Elements]: 4,
[TaxonomicFilterGroupType.Sessions]: 1,
[TaxonomicFilterGroupType.SessionProperties]: 1,
},
})
.toDispatchActions(['infiniteListResultsReceived'])
Expand All @@ -87,7 +87,7 @@ describe('taxonomicFilterLogic', () => {
[TaxonomicFilterGroupType.Events]: 157,
[TaxonomicFilterGroupType.Actions]: 0, // not mocked
[TaxonomicFilterGroupType.Elements]: 4,
[TaxonomicFilterGroupType.Sessions]: 1,
[TaxonomicFilterGroupType.SessionProperties]: 1,
},
})
})
Expand All @@ -110,7 +110,7 @@ describe('taxonomicFilterLogic', () => {
[TaxonomicFilterGroupType.Events]: 4,
[TaxonomicFilterGroupType.Actions]: 0,
[TaxonomicFilterGroupType.Elements]: 0,
[TaxonomicFilterGroupType.Sessions]: 0,
[TaxonomicFilterGroupType.SessionProperties]: 0,
},
})

Expand All @@ -127,7 +127,7 @@ describe('taxonomicFilterLogic', () => {
[TaxonomicFilterGroupType.Events]: 0,
[TaxonomicFilterGroupType.Actions]: 0,
[TaxonomicFilterGroupType.Elements]: 1,
[TaxonomicFilterGroupType.Sessions]: 0,
[TaxonomicFilterGroupType.SessionProperties]: 0,
},
})

Expand All @@ -144,7 +144,7 @@ describe('taxonomicFilterLogic', () => {
[TaxonomicFilterGroupType.Events]: 0,
[TaxonomicFilterGroupType.Actions]: 0,
[TaxonomicFilterGroupType.Elements]: 0,
[TaxonomicFilterGroupType.Sessions]: 0,
[TaxonomicFilterGroupType.SessionProperties]: 0,
},
})

Expand All @@ -161,13 +161,13 @@ describe('taxonomicFilterLogic', () => {
[TaxonomicFilterGroupType.Events]: 157,
[TaxonomicFilterGroupType.Actions]: 0,
[TaxonomicFilterGroupType.Elements]: 4,
[TaxonomicFilterGroupType.Sessions]: 1,
[TaxonomicFilterGroupType.SessionProperties]: 1,
},
})

// move right, skipping Actions
await expectLogic(logic, () => logic.actions.tabRight()).toMatchValues({
activeTab: TaxonomicFilterGroupType.Sessions,
activeTab: TaxonomicFilterGroupType.SessionProperties,
})
await expectLogic(logic, () => logic.actions.tabRight()).toMatchValues({
activeTab: TaxonomicFilterGroupType.Events,
Expand All @@ -181,7 +181,7 @@ describe('taxonomicFilterLogic', () => {
activeTab: TaxonomicFilterGroupType.Events,
})
await expectLogic(logic, () => logic.actions.tabLeft()).toMatchValues({
activeTab: TaxonomicFilterGroupType.Sessions,
activeTab: TaxonomicFilterGroupType.SessionProperties,
})
await expectLogic(logic, () => logic.actions.tabLeft()).toMatchValues({
activeTab: TaxonomicFilterGroupType.Elements,
Expand All @@ -201,7 +201,7 @@ describe('taxonomicFilterLogic', () => {
[TaxonomicFilterGroupType.Events]: 4,
[TaxonomicFilterGroupType.Actions]: 0,
[TaxonomicFilterGroupType.Elements]: 0,
[TaxonomicFilterGroupType.Sessions]: 0,
[TaxonomicFilterGroupType.SessionProperties]: 0,
},
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([
{
name: 'Session Properties',
searchPlaceholder: 'sessions',
type: TaxonomicFilterGroupType.Sessions,
type: TaxonomicFilterGroupType.SessionProperties,
options: featureFlags[FEATURE_FLAGS.SESSION_TABLE_PROPERTY_FILTERS]
? undefined
: [
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/TaxonomicFilter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export enum TaxonomicFilterGroupType {
Plugins = 'plugins',
Dashboards = 'dashboards',
GroupNamesPrefix = 'name_groups',
Sessions = 'session_properties',
SessionProperties = 'session_properties',
HogQLExpression = 'hogql_expression',
Notebooks = 'notebooks',
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function GlobalAndOrFilters({ insightProps }: EditorFilterProps): JSX.Ele
...groupsTaxonomicTypes,
TaxonomicFilterGroupType.Cohorts,
TaxonomicFilterGroupType.Elements,
...(isTrends ? [TaxonomicFilterGroupType.Sessions] : []),
...(isTrends ? [TaxonomicFilterGroupType.SessionProperties] : []),
TaxonomicFilterGroupType.HogQLExpression,
...(featureFlags[FEATURE_FLAGS.DATA_WAREHOUSE] && featureFlags[FEATURE_FLAGS.HOGQL_INSIGHTS]
? [TaxonomicFilterGroupType.DataWarehousePersonProperties]
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/queries/nodes/InsightViz/TrendsSeries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function TrendsSeries(): JSX.Element | null {
...groupsTaxonomicTypes,
TaxonomicFilterGroupType.Cohorts,
TaxonomicFilterGroupType.Elements,
...(isTrends ? [TaxonomicFilterGroupType.Sessions] : []),
...(isTrends ? [TaxonomicFilterGroupType.SessionProperties] : []),
TaxonomicFilterGroupType.HogQLExpression,
TaxonomicFilterGroupType.DataWarehouseProperties,
...(featureFlags[FEATURE_FLAGS.DATA_WAREHOUSE] && featureFlags[FEATURE_FLAGS.HOGQL_INSIGHTS]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export function ActionFilterRow({
groupTypes={[
TaxonomicFilterGroupType.DataWarehouseProperties,
TaxonomicFilterGroupType.NumericalEventProperties,
TaxonomicFilterGroupType.Sessions,
TaxonomicFilterGroupType.SessionProperties,
]}
schemaColumns={
filter.type == TaxonomicFilterGroupType.DataWarehouse && filter.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const TaxonomicBreakdownPopover = ({ open, setOpen, children }: Taxonomic
TaxonomicFilterGroupType.EventFeatureFlags,
...groupsTaxonomicTypes,
TaxonomicFilterGroupType.CohortsWithAllUsers,
...(includeSessions ? [TaxonomicFilterGroupType.Sessions] : []),
...(includeSessions ? [TaxonomicFilterGroupType.SessionProperties] : []),
TaxonomicFilterGroupType.HogQLExpression,
TaxonomicFilterGroupType.DataWarehouseProperties,
]
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/web-analytics/WebPropertyFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const WebPropertyFilters = ({
taxonomicGroupTypes={
featureFlags[FEATURE_FLAGS.SESSION_TABLE_PROPERTY_FILTERS]
? [
TaxonomicFilterGroupType.Sessions,
TaxonomicFilterGroupType.SessionProperties,
TaxonomicFilterGroupType.EventProperties,
TaxonomicFilterGroupType.PersonProperties,
]
Expand Down

0 comments on commit 350f046

Please sign in to comment.