Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 17 additions & 37 deletions frontend/web/components/feature-summary/FeatureRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { FC, useCallback, useEffect, useMemo } from 'react'
import ConfirmToggleFeature from 'components/modals/ConfirmToggleFeature'
import ConfirmRemoveFeature from 'components/modals/ConfirmRemoveFeature'
import CreateFlagModal from 'components/modals/create-feature'
import CreateExperimentModal from 'components/modals/create-experiment'

@talissoncosta talissoncosta Jun 30, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we still gonna keep CreateExperimentModal ?
Just checking to prevent dead code.

import ProjectStore from 'common/stores/project-store'
import Constants from 'common/constants'
import { useProtectedTags } from 'common/utils/useProtectedTags'
Expand Down Expand Up @@ -57,7 +56,6 @@ interface FeatureRowProps {
releasePipelines?: ReleasePipeline[]
onCloseEditModal?: () => void
isCompact?: boolean
experimentMode?: boolean
}

const width = [220, 50, 55, 70, 450]
Expand All @@ -69,7 +67,6 @@ const FeatureRow: FC<FeatureRowProps> = (props) => {
disableControls,
environmentFlags,
environmentId,
experimentMode = false,
fadeEnabled,
fadeValue,
hideAudit = false,
Expand Down Expand Up @@ -114,9 +111,9 @@ const FeatureRow: FC<FeatureRowProps> = (props) => {
const { feature } = Utils.fromParam()
const { id } = projectFlag

const isModalOpen =
!!document?.getElementsByClassName('create-feature-modal')?.length ||
!!document?.getElementsByClassName('create-experiment-modal')?.length
const isModalOpen = !!document?.getElementsByClassName(
'create-feature-modal',
)?.length
if (`${id}` === feature && !isModalOpen) {
editFeature()
}
Expand Down Expand Up @@ -202,35 +199,18 @@ const FeatureRow: FC<FeatureRowProps> = (props) => {
search: `?feature=${projectFlag.id}&tab=${tabValue}`,
})

const ModalComponent = experimentMode
? CreateExperimentModal
: CreateFlagModal
const modalCssClass = experimentMode
? 'side-modal create-feature-modal create-experiment-modal'
: 'side-modal create-feature-modal'

const modalProps = experimentMode
? {
environmentFlag,
environmentId,
history,
noPermissions: !permission,
projectFlag,
projectId,
tab,
}
: {
environmentFlag,
environmentId,
hasUnhealthyEvents:
isFeatureHealthEnabled && !!featureUnhealthyEvents?.length,
hideTagsByType: ['UNHEALTHY'],
history,
noPermissions: !permission,
projectFlag,
projectId,
tab,
}
const modalProps = {
environmentFlag,
environmentId,
hasUnhealthyEvents:
isFeatureHealthEnabled && !!featureUnhealthyEvents?.length,
hideTagsByType: ['UNHEALTHY'],
history,
noPermissions: !permission,
projectFlag,
projectId,
tab,
}

const ownerChips = enforceFeatureOwners
? [
Expand Down Expand Up @@ -273,8 +253,8 @@ const FeatureRow: FC<FeatureRowProps> = (props) => {
</div>
)}
</Row>,
<ModalComponent {...modalProps} />,
modalCssClass,
<CreateFlagModal {...modalProps} />,
'side-modal create-feature-modal',
() => {
if (onCloseEditModal) {
return onCloseEditModal()
Expand Down

This file was deleted.

Loading
Loading