mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-04 13:48:56 +02:00
chore: remove variantTypeNumber flag (#5382)
Closes # [1-1648](https://linear.app/unleash/issue/1-1648/clean-varianttypenumber-flag-for-release) --------- Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
parent
1dafc85eaa
commit
937a605888
@ -145,6 +145,7 @@ const payloadOptions = [
|
|||||||
{ key: 'string', label: 'string' },
|
{ key: 'string', label: 'string' },
|
||||||
{ key: 'json', label: 'json' },
|
{ key: 'json', label: 'json' },
|
||||||
{ key: 'csv', label: 'csv' },
|
{ key: 'csv', label: 'csv' },
|
||||||
|
{ key: 'number', label: 'number' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const EMPTY_PAYLOAD = { type: 'string', value: '' };
|
const EMPTY_PAYLOAD = { type: 'string', value: '' };
|
||||||
@ -198,17 +199,6 @@ export const VariantForm = ({
|
|||||||
|
|
||||||
const [errors, setErrors] = useState<IVariantFormErrors>({});
|
const [errors, setErrors] = useState<IVariantFormErrors>({});
|
||||||
|
|
||||||
const variantTypeNumber = useUiFlag('variantTypeNumber');
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (
|
|
||||||
variantTypeNumber &&
|
|
||||||
!payloadOptions.some((option) => option.key === 'number')
|
|
||||||
) {
|
|
||||||
payloadOptions.push({ key: 'number', label: 'number' });
|
|
||||||
}
|
|
||||||
}, [variantTypeNumber]);
|
|
||||||
|
|
||||||
const clearError = (field: ErrorField) => {
|
const clearError = (field: ErrorField) => {
|
||||||
setErrors((errors) => ({ ...errors, [field]: undefined }));
|
setErrors((errors) => ({ ...errors, [field]: undefined }));
|
||||||
};
|
};
|
||||||
@ -300,7 +290,7 @@ export const VariantForm = ({
|
|||||||
if (payload.type === 'json') {
|
if (payload.type === 'json') {
|
||||||
JSON.parse(payload.value);
|
JSON.parse(payload.value);
|
||||||
}
|
}
|
||||||
if (variantTypeNumber && payload.type === 'number') {
|
if (payload.type === 'number') {
|
||||||
return !Number.isNaN(Number(payload.value));
|
return !Number.isNaN(Number(payload.value));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -61,7 +61,6 @@ export type UiFlags = {
|
|||||||
customRootRolesKillSwitch?: boolean;
|
customRootRolesKillSwitch?: boolean;
|
||||||
strategyVariant?: boolean;
|
strategyVariant?: boolean;
|
||||||
doraMetrics?: boolean;
|
doraMetrics?: boolean;
|
||||||
variantTypeNumber?: boolean;
|
|
||||||
privateProjects?: boolean;
|
privateProjects?: boolean;
|
||||||
dependentFeatures?: boolean;
|
dependentFeatures?: boolean;
|
||||||
banners?: boolean;
|
banners?: boolean;
|
||||||
|
@ -104,7 +104,6 @@ exports[`should create default config 1`] = `
|
|||||||
"scheduledConfigurationChanges": false,
|
"scheduledConfigurationChanges": false,
|
||||||
"strictSchemaValidation": false,
|
"strictSchemaValidation": false,
|
||||||
"useLastSeenRefactor": false,
|
"useLastSeenRefactor": false,
|
||||||
"variantTypeNumber": false,
|
|
||||||
},
|
},
|
||||||
"externalResolver": {
|
"externalResolver": {
|
||||||
"getVariant": [Function],
|
"getVariant": [Function],
|
||||||
|
@ -22,7 +22,6 @@ export type IFlagKey =
|
|||||||
| 'advancedPlayground'
|
| 'advancedPlayground'
|
||||||
| 'filterInvalidClientMetrics'
|
| 'filterInvalidClientMetrics'
|
||||||
| 'customRootRolesKillSwitch'
|
| 'customRootRolesKillSwitch'
|
||||||
| 'variantTypeNumber'
|
|
||||||
| 'privateProjects'
|
| 'privateProjects'
|
||||||
| 'dependentFeatures'
|
| 'dependentFeatures'
|
||||||
| 'disableMetrics'
|
| 'disableMetrics'
|
||||||
@ -111,10 +110,6 @@ const flags: IFlags = {
|
|||||||
process.env.UNLEASH_EXPERIMENTAL_DEPENDENT_FEATURES,
|
process.env.UNLEASH_EXPERIMENTAL_DEPENDENT_FEATURES,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
variantTypeNumber: parseEnvVarBoolean(
|
|
||||||
process.env.UNLEASH_EXPERIMENTAL_VARIANT_TYPE_NUMBER,
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
privateProjects: parseEnvVarBoolean(
|
privateProjects: parseEnvVarBoolean(
|
||||||
process.env.UNLEASH_EXPERIMENTAL_PRIVATE_PROJECTS,
|
process.env.UNLEASH_EXPERIMENTAL_PRIVATE_PROJECTS,
|
||||||
false,
|
false,
|
||||||
|
@ -37,7 +37,6 @@ process.nextTick(async () => {
|
|||||||
embedProxyFrontend: true,
|
embedProxyFrontend: true,
|
||||||
anonymiseEventLog: false,
|
anonymiseEventLog: false,
|
||||||
responseTimeWithAppNameKillSwitch: false,
|
responseTimeWithAppNameKillSwitch: false,
|
||||||
variantTypeNumber: true,
|
|
||||||
privateProjects: true,
|
privateProjects: true,
|
||||||
dependentFeatures: true,
|
dependentFeatures: true,
|
||||||
useLastSeenRefactor: true,
|
useLastSeenRefactor: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user