-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bi): Adds support for list type variables in BI (#25651)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2ca6df5
commit c6ca943
Showing
15 changed files
with
109 additions
and
24 deletions.
There are no files selected for viewing
Binary file modified
BIN
-566 Bytes
(100%)
frontend/__snapshots__/exporter-exporter--event-table-insight--dark.png
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
BIN
+70 Bytes
(100%)
frontend/__snapshots__/exporter-exporter--event-table-insight--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
frontend/src/scenes/settings/environment/sessionReplayLinkedFlagLogic.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { actions, afterMount, connect, kea, path, props, reducers, selectors } from 'kea' | ||
import { loaders } from 'kea-loaders' | ||
import api from 'lib/api' | ||
import { isObject } from 'lib/utils' | ||
import { variantKeyToIndexFeatureFlagPayloads } from 'scenes/feature-flags/featureFlagLogic' | ||
import { teamLogic } from 'scenes/teamLogic' | ||
|
||
import { FeatureFlagBasicType } from '~/types' | ||
|
||
import type { sessionReplayLinkedFlagLogicType } from './sessionReplayLinkedFlagLogicType' | ||
|
||
export interface ReplayLinkedFlagLogicProps { | ||
id: number | null | ||
} | ||
|
||
export const sessionReplayLinkedFlagLogic = kea<sessionReplayLinkedFlagLogicType>([ | ||
path(['scenes', 'settings', 'project', 'sessionReplayLinkedFlagLogic']), | ||
actions({ | ||
selectFeatureFlag: (flag: FeatureFlagBasicType) => ({ flag }), | ||
}), | ||
connect({ values: [teamLogic, ['currentTeam']] }), | ||
reducers({ | ||
selectedFlag: [ | ||
null as FeatureFlagBasicType | null, | ||
{ | ||
selectFeatureFlag: (_, { flag }) => flag, | ||
}, | ||
], | ||
}), | ||
props({} as ReplayLinkedFlagLogicProps), | ||
loaders(({ props }) => ({ | ||
featureFlag: { | ||
loadFeatureFlag: async () => { | ||
if (props.id) { | ||
const retrievedFlag = await api.featureFlags.get(props.id) | ||
return variantKeyToIndexFeatureFlagPayloads(retrievedFlag) | ||
} | ||
return null | ||
}, | ||
}, | ||
})), | ||
selectors({ | ||
linkedFlag: [ | ||
(s) => [s.featureFlag, s.selectedFlag, s.currentTeam], | ||
// an existing linked flag is loaded from the API, | ||
// a newly chosen flag is selected can be passed in | ||
// the current team is used to ensure that we don't show stale values | ||
// as people change the selection | ||
(featureFlag, selectedFlag, currentTeam) => | ||
currentTeam?.session_recording_linked_flag?.id ? selectedFlag || featureFlag : null, | ||
], | ||
flagHasVariants: [(s) => [s.linkedFlag], (linkedFlag) => isObject(linkedFlag?.filters.multivariate)], | ||
}), | ||
afterMount(({ actions }) => { | ||
actions.loadFeatureFlag() | ||
}), | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 4.2.15 on 2024-10-17 10:44 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("posthog", "0492_team_session_recording_url_trigger_config"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="insightvariable", | ||
name="values", | ||
field=models.JSONField(blank=True, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters