twenty
twenty copied to clipboard
Finish Implementing Select/MultiSelect #3166
refactor: improve generateEmptyFieldValue function
- Optimize handling of MultiSelect and Select cases
- Provide a default value for Select based on FieldSelectValue
- Enhance code readability and maintainability
CLA
Hello there and welcome to our project! By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement. Although we don't have a dedicated legal counsel, having this kind of agreement can protect us from potential legal issues or patent trolls. Thank you for your understanding.
Generated by :no_entry_sign: dangerJS against 055d25194732b91baad3dbd38e3b1b843e2f9e96
hello @lucasbordeau , I am new to open source and I am still understanding the code base. Can you please help me to understand the issue more clearly?
Also, could you please add a first jest test on this function? And update the PR title :)
I cannot understand the issue properly can you please guide me?
case FieldMetadataType.MultiSelect: {
// Handle MultiSelect-specific logic
if (!backendSupportsMultiSelect) {
throw new Error('MultiSelect not implemented on the backend yet');
}
// Additional MultiSelect handling
break;
}
case FieldMetadataType.Select: {
// Handle Select-specific logic
const defaultSelectValue = {
color: 'DEFAULT_COLOR', // Replace with the actual default color
label: '',
__typename: 'FieldSelectValue',
};
return defaultSelectValue;
}
default: {
throw new Error('Unhandled FieldMetadataType');
}
Is this code completing your requirements? I have separated them from the default case.
@GARY121github It looks good but it's not what I see in your PR
@GARY121github It looks good but it's not what I see in your PR
I have updated the code according to your explanation should I create a new PR
Here is what I see:
@charlesBochet I have sent new PR can you please review and merge it