Skip to content

Commit

Permalink
revert demo feature
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmarron committed Sep 14, 2021
1 parent 2b4267c commit 75ddde6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
16 changes: 1 addition & 15 deletions frontend/src/layout/navigation/DemoWarnings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ import { LinkButton } from 'lib/components/LinkButton'
import { Link } from 'lib/components/Link'
import { navigationLogic } from './navigationLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { FEATURE_FLAGS } from 'lib/constants'
import posthog from 'posthog-js'

interface WarningInterface {
message: JSX.Element | string
description: JSX.Element | string
action?: JSX.Element
type?: 'error' | 'success' | 'info' | 'warning'
type?: 'warning' | 'info'
}

interface WarningsInterface {
Expand All @@ -30,14 +27,6 @@ export function DemoWarnings(): JSX.Element | null {
const { user } = useValues(userLogic)
const { demoWarning } = useValues(navigationLogic)
const { reportDemoWarningDismissed } = useActions(eventUsageLogic)
const { featureFlags } = useValues(featureFlagLogic)

const warningColor: string =
typeof featureFlags[FEATURE_FLAGS.DEMO_BANNER_COLOR] === 'string'
? (featureFlags[FEATURE_FLAGS.DEMO_BANNER_COLOR] as string)
: 'yellow'
const warningType = ({ red: 'error', yellow: 'warning', blue: 'info', green: 'success' }[warningColor] ||
'warning') as WarningInterface['type']

const WARNINGS: WarningsInterface = {
welcome: {
Expand Down Expand Up @@ -68,12 +57,10 @@ export function DemoWarnings(): JSX.Element | null {
to="/setup"
data-attr="demo-warning-cta"
data-message="incomplete_setup_on_demo_project-setup"
onClick={() => posthog.capture('demo-warning-click')}
>
<SettingOutlined /> Go to setup
</LinkButton>
),
type: warningType,
},
incomplete_setup_on_real_project: {
message: `Finish setting up Posthog, ${user?.first_name}!`,
Expand All @@ -95,7 +82,6 @@ export function DemoWarnings(): JSX.Element | null {
demo_project: {
message: "You're viewing demo data.",
description: <span>This is a demo project with dummy data.</span>,
type: warningType,
},
real_project_with_no_events: {
message: 'This project has no events yet.',
Expand Down
1 change: 0 additions & 1 deletion frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ export const FEATURE_FLAGS = {
PLUGINS_UI_JOBS: '5720-plugins-ui-jobs',
DIVE_DASHBOARDS: 'hackathon-dive-dashboards',
TOOLBAR_FEATURE_FLAGS: 'posthog-toolbar-feature-flags',
DEMO_BANNER_COLOR: 'demo-banner-color',
}

export const ENVIRONMENT_LOCAL_STORAGE_KEY = '$environment'
Expand Down

0 comments on commit 75ddde6

Please sign in to comment.