File tree Expand file tree Collapse file tree 3 files changed +11
-22
lines changed
static/app/views/settings Expand file tree Collapse file tree 3 files changed +11
-22
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,11 @@ import useOrganization from 'sentry/utils/useOrganization';
16
16
import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader' ;
17
17
import { OrganizationSampling } from 'sentry/views/settings/dynamicSampling/organizationSampling' ;
18
18
import { ProjectSampling } from 'sentry/views/settings/dynamicSampling/projectSampling' ;
19
- import {
20
- useHasDynamicSamplingReadAccess ,
21
- useHasDynamicSamplingWriteAccess ,
22
- } from 'sentry/views/settings/dynamicSampling/utils/access' ;
19
+ import { useHasDynamicSamplingReadAccess } from 'sentry/views/settings/dynamicSampling/utils/access' ;
20
+ import { OrganizationPermissionAlert } from 'sentry/views/settings/organization/organizationPermissionAlert' ;
23
21
24
22
export default function DynamicSamplingSettings ( ) {
25
23
const organization = useOrganization ( ) ;
26
- const hasWriteAccess = useHasDynamicSamplingWriteAccess ( ) ;
27
24
const hasReadAccess = useHasDynamicSamplingReadAccess ( ) ;
28
25
29
26
if (
@@ -86,15 +83,7 @@ export default function DynamicSamplingSettings() {
86
83
</ LinkButton >
87
84
}
88
85
/>
89
- { ! hasWriteAccess && (
90
- < Alert . Container >
91
- < Alert type = "warning" >
92
- { t (
93
- 'These settings can only be edited by users with the organization owner or manager role.'
94
- ) }
95
- </ Alert >
96
- </ Alert . Container >
97
- ) }
86
+ < OrganizationPermissionAlert />
98
87
{ hasReadAccess ? (
99
88
< Fragment >
100
89
< Paragraph >
Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ export function ProjectPermissionAlert({
22
22
{ ( { hasAccess} ) =>
23
23
! hasAccess && (
24
24
< Alert . Container >
25
- < Alert data-test-id = "project-permission-alert" type = "warning" { ...props } >
25
+ < Alert
26
+ data-test-id = "project-permission-alert"
27
+ type = "warning"
28
+ showIcon
29
+ { ...props }
30
+ >
26
31
{ t (
27
32
'These settings can only be edited by users with the organization-level owner, manager, or team-level admin roles.'
28
33
) }
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {setApiQueryData} from 'sentry/utils/queryClient';
22
22
import useOrganization from 'sentry/utils/useOrganization' ;
23
23
import { getPricingDocsLinkForEventType } from 'sentry/views/settings/account/notifications/utils' ;
24
24
import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader' ;
25
+ import { ProjectPermissionAlert } from 'sentry/views/settings/project/projectPermissionAlert' ;
25
26
26
27
import { AutofixRepositories } from './autofixRepositories' ;
27
28
@@ -226,13 +227,7 @@ function ProjectSeerGeneralForm({project}: ProjectSeerProps) {
226
227
}
227
228
) }
228
229
</ Alert >
229
- { ! canWriteProject && (
230
- < Alert type = "warning" system >
231
- { t (
232
- 'These settings can only be edited by users with the organization-level owner, manager, or team-level admin role.'
233
- ) }
234
- </ Alert >
235
- ) }
230
+ < ProjectPermissionAlert project = { project } />
236
231
{ showWarning && (
237
232
< Alert type = "warning" system showIcon >
238
233
{ t (
You can’t perform that action at this time.
0 commit comments