@@ -8,6 +8,8 @@ import { useHasPermission } from 'common/providers/Permission'
88import Switch from 'components/Switch'
99import Tooltip from 'components/Tooltip'
1010import Icon from 'components/Icon'
11+ import InfoMessage from 'components/InfoMessage'
12+ import { useGetProjectQuery } from 'common/services/useProject'
1113import { useCreateTagMutation , useGetTagsQuery } from 'common/services/useTag'
1214
1315type CreateFeatureTabProps = {
@@ -55,6 +57,9 @@ const CreateFeature: FC<CreateFeatureTabProps> = ({
5557 permission : 'ADMIN' ,
5658 } )
5759
60+ const { data : project } = useGetProjectQuery ( { id : projectId } )
61+ const preventFlagDefaults = ! ! project ?. prevent_flag_defaults && ! identity
62+
5863 const noPermissions = ! createFeature && ! projectAdmin
5964
6065 const showExperimentToggle =
@@ -134,10 +139,17 @@ const CreateFeature: FC<CreateFeatureTabProps> = ({
134139 < WarningMessage warningMessage = { featureWarning } />
135140 { ! ! projectFlag && (
136141 < >
142+ { preventFlagDefaults && (
143+ < InfoMessage collapseId = 'create-flag' >
144+ This will create the feature for < strong > all environments</ strong >
145+ , you can edit the feature's enabled state and value per
146+ environment once the feature is created.
147+ </ InfoMessage >
148+ ) }
137149 < FeatureValue
138150 error = { error }
139151 createFeature = { createFeature }
140- hideValue = { false }
152+ hideValue = { preventFlagDefaults }
141153 isEdit = { ! ! identity }
142154 identity = { identity }
143155 noPermissions = { noPermissions }
0 commit comments