Skip to content

Commit

Permalink
chore(experiments): delete migration banner (#26609)
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajmajerik authored Dec 3, 2024
1 parent e2ea038 commit 5830eec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 56 deletions.
1 change: 0 additions & 1 deletion frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ export const FEATURE_FLAGS = {
AI_SURVEY_RESPONSE_SUMMARY: 'ai-survey-response-summary', // owner: @pauldambra
CUSTOM_CHANNEL_TYPE_RULES: 'custom-channel-type-rules', // owner: @robbie-c #team-web-analytics
SELF_SERVE_CREDIT_OVERRIDE: 'self-serve-credit-override', // owner: @zach
EXPERIMENTS_MIGRATION_DISABLE_UI: 'experiments-migration-disable-ui', // owner: @jurajmajerik #team-experiments
CUSTOM_CSS_THEMES: 'custom-css-themes', // owner: @daibhin
EXPERIMENTS_MULTIPLE_METRICS: 'experiments-multiple-metrics', // owner: @jurajmajerik #team-experiments
WEB_ANALYTICS_WARN_CUSTOM_EVENT_NO_SESSION: 'web-analytics-warn-custom-event-no-session', // owner: @robbie-c #team-web-analytics
Expand Down
9 changes: 3 additions & 6 deletions frontend/src/scenes/experiments/ExperimentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LemonDivider, LemonInput, LemonTextArea, Tooltip } from '@posthog/lemon
import { useActions, useValues } from 'kea'
import { Form, Group } from 'kea-forms'
import { ExperimentVariantNumber } from 'lib/components/SeriesGlyph'
import { FEATURE_FLAGS, MAX_EXPERIMENT_VARIANTS } from 'lib/constants'
import { MAX_EXPERIMENT_VARIANTS } from 'lib/constants'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonRadio } from 'lib/lemon-ui/LemonRadio'
Expand All @@ -14,17 +14,14 @@ import { capitalizeFirstLetter } from 'lib/utils'
import { experimentsLogic } from 'scenes/experiments/experimentsLogic'

import { experimentLogic } from './experimentLogic'
import { ExperimentsDisabledBanner } from './Experiments'

const ExperimentFormFields = (): JSX.Element => {
const { experiment, featureFlags, groupTypes, aggregationLabel, dynamicFeatureFlagKey } = useValues(experimentLogic)
const { experiment, groupTypes, aggregationLabel, dynamicFeatureFlagKey } = useValues(experimentLogic)
const { addExperimentGroup, removeExperimentGroup, setExperiment, createExperiment, setExperimentType } =
useActions(experimentLogic)
const { webExperimentsAvailable } = useValues(experimentsLogic)

return featureFlags[FEATURE_FLAGS.EXPERIMENTS_MIGRATION_DISABLE_UI] ? (
<ExperimentsDisabledBanner />
) : (
return (
<div>
<div className="space-y-8">
<div className="space-y-6 max-w-120">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import '../Experiment.scss'

import { LemonDivider, LemonTabs } from '@posthog/lemon-ui'
import { useActions, useValues } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
import { PostHogFeature } from 'posthog-js/react'
import { WebExperimentImplementationDetails } from 'scenes/experiments/WebExperimentImplementationDetails'

import { ExperimentImplementationDetails } from '../ExperimentImplementationDetails'
import { experimentLogic } from '../experimentLogic'
import { ExperimentsDisabledBanner } from '../Experiments'
import {
ExperimentLoadingAnimation,
LoadingState,
Expand Down Expand Up @@ -69,16 +67,14 @@ const VariantsTab = (): JSX.Element => {
}

export function ExperimentView(): JSX.Element {
const { experimentLoading, experimentResultsLoading, experimentId, experimentResults, tabKey, featureFlags } =
const { experimentLoading, experimentResultsLoading, experimentId, experimentResults, tabKey } =
useValues(experimentLogic)

const { setTabKey } = useActions(experimentLogic)

const hasResultsInsight = experimentResults && experimentResults.insight

return featureFlags[FEATURE_FLAGS.EXPERIMENTS_MIGRATION_DISABLE_UI] ? (
<ExperimentsDisabledBanner />
) : (
return (
<>
<PageHeaderCustom />
<div className="space-y-8 experiment-view">
Expand Down
47 changes: 4 additions & 43 deletions frontend/src/scenes/experiments/Experiments.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { LemonDialog, LemonInput, LemonSelect } from '@posthog/lemon-ui'
import { useActions, useValues } from 'kea'
import { router } from 'kea-router'
import { DetectiveHog, ExperimentsHog } from 'lib/components/hedgehogs'
import { ExperimentsHog } from 'lib/components/hedgehogs'
import { MemberSelect } from 'lib/components/MemberSelect'
import { PageHeader } from 'lib/components/PageHeader'
import { ProductIntroduction } from 'lib/components/ProductIntroduction/ProductIntroduction'
import { FEATURE_FLAGS } from 'lib/constants'
import { dayjs } from 'lib/dayjs'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { More } from 'lib/lemon-ui/LemonButton/More'
Expand All @@ -16,7 +15,6 @@ import { LemonTableLink } from 'lib/lemon-ui/LemonTable/LemonTableLink'
import { LemonTabs } from 'lib/lemon-ui/LemonTabs'
import { Link } from 'lib/lemon-ui/Link'
import stringWithWBR from 'lib/utils/stringWithWBR'
import posthog from 'posthog-js'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'

Expand All @@ -31,44 +29,9 @@ export const scene: SceneExport = {
logic: experimentsLogic,
}

export const ExperimentsDisabledBanner = (): JSX.Element => {
const payload = posthog.getFeatureFlagPayload(FEATURE_FLAGS.EXPERIMENTS_MIGRATION_DISABLE_UI)

return (
<div className="border-2 border-dashed border-border w-full p-8 justify-center rounded mt-2 mb-4">
<div className="flex items-center gap-8 w-full justify-center flex-wrap">
<div>
<div className="w-50 mx-auto mb-4">
<DetectiveHog className="w-full h-full" />
</div>
</div>
<div className="flex-shrink max-w-140">
<h2>We'll be right back!</h2>
<p>
We’re upgrading experiments to a new schema to make them faster, more reliable, and ready for
future improvements.
</p>
<p>
We expect to be done by <span className="font-semibold">{payload}</span>. Thanks for your
patience!
</p>
</div>
</div>
</div>
)
}

export function Experiments(): JSX.Element {
const {
filteredExperiments,
experimentsLoading,
tab,
searchTerm,
shouldShowEmptyState,
searchStatus,
userFilter,
featureFlags,
} = useValues(experimentsLogic)
const { filteredExperiments, experimentsLoading, tab, searchTerm, shouldShowEmptyState, searchStatus, userFilter } =
useValues(experimentsLogic)
const { setExperimentsTab, deleteExperiment, archiveExperiment, setSearchStatus, setSearchTerm, setUserFilter } =
useActions(experimentsLogic)

Expand Down Expand Up @@ -217,9 +180,7 @@ export function Experiments(): JSX.Element {
},
]

return featureFlags[FEATURE_FLAGS.EXPERIMENTS_MIGRATION_DISABLE_UI] ? (
<ExperimentsDisabledBanner />
) : (
return (
<div>
<PageHeader
buttons={
Expand Down

0 comments on commit 5830eec

Please sign in to comment.