mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-18 13:48:58 +02:00
Add "feature status will change"
This commit is contained in:
parent
2dc7cbaa31
commit
da20905e7c
@ -81,17 +81,7 @@ export const ChangeRequest: VFC<IChangeRequestProps> = ({
|
||||
))}
|
||||
{feature.defaultChange ? (
|
||||
<FeatureChange
|
||||
actions={
|
||||
<Typography
|
||||
variant='body2'
|
||||
color='text.secondary'
|
||||
>
|
||||
{feature.defaultChange.action ===
|
||||
'addStrategy'
|
||||
? 'Default strategy will be added'
|
||||
: 'Feature status will change'}
|
||||
</Typography>
|
||||
}
|
||||
isDefaultChange
|
||||
index={feature.changes.length}
|
||||
changeRequest={changeRequest}
|
||||
change={feature.defaultChange}
|
||||
|
@ -89,7 +89,8 @@ const ChangeInnerBox = styled(Box)(({ theme }) => ({
|
||||
}));
|
||||
|
||||
export const FeatureChange: FC<{
|
||||
actions: ReactNode;
|
||||
isDefaultChange?: boolean;
|
||||
actions?: ReactNode;
|
||||
index: number;
|
||||
changeRequest: ChangeRequestType;
|
||||
change: IFeatureChange;
|
||||
@ -189,6 +190,7 @@ export const FeatureChange: FC<{
|
||||
)}
|
||||
{change.action === 'updateEnabled' && (
|
||||
<StatusChangeComponent
|
||||
isDefaultChange
|
||||
enabled={change.payload.enabled}
|
||||
actions={actions}
|
||||
/>
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { FC, ReactNode } from 'react';
|
||||
import { Box } from '@mui/material';
|
||||
import { Box, Typography } from '@mui/material';
|
||||
import { Badge } from 'component/common/Badge/Badge';
|
||||
import { ChangeItemWrapper as LegacyChangeItemWrapper } from './LegacyStrategyChange.tsx';
|
||||
import { Action, ChangeItemInfo, ChangeItemWrapper } from './Change.styles';
|
||||
@ -7,14 +7,27 @@ import { Action, ChangeItemInfo, ChangeItemWrapper } from './Change.styles';
|
||||
interface IToggleStatusChange {
|
||||
enabled: boolean;
|
||||
actions?: ReactNode;
|
||||
isDefaultChange?: boolean;
|
||||
}
|
||||
|
||||
const StatusWillChange = () => (
|
||||
<Typography
|
||||
variant='body2'
|
||||
component='span'
|
||||
color='text.secondary'
|
||||
sx={{ marginLeft: 'auto' }}
|
||||
>
|
||||
Feature status will change
|
||||
</Typography>
|
||||
);
|
||||
|
||||
/**
|
||||
* @deprecated use ToggleStatusChange instead; remove with flag crDiffView
|
||||
*/
|
||||
export const LegacyToggleStatusChange: FC<IToggleStatusChange> = ({
|
||||
enabled,
|
||||
actions,
|
||||
isDefaultChange,
|
||||
}) => {
|
||||
return (
|
||||
<LegacyChangeItemWrapper>
|
||||
@ -27,6 +40,7 @@ export const LegacyToggleStatusChange: FC<IToggleStatusChange> = ({
|
||||
{enabled ? ' Enabled' : 'Disabled'}
|
||||
</Badge>
|
||||
</Box>
|
||||
{isDefaultChange ? <StatusWillChange /> : null}
|
||||
{actions}
|
||||
</LegacyChangeItemWrapper>
|
||||
);
|
||||
@ -35,6 +49,7 @@ export const LegacyToggleStatusChange: FC<IToggleStatusChange> = ({
|
||||
export const ToggleStatusChange: FC<IToggleStatusChange> = ({
|
||||
enabled,
|
||||
actions,
|
||||
isDefaultChange,
|
||||
}) => {
|
||||
return (
|
||||
<ChangeItemWrapper>
|
||||
@ -43,6 +58,7 @@ export const ToggleStatusChange: FC<IToggleStatusChange> = ({
|
||||
<Badge color={enabled ? 'success' : 'error'}>
|
||||
{enabled ? ' Enabled' : 'Disabled'}
|
||||
</Badge>
|
||||
{isDefaultChange ? <StatusWillChange /> : null}
|
||||
{actions}
|
||||
</ChangeItemInfo>
|
||||
</ChangeItemWrapper>
|
||||
|
Loading…
Reference in New Issue
Block a user