Browse Source

feat(codecov): Add codecov cta hook (#45508)

also adds a dismissed analytic
Scott Cooper 2 years ago
parent
commit
a16663f624

+ 4 - 0
static/app/components/events/traceEventDataSection.tsx

@@ -10,6 +10,7 @@ import styled from '@emotion/styled';
 import {Button} from 'sentry/components/button';
 import ButtonBar from 'sentry/components/buttonBar';
 import {CompactSelect} from 'sentry/components/compactSelect';
+import HookOrDefault from 'sentry/components/hookOrDefault';
 import {SegmentedControl} from 'sentry/components/segmentedControl';
 import {Tooltip} from 'sentry/components/tooltip';
 import {IconEllipsis, IconLink, IconSort} from 'sentry/icons';
@@ -38,6 +39,8 @@ export const displayOptions = {
   'verbose-function-names': t('Verbose function names'),
 };
 
+const HookCodecovCTA = HookOrDefault({hookName: 'component:codecov-integration-cta'});
+
 type State = {
   display: Array<keyof typeof displayOptions>;
   fullStackTrace: boolean;
@@ -464,6 +467,7 @@ export function TraceEventDataSection({
       wrapTitle={wrapTitle}
     >
       <TraceEventDataSectionContext.Provider value={childProps}>
+        <HookCodecovCTA />
         {children(childProps)}
       </TraceEventDataSectionContext.Provider>
     </EventDataSection>

+ 1 - 0
static/app/types/hooks.tsx

@@ -97,6 +97,7 @@ type GuideUpdateCallback = (nextGuide: Guide | null, opts: {dismissed?: boolean}
  * Component wrapping hooks
  */
 export type ComponentHooks = {
+  'component:codecov-integration-cta': () => React.ReactNode;
   'component:dashboards-header': () => React.ComponentType<DashboardHeadersProps>;
   'component:disabled-app-store-connect-multiple': () => React.ComponentType<DisabledAppStoreConnectMultiple>;
   'component:disabled-custom-symbol-sources': () => React.ComponentType<DisabledCustomSymbolSources>;

+ 3 - 0
static/app/utils/analytics/integrations/stacktraceLinkAnalyticsEvents.ts

@@ -14,6 +14,7 @@ export enum StacktraceLinkEvents {
   SUBMIT = 'integrations.stacktrace_submit_config',
   CODECOV_LINK_CLICKED = 'integrations.stacktrace_codecov_link_clicked',
   CODECOV_PROMPT_CLICKED = 'integrations.stacktrace_codecov_prompt_clicked',
+  CODECOV_PROMPT_DISMISSED = 'integrations.stacktrace_codecov_prompt_dismissed',
 }
 
 // This type allows analytics functions to use the string literal or enum.KEY
@@ -44,4 +45,6 @@ export const stacktraceLinkEventMap: Record<StacktraceLinkEventsLiterals, string
     'Integrations: Stacktrace Codecov Link Clicked',
   [StacktraceLinkEvents.CODECOV_PROMPT_CLICKED]:
     'Integrations: Stacktrace Codecov Prompt Clicked',
+  [StacktraceLinkEvents.CODECOV_PROMPT_DISMISSED]:
+    'Integrations: Stacktrace Codecov Prompt Dismissed',
 };