diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/DisableEnableStrategy/DisableEnableStrategy.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/DisableEnableStrategy/DisableEnableStrategy.tsx deleted file mode 100644 index ca9807c213..0000000000 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/DisableEnableStrategy/DisableEnableStrategy.tsx +++ /dev/null @@ -1,179 +0,0 @@ -import { VFC, useState } from 'react'; -import { Alert, Typography } from '@mui/material'; -import BlockIcon from '@mui/icons-material/Block'; -import TrackChangesIcon from '@mui/icons-material/TrackChanges'; -import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { UPDATE_FEATURE_STRATEGY } from '@server/types/permissions'; -import { Dialogue } from 'component/common/Dialogue/Dialogue'; -import { useEnableDisable } from './hooks/useEnableDisable'; -import { useSuggestEnableDisable } from './hooks/useSuggestEnableDisable'; -import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled'; -import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { FeatureStrategyChangeRequestAlert } from 'component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyChangeRequestAlert/FeatureStrategyChangeRequestAlert'; -import { IDisableEnableStrategyProps } from './IDisableEnableStrategyProps'; -import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; - -const DisableStrategy: VFC = ({ ...props }) => { - const { projectId, environmentId, featureId } = props; - const [isDialogueOpen, setDialogueOpen] = useState(false); - const { onDisable } = useEnableDisable({ ...props }); - const { onSuggestDisable } = useSuggestEnableDisable({ ...props }); - const { isChangeRequestConfigured } = useChangeRequestsEnabled(projectId); - const isChangeRequest = isChangeRequestConfigured(environmentId); - const { refetchFeature } = useFeature(projectId, featureId); - - const onClick = (event: React.FormEvent) => { - event.preventDefault(); - if (isChangeRequest) { - onSuggestDisable(); - } else { - onDisable(); - refetchFeature(); - } - setDialogueOpen(false); - }; - - return ( - <> - setDialogueOpen(true)} - projectId={projectId} - environmentId={environmentId} - permission={UPDATE_FEATURE_STRATEGY} - tooltipProps={{ - title: 'Disable strategy', - }} - type="button" - > - - theme.spacing(1) }} - > - Disable - - } - /> - - setDialogueOpen(false)} - > - - } - elseShow={ - - Disabling the strategy will change which users - receive access to the feature. - - } - /> - - - ); -}; - -const EnableStrategy: VFC = ({ ...props }) => { - const { projectId, environmentId } = props; - const [isDialogueOpen, setDialogueOpen] = useState(false); - const { onEnable } = useEnableDisable({ ...props }); - const { onSuggestEnable } = useSuggestEnableDisable({ ...props }); - const { isChangeRequestConfigured } = useChangeRequestsEnabled(projectId); - const isChangeRequest = isChangeRequestConfigured(environmentId); - - const onClick = (event: React.FormEvent) => { - event.preventDefault(); - if (isChangeRequest) { - onSuggestEnable(); - } else { - onEnable(); - } - setDialogueOpen(false); - }; - - return ( - <> - setDialogueOpen(true)} - projectId={projectId} - environmentId={environmentId} - permission={UPDATE_FEATURE_STRATEGY} - tooltipProps={{ - title: 'Enable strategy', - }} - type="button" - > - - theme.spacing(1) }} - > - Disable - - } - /> - - setDialogueOpen(false)} - > - - } - elseShow={ - - Enabling the strategy will change which users - receive access to the feature. - - } - /> - - - ); -}; - -export const DisableEnableStrategy: VFC = ({ - ...props -}) => - props.strategy.disabled ? ( - - ) : ( - - ); diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyRemove/FeatureStrategyRemove.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/LegacyFeatureStrategyRemove.tsx similarity index 97% rename from frontend/src/component/feature/FeatureStrategy/FeatureStrategyRemove/FeatureStrategyRemove.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/LegacyFeatureStrategyRemove.tsx index fdc0c081d5..46f6e81a5e 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyRemove/FeatureStrategyRemove.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/LegacyFeatureStrategyRemove.tsx @@ -3,7 +3,7 @@ import useFeatureStrategyApi from 'hooks/api/actions/useFeatureStrategyApi/useFe import { formatUnknownError } from 'utils/formatUnknownError'; import { useNavigate } from 'react-router-dom'; import useToast from 'hooks/useToast'; -import { formatFeaturePath } from '../FeatureStrategyEdit/FeatureStrategyEdit'; +import { formatFeaturePath } from 'component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit'; import { Dialogue } from 'component/common/Dialogue/Dialogue'; import { Alert, styled, Typography } from '@mui/material'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; @@ -157,7 +157,11 @@ const useOnSuggestRemove = ({ return onSuggestRemove; }; -export const FeatureStrategyRemove = ({ +/** + * @deprecated + * TODO: remove when strategyImprovements flag is removed + */ +export const LegacyFeatureStrategyRemove = ({ projectId, featureId, environmentId, diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DialogStrategyRemove.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DialogStrategyRemove.tsx new file mode 100644 index 0000000000..cc6d9502e9 --- /dev/null +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DialogStrategyRemove.tsx @@ -0,0 +1,201 @@ +import React, { FC } from 'react'; +import useFeatureStrategyApi from 'hooks/api/actions/useFeatureStrategyApi/useFeatureStrategyApi'; +import { formatUnknownError } from 'utils/formatUnknownError'; +import { useNavigate } from 'react-router-dom'; +import useToast from 'hooks/useToast'; +import { formatFeaturePath } from '../../../../../../../../FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit'; +import { Dialogue } from 'component/common/Dialogue/Dialogue'; +import { Alert, styled, Typography } from '@mui/material'; +import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; +import { useChangeRequestApi } from 'hooks/api/actions/useChangeRequestApi/useChangeRequestApi'; +import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled'; +import { usePendingChangeRequests } from 'hooks/api/getters/usePendingChangeRequests/usePendingChangeRequests'; + +interface IFeatureStrategyRemoveProps { + projectId: string; + featureId: string; + environmentId: string; + strategyId: string; + disabled?: boolean; + icon?: boolean; + text?: boolean; +} + +interface IFeatureStrategyRemoveDialogueProps { + onRemove: (event: React.FormEvent) => Promise; + onClose: () => void; + isOpen: boolean; +} + +const RemoveAlert: FC = () => ( + + Removing the strategy will change which users receive access to the + feature. + +); + +const FeatureStrategyRemoveDialogue: FC< + IFeatureStrategyRemoveDialogueProps +> = ({ onRemove, onClose, isOpen }) => { + return ( + + + + ); +}; + +const MsgContainer = styled('div')(({ theme }) => ({ + marginTop: theme.spacing(3), + marginBottom: theme.spacing(1), +})); + +const SuggestFeatureStrategyRemoveDialogue: FC< + IFeatureStrategyRemoveDialogueProps +> = ({ onRemove, onClose, isOpen }) => { + return ( + + + + + Your suggestion: + + + Remove strategy + + ); +}; + +interface IRemoveProps { + projectId: string; + featureId: string; + environmentId: string; + strategyId: string; +} + +const useOnRemove = ({ + projectId, + featureId, + environmentId, + strategyId, +}: IRemoveProps) => { + const { deleteStrategyFromFeature } = useFeatureStrategyApi(); + const { setToastData, setToastApiError } = useToast(); + const navigate = useNavigate(); + const { refetchFeature } = useFeature(projectId, featureId); + + const onRemove = async (event: React.FormEvent) => { + try { + event.preventDefault(); + await deleteStrategyFromFeature( + projectId, + featureId, + environmentId, + strategyId + ); + setToastData({ + title: 'Strategy deleted', + type: 'success', + }); + refetchFeature(); + navigate(formatFeaturePath(projectId, featureId)); + } catch (error: unknown) { + setToastApiError(formatUnknownError(error)); + } + }; + return onRemove; +}; + +const useOnSuggestRemove = ({ + projectId, + featureId, + environmentId, + strategyId, +}: IRemoveProps) => { + const { addChange } = useChangeRequestApi(); + const { refetch: refetchChangeRequests } = + usePendingChangeRequests(projectId); + const { setToastData, setToastApiError } = useToast(); + const onSuggestRemove = async (event: React.FormEvent) => { + try { + event.preventDefault(); + await addChange(projectId, environmentId, { + action: 'deleteStrategy', + feature: featureId, + payload: { + id: strategyId, + }, + }); + setToastData({ + title: 'Changes added to the draft!', + type: 'success', + }); + await refetchChangeRequests(); + } catch (error: unknown) { + setToastApiError(formatUnknownError(error)); + } + }; + return onSuggestRemove; +}; + +export const DialogStrategyRemove = ({ + projectId, + featureId, + environmentId, + strategyId, + text, + isOpen, + onClose, +}: IFeatureStrategyRemoveProps & { + isOpen: boolean; + onClose: () => void; +}) => { + const { isChangeRequestConfigured } = useChangeRequestsEnabled(projectId); + + const onRemove = useOnRemove({ + featureId, + projectId, + strategyId, + environmentId, + }); + const onSuggestRemove = useOnSuggestRemove({ + featureId, + projectId, + strategyId, + environmentId, + }); + + if (isChangeRequestConfigured(environmentId)) { + return ( + onClose()} + onRemove={async e => { + await onSuggestRemove(e); + onClose(); + }} + /> + ); + } + + return ( + onClose()} + onRemove={onRemove} + /> + ); +}; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/DisableEnableStrategyDialog.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/DisableEnableStrategyDialog.tsx new file mode 100644 index 0000000000..1672131e34 --- /dev/null +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/DisableEnableStrategyDialog.tsx @@ -0,0 +1,78 @@ +import { Alert } from '@mui/material'; +import { Dialogue } from 'component/common/Dialogue/Dialogue'; +import { useEnableDisable } from './hooks/useEnableDisable'; +import { useSuggestEnableDisable } from './hooks/useSuggestEnableDisable'; +import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled'; +import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; +import { FeatureStrategyChangeRequestAlert } from 'component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyChangeRequestAlert/FeatureStrategyChangeRequestAlert'; +import { IDisableEnableStrategyProps } from './IDisableEnableStrategyProps'; + +export const DisableEnableStrategyDialog = ({ + isOpen, + onClose, + ...props +}: IDisableEnableStrategyProps & { + isOpen: boolean; + onClose: () => void; +}) => { + const { projectId, environmentId } = props; + const { isChangeRequestConfigured } = useChangeRequestsEnabled(projectId); + const isChangeRequest = isChangeRequestConfigured(environmentId); + const { onSuggestEnable } = useSuggestEnableDisable({ ...props }); + const { onEnable, onDisable } = useEnableDisable({ ...props }); + const disabled = Boolean(props.strategy?.disabled); + + const onClick = (event: React.FormEvent) => { + event.preventDefault(); + if (isChangeRequest) { + if (disabled) { + onSuggestEnable(); + } else { + onSuggestEnable(); + } + } else { + if (disabled) { + onEnable(); + } else { + onDisable(); + } + } + onClose(); + }; + + return ( + onClose()} + > + + } + elseShow={ + + Enabling the strategy will change which users receive + access to the feature. + + } + /> + + ); +}; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/DisableEnableStrategy/IDisableEnableStrategyProps.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/IDisableEnableStrategyProps.ts similarity index 100% rename from frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/DisableEnableStrategy/IDisableEnableStrategyProps.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/IDisableEnableStrategyProps.ts diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/DisableEnableStrategy/hooks/useEnableDisable.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useEnableDisable.ts similarity index 100% rename from frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/DisableEnableStrategy/hooks/useEnableDisable.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useEnableDisable.ts diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/DisableEnableStrategy/hooks/useSuggestEnableDisable.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useSuggestEnableDisable.ts similarity index 100% rename from frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/DisableEnableStrategy/hooks/useSuggestEnableDisable.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useSuggestEnableDisable.ts diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/MenuStrategyRemove.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/MenuStrategyRemove.tsx new file mode 100644 index 0000000000..5583f90571 --- /dev/null +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/MenuStrategyRemove.tsx @@ -0,0 +1,149 @@ +import React, { SyntheticEvent, useState } from 'react'; +import { + Box, + IconButton, + ListItemIcon, + ListItemText, + Menu, + MenuItem, + Tooltip, +} from '@mui/material'; +import MoreVertIcon from '@mui/icons-material/MoreVert'; +import { IFeatureStrategy } from 'interfaces/strategy'; +import { DialogStrategyRemove } from './DialogStrategyRemove'; +import { DisableEnableStrategyDialog } from './DisableEnableStrategyDialog/DisableEnableStrategyDialog'; +import TrackChangesIcon from '@mui/icons-material/TrackChanges'; +import DeleteIcon from '@mui/icons-material/Delete'; +import BlockIcon from '@mui/icons-material/Block'; +import { + DELETE_FEATURE_STRATEGY, + UPDATE_FEATURE_STRATEGY, +} from '@server/types/permissions'; +import { useHasProjectEnvironmentAccess } from 'hooks/useHasAccess'; +import { STRATEGY_FORM_REMOVE_ID } from 'utils/testIds'; + +export interface IRemoveStrategyMenuProps { + projectId: string; + featureId: string; + environmentId: string; + strategy: IFeatureStrategy; +} + +const MenuStrategyRemove = ({ + projectId, + strategy, + featureId, + environmentId, +}: IRemoveStrategyMenuProps) => { + const [anchorEl, setAnchorEl] = useState(null); + const [isDisableEnableDialogOpen, setDisableEnableDialogOpen] = + useState(false); + const [isRemoveDialogOpen, setRemoveDialogOpen] = useState(false); + const open = Boolean(anchorEl); + const handleClick = (event: React.MouseEvent) => { + setAnchorEl(event.currentTarget); + }; + const handleClose = (event: SyntheticEvent) => { + setAnchorEl(null); + event.stopPropagation(); + }; + const updateAccess = useHasProjectEnvironmentAccess( + UPDATE_FEATURE_STRATEGY, + projectId, + environmentId + ); + const deleteAccess = useHasProjectEnvironmentAccess( + DELETE_FEATURE_STRATEGY, + projectId, + environmentId + ); + + return ( + <> + + + + + + + + + + setDisableEnableDialogOpen(true)} + > + + {strategy.disabled ? ( + + ) : ( + + )} + + + {strategy.disabled ? 'Enable' : 'Disable'} + + + + + setRemoveDialogOpen(true)} + data-testid={STRATEGY_FORM_REMOVE_ID} + > + + + + Remove + + + + setDisableEnableDialogOpen(false)} + projectId={projectId} + featureId={featureId} + environmentId={environmentId} + strategy={strategy} + /> + setRemoveDialogOpen(false)} + projectId={projectId} + featureId={featureId} + environmentId={environmentId} + strategyId={strategy.id} + /> + + ); +}; + +export default MenuStrategyRemove; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/RemoveStrategyMenu/RemoveStrategyMenu.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/RemoveStrategyMenu/RemoveStrategyMenu.tsx deleted file mode 100644 index 82dddb664c..0000000000 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/RemoveStrategyMenu/RemoveStrategyMenu.tsx +++ /dev/null @@ -1,134 +0,0 @@ -import React, { SyntheticEvent } from 'react'; -import { - Avatar, - Box, - IconButton, - ListItem, - Menu, - MenuItem, - styled, - Tooltip, - Typography, -} from '@mui/material'; -import MoreVertIcon from '@mui/icons-material/MoreVert'; -import { IFeatureStrategy } from '../../../../../../../../../../interfaces/strategy'; -import { FeatureStrategyRemove } from '../../../../../../../../FeatureStrategy/FeatureStrategyRemove/FeatureStrategyRemove'; -import { DisableEnableStrategy } from '../DisableEnableStrategy/DisableEnableStrategy'; - -export interface IRemoveStrategyMenuProps { - projectId: string; - featureId: string; - environmentId: string; - strategy: IFeatureStrategy; -} - -const StyledContainer = styled(ListItem)(({ theme }) => ({ - display: 'flex', - flexDirection: 'row', - justifyContent: 'center', - minWidth: 'fit-content', - padding: theme.spacing(0, 2), -})); - -const RemoveStrategyMenu = ({ - projectId, - strategy, - featureId, - environmentId, -}: IRemoveStrategyMenuProps) => { - const [anchorEl, setAnchorEl] = React.useState(null); - const open = Boolean(anchorEl); - const handleClick = (event: React.MouseEvent) => { - setAnchorEl(event.currentTarget); - }; - const handleClose = (event: SyntheticEvent) => { - setAnchorEl(null); - event.stopPropagation(); - }; - return ( - <> - - - - - - - - - ( - - - - )} - /> - ( - - )} - /> - - - ); -}; - -export default RemoveStrategyMenu; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx index 506556e0d6..4f5bbf558e 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx @@ -6,15 +6,14 @@ import { IFeatureStrategy } from 'interfaces/strategy'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; import { UPDATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions'; import { formatEditStrategyPath } from 'component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit'; -import { FeatureStrategyRemove } from 'component/feature/FeatureStrategy/FeatureStrategyRemove/FeatureStrategyRemove'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { StrategyExecution } from './StrategyExecution/StrategyExecution'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { CopyStrategyIconMenu } from './CopyStrategyIconMenu/CopyStrategyIconMenu'; import { StrategyItemContainer } from 'component/common/StrategyItemContainer/StrategyItemContainer'; -import { DisableEnableStrategy } from './DisableEnableStrategy/DisableEnableStrategy'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; -import RemoveStrategyMenu from './RemoveStrategyMenu/RemoveStrategyMenu'; +import MenuStrategyRemove from './MenuStrategyRemove/MenuStrategyRemove'; +import { LegacyFeatureStrategyRemove } from './LegacyFeatureStrategyRemove'; interface IStrategyItemProps { environmentId: string; @@ -85,7 +84,7 @@ export const StrategyItem: FC = ({ uiConfig?.flags?.strategyImprovements )} show={() => ( - = ({ /> )} elseShow={() => ( -