@@ -17,7 +17,6 @@ import VariationLabel from 'elements/variation-label';
1717import { DefaultRuleSchema , TargetingSchema } from '../form-schema' ;
1818import Strategy from '../segment-rule/strategy' ;
1919import { VariationOption } from '../segment-rule/variation' ;
20- import { getDefaultRolloutStrategy } from '../utils' ;
2120import DefaultRuleRollout from './rollout' ;
2221
2322const DefaultRule = ( {
@@ -33,13 +32,11 @@ const DefaultRule = ({
3332} ) => {
3433 const { t } = useTranslation ( [ 'form' ] ) ;
3534
36- const { control, watch, setFocus, setValue } =
37- useFormContext < TargetingSchema > ( ) ;
35+ const { control, watch, setFocus } = useFormContext < TargetingSchema > ( ) ;
3836
3937 const commonName = 'defaultRule' ;
4038 const defaultRule = watch ( commonName ) ;
4139 const manualStrategy = watch ( 'defaultRule.manualStrategy' ) ;
42- const defaultRolloutStrategy = getDefaultRolloutStrategy ( feature ) ;
4340
4441 const variationOptions : VariationOption [ ] = useMemo ( ( ) => {
4542 const variations = feature . variations . map ( ( item , index ) => ( {
@@ -56,12 +53,6 @@ const DefaultRule = ({
5653 type : StrategyType . MANUAL ,
5754 icon : IconPercentage
5855 }
59- // {
60- // label: t('common:source-type.progressive-rollout'),
61- // value: StrategyType.ROLLOUT,
62- // type: StrategyType.ROLLOUT,
63- // icon: IconCircleDashed
64- // }
6556 ] ;
6657 } , [ feature ] ) ;
6758
@@ -81,18 +72,12 @@ const DefaultRule = ({
8172 currentOption : value ,
8273 fixedStrategy : {
8374 variation : isFixed ? value : ''
84- } ,
85- rolloutStrategy : isFixed ? [ ] : defaultRolloutStrategy
75+ }
76+ // rolloutStrategy: isFixed ? [] : defaultRolloutStrategy
8677 } ) ;
8778 if ( ! isFixed ) {
8879 let timerId : NodeJS . Timeout | null = null ;
8980 if ( timerId ) clearTimeout ( timerId ) ;
90- defaultRolloutStrategy . forEach ( ( _ , index ) =>
91- setValue (
92- `${ commonName } .${ isRollout ? 'rolloutStrategy' : 'manualStrategy' } .${ index } .weight` ,
93- 0
94- )
95- ) ;
9681 timerId = setTimeout (
9782 ( ) =>
9883 setFocus (
0 commit comments