mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
fix: refetch immutable toggle when adding strategy (#1164)
This commit is contained in:
parent
850c7a26db
commit
c79465e7d9
@ -5,12 +5,14 @@ interface IPercentageCircleProps {
|
|||||||
percentage: number;
|
percentage: number;
|
||||||
secondaryPieColor?: string;
|
secondaryPieColor?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
hideNumber?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PercentageCircle = ({
|
const PercentageCircle = ({
|
||||||
styles,
|
styles,
|
||||||
percentage,
|
percentage,
|
||||||
secondaryPieColor,
|
secondaryPieColor,
|
||||||
|
hideNumber,
|
||||||
...rest
|
...rest
|
||||||
}: IPercentageCircleProps) => {
|
}: IPercentageCircleProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
@ -35,9 +37,10 @@ const PercentageCircle = ({
|
|||||||
display: 'flex',
|
display: 'flex',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
fontSize: '12px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
100%
|
{hideNumber ? null : '100%'}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import { FeatureStrategyMenu } from '../FeatureStrategyMenu/FeatureStrategyMenu'
|
|||||||
import { PresetCard } from './PresetCard/PresetCard';
|
import { PresetCard } from './PresetCard/PresetCard';
|
||||||
import { useStyles } from './FeatureStrategyEmpty.styles';
|
import { useStyles } from './FeatureStrategyEmpty.styles';
|
||||||
import { formatUnknownError } from 'utils/formatUnknownError';
|
import { formatUnknownError } from 'utils/formatUnknownError';
|
||||||
|
import { useFeatureImmutable } from 'hooks/api/getters/useFeature/useFeatureImmutable';
|
||||||
import { getFeatureStrategyIcon } from 'utils/strategyNames';
|
import { getFeatureStrategyIcon } from 'utils/strategyNames';
|
||||||
|
|
||||||
interface IFeatureStrategyEmptyProps {
|
interface IFeatureStrategyEmptyProps {
|
||||||
@ -25,9 +26,15 @@ export const FeatureStrategyEmpty = ({
|
|||||||
const { addStrategyToFeature } = useFeatureStrategyApi();
|
const { addStrategyToFeature } = useFeatureStrategyApi();
|
||||||
const { setToastData, setToastApiError } = useToast();
|
const { setToastData, setToastApiError } = useToast();
|
||||||
const { refetchFeature } = useFeature(projectId, featureId);
|
const { refetchFeature } = useFeature(projectId, featureId);
|
||||||
|
const { refetchFeature: refetchFeatureImmutable } = useFeatureImmutable(
|
||||||
|
projectId,
|
||||||
|
featureId
|
||||||
|
);
|
||||||
|
|
||||||
const onAfterAddStrategy = () => {
|
const onAfterAddStrategy = () => {
|
||||||
refetchFeature();
|
refetchFeature();
|
||||||
|
refetchFeatureImmutable();
|
||||||
|
|
||||||
setToastData({
|
setToastData({
|
||||||
title: 'Strategy created',
|
title: 'Strategy created',
|
||||||
text: 'Successfully created strategy',
|
text: 'Successfully created strategy',
|
||||||
|
@ -50,6 +50,7 @@ export const StrategyExecution = ({ strategy }: IStrategyExecutionProps) => {
|
|||||||
sx={{ display: 'flex', alignItems: 'center' }}
|
sx={{ display: 'flex', alignItems: 'center' }}
|
||||||
>
|
>
|
||||||
<PercentageCircle
|
<PercentageCircle
|
||||||
|
hideNumber
|
||||||
percentage={parseParameterNumber(
|
percentage={parseParameterNumber(
|
||||||
parameters[key]
|
parameters[key]
|
||||||
)}
|
)}
|
||||||
|
Loading…
Reference in New Issue
Block a user