Skip to content

Commit

Permalink
fix: universal search with notebooks disabled (#17437)
Browse files Browse the repository at this point in the history
* fix: universal search with notebooks disabled

* Update frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx

Co-authored-by: Paul D'Ambra <[email protected]>

* Update UI snapshots for `chromium` (1)

* fix(experiments): JS snippet typo (#17434)

* chore: clear the console in storybook a little (#17430)

* chore: clear the console in storybook a little

* Update .storybook/preview.tsx

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* maybe this?

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* maybe this

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Paul D'Ambra <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 14, 2023
1 parent 65de847 commit 267f0af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import { groupDisplayId } from 'scenes/persons/GroupActorDisplay'
import { infiniteListLogicType } from 'lib/components/TaxonomicFilter/infiniteListLogicType'
import { updatePropertyDefinitions } from '~/models/propertyDefinitionsModel'
import { InlineHogQLEditor } from './InlineHogQLEditor'
import { FEATURE_FLAGS } from 'lib/constants'

export const eventTaxonomicGroupProps: Pick<TaxonomicFilterGroup, 'getPopoverHeader' | 'getIcon'> = {
getPopoverHeader: (eventDefinition: EventDefinition): string => {
Expand Down Expand Up @@ -79,8 +78,6 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>({
['groupTypes', 'aggregationLabel'],
groupPropertiesModel,
['allGroupProperties'],
featureFlagsLogic,
['featureFlags'],
],
},
actions: () => ({
Expand Down Expand Up @@ -150,15 +147,13 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>({
s.groupAnalyticsTaxonomicGroupNames,
s.eventNames,
s.excludedProperties,
s.featureFlags,
],
(
teamId,
groupAnalyticsTaxonomicGroups,
groupAnalyticsTaxonomicGroupNames,
eventNames,
excludedProperties,
featureFlags
excludedProperties
): TaxonomicFilterGroup[] => {
const groups = [
{
Expand Down Expand Up @@ -404,6 +399,16 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>({
getValue: (dashboard: DashboardType) => dashboard.id,
getPopoverHeader: () => `Dashboards`,
},
{
name: 'Notebooks',
searchPlaceholder: 'notebooks',
type: TaxonomicFilterGroupType.Notebooks,
value: 'notebooks',
endpoint: `api/projects/${teamId}/notebooks/`,
getName: (notebook: NotebookType) => notebook.title || `Notebook ${notebook.short_id}`,
getValue: (notebook: NotebookType) => notebook.short_id,
getPopoverHeader: () => 'Notebooks',
},
{
name: 'Sessions',
searchPlaceholder: 'sessions',
Expand All @@ -429,19 +434,6 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>({
...groupAnalyticsTaxonomicGroupNames,
]

if (featureFlags[FEATURE_FLAGS.NOTEBOOKS]) {
groups.push({
name: 'Notebooks',
searchPlaceholder: 'notebooks',
type: TaxonomicFilterGroupType.Notebooks,
value: 'notebooks',
endpoint: `api/projects/${teamId}/notebooks/`,
getName: (notebook: NotebookType) => notebook.title || `Notebook ${notebook.short_id}`,
getValue: (notebook: NotebookType) => notebook.short_id,
getPopoverHeader: () => 'Notebooks',
})
}

return groups
},
],
Expand Down

0 comments on commit 267f0af

Please sign in to comment.