Skip to content

Commit

Permalink
chore: Remove stale feature flags (#17925)
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkakkar authored Oct 11, 2023
1 parent ed40b77 commit e15de55
Show file tree
Hide file tree
Showing 36 changed files with 75 additions and 157 deletions.
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 frontend/__snapshots__/scenes-app-apps--installed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 frontend/__snapshots__/scenes-app-batchexports--exports.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 frontend/__snapshots__/scenes-app-batchexports--view-export.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 frontend/__snapshots__/scenes-app-dashboards--list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 frontend/__snapshots__/scenes-app-dashboards--new.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 frontend/__snapshots__/scenes-app-data-management--database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 frontend/__snapshots__/scenes-app-events--event-explorer.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 frontend/__snapshots__/scenes-app-features--features-list.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 frontend/__snapshots__/scenes-app-features--new-feature-flag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 frontend/__snapshots__/scenes-app-insights--lifecycle--webkit.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 frontend/__snapshots__/scenes-app-insights--stickiness--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 14 additions & 20 deletions frontend/src/layout/navigation/SideBar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,33 +164,27 @@ function Pages(): JSX.Element {
/>
<PageButton icon={<IconRecording />} identifier={Scene.Replay} to={urls.replay()} />

{featureFlags[FEATURE_FLAGS.EARLY_ACCESS_FEATURE] && (
<div className="SideBar__heading">Feature Management</div>
)}
<div className="SideBar__heading">Feature Management</div>

<PageButton icon={<IconFlag />} identifier={Scene.FeatureFlags} to={urls.featureFlags()} />
{(hasAvailableFeature(AvailableFeature.EXPERIMENTATION) ||
!preflight?.instance_preferences?.disable_paid_fs) && (
<PageButton icon={<IconExperiment />} identifier={Scene.Experiments} to={urls.experiments()} />
)}
{featureFlags[FEATURE_FLAGS.EARLY_ACCESS_FEATURE] && (
<PageButton
icon={<IconRocketLaunch />}
identifier={Scene.EarlyAccessFeatures}
title={'Early Access Management'}
to={urls.earlyAccessFeatures()}
/>
)}
<PageButton
icon={<IconRocketLaunch />}
identifier={Scene.EarlyAccessFeatures}
title={'Early Access Management'}
to={urls.earlyAccessFeatures()}
/>

{featureFlags[FEATURE_FLAGS.SURVEYS] && (
<PageButton
icon={<IconSurveys />}
identifier={Scene.Surveys}
title={'Surveys'}
to={urls.surveys()}
highlight="beta"
/>
)}
<PageButton
icon={<IconSurveys />}
identifier={Scene.Surveys}
title={'Surveys'}
to={urls.surveys()}
highlight="beta"
/>

{featureFlags[FEATURE_FLAGS.WEB_ANALYTICS] && (
<PageButton
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,18 @@ export const FEATURE_FLAGS = {
INGESTION_WARNINGS_ENABLED: 'ingestion-warnings-enabled', // owner: @tiina303
SESSION_RESET_ON_LOAD: 'session-reset-on-load', // owner: @benjackwhite
DEBUG_REACT_RENDERS: 'debug-react-renders', // owner: @benjackwhite
RECORDINGS_ON_FEATURE_FLAGS: 'recordings-on-feature-flags', // owner: @EDsCODE
AUTO_ROLLBACK_FEATURE_FLAGS: 'auto-rollback-feature-flags', // owner: @EDsCODE
ONBOARDING_V2_DEMO: 'onboarding-v2-demo', // owner: #team-growth
FEATURE_FLAG_ROLLOUT_UX: 'feature-flag-rollout-ux', // owner: @neilkakkar
ROLE_BASED_ACCESS: 'role-based-access', // owner: #team-experiments, @liyiy
QUERY_RUNNING_TIME: 'query_running_time', // owner: @mariusandra
QUERY_TIMINGS: 'query-timings', // owner: @mariusandra
POSTHOG_3000: 'posthog-3000', // owner: @Twixes
ENABLE_PROMPTS: 'enable-prompts', // owner: @lharries
FEEDBACK_SCENE: 'feedback-scene', // owner: @lharries
NOTEBOOKS: 'notebooks', // owner: #team-monitoring
EARLY_ACCESS_FEATURE: 'early-access-feature', // owner: @EDsCODE
EARLY_ACCESS_FEATURE_SITE_BUTTON: 'early-access-feature-site-button', // owner: @neilkakkar
HEDGEHOG_MODE_DEBUG: 'hedgehog-mode-debug', // owner: @benjackwhite
AUTO_REDIRECT: 'auto-redirect', // owner: @lharries
SURVEYS: 'surveys', // owner: @liyiy
GENERIC_SIGNUP_BENEFITS: 'generic-signup-benefits', // experiment, owner: @raquelmsmith
SURVEYS_POSITIONS: 'surveys-positions', // owner: @liyiy
WEB_ANALYTICS: 'web-analytics', // owner @robbie-c #team-web-analytics
Expand All @@ -161,11 +157,9 @@ export const FEATURE_FLAGS = {
PRODUCT_SPECIFIC_ONBOARDING: 'product-specific-onboarding', // owner: @raquelmsmith
REDIRECT_SIGNUPS_TO_INSTANCE: 'redirect-signups-to-instance', // owner: @raquelmsmith
APPS_AND_EXPORTS_UI: 'apps-and-exports-ui', // owner: @benjackwhite
SURVEY_NPS_RESULTS: 'survey-nps-results', // owner: @liyiy
SESSION_REPLAY_CORS_PROXY: 'session-replay-cors-proxy', // owner: #team-monitoring
HOGQL_INSIGHTS: 'hogql-insights', // owner: @mariusandra
WEBHOOKS_DENYLIST: 'webhooks-denylist', // owner: #team-pipeline
SURVEYS_SITE_APP_DEPRECATION: 'surveys-site-app-deprecation', // owner: @neilkakkar
SURVEYS_MULTIPLE_QUESTIONS: 'surveys-multiple-questions', // owner: @liyiy
SURVEYS_RESULTS_VISUALIZATIONS: 'surveys-results-visualizations', // owner: @jurajmajerik
CONSOLE_RECORDING_SEARCH: 'console-recording-search', // owner: #team-monitoring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { Meta } from '@storybook/react'
import { router } from 'kea-router'
import { urls } from 'scenes/urls'
import { App } from 'scenes/App'
import { mswDecorator, useFeatureFlags } from '~/mocks/browser'
import { mswDecorator } from '~/mocks/browser'
import { EarlyAccessFeatureType } from '~/types'
import { FEATURE_FLAGS } from 'lib/constants'

const EARLY_ACCESS_FEATURE_RESULT = [
{
Expand Down Expand Up @@ -139,23 +138,20 @@ const meta: Meta = {
}
export default meta
export function FeaturesList(): JSX.Element {
useFeatureFlags([FEATURE_FLAGS.EARLY_ACCESS_FEATURE])
useEffect(() => {
router.actions.push(urls.earlyAccessFeatures())
}, [])
return <App />
}

export function NewFeatureFlag(): JSX.Element {
useFeatureFlags([FEATURE_FLAGS.EARLY_ACCESS_FEATURE])
useEffect(() => {
router.actions.push(urls.earlyAccessFeature('new'))
}, [])
return <App />
}

export function NotFoundEarlyAccess(): JSX.Element {
useFeatureFlags([FEATURE_FLAGS.EARLY_ACCESS_FEATURE])
useEffect(() => {
router.actions.push(urls.earlyAccessFeature('not-found'))
}, [])
Expand Down
18 changes: 7 additions & 11 deletions frontend/src/scenes/feature-flags/FeatureFlag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -521,17 +521,13 @@ export function FeatureFlag({ id }: { id?: string } = {}): JSX.Element {
}}
type="secondary"
/>
{featureFlags[FEATURE_FLAGS.RECORDINGS_ON_FEATURE_FLAGS] && (
<>
<LemonButton
to={urls.replay(ReplayTabs.Recent, recordingFilterForFlag)}
type="secondary"
>
View Recordings
</LemonButton>
<LemonDivider vertical />
</>
)}
<LemonButton
to={urls.replay(ReplayTabs.Recent, recordingFilterForFlag)}
type="secondary"
>
View Recordings
</LemonButton>
<LemonDivider vertical />
<LemonButton
data-attr="delete-feature-flag"
status="danger"
Expand Down
53 changes: 23 additions & 30 deletions frontend/src/scenes/feature-flags/FeatureFlagReleaseConditions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useActions, useValues } from 'kea'
import { capitalizeFirstLetter, humanFriendlyNumber } from 'lib/utils'
import { PropertyFilters } from 'lib/components/PropertyFilters/PropertyFilters'
import { featureFlagLogic } from './featureFlagLogic'
import { featureFlagLogic as enabledFeaturesLogic } from 'lib/logic/featureFlagLogic'
import './FeatureFlag.scss'
import { IconCopy, IconDelete, IconPlus, IconSubArrowRight, IconErrorOutline } from 'lib/lemon-ui/icons'
import { LemonDivider } from 'lib/lemon-ui/LemonDivider'
Expand All @@ -15,7 +14,7 @@ import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { urls } from 'scenes/urls'
import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'
import { router } from 'kea-router'
import { FEATURE_FLAGS, INSTANTLY_AVAILABLE_PROPERTIES } from 'lib/constants'
import { INSTANTLY_AVAILABLE_PROPERTIES } from 'lib/constants'
import { LemonTag } from 'lib/lemon-ui/LemonTag/LemonTag'
import { allOperatorsToHumanName } from 'lib/components/DefinitionPopover/utils'
import { cohortsModel } from '~/models/cohortsModel'
Expand Down Expand Up @@ -54,7 +53,6 @@ export function FeatureFlagReleaseConditions({
addConditionSet,
} = useActions(featureFlagLogic)
const { cohortsById } = useValues(cohortsModel)
const { featureFlags } = useValues(enabledFeaturesLogic)

const filterGroups: FeatureFlagGroupType[] = isSuper
? featureFlag.filters.super_groups || []
Expand Down Expand Up @@ -256,33 +254,28 @@ export function FeatureFlagReleaseConditions({
/>{' '}
of <b>{aggregationTargetName}</b> in this set.{' '}
</div>
{featureFlags[FEATURE_FLAGS.FEATURE_FLAG_ROLLOUT_UX] && (
<div>
Will match approximately{' '}
{affectedUsers[index] !== undefined ? (
<b>
{`${
computeBlastRadiusPercentage(
group.rollout_percentage,
index
).toPrecision(2) * 1
// Multiplying by 1 removes trailing zeros after the decimal
// point added by toPrecision
}% `}
</b>
) : (
<Spinner className="mr-1" />
)}{' '}
{affectedUsers[index] && affectedUsers[index] >= 0 && totalUsers
? `(${humanFriendlyNumber(
Math.floor(
(affectedUsers[index] * (group.rollout_percentage ?? 100)) / 100
)
)} / ${humanFriendlyNumber(totalUsers)})`
: ''}{' '}
of total {aggregationTargetName}.
</div>
)}
<div>
Will match approximately{' '}
{affectedUsers[index] !== undefined ? (
<b>
{`${
computeBlastRadiusPercentage(group.rollout_percentage, index).toPrecision(
2
) * 1
// Multiplying by 1 removes trailing zeros after the decimal
// point added by toPrecision
}% `}
</b>
) : (
<Spinner className="mr-1" />
)}{' '}
{affectedUsers[index] && affectedUsers[index] >= 0 && totalUsers
? `(${humanFriendlyNumber(
Math.floor((affectedUsers[index] * (group.rollout_percentage ?? 100)) / 100)
)} / ${humanFriendlyNumber(totalUsers)})`
: ''}{' '}
of total {aggregationTargetName}.
</div>
</div>
)}
{nonEmptyVariants.length > 0 && (
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/scenes/project/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ import { ExtraTeamSettings } from './ExtraTeamSettings'
import { WeekStartConfig } from './WeekStartConfig'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { SurveySettings } from './Survey'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'

export const scene: SceneExport = {
component: ProjectSettings,
Expand Down Expand Up @@ -78,7 +76,6 @@ export function ProjectSettings(): JSX.Element {
const { location } = useValues(router)
const { user, hasAvailableFeature } = useValues(userLogic)
const hasAdvancedPaths = user?.organization?.available_features?.includes(AvailableFeature.PATHS_ADVANCED)
const { featureFlags } = useValues(featureFlagLogic)

useAnchor(location.hash)

Expand Down Expand Up @@ -249,7 +246,7 @@ export function ProjectSettings(): JSX.Element {
<SessionRecording />
<LemonDivider className="my-6" />
<GroupAnalytics />
{featureFlags[FEATURE_FLAGS.SURVEYS_SITE_APP_DEPRECATION] && <SurveySettings />}
<SurveySettings />
<ExtraTeamSettings />
<RestrictedArea Component={AccessControl} minimumAccessLevel={OrganizationMembershipLevel.Admin} />
<LemonDivider className="my-6" />
Expand Down
29 changes: 8 additions & 21 deletions frontend/src/scenes/surveys/SurveyView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton'
import { LemonTabs } from 'lib/lemon-ui/LemonTabs'
import { capitalizeFirstLetter, pluralize } from 'lib/utils'
import { useState, useEffect } from 'react'
import { pluginsLogic } from 'scenes/plugins/pluginsLogic'
import { Query } from '~/queries/Query/Query'
import { surveyLogic } from './surveyLogic'
import { surveysLogic } from './surveysLogic'
Expand All @@ -24,7 +23,6 @@ import {
SurveyType,
} from '~/types'
import { SurveyAPIEditor } from './SurveyAPIEditor'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { NodeKind } from '~/queries/schema'
import { dayjs } from 'lib/dayjs'
import { defaultSurveyAppearance, SURVEY_EVENT_NAME } from './constants'
Expand All @@ -33,11 +31,10 @@ import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { RatingQuestionBarChart, Summary } from './surveyViewViz'

export function SurveyView({ id }: { id: string }): JSX.Element {
const { survey, surveyLoading, surveyPlugin, showSurveyAppWarning } = useValues(surveyLogic)
const { survey, surveyLoading } = useValues(surveyLogic)
const { editingSurvey, updateSurvey, launchSurvey, stopSurvey, archiveSurvey, resumeSurvey } =
useActions(surveyLogic)
const { deleteSurvey } = useActions(surveysLogic)
const { editPlugin } = useActions(pluginsLogic)

const [tabKey, setTabKey] = useState(survey.start_date ? 'results' : 'overview')
useEffect(() => {
Expand Down Expand Up @@ -120,14 +117,6 @@ export function SurveyView({ id }: { id: string }): JSX.Element {
</>
}
/>
{!surveyLoading && showSurveyAppWarning && (
<LemonBanner type="error">
Surveys requires the{' '}
<a onClick={() => surveyPlugin?.id && editPlugin(surveyPlugin.id)}>survey app</a> to be
enabled. You also need to make sure you have the "opt_in_site_apps" setting in your PostHog
initialization code.
</LemonBanner>
)}
<LemonTabs
activeKey={tabKey}
onChange={(key) => setTabKey(key)}
Expand Down Expand Up @@ -322,15 +311,13 @@ export function SurveyResult({ disableEventsTable }: { disableEventsTable?: bool
!featureFlags[FEATURE_FLAGS.SURVEYS_RESULTS_VISUALIZATIONS] && (
<div className="mb-4">
<Query query={surveyRatingQuery} />
{featureFlags[FEATURE_FLAGS.SURVEY_NPS_RESULTS] &&
(survey.questions[currentQuestionIndexAndType.idx] as RatingSurveyQuestion).scale ===
10 && (
<>
<LemonDivider className="my-4" />
<h2>NPS Score</h2>
<SurveyNPSResults survey={survey as Survey} />
</>
)}
{(survey.questions[currentQuestionIndexAndType.idx] as RatingSurveyQuestion).scale === 10 && (
<>
<LemonDivider className="my-4" />
<h2>NPS Score</h2>
<SurveyNPSResults survey={survey as Survey} />
</>
)}
</div>
)}
{(currentQuestionIndexAndType.type === SurveyQuestionType.SingleChoice ||
Expand Down
7 changes: 1 addition & 6 deletions frontend/src/scenes/surveys/Surveys.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { FEATURE_FLAGS } from 'lib/constants'
import { useEffect } from 'react'
import { App } from 'scenes/App'
import { urls } from 'scenes/urls'
import { mswDecorator, useFeatureFlags } from '~/mocks/browser'
import { mswDecorator } from '~/mocks/browser'
import { toPaginatedResponse } from '~/mocks/handlers'
import { PropertyFilterType, PropertyOperator, Survey, SurveyQuestionType, SurveyType } from '~/types'
import { Meta } from '@storybook/react'
Expand Down Expand Up @@ -184,31 +183,27 @@ const meta: Meta = {
}
export default meta
export function SurveysList(): JSX.Element {
useFeatureFlags([FEATURE_FLAGS.SURVEYS])
useEffect(() => {
router.actions.push(urls.surveys())
}, [])
return <App />
}

export function NewSurvey(): JSX.Element {
useFeatureFlags([FEATURE_FLAGS.SURVEYS])
useEffect(() => {
router.actions.push(urls.survey('new'))
}, [])
return <App />
}

export function SurveyView(): JSX.Element {
useFeatureFlags([FEATURE_FLAGS.SURVEYS])
useEffect(() => {
router.actions.push(urls.survey(MOCK_SURVEY_WITH_RELEASE_CONS.id))
}, [])
return <App />
}

export function SurveyNotFound(): JSX.Element {
useFeatureFlags([FEATURE_FLAGS.SURVEYS])
useEffect(() => {
router.actions.push(urls.survey('1234566789'))
}, [])
Expand Down
Loading

0 comments on commit e15de55

Please sign in to comment.