-
-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
169 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...omponent/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlanMilestoneStrategy.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { Box, styled } from '@mui/material'; | ||
import { StrategyExecution } from '../FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/StrategyExecution'; | ||
import SplitPreviewSlider from 'component/feature/StrategyTypes/SplitPreviewSlider/SplitPreviewSlider'; | ||
import { | ||
formatStrategyName, | ||
getFeatureStrategyIcon, | ||
} from 'utils/strategyNames'; | ||
import type { IFeatureStrategy } from 'interfaces/strategy'; | ||
|
||
const StyledStrategy = styled('div')(({ theme }) => ({ | ||
background: theme.palette.background.paper, | ||
border: `1px solid ${theme.palette.divider}`, | ||
borderRadius: theme.shape.borderRadiusMedium, | ||
padding: theme.spacing(2), | ||
})); | ||
|
||
const StyledHeader = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
gap: theme.spacing(1), | ||
alignItems: 'center', | ||
color: theme.palette.text.primary, | ||
'& > svg': { | ||
fill: theme.palette.action.disabled, | ||
}, | ||
marginBottom: theme.spacing(1), | ||
})); | ||
|
||
interface IReleasePlanMilestoneStrategyProps { | ||
strategy: IFeatureStrategy; | ||
} | ||
|
||
export const ReleasePlanMilestoneStrategy = ({ | ||
strategy, | ||
}: IReleasePlanMilestoneStrategyProps) => { | ||
const Icon = getFeatureStrategyIcon(strategy.strategyName); | ||
|
||
return ( | ||
<StyledStrategy> | ||
<StyledHeader> | ||
<Icon /> | ||
{`${formatStrategyName(String(strategy.strategyName))}${strategy.title ? `: ${strategy.title}` : ''}`} | ||
</StyledHeader> | ||
<StrategyExecution strategy={strategy} /> | ||
{strategy.variants && | ||
strategy.variants.length > 0 && | ||
(strategy.disabled ? ( | ||
<Box sx={{ opacity: '0.5' }}> | ||
<SplitPreviewSlider variants={strategy.variants} /> | ||
</Box> | ||
) : ( | ||
<SplitPreviewSlider variants={strategy.variants} /> | ||
))} | ||
</StyledStrategy> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters