Skip to content

Commit

Permalink
feat: Feature gate session replay controls using available_product_fe…
Browse files Browse the repository at this point in the history
…atures (#19401)

* feature gate session replay control using available_product_features

* separate out feature checks

* refine the separate feature checks

* Update query snapshots

* Update UI snapshots for `chromium` (2)

* Update query snapshots

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: Bianca Yang <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 2, 2024
1 parent 98f6575 commit b8b90c1
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 166 deletions.
7 changes: 4 additions & 3 deletions frontend/src/scenes/onboarding/Onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { useEffect, useState } from 'react'
import { SceneExport } from 'scenes/sceneTypes'
import { teamLogic } from 'scenes/teamLogic'
import { userLogic } from 'scenes/userLogic'

import { ProductKey } from '~/types'
import { AvailableFeature, ProductKey } from '~/types'

import { OnboardingBillingStep } from './OnboardingBillingStep'
import { OnboardingInviteTeammates } from './OnboardingInviteTeammates'
Expand Down Expand Up @@ -109,7 +110,7 @@ const ProductAnalyticsOnboarding = (): JSX.Element => {
)
}
const SessionReplayOnboarding = (): JSX.Element => {
const { featureFlags } = useValues(featureFlagLogic)
const { hasAvailableFeature } = useValues(userLogic)
const configOptions: ProductConfigOption[] = [
{
type: 'toggle',
Expand All @@ -129,7 +130,7 @@ const SessionReplayOnboarding = (): JSX.Element => {
},
]

if (featureFlags[FEATURE_FLAGS.SESSION_RECORDING_SAMPLING] === true) {
if (hasAvailableFeature(AvailableFeature.RECORDING_DURATION_MINIMUM)) {
configOptions.push({
type: 'select',
title: 'Minimum session duration (seconds)',
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/scenes/settings/SettingsMap.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { AvailableFeature } from '~/types'

import { Invites } from './organization/Invites'
import { Members } from './organization/Members'
import { OrganizationDangerZone } from './organization/OrganizationDangerZone'
Expand Down Expand Up @@ -158,6 +160,11 @@ export const SettingsMap: SettingSection[] = [
title: 'Ingestion controls',
component: <ReplayCostControl />,
flag: 'SESSION_RECORDING_SAMPLING',
features: [
AvailableFeature.SESSION_REPLAY_SAMPLING,
AvailableFeature.RECORDING_DURATION_MINIMUM,
AvailableFeature.FEATURE_FLAG_BASED_RECORDING,
],
},
],
},
Expand Down
Loading

0 comments on commit b8b90c1

Please sign in to comment.