123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643 |
- import type {Route, RouteComponentProps, RouteContextInterface} from 'react-router';
- import type {ChildrenRenderFn} from 'sentry/components/acl/feature';
- import type {Guide} from 'sentry/components/assistant/types';
- import type {ButtonProps} from 'sentry/components/button';
- import type {ProductSelectionProps} from 'sentry/components/onboarding/productSelection';
- import type SidebarItem from 'sentry/components/sidebar/sidebarItem';
- import type DateRange from 'sentry/components/timeRangeSelector/dateRange';
- import type SelectorItems from 'sentry/components/timeRangeSelector/selectorItems';
- import type {SVGIconProps} from 'sentry/icons/svgIcon';
- import type {Group} from 'sentry/types';
- import type {UseExperiment} from 'sentry/utils/useExperiment';
- import type {StatusToggleButtonProps} from 'sentry/views/monitors/components/statusToggleButton';
- import type {OrganizationStatsProps} from 'sentry/views/organizationStats/index';
- import type {RouteAnalyticsContext} from 'sentry/views/routeAnalyticsContextProvider';
- import type {NavigationItem, NavigationSection} from 'sentry/views/settings/types';
- import type {ExperimentKey} from './experiments';
- import type {Integration, IntegrationProvider} from './integrations';
- import type {Member, Organization} from './organization';
- import type {Project} from './project';
- import type {User} from './user';
- export interface Hooks
- extends RouteHooks,
- ComponentHooks,
- CustomizationHooks,
- AnalyticsHooks,
- FeatureDisabledHooks,
- InterfaceChromeHooks,
- OnboardingHooks,
- SettingsHooks,
- FeatureSpecificHooks,
- ReactHooks,
- CallbackHooks {
- _: any;
- }
- export type HookName = keyof Hooks;
- export type RouteHooks = {
- 'routes:api': RoutesHook;
- 'routes:organization': RoutesHook;
- 'routes:root': RoutesHook;
- };
- type DateRangeProps = React.ComponentProps<typeof DateRange>;
- type SelectorItemsProps = React.ComponentProps<typeof SelectorItems>;
- type DisabledMemberViewProps = RouteComponentProps<{orgId: string}, {}>;
- type MemberListHeaderProps = {
- members: Member[];
- organization: Organization;
- };
- type DisabledAppStoreConnectMultiple = {
- children: React.ReactNode;
- organization: Organization;
- };
- type DisabledCustomSymbolSources = {
- children: React.ReactNode;
- organization: Organization;
- };
- type DisabledMemberTooltipProps = {children: React.ReactNode};
- type DashboardHeadersProps = {organization: Organization};
- type ReplayFeedbackButton = {children: React.ReactNode};
- type ReplayListPageHeaderProps = {children?: React.ReactNode};
- type ReplayOnboardingAlertProps = {children: React.ReactNode};
- type ReplayOnboardingCTAProps = {children: React.ReactNode; organization: Organization};
- type ProductUnavailableCTAProps = {organization: Organization};
- type ProfilingBetaAlertBannerProps = {
- organization: Organization;
- };
- type ProfilingUpgradePlanButtonProps = ButtonProps & {
- children: React.ReactNode;
- fallback: React.ReactNode;
- organization: Organization;
- };
- type ProfilingAM1OrMMXUpgradeProps = {
- fallback: React.ReactNode;
- organization: Organization;
- };
- type CronsBillingBannerProps = {
- organization: Organization;
- };
- type OrganizationHeaderProps = {
- organization: Organization;
- };
- type ProductSelectionAvailabilityProps = Pick<
- ProductSelectionProps,
- 'lazyLoader' | 'skipLazyLoader' | 'platform' | 'withBottomMargin'
- > & {
- organization: Organization;
- };
- type FirstPartyIntegrationAlertProps = {
- integrations: Integration[];
- hideCTA?: boolean;
- wrapWithContainer?: boolean;
- };
- type FirstPartyIntegrationAdditionalCTAProps = {
- integrations: Integration[];
- };
- type AttemptCloseAttemptProps = {
- handleRemoveAccount: () => void;
- organizationSlugs: string[];
- };
- type CodecovLinkProps = {
- organization: Organization;
- };
- type QualitativeIssueFeedbackProps = {
- group: Group;
- organization: Organization;
- };
- type GuideUpdateCallback = (nextGuide: Guide | null, opts: {dismissed?: boolean}) => void;
- type MonitorCreatedCallback = (organization: Organization) => void;
- type SentryLogoProps = SVGIconProps & {
- pride?: boolean;
- };
- export type ComponentHooks = {
- 'component:codecov-integration-settings-link': () => React.ComponentType<CodecovLinkProps>;
- 'component:codecov-integration-stacktrace-link': () => React.ComponentType<CodecovLinkProps>;
- 'component:confirm-account-close': () => React.ComponentType<AttemptCloseAttemptProps>;
- 'component:crons-list-page-header': () => React.ComponentType<CronsBillingBannerProps>;
- 'component:dashboards-header': () => React.ComponentType<DashboardHeadersProps>;
- 'component:disabled-app-store-connect-multiple': () => React.ComponentType<DisabledAppStoreConnectMultiple>;
- 'component:disabled-custom-symbol-sources': () => React.ComponentType<DisabledCustomSymbolSources>;
- 'component:disabled-member': () => React.ComponentType<DisabledMemberViewProps>;
- 'component:disabled-member-tooltip': () => React.ComponentType<DisabledMemberTooltipProps>;
- 'component:enhanced-org-stats': () => React.ComponentType<OrganizationStatsProps>;
- 'component:escalating-issues-banner-feedback': () => React.ComponentType<QualitativeIssueFeedbackProps>;
- 'component:first-party-integration-additional-cta': () => React.ComponentType<FirstPartyIntegrationAdditionalCTAProps>;
- 'component:first-party-integration-alert': () => React.ComponentType<FirstPartyIntegrationAlertProps>;
- 'component:header-date-range': () => React.ComponentType<DateRangeProps>;
- 'component:header-selector-items': () => React.ComponentType<SelectorItemsProps>;
- 'component:issue-priority-feedback': () => React.ComponentType<QualitativeIssueFeedbackProps>;
- 'component:member-list-header': () => React.ComponentType<MemberListHeaderProps>;
- 'component:monitor-status-toggle': () => React.ComponentType<StatusToggleButtonProps>;
- 'component:org-stats-banner': () => React.ComponentType<DashboardHeadersProps>;
- 'component:organization-header': () => React.ComponentType<OrganizationHeaderProps>;
- 'component:product-selection-availability': () => React.ComponentType<ProductSelectionAvailabilityProps>;
- 'component:product-unavailable-cta': () => React.ComponentType<ProductUnavailableCTAProps>;
- 'component:profiling-am1-or-mmx-upgrade': () => React.ComponentType<ProfilingAM1OrMMXUpgradeProps>;
- 'component:profiling-billing-banner': () => React.ComponentType<ProfilingBetaAlertBannerProps>;
- 'component:profiling-upgrade-plan-button': () => React.ComponentType<ProfilingUpgradePlanButtonProps>;
- 'component:replay-feedback-button': () => React.ComponentType<ReplayFeedbackButton>;
- 'component:replay-list-page-header': () => React.ComponentType<ReplayListPageHeaderProps> | null;
- 'component:replay-onboarding-alert': () => React.ComponentType<ReplayOnboardingAlertProps>;
- 'component:replay-onboarding-cta': () => React.ComponentType<ReplayOnboardingCTAProps>;
- 'component:replay-onboarding-cta-button': () => React.ComponentType<{}> | null;
- 'component:sentry-logo': () => React.ComponentType<SentryLogoProps>;
- 'component:superuser-access-category': React.ComponentType<any>;
- 'component:superuser-warning': React.ComponentType<any>;
- };
- export type CustomizationHooks = {
- 'integrations:feature-gates': IntegrationsFeatureGatesHook;
- 'member-invite-button:customization': InviteButtonCustomizationHook;
- 'member-invite-modal:customization': InviteModalCustomizationHook;
- };
- export type AnalyticsHooks = {
- 'analytics:init-user': AnalyticsInitUser;
- 'analytics:log-experiment': AnalyticsLogExperiment;
- 'analytics:raw-track-event': AnalyticsRawTrackEvent;
- 'metrics:event': MetricsEvent;
- };
- export type FeatureDisabledHooks = {
- 'feature-disabled:alert-wizard-performance': FeatureDisabledHook;
- 'feature-disabled:alerts-page': FeatureDisabledHook;
- 'feature-disabled:codecov-integration-setting': FeatureDisabledHook;
- 'feature-disabled:custom-inbound-filters': FeatureDisabledHook;
- 'feature-disabled:dashboards-edit': FeatureDisabledHook;
- 'feature-disabled:dashboards-page': FeatureDisabledHook;
- 'feature-disabled:dashboards-sidebar-item': FeatureDisabledHook;
- 'feature-disabled:data-forwarding': FeatureDisabledHook;
- 'feature-disabled:discard-groups': FeatureDisabledHook;
- 'feature-disabled:discover-page': FeatureDisabledHook;
- 'feature-disabled:discover-saved-query-create': FeatureDisabledHook;
- 'feature-disabled:discover-sidebar-item': FeatureDisabledHook;
- 'feature-disabled:discover2-page': FeatureDisabledHook;
- 'feature-disabled:discover2-sidebar-item': FeatureDisabledHook;
- 'feature-disabled:events-page': FeatureDisabledHook;
- 'feature-disabled:events-sidebar-item': FeatureDisabledHook;
- 'feature-disabled:grid-editable-actions': FeatureDisabledHook;
- 'feature-disabled:incidents-sidebar-item': FeatureDisabledHook;
- 'feature-disabled:open-discover': FeatureDisabledHook;
- 'feature-disabled:open-in-discover': FeatureDisabledHook;
- 'feature-disabled:performance-new-project': FeatureDisabledHook;
- 'feature-disabled:performance-page': FeatureDisabledHook;
- 'feature-disabled:performance-quick-trace': FeatureDisabledHook;
- 'feature-disabled:performance-sidebar-item': FeatureDisabledHook;
- 'feature-disabled:profiling-page': FeatureDisabledHook;
- 'feature-disabled:profiling-sidebar-item': FeatureDisabledHook;
- 'feature-disabled:project-performance-score-card': FeatureDisabledHook;
- 'feature-disabled:project-selector-all-projects': FeatureDisabledHook;
- 'feature-disabled:project-selector-checkbox': FeatureDisabledHook;
- 'feature-disabled:rate-limits': FeatureDisabledHook;
- 'feature-disabled:relay': FeatureDisabledHook;
- 'feature-disabled:replay-sidebar-item': FeatureDisabledHook;
- 'feature-disabled:sso-basic': FeatureDisabledHook;
- 'feature-disabled:sso-saml2': FeatureDisabledHook;
- 'feature-disabled:starfish-view': FeatureDisabledHook;
- 'feature-disabled:trace-view-link': FeatureDisabledHook;
- };
- export type InterfaceChromeHooks = {
- footer: GenericComponentHook;
- 'help-modal:footer': HelpModalFooterHook;
- 'sidebar:bottom-items': SidebarBottomItemsHook;
- 'sidebar:help-menu': GenericOrganizationComponentHook;
- 'sidebar:item-label': SidebarItemLabelHook;
- 'sidebar:organization-dropdown-menu': GenericOrganizationComponentHook;
- 'sidebar:organization-dropdown-menu-bottom': GenericOrganizationComponentHook;
- };
- export type OnboardingHooks = {
- 'onboarding-wizard:skip-help': GenericOrganizationComponentHook;
- 'onboarding:block-hide-sidebar': () => boolean;
- 'onboarding:extra-chrome': GenericComponentHook;
- 'onboarding:targeted-onboarding-header': (opts: {source: string}) => React.ReactNode;
- };
- export type SettingsHooks = {
- 'settings:api-navigation-config': SettingsItemsHook;
- 'settings:organization-navigation': OrganizationSettingsHook;
- 'settings:organization-navigation-config': SettingsConfigHook;
- };
- export interface FeatureSpecificHooks extends SpendVisibilityHooks {}
- export type SpendVisibilityHooks = {
- 'spend-visibility:spike-protection-project-settings': GenericProjectComponentHook;
- };
- export type ReactHooks = {
- 'react-hook:route-activated': (
- props: RouteContextInterface
- ) => React.ContextType<typeof RouteAnalyticsContext>;
- 'react-hook:use-button-tracking': (props: ButtonProps) => () => void;
- 'react-hook:use-experiment': UseExperiment;
- };
- type CallbackHooks = {
- 'callback:on-guide-update': GuideUpdateCallback;
- 'callback:on-monitor-created': MonitorCreatedCallback;
- };
- type GenericComponentHook = () => React.ReactNode;
- type RoutesHook = () => Route[];
- type GenericOrganizationComponentHook = (opts: {
- organization: Organization;
- }) => React.ReactNode;
- type GenericProjectComponentHook = (opts: {project: Project}) => React.ReactNode;
- type FeatureDisabledHook = (opts: {
-
- children: React.ReactNode | ChildrenRenderFn;
-
- features: string[];
-
- hasFeature: boolean;
-
- organization: Organization;
-
- project?: Project;
- }) => React.ReactNode;
- type AnalyticsInitUser = (user: User) => void;
- type AnalyticsRawTrackEvent = (
- data: {
-
- [key: string]: any;
-
- eventKey: string;
-
- eventName: string | null;
-
- organization: Organization | string | null;
- },
- options?: {
-
- mapValuesFn?: (params: Record<string, any>) => Record<string, any>;
-
- startSession?: boolean;
-
- time?: number;
- }
- ) => void;
- type AnalyticsLogExperiment = (opts: {
-
- key: ExperimentKey;
-
- organization?: Organization;
- }) => void;
- type MetricsEvent = (
-
- name: string,
-
- value: number,
-
- tags?: object
- ) => void;
- type OrganizationSettingsHook = (organization: Organization) => React.ReactElement;
- type SettingsConfigHook = (organization: Organization) => NavigationSection;
- type SettingsItemsHook = (organization?: Organization) => NavigationItem[];
- type SidebarItemLabelHook = () => React.ComponentType<{
-
- children: React.ReactNode;
-
- id?: string;
- }>;
- type SidebarProps = Pick<
- React.ComponentProps<typeof SidebarItem>,
- 'orientation' | 'collapsed' | 'hasPanel'
- >;
- type SidebarBottomItemsHook = (
- opts: SidebarProps & {organization: Organization}
- ) => React.ReactNode;
- type HelpModalFooterHook = (opts: {
- closeModal: () => void;
- organization: Organization;
- }) => React.ReactNode;
- type DecoratedIntegrationFeature = {
-
- description: React.ReactNode;
- featureGate: string;
- };
- type IntegrationFeatureGroup = {
-
- features: DecoratedIntegrationFeature[];
-
- hasFeatures: boolean;
- };
- type FeatureGateSharedProps = {
-
- features: DecoratedIntegrationFeature[];
-
- organization: Organization;
- };
- type IntegrationFeaturesProps = FeatureGateSharedProps & {
-
- children: (opts: {
-
- disabled: boolean;
-
- disabledReason: React.ReactNode;
-
- gatedFeatureGroups: IntegrationFeatureGroup[];
-
- ungatedFeatures: DecoratedIntegrationFeature[];
- }) => React.ReactElement;
- };
- type IntegrationFeatureListProps = FeatureGateSharedProps & {
- provider: Pick<IntegrationProvider, 'key'>;
- };
- type IntegrationsFeatureGatesHook = () => {
-
- FeatureList: React.ComponentType<IntegrationFeatureListProps>;
-
- IntegrationFeatures: React.ComponentType<IntegrationFeaturesProps>;
- };
- type InviteButtonCustomizationHook = () => React.ComponentType<{
- children: (opts: {
-
- disabled: boolean;
- onTriggerModal: () => void;
- }) => React.ReactElement;
- onTriggerModal: () => void;
- organization: Organization;
- }>;
- type InviteModalCustomizationHook = () => React.ComponentType<{
- children: (opts: {
-
- canSend: boolean;
-
- sendInvites: () => void;
-
- headerInfo?: React.ReactNode;
- }) => React.ReactElement;
-
- onSendInvites: () => void;
-
- organization: Organization;
-
- willInvite: boolean;
- }>;
|