Skip to content

Commit

Permalink
put back ff disabled checks
Browse files Browse the repository at this point in the history
  • Loading branch information
zlwaterfield committed Jan 20, 2025
1 parent 48eb0e8 commit df35d12
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 12 additions & 3 deletions frontend/src/scenes/feature-flags/FeatureFlag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,9 @@ export function FeatureFlag({ id }: { id?: string } = {}): JSX.Element {
: deleteFeatureFlag(featureFlag)
}}
disabledReason={
(featureFlag.features?.length || 0) > 0
!featureFlag.can_edit
? "You have only 'View' access for this feature flag. To make changes, please contact the flag's creator."
: (featureFlag.features?.length || 0) > 0
? 'This feature flag is in use with an early access feature. Delete the early access feature to delete this flag'
: (featureFlag.experiment_set?.length || 0) > 0
? 'This feature flag is linked to an experiment. Delete the experiment to delete this flag'
Expand Down Expand Up @@ -574,7 +576,9 @@ export function FeatureFlag({ id }: { id?: string } = {}): JSX.Element {
data-attr="edit-feature-flag"
type="secondary"
disabledReason={
featureFlag.deleted
!featureFlag.can_edit
? "You have only 'View' access for this feature flag. To make changes, please contact the flag's creator."
: featureFlag.deleted
? 'This feature flag has been deleted. Restore it to edit.'
: null
}
Expand Down Expand Up @@ -817,7 +821,12 @@ function FeatureFlagRollout({ readOnly }: { readOnly?: boolean }): JSX.Element {
})
}}
label="Enabled"
disabledReason={accessControlDisabledReason}
disabledReason={
accessControlDisabledReason ||
(!featureFlag.can_edit
? "You only have view access to this feature flag. To make changes, contact the flag's creator."
: null)
}
checked={featureFlag.active}
/>
<FeatureFlagStatusIndicator flagStatus={flagStatus} />
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/scenes/feature-flags/FeatureFlags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ export function OverViewTab({
})
}}
disabledReason={
(featureFlag.features?.length || 0) > 0
!featureFlag.can_edit
? "You have only 'View' access for this feature flag. To make changes, please contact the flag's creator."
: (featureFlag.features?.length || 0) > 0
? 'This feature flag is in use with an early access feature. Delete the early access feature to delete this flag'
: (featureFlag.experiment_set?.length || 0) > 0
? 'This feature flag is linked to an experiment. Delete the experiment to delete this flag'
Expand Down

0 comments on commit df35d12

Please sign in to comment.