mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-18 01:18:23 +02:00
feat: update strategy window styles, extract old and new components (#9730)
This commit is contained in:
parent
a92c79e2dd
commit
02aadfe1bb
@ -12,7 +12,7 @@ import { useChangeRequestAddStrategy } from 'hooks/useChangeRequestAddStrategy';
|
|||||||
import { ChangeRequestDialogue } from 'component/changeRequest/ChangeRequestConfirmDialog/ChangeRequestConfirmDialog';
|
import { ChangeRequestDialogue } from 'component/changeRequest/ChangeRequestConfirmDialog/ChangeRequestConfirmDialog';
|
||||||
import { CopyStrategiesMessage } from 'component/changeRequest/ChangeRequestConfirmDialog/ChangeRequestMessages/CopyStrategiesMessage';
|
import { CopyStrategiesMessage } from 'component/changeRequest/ChangeRequestConfirmDialog/ChangeRequestMessages/CopyStrategiesMessage';
|
||||||
import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled';
|
import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled';
|
||||||
import { FeatureStrategyMenu } from '../FeatureStrategyMenu/FeatureStrategyMenu';
|
import { FeatureStrategyMenuWrapper } from '../FeatureStrategyMenu/FeatureStrategyMenu';
|
||||||
|
|
||||||
interface IFeatureStrategyEmptyProps {
|
interface IFeatureStrategyEmptyProps {
|
||||||
projectId: string;
|
projectId: string;
|
||||||
@ -161,7 +161,7 @@ export const FeatureStrategyEmpty = ({
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FeatureStrategyMenu
|
<FeatureStrategyMenuWrapper
|
||||||
label='Add your first strategy'
|
label='Add your first strategy'
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
featureId={featureId}
|
featureId={featureId}
|
||||||
|
@ -5,7 +5,7 @@ import PermissionButton, {
|
|||||||
type IPermissionButtonProps,
|
type IPermissionButtonProps,
|
||||||
} from 'component/common/PermissionButton/PermissionButton';
|
} from 'component/common/PermissionButton/PermissionButton';
|
||||||
import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions';
|
import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions';
|
||||||
import { Popover, styled } from '@mui/material';
|
import { Dialog, styled } from '@mui/material';
|
||||||
import { FeatureStrategyMenuCards } from './FeatureStrategyMenuCards/FeatureStrategyMenuCards';
|
import { FeatureStrategyMenuCards } from './FeatureStrategyMenuCards/FeatureStrategyMenuCards';
|
||||||
import { formatCreateStrategyPath } from '../FeatureStrategyCreate/FeatureStrategyCreate';
|
import { formatCreateStrategyPath } from '../FeatureStrategyCreate/FeatureStrategyCreate';
|
||||||
import MoreVert from '@mui/icons-material/MoreVert';
|
import MoreVert from '@mui/icons-material/MoreVert';
|
||||||
@ -20,9 +20,8 @@ import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled';
|
|||||||
import { formatUnknownError } from 'utils/formatUnknownError';
|
import { formatUnknownError } from 'utils/formatUnknownError';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag';
|
import { useUiFlag } from 'hooks/useUiFlag';
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
import { OldFeatureStrategyMenuCards } from './FeatureStrategyMenuCards/OldFeatureStrategyMenuCards';
|
|
||||||
import { ReleasePlanReviewDialog } from '../../FeatureView/FeatureOverview/ReleasePlan/ReleasePlanReviewDialog';
|
import { ReleasePlanReviewDialog } from '../../FeatureView/FeatureOverview/ReleasePlan/ReleasePlanReviewDialog';
|
||||||
import { ReleasePlanAddDialog } from '../../FeatureView/FeatureOverview/ReleasePlan/ReleasePlanAddDialog';
|
import { OldFeatureStrategyMenu } from './OldFeatureStrategyMenu';
|
||||||
|
|
||||||
interface IFeatureStrategyMenuProps {
|
interface IFeatureStrategyMenuProps {
|
||||||
label: string;
|
label: string;
|
||||||
@ -49,6 +48,18 @@ const StyledAdditionalMenuButton = styled(PermissionButton)(({ theme }) => ({
|
|||||||
paddingBlock: 0,
|
paddingBlock: 0,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
export const FeatureStrategyMenuWrapper = (
|
||||||
|
props: IFeatureStrategyMenuProps,
|
||||||
|
) => {
|
||||||
|
const newStrategyDropdownEnabled = useUiFlag('newStrategyDropdown');
|
||||||
|
|
||||||
|
if (newStrategyDropdownEnabled) {
|
||||||
|
return <FeatureStrategyMenu {...props} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
return <OldFeatureStrategyMenu {...props} />;
|
||||||
|
};
|
||||||
|
|
||||||
export const FeatureStrategyMenu = ({
|
export const FeatureStrategyMenu = ({
|
||||||
label,
|
label,
|
||||||
projectId,
|
projectId,
|
||||||
@ -77,7 +88,6 @@ export const FeatureStrategyMenu = ({
|
|||||||
const { addReleasePlanToFeature } = useReleasePlansApi();
|
const { addReleasePlanToFeature } = useReleasePlansApi();
|
||||||
const { isOss } = useUiConfig();
|
const { isOss } = useUiConfig();
|
||||||
const releasePlansEnabled = useUiFlag('releasePlans');
|
const releasePlansEnabled = useUiFlag('releasePlans');
|
||||||
const newStrategyDropdownEnabled = useUiFlag('newStrategyDropdown');
|
|
||||||
const displayReleasePlanButton = !isOss() && releasePlansEnabled;
|
const displayReleasePlanButton = !isOss() && releasePlansEnabled;
|
||||||
const crProtected =
|
const crProtected =
|
||||||
releasePlansEnabled && isChangeRequestConfigured(environmentId);
|
releasePlansEnabled && isChangeRequestConfigured(environmentId);
|
||||||
@ -211,22 +221,17 @@ export const FeatureStrategyMenu = ({
|
|||||||
>
|
>
|
||||||
<MoreVert />
|
<MoreVert />
|
||||||
</StyledAdditionalMenuButton>
|
</StyledAdditionalMenuButton>
|
||||||
<Popover
|
<Dialog
|
||||||
id={popoverId}
|
|
||||||
open={isPopoverOpen}
|
open={isPopoverOpen}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
onClick={onClose}
|
maxWidth='md'
|
||||||
disableScrollLock={true}
|
PaperProps={{
|
||||||
sx={{
|
sx: {
|
||||||
'& .MuiPopover-paper': {
|
borderRadius: (theme) => '12px',
|
||||||
position: 'fixed',
|
|
||||||
top: '50% !important',
|
|
||||||
left: '50% !important',
|
|
||||||
transform: 'translate(-50%, -50%) !important',
|
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{newStrategyDropdownEnabled ? (
|
{
|
||||||
<FeatureStrategyMenuCards
|
<FeatureStrategyMenuCards
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
featureId={featureId}
|
featureId={featureId}
|
||||||
@ -242,21 +247,9 @@ export const FeatureStrategyMenu = ({
|
|||||||
}}
|
}}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
/>
|
/>
|
||||||
) : (
|
}
|
||||||
<OldFeatureStrategyMenuCards
|
</Dialog>
|
||||||
projectId={projectId}
|
{selectedTemplate && (
|
||||||
featureId={featureId}
|
|
||||||
environmentId={environmentId}
|
|
||||||
onlyReleasePlans={onlyReleasePlans}
|
|
||||||
onAddReleasePlan={(template) => {
|
|
||||||
setSelectedTemplate(template);
|
|
||||||
setAddReleasePlanOpen(true);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Popover>
|
|
||||||
{selectedTemplate &&
|
|
||||||
(newStrategyDropdownEnabled ? (
|
|
||||||
<ReleasePlanReviewDialog
|
<ReleasePlanReviewDialog
|
||||||
open={addReleasePlanOpen}
|
open={addReleasePlanOpen}
|
||||||
setOpen={setAddReleasePlanOpen}
|
setOpen={setAddReleasePlanOpen}
|
||||||
@ -269,19 +262,7 @@ export const FeatureStrategyMenu = ({
|
|||||||
environment={environmentId}
|
environment={environmentId}
|
||||||
crProtected={crProtected}
|
crProtected={crProtected}
|
||||||
/>
|
/>
|
||||||
) : (
|
)}
|
||||||
<ReleasePlanAddDialog
|
|
||||||
open={addReleasePlanOpen}
|
|
||||||
setOpen={setAddReleasePlanOpen}
|
|
||||||
onConfirm={() => {
|
|
||||||
addReleasePlan(selectedTemplate);
|
|
||||||
}}
|
|
||||||
template={selectedTemplate}
|
|
||||||
projectId={projectId}
|
|
||||||
featureName={featureId}
|
|
||||||
environment={environmentId}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</StyledStrategyMenu>
|
</StyledStrategyMenu>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -29,7 +29,7 @@ interface IFeatureStrategyMenuCardsProps {
|
|||||||
|
|
||||||
const StyledTypography = styled(Typography)(({ theme }) => ({
|
const StyledTypography = styled(Typography)(({ theme }) => ({
|
||||||
fontSize: theme.fontSizes.smallBody,
|
fontSize: theme.fontSizes.smallBody,
|
||||||
padding: theme.spacing(1, 2),
|
padding: theme.spacing(1, 4),
|
||||||
width: '100%',
|
width: '100%',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -48,14 +48,14 @@ const ScrollableContent = styled(Box)(({ theme }) => ({
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
maxHeight: '70vh',
|
maxHeight: '70vh',
|
||||||
overflowY: 'auto',
|
overflowY: 'auto',
|
||||||
padding: theme.spacing(0, 0, 1, 0),
|
padding: theme.spacing(1, 0, 1, 0),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const GridSection = styled(Box)(({ theme }) => ({
|
const GridSection = styled(Box)(({ theme }) => ({
|
||||||
display: 'grid',
|
display: 'grid',
|
||||||
gridTemplateColumns: 'repeat(2, 1fr)',
|
gridTemplateColumns: 'repeat(2, 1fr)',
|
||||||
gap: theme.spacing(1.5),
|
gap: theme.spacing(1.5),
|
||||||
padding: theme.spacing(0, 2),
|
padding: theme.spacing(0, 4),
|
||||||
marginBottom: theme.spacing(3),
|
marginBottom: theme.spacing(3),
|
||||||
width: '100%',
|
width: '100%',
|
||||||
}));
|
}));
|
||||||
@ -69,7 +69,7 @@ const TitleRow = styled(Box)(({ theme }) => ({
|
|||||||
display: 'flex',
|
display: 'flex',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
padding: theme.spacing(1, 2),
|
padding: theme.spacing(4, 4, 2, 4),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const TitleText = styled(Typography)(({ theme }) => ({
|
const TitleText = styled(Typography)(({ theme }) => ({
|
||||||
@ -82,7 +82,7 @@ const SectionTitle = styled(Box)(({ theme }) => ({
|
|||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
gap: theme.spacing(0.5),
|
gap: theme.spacing(0.5),
|
||||||
padding: theme.spacing(1, 2),
|
padding: theme.spacing(0, 4, 1, 4),
|
||||||
width: '100%',
|
width: '100%',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ const EmptyStateContainer = styled(Box)(({ theme }) => ({
|
|||||||
backgroundColor: theme.palette.neutral.light,
|
backgroundColor: theme.palette.neutral.light,
|
||||||
borderRadius: theme.shape.borderRadiusMedium,
|
borderRadius: theme.shape.borderRadiusMedium,
|
||||||
padding: theme.spacing(3),
|
padding: theme.spacing(3),
|
||||||
margin: theme.spacing(0, 2),
|
margin: theme.spacing(0, 4),
|
||||||
width: 'auto',
|
width: 'auto',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -0,0 +1,254 @@
|
|||||||
|
import type React from 'react';
|
||||||
|
import { useState } from 'react';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
import PermissionButton, {
|
||||||
|
type IPermissionButtonProps,
|
||||||
|
} from 'component/common/PermissionButton/PermissionButton';
|
||||||
|
import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions';
|
||||||
|
import { Popover, styled } from '@mui/material';
|
||||||
|
import { formatCreateStrategyPath } from '../FeatureStrategyCreate/FeatureStrategyCreate';
|
||||||
|
import MoreVert from '@mui/icons-material/MoreVert';
|
||||||
|
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
||||||
|
import type { IReleasePlanTemplate } from 'interfaces/releasePlans';
|
||||||
|
import { useChangeRequestApi } from 'hooks/api/actions/useChangeRequestApi/useChangeRequestApi';
|
||||||
|
import { usePendingChangeRequests } from 'hooks/api/getters/usePendingChangeRequests/usePendingChangeRequests';
|
||||||
|
import useToast from 'hooks/useToast';
|
||||||
|
import { ReleasePlanAddDialog } from 'component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanAddDialog';
|
||||||
|
import { useReleasePlansApi } from 'hooks/api/actions/useReleasePlansApi/useReleasePlansApi';
|
||||||
|
import { useReleasePlans } from 'hooks/api/getters/useReleasePlans/useReleasePlans';
|
||||||
|
import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled';
|
||||||
|
import { formatUnknownError } from 'utils/formatUnknownError';
|
||||||
|
import { useUiFlag } from 'hooks/useUiFlag';
|
||||||
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
|
import { OldFeatureStrategyMenuCards } from './FeatureStrategyMenuCards/OldFeatureStrategyMenuCards';
|
||||||
|
|
||||||
|
interface IFeatureStrategyMenuProps {
|
||||||
|
label: string;
|
||||||
|
projectId: string;
|
||||||
|
featureId: string;
|
||||||
|
environmentId: string;
|
||||||
|
variant?: IPermissionButtonProps['variant'];
|
||||||
|
matchWidth?: boolean;
|
||||||
|
size?: IPermissionButtonProps['size'];
|
||||||
|
disableReason?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const StyledStrategyMenu = styled('div')(({ theme }) => ({
|
||||||
|
display: 'flex',
|
||||||
|
flexFlow: 'row',
|
||||||
|
justifyContent: 'flex-end',
|
||||||
|
gap: theme.spacing(1),
|
||||||
|
}));
|
||||||
|
|
||||||
|
const StyledAdditionalMenuButton = styled(PermissionButton)(({ theme }) => ({
|
||||||
|
minWidth: 0,
|
||||||
|
width: theme.spacing(4.5),
|
||||||
|
alignSelf: 'stretch',
|
||||||
|
paddingBlock: 0,
|
||||||
|
}));
|
||||||
|
|
||||||
|
export const OldFeatureStrategyMenu = ({
|
||||||
|
label,
|
||||||
|
projectId,
|
||||||
|
featureId,
|
||||||
|
environmentId,
|
||||||
|
variant,
|
||||||
|
size,
|
||||||
|
matchWidth,
|
||||||
|
disableReason,
|
||||||
|
}: IFeatureStrategyMenuProps) => {
|
||||||
|
const [anchor, setAnchor] = useState<Element>();
|
||||||
|
const [onlyReleasePlans, setOnlyReleasePlans] = useState<boolean>(false);
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const { trackEvent } = usePlausibleTracker();
|
||||||
|
const [selectedTemplate, setSelectedTemplate] =
|
||||||
|
useState<IReleasePlanTemplate>();
|
||||||
|
const [addReleasePlanOpen, setAddReleasePlanOpen] = useState(false);
|
||||||
|
const isPopoverOpen = Boolean(anchor);
|
||||||
|
const popoverId = isPopoverOpen ? 'FeatureStrategyMenuPopover' : undefined;
|
||||||
|
const { setToastApiError, setToastData } = useToast();
|
||||||
|
const { isChangeRequestConfigured } = useChangeRequestsEnabled(projectId);
|
||||||
|
const { addChange } = useChangeRequestApi();
|
||||||
|
const { refetch: refetchChangeRequests } =
|
||||||
|
usePendingChangeRequests(projectId);
|
||||||
|
const { refetch } = useReleasePlans(projectId, featureId, environmentId);
|
||||||
|
const { addReleasePlanToFeature } = useReleasePlansApi();
|
||||||
|
const { isOss } = useUiConfig();
|
||||||
|
const releasePlansEnabled = useUiFlag('releasePlans');
|
||||||
|
const displayReleasePlanButton = !isOss() && releasePlansEnabled;
|
||||||
|
const crProtected =
|
||||||
|
releasePlansEnabled && isChangeRequestConfigured(environmentId);
|
||||||
|
|
||||||
|
const onClose = () => {
|
||||||
|
setAnchor(undefined);
|
||||||
|
};
|
||||||
|
|
||||||
|
const openDefaultStrategyCreationModal = (event: React.SyntheticEvent) => {
|
||||||
|
trackEvent('strategy-add', {
|
||||||
|
props: {
|
||||||
|
buttonTitle: label,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
navigate(createStrategyPath);
|
||||||
|
};
|
||||||
|
|
||||||
|
const openMoreStrategies = (event: React.SyntheticEvent) => {
|
||||||
|
setOnlyReleasePlans(false);
|
||||||
|
setAnchor(event.currentTarget);
|
||||||
|
};
|
||||||
|
|
||||||
|
const openReleasePlans = (event: React.SyntheticEvent) => {
|
||||||
|
setOnlyReleasePlans(true);
|
||||||
|
setAnchor(event.currentTarget);
|
||||||
|
};
|
||||||
|
|
||||||
|
const addReleasePlan = async () => {
|
||||||
|
if (!selectedTemplate) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (crProtected) {
|
||||||
|
await addChange(projectId, environmentId, {
|
||||||
|
feature: featureId,
|
||||||
|
action: 'addReleasePlan',
|
||||||
|
payload: {
|
||||||
|
templateId: selectedTemplate.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
setToastData({
|
||||||
|
type: 'success',
|
||||||
|
text: 'Added to draft',
|
||||||
|
});
|
||||||
|
|
||||||
|
refetchChangeRequests();
|
||||||
|
} else {
|
||||||
|
await addReleasePlanToFeature(
|
||||||
|
featureId,
|
||||||
|
selectedTemplate.id,
|
||||||
|
projectId,
|
||||||
|
environmentId,
|
||||||
|
);
|
||||||
|
|
||||||
|
setToastData({
|
||||||
|
type: 'success',
|
||||||
|
text: 'Release plan added',
|
||||||
|
});
|
||||||
|
|
||||||
|
refetch();
|
||||||
|
}
|
||||||
|
trackEvent('release-management', {
|
||||||
|
props: {
|
||||||
|
eventType: 'add-plan',
|
||||||
|
plan: selectedTemplate.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} catch (error: unknown) {
|
||||||
|
setToastApiError(formatUnknownError(error));
|
||||||
|
} finally {
|
||||||
|
setAddReleasePlanOpen(false);
|
||||||
|
setSelectedTemplate(undefined);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const createStrategyPath = formatCreateStrategyPath(
|
||||||
|
projectId,
|
||||||
|
featureId,
|
||||||
|
environmentId,
|
||||||
|
'flexibleRollout',
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<StyledStrategyMenu onClick={(event) => event.stopPropagation()}>
|
||||||
|
{displayReleasePlanButton ? (
|
||||||
|
<PermissionButton
|
||||||
|
data-testid='ADD_TEMPLATE_BUTTON'
|
||||||
|
permission={CREATE_FEATURE_STRATEGY}
|
||||||
|
projectId={projectId}
|
||||||
|
environmentId={environmentId}
|
||||||
|
onClick={openReleasePlans}
|
||||||
|
aria-labelledby={popoverId}
|
||||||
|
variant='outlined'
|
||||||
|
sx={{ minWidth: matchWidth ? '282px' : 'auto' }}
|
||||||
|
disabled={Boolean(disableReason)}
|
||||||
|
tooltipProps={{
|
||||||
|
title: disableReason ? disableReason : undefined,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Use template
|
||||||
|
</PermissionButton>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
<PermissionButton
|
||||||
|
data-testid='ADD_STRATEGY_BUTTON'
|
||||||
|
permission={CREATE_FEATURE_STRATEGY}
|
||||||
|
projectId={projectId}
|
||||||
|
environmentId={environmentId}
|
||||||
|
onClick={openDefaultStrategyCreationModal}
|
||||||
|
aria-labelledby={popoverId}
|
||||||
|
variant={variant}
|
||||||
|
sx={{ minWidth: matchWidth ? '282px' : 'auto' }}
|
||||||
|
disabled={Boolean(disableReason)}
|
||||||
|
tooltipProps={{
|
||||||
|
title: disableReason ? disableReason : undefined,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{label}
|
||||||
|
</PermissionButton>
|
||||||
|
|
||||||
|
<StyledAdditionalMenuButton
|
||||||
|
permission={CREATE_FEATURE_STRATEGY}
|
||||||
|
projectId={projectId}
|
||||||
|
environmentId={environmentId}
|
||||||
|
onClick={openMoreStrategies}
|
||||||
|
variant='outlined'
|
||||||
|
hideLockIcon
|
||||||
|
disabled={Boolean(disableReason)}
|
||||||
|
tooltipProps={{
|
||||||
|
title: disableReason ? disableReason : 'More strategies',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MoreVert />
|
||||||
|
</StyledAdditionalMenuButton>
|
||||||
|
<Popover
|
||||||
|
id={popoverId}
|
||||||
|
open={isPopoverOpen}
|
||||||
|
anchorEl={anchor}
|
||||||
|
onClose={onClose}
|
||||||
|
onClick={onClose}
|
||||||
|
anchorOrigin={{
|
||||||
|
vertical: 'bottom',
|
||||||
|
horizontal: 'left',
|
||||||
|
}}
|
||||||
|
PaperProps={{
|
||||||
|
sx: (theme) => ({
|
||||||
|
paddingBottom: theme.spacing(1),
|
||||||
|
}),
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<OldFeatureStrategyMenuCards
|
||||||
|
projectId={projectId}
|
||||||
|
featureId={featureId}
|
||||||
|
environmentId={environmentId}
|
||||||
|
onlyReleasePlans={onlyReleasePlans}
|
||||||
|
onAddReleasePlan={(template) => {
|
||||||
|
setSelectedTemplate(template);
|
||||||
|
setAddReleasePlanOpen(true);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Popover>
|
||||||
|
{selectedTemplate && (
|
||||||
|
<ReleasePlanAddDialog
|
||||||
|
open={addReleasePlanOpen}
|
||||||
|
setOpen={setAddReleasePlanOpen}
|
||||||
|
onConfirm={addReleasePlan}
|
||||||
|
template={selectedTemplate}
|
||||||
|
projectId={projectId}
|
||||||
|
featureName={featureId}
|
||||||
|
environment={environmentId}
|
||||||
|
crProtected={crProtected}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</StyledStrategyMenu>
|
||||||
|
);
|
||||||
|
};
|
@ -3,7 +3,7 @@ import type {
|
|||||||
IFeatureEnvironment,
|
IFeatureEnvironment,
|
||||||
IFeatureEnvironmentMetrics,
|
IFeatureEnvironmentMetrics,
|
||||||
} from 'interfaces/featureToggle';
|
} from 'interfaces/featureToggle';
|
||||||
import { FeatureStrategyMenu } from 'component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureStrategyMenu';
|
import { FeatureStrategyMenuWrapper } from 'component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureStrategyMenu';
|
||||||
import { FEATURE_ENVIRONMENT_ACCORDION } from 'utils/testIds';
|
import { FEATURE_ENVIRONMENT_ACCORDION } from 'utils/testIds';
|
||||||
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
|
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
|
||||||
import { UpgradeChangeRequests } from './UpgradeChangeRequests/UpgradeChangeRequests';
|
import { UpgradeChangeRequests } from './UpgradeChangeRequests/UpgradeChangeRequests';
|
||||||
@ -103,7 +103,7 @@ export const FeatureOverviewEnvironment = ({
|
|||||||
environment={environment}
|
environment={environment}
|
||||||
/>
|
/>
|
||||||
{!hasActivations ? (
|
{!hasActivations ? (
|
||||||
<FeatureStrategyMenu
|
<FeatureStrategyMenuWrapper
|
||||||
label='Add strategy'
|
label='Add strategy'
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
featureId={featureId}
|
featureId={featureId}
|
||||||
@ -129,7 +129,7 @@ export const FeatureOverviewEnvironment = ({
|
|||||||
<Box sx={{ display: 'flex', flexDirection: 'row' }}>
|
<Box sx={{ display: 'flex', flexDirection: 'row' }}>
|
||||||
<ReleaseTemplatesFeedback />
|
<ReleaseTemplatesFeedback />
|
||||||
<Box ml='auto'>
|
<Box ml='auto'>
|
||||||
<FeatureStrategyMenu
|
<FeatureStrategyMenuWrapper
|
||||||
label='Add strategy'
|
label='Add strategy'
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
featureId={featureId}
|
featureId={featureId}
|
||||||
|
@ -16,7 +16,7 @@ import StringTruncator from 'component/common/StringTruncator/StringTruncator';
|
|||||||
import EnvironmentAccordionBody from './EnvironmentAccordionBody/LegacyEnvironmentAccordionBody';
|
import EnvironmentAccordionBody from './EnvironmentAccordionBody/LegacyEnvironmentAccordionBody';
|
||||||
import { EnvironmentFooter } from './EnvironmentFooter/EnvironmentFooter';
|
import { EnvironmentFooter } from './EnvironmentFooter/EnvironmentFooter';
|
||||||
import FeatureOverviewEnvironmentMetrics from './EnvironmentHeader/FeatureOverviewEnvironmentMetrics/LegacyFeatureOverviewEnvironmentMetrics';
|
import FeatureOverviewEnvironmentMetrics from './EnvironmentHeader/FeatureOverviewEnvironmentMetrics/LegacyFeatureOverviewEnvironmentMetrics';
|
||||||
import { FeatureStrategyMenu } from 'component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureStrategyMenu';
|
import { FeatureStrategyMenuWrapper } from 'component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureStrategyMenu';
|
||||||
import { FEATURE_ENVIRONMENT_ACCORDION } from 'utils/testIds';
|
import { FEATURE_ENVIRONMENT_ACCORDION } from 'utils/testIds';
|
||||||
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
|
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
|
||||||
import { FeatureStrategyIcons } from 'component/feature/FeatureStrategy/FeatureStrategyIcons/FeatureStrategyIcons';
|
import { FeatureStrategyIcons } from 'component/feature/FeatureStrategy/FeatureStrategyIcons/FeatureStrategyIcons';
|
||||||
@ -179,7 +179,7 @@ const FeatureOverviewEnvironment = ({
|
|||||||
/>
|
/>
|
||||||
</StyledHeaderTitle>
|
</StyledHeaderTitle>
|
||||||
<StyledButtonContainer>
|
<StyledButtonContainer>
|
||||||
<FeatureStrategyMenu
|
<FeatureStrategyMenuWrapper
|
||||||
label='Add strategy'
|
label='Add strategy'
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
featureId={featureId}
|
featureId={featureId}
|
||||||
@ -223,7 +223,7 @@ const FeatureOverviewEnvironment = ({
|
|||||||
py: 1,
|
py: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FeatureStrategyMenu
|
<FeatureStrategyMenuWrapper
|
||||||
label='Add strategy'
|
label='Add strategy'
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
featureId={featureId}
|
featureId={featureId}
|
||||||
|
Loading…
Reference in New Issue
Block a user