-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(settings): Disable AI settings when gen-ai-features flag is off #103387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4ee5327
b0c02aa
512b404
0326f20
2f562f0
e48c91a
db20f06
40f4f80
6322c96
599357e
31b0af2
2495475
25f4eae
6ec4501
27e24ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,25 +10,29 @@ export const defaultEnableSeerFeaturesValue = (organization: Organization) => { | |
|
|
||
| export const makeHideAiFeaturesField = (organization: Organization): FieldObject => { | ||
| const isBaa = false; // TODO: add a check here once we have a way to check if the org is a BAA customer. Leave it as false for now. | ||
| const hasFeatureFlag = organization.features.includes('gen-ai-features'); | ||
|
|
||
| return { | ||
| name: 'hideAiFeatures', | ||
| type: 'boolean', | ||
| label: t('Show Generative AI Features'), | ||
| help: tct( | ||
| 'Allows organization members to access [docs:features] powered by generative AI', | ||
| { | ||
| docs: ( | ||
| <ExternalLink href="https://docs.sentry.io/product/ai-in-sentry/#ai-powered-features" /> | ||
| ), | ||
| } | ||
| ), | ||
| help: tct('Allows organization members to access [link:generative AI features]', { | ||
| link: ( | ||
| <ExternalLink href="https://docs.sentry.io/product/ai-in-sentry/#ai-powered-features" /> | ||
| ), | ||
| }), | ||
| defaultValue: defaultEnableSeerFeaturesValue(organization), | ||
| disabled: ({access}) => !access.has('org:write'), | ||
| disabled: ({access}) => !hasFeatureFlag || !access.has('org:write'), | ||
| getValue: value => { | ||
| // Reversing value because the field was previously called hideAiFeatures and we've inverted the behavior. | ||
| return !value; | ||
| }, | ||
| setValue: value => { | ||
| if (!hasFeatureFlag) { | ||
| return false; | ||
| } | ||
| return value; | ||
| }, | ||
|
Comment on lines
+30
to
+35
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is necessary if it's already disabled.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the whole set value fn?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then it should be done in
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm that doesn't seem to work?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: setValue doesn't invert hideAiFeatures value correctlyThe |
||
| disabledReason: isBaa | ||
| ? t( | ||
| 'To remain HIPAA compliant, Generative AI features are disabled for BAA customers' | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.