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