Skip to content

Commit

Permalink
chore(settings): Fix disabled state for scraping (#81881)
Browse files Browse the repository at this point in the history
right now in project settings, the JS source fetching setting isn't
disabled for members, even though if they try to update the setting it
won't work. this pr fixes it so it is disabled correctly

fixes #70604
  • Loading branch information
roggenkemper authored and mifu67 committed Dec 10, 2024
1 parent 8b371bf commit 60aa52f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion static/app/data/forms/projectGeneralSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {createFilter} from 'react-select';
import styled from '@emotion/styled';
import {PlatformIcon} from 'platformicons';

import {hasEveryAccess} from 'sentry/components/acl/access';
import type {Field} from 'sentry/components/forms/types';
import platforms from 'sentry/data/platforms';
import {t, tct, tn} from 'sentry/locale';
Expand Down Expand Up @@ -149,7 +150,8 @@ export const fields: Record<string, Field> = {
name: 'scrapeJavaScript',
type: 'boolean',
// if this is off for the organization, it cannot be enabled for the project
disabled: ({organization, name}) => !organization[name],
disabled: ({organization, project, name}) =>
!organization[name] || !hasEveryAccess(['project:write'], {organization, project}),
disabledReason: ORG_DISABLED_REASON,
// `props` are the props given to FormField
setValue: (val, props) => props.organization?.[props.name] && val,
Expand Down

0 comments on commit 60aa52f

Please sign in to comment.