-
-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: variant with number payload #4654
Conversation
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@@ -19,6 +19,7 @@ import useUnleashContext from 'hooks/api/getters/useUnleashContext/useUnleashCon | |||
import { WeightType } from 'constants/variantTypes'; | |||
import { IFeatureVariantEdit } from '../EnvironmentVariantsModal'; | |||
import { Delete } from '@mui/icons-material'; | |||
import useUiConfig from '../../../../../../../hooks/api/getters/useUiConfig/useUiConfig'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dots
@@ -195,6 +197,16 @@ export const VariantForm = ({ | |||
|
|||
const [errors, setErrors] = useState<IVariantFormErrors>({}); | |||
|
|||
const shouldAddTypeNumberToOptions = Boolean( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd call it after flag: const variantTypeNumber
uiConfig.flags.variantTypeNumber | ||
); | ||
|
||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming it's because the flag hasn't loaded yet, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
payloadOptions is defined before the component - we need to load the flag and determine whether to add the option to the list
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also check with the strategy variants
If you'd like to write automated tests for variants I added some in StrategyVariants.test.tsx |
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Adds
number
as possible payload type for variant.Adds a flag to enable the feature
Updates all relevant models and schemas
Adds the option to the UI
Closes: # 1-1357