From 4718111cf53627c01be76678c9a3d4263f11288d Mon Sep 17 00:00:00 2001 From: Rohan Agarwal Date: Fri, 30 May 2025 12:03:30 -0700 Subject: [PATCH] Seer beta banner copy changes --- static/app/types/hooks.tsx | 1 + .../streamline/sidebar/seerNotices.tsx | 49 ++-------- .../components/ai/SeerBetaClosingAlert.tsx | 90 +++++++++++++++++++ static/gsApp/registerHooks.tsx | 2 + 4 files changed, 99 insertions(+), 43 deletions(-) create mode 100644 static/gsApp/components/ai/SeerBetaClosingAlert.tsx diff --git a/static/app/types/hooks.tsx b/static/app/types/hooks.tsx index 222149dd5cccb5..71055c0bf7afa9 100644 --- a/static/app/types/hooks.tsx +++ b/static/app/types/hooks.tsx @@ -193,6 +193,7 @@ type ComponentHooks = { 'component:replay-onboarding-alert': () => React.ComponentType; 'component:replay-onboarding-cta': () => React.ComponentType; 'component:replay-settings-alert': () => React.ComponentType | null; + 'component:seer-beta-closing-alert': () => React.ComponentType; 'component:superuser-access-category': React.ComponentType; 'component:superuser-warning': React.ComponentType; 'component:superuser-warning-excluded': SuperuserWarningExcluded; diff --git a/static/app/views/issueDetails/streamline/sidebar/seerNotices.tsx b/static/app/views/issueDetails/streamline/sidebar/seerNotices.tsx index d93de1ad432d39..8dc0c7d29ae7c4 100644 --- a/static/app/views/issueDetails/streamline/sidebar/seerNotices.tsx +++ b/static/app/views/issueDetails/streamline/sidebar/seerNotices.tsx @@ -18,13 +18,13 @@ import {LinkButton} from 'sentry/components/core/button/linkButton'; import {useProjectSeerPreferences} from 'sentry/components/events/autofix/preferences/hooks/useProjectSeerPreferences'; import {useAutofixRepos} from 'sentry/components/events/autofix/useAutofix'; import {GuidedSteps} from 'sentry/components/guidedSteps/guidedSteps'; +import HookOrDefault from 'sentry/components/hookOrDefault'; import ExternalLink from 'sentry/components/links/externalLink'; -import {IconChevron, IconClose} from 'sentry/icons'; +import {IconChevron} from 'sentry/icons'; import {t, tct} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Project} from 'sentry/types/project'; import {FieldKey} from 'sentry/utils/fields'; -import useDismissAlert from 'sentry/utils/useDismissAlert'; import {useLocalStorageState} from 'sentry/utils/useLocalStorageState'; import useOrganization from 'sentry/utils/useOrganization'; import {useCreateGroupSearchView} from 'sentry/views/issueList/mutations/useCreateGroupSearchView'; @@ -37,41 +37,10 @@ interface SeerNoticesProps { hasGithubIntegration?: boolean; } -// Temporary Seer beta closing alert -function SeerBetaClosingAlert() { - const {isDismissed, dismiss} = useDismissAlert({ - key: 'seer-beta-closing-alert-dismissed', - }); - if (isDismissed) return null; - return ( - } - onClick={dismiss} - size="zero" - borderless - /> - } - > - - - Seer beta is ending soon - - - Thanks for trying Seer. FYI: Starting June 10th, Seer will require a $20/month - subscription to continue scanning and fixing issues. - - - Learn more - - - - ); -} +const SeerBetaClosingAlert = HookOrDefault({ + hookName: 'component:seer-beta-closing-alert', + defaultComponent: () =>
, +}); export function SeerNotices({groupId, hasGithubIntegration, project}: SeerNoticesProps) { const organization = useOrganization(); @@ -394,12 +363,6 @@ const StyledAlert = styled(Alert)` margin-bottom: ${space(2)}; `; -const AlertBody = styled('div')` - display: flex; - flex-direction: column; - gap: ${space(0.5)}; -`; - const NoticesContainer = styled('div')` display: flex; flex-direction: column; diff --git a/static/gsApp/components/ai/SeerBetaClosingAlert.tsx b/static/gsApp/components/ai/SeerBetaClosingAlert.tsx new file mode 100644 index 00000000000000..f7c151e17df201 --- /dev/null +++ b/static/gsApp/components/ai/SeerBetaClosingAlert.tsx @@ -0,0 +1,90 @@ +import styled from '@emotion/styled'; + +import {Alert} from 'sentry/components/core/alert'; +import {Button} from 'sentry/components/core/button'; +import ExternalLink from 'sentry/components/links/externalLink'; +import {IconClose} from 'sentry/icons'; +import {space} from 'sentry/styles/space'; +import useDismissAlert from 'sentry/utils/useDismissAlert'; + +import useSubscription from 'getsentry/hooks/useSubscription'; +import {BillingType} from 'getsentry/types'; + +// Temporary Seer beta closing alert +function SeerBetaClosingAlert() { + const {isDismissed, dismiss} = useDismissAlert({ + key: 'seer-beta-closing-alert-dismissed', + }); + const subscription = useSubscription(); + const isTouchCustomer = subscription?.type === BillingType.INVOICED; + + if (isDismissed) return null; + if (isTouchCustomer) { + return ( + } + onClick={dismiss} + size="zero" + borderless + /> + } + > + + + Seer beta is ending soon + + + Thanks for trying Seer. Starting June 10, Seer will require a committed budget + to continue scanning and fixing issues. Reach out to your account manager to + learn more. + + + + ); + } + return ( + } + onClick={dismiss} + size="zero" + borderless + /> + } + > + + + Seer beta is ending soon + + + Thanks for trying Seer. Starting June 10, Seer will require a $20/month + subscription to continue scanning and fixing issues. + + + Learn more + + + + ); +} + +export default SeerBetaClosingAlert; + +const AlertBody = styled('div')` + display: flex; + flex-direction: column; + gap: ${space(0.5)}; +`; + +const StyledAlert = styled(Alert)` + margin-bottom: ${space(2)}; +`; diff --git a/static/gsApp/registerHooks.tsx b/static/gsApp/registerHooks.tsx index 0736281f784ec2..2fcaa05d16533d 100644 --- a/static/gsApp/registerHooks.tsx +++ b/static/gsApp/registerHooks.tsx @@ -6,6 +6,7 @@ import HookStore from 'sentry/stores/hookStore'; import type {Hooks} from 'sentry/types/hooks'; import AiSetupDataConsent from 'getsentry/components/ai/AiSetupDataConsent'; +import SeerBetaClosingAlert from 'getsentry/components/ai/SeerBetaClosingAlert'; import CronsBillingBanner from 'getsentry/components/crons/cronsBillingBanner'; import DashboardBanner from 'getsentry/components/dashboardBanner'; import DataConsentBanner from 'getsentry/components/dataConsentBanner'; @@ -204,6 +205,7 @@ const GETSENTRY_HOOKS: Partial = { 'component:insights-date-range-query-limit-footer': () => InsightsDateRangeQueryLimitFooter, 'component:ai-setup-data-consent': () => AiSetupDataConsent, + 'component:seer-beta-closing-alert': () => SeerBetaClosingAlert, 'component:codecov-integration-settings-link': () => CodecovSettingsLink, 'component:continuous-profiling-beta-banner': () => ContinuousProfilingBetaAlertBanner, 'component:continuous-profiling-beta-sdk-banner': () =>