mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +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:
		
							parent
							
								
									1dafc85eaa
								
							
						
					
					
						commit
						937a605888
					
				@ -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;
 | 
			
		||||
 | 
			
		||||
@ -61,7 +61,6 @@ export type UiFlags = {
 | 
			
		||||
    customRootRolesKillSwitch?: boolean;
 | 
			
		||||
    strategyVariant?: boolean;
 | 
			
		||||
    doraMetrics?: boolean;
 | 
			
		||||
    variantTypeNumber?: boolean;
 | 
			
		||||
    privateProjects?: boolean;
 | 
			
		||||
    dependentFeatures?: boolean;
 | 
			
		||||
    banners?: boolean;
 | 
			
		||||
 | 
			
		||||
@ -104,7 +104,6 @@ exports[`should create default config 1`] = `
 | 
			
		||||
      "scheduledConfigurationChanges": false,
 | 
			
		||||
      "strictSchemaValidation": false,
 | 
			
		||||
      "useLastSeenRefactor": false,
 | 
			
		||||
      "variantTypeNumber": false,
 | 
			
		||||
    },
 | 
			
		||||
    "externalResolver": {
 | 
			
		||||
      "getVariant": [Function],
 | 
			
		||||
 | 
			
		||||
@ -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,
 | 
			
		||||
 | 
			
		||||
@ -37,7 +37,6 @@ process.nextTick(async () => {
 | 
			
		||||
                        embedProxyFrontend: true,
 | 
			
		||||
                        anonymiseEventLog: false,
 | 
			
		||||
                        responseTimeWithAppNameKillSwitch: false,
 | 
			
		||||
                        variantTypeNumber: true,
 | 
			
		||||
                        privateProjects: true,
 | 
			
		||||
                        dependentFeatures: true,
 | 
			
		||||
                        useLastSeenRefactor: true,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user