1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01: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:
andreas-unleash 2023-11-23 11:12:56 +02:00 committed by GitHub
parent 1dafc85eaa
commit 937a605888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 20 deletions

View File

@ -145,6 +145,7 @@ const payloadOptions = [
{ key: 'string', label: 'string' },
{ key: 'json', label: 'json' },
{ key: 'csv', label: 'csv' },
{ key: 'number', label: 'number' },
];
const EMPTY_PAYLOAD = { type: 'string', value: '' };
@ -198,17 +199,6 @@ export const VariantForm = ({
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) => {
setErrors((errors) => ({ ...errors, [field]: undefined }));
};
@ -300,7 +290,7 @@ export const VariantForm = ({
if (payload.type === 'json') {
JSON.parse(payload.value);
}
if (variantTypeNumber && payload.type === 'number') {
if (payload.type === 'number') {
return !Number.isNaN(Number(payload.value));
}
return true;

View File

@ -61,7 +61,6 @@ export type UiFlags = {
customRootRolesKillSwitch?: boolean;
strategyVariant?: boolean;
doraMetrics?: boolean;
variantTypeNumber?: boolean;
privateProjects?: boolean;
dependentFeatures?: boolean;
banners?: boolean;

View File

@ -104,7 +104,6 @@ exports[`should create default config 1`] = `
"scheduledConfigurationChanges": false,
"strictSchemaValidation": false,
"useLastSeenRefactor": false,
"variantTypeNumber": false,
},
"externalResolver": {
"getVariant": [Function],

View File

@ -22,7 +22,6 @@ export type IFlagKey =
| 'advancedPlayground'
| 'filterInvalidClientMetrics'
| 'customRootRolesKillSwitch'
| 'variantTypeNumber'
| 'privateProjects'
| 'dependentFeatures'
| 'disableMetrics'
@ -111,10 +110,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_DEPENDENT_FEATURES,
false,
),
variantTypeNumber: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_VARIANT_TYPE_NUMBER,
false,
),
privateProjects: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_PRIVATE_PROJECTS,
false,

View File

@ -37,7 +37,6 @@ process.nextTick(async () => {
embedProxyFrontend: true,
anonymiseEventLog: false,
responseTimeWithAppNameKillSwitch: false,
variantTypeNumber: true,
privateProjects: true,
dependentFeatures: true,
useLastSeenRefactor: true,