Просмотр исходного кода

feat(data-consent): Add in hooks for data consent banner (#67789)

this pr adds in the hooks that will be used to show the data consent
banner on issues, alerts, and grouping.

closes https://github.com/getsentry/getsentry/issues/13265
Richard Roggenkemper 11 месяцев назад
Родитель
Сommit
1d49c5829a

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

@@ -184,6 +184,7 @@ export type ComponentHooks = {
   'component:confirm-account-close': () => React.ComponentType<AttemptCloseAttemptProps>;
   'component:crons-list-page-header': () => React.ComponentType<CronsBillingBannerProps>;
   'component:dashboards-header': () => React.ComponentType<DashboardHeadersProps>;
+  'component:data-consent-banner': () => React.ComponentType<{source: string}> | null;
   'component:ddm-metrics-samples-list': () => React.ComponentType<DDMMetricsSamplesListProps>;
   'component:disabled-app-store-connect-multiple': () => React.ComponentType<DisabledAppStoreConnectMultiple>;
   'component:disabled-custom-symbol-sources': () => React.ComponentType<DisabledCustomSymbolSources>;

+ 7 - 0
static/app/views/alerts/list/rules/alertRulesList.tsx

@@ -7,6 +7,7 @@ import {
   addMessage,
   addSuccessMessage,
 } from 'sentry/actionCreators/indicator';
+import HookOrDefault from 'sentry/components/hookOrDefault';
 import * as Layout from 'sentry/components/layouts/thirds';
 import Link from 'sentry/components/links/link';
 import LoadingError from 'sentry/components/loadingError';
@@ -55,6 +56,11 @@ function getAlertListQueryKey(orgSlug: string, query: Location['query']): ApiQue
   return [`/organizations/${orgSlug}/combined-rules/`, {query: queryParams}];
 }
 
+const DataConsentBanner = HookOrDefault({
+  hookName: 'component:data-consent-banner',
+  defaultComponent: null,
+});
+
 function AlertRulesList() {
   const location = useLocation();
   const router = useRouter();
@@ -174,6 +180,7 @@ function AlertRulesList() {
         <AlertHeader router={router} activeTab="rules" />
         <Layout.Body>
           <Layout.Main fullWidth>
+            <DataConsentBanner source="alerts" />
             <FilterBar
               location={location}
               onChangeFilter={handleChangeFilter}

+ 6 - 0
static/app/views/issueDetails/groupSimilarIssues/similarStackTrace/index.tsx

@@ -6,6 +6,7 @@ import * as qs from 'query-string';
 
 import Alert from 'sentry/components/alert';
 import EmptyStateWarning from 'sentry/components/emptyStateWarning';
+import HookOrDefault from 'sentry/components/hookOrDefault';
 import * as Layout from 'sentry/components/layouts/thirds';
 import LoadingError from 'sentry/components/loadingError';
 import LoadingIndicator from 'sentry/components/loadingIndicator';
@@ -36,6 +37,10 @@ type ItemState = {
   similar: SimilarItem[];
 };
 
+const DataConsentBanner = HookOrDefault({
+  hookName: 'component:data-consent-banner',
+  defaultComponent: null,
+});
 function SimilarStackTrace({params, location, project}: Props) {
   const {orgId, groupId} = params;
 
@@ -228,6 +233,7 @@ function SimilarStackTrace({params, location, project}: Props) {
               pageLinks={items.pageLinks}
             />
           )}
+          <DataConsentBanner source="grouping" />
         </Layout.Main>
       </Layout.Body>
     </Fragment>

+ 7 - 0
static/app/views/issueList/overview.tsx

@@ -17,6 +17,7 @@ import {addMessage} from 'sentry/actionCreators/indicator';
 import {fetchOrgMembers, indexMembersByProject} from 'sentry/actionCreators/members';
 import {fetchTagValues, loadOrganizationTags} from 'sentry/actionCreators/tags';
 import type {Client} from 'sentry/api';
+import HookOrDefault from 'sentry/components/hookOrDefault';
 import * as Layout from 'sentry/components/layouts/thirds';
 import LoadingIndicator from 'sentry/components/loadingIndicator';
 import {extractSelectionParameters} from 'sentry/components/organizations/pageFilters/utils';
@@ -149,6 +150,11 @@ type StatEndpointParams = Omit<EndpointParams, 'cursor' | 'page'> & {
   expand?: string | string[];
 };
 
+const DataConsentBanner = HookOrDefault({
+  hookName: 'component:data-consent-banner',
+  defaultComponent: null,
+});
+
 class IssueListOverview extends Component<Props, State> {
   state: State = this.getInitialState();
 
@@ -1251,6 +1257,7 @@ class IssueListOverview extends Component<Props, State> {
         />
         <StyledBody>
           <StyledMain>
+            <DataConsentBanner source="issues" />
             <IssueListFilters query={query} onSearch={this.onSearch} />
 
             <Panel>