You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that we don't handle well select options enums update. When a select is non nullable (in fieldMetadata), this leads to an issue where the defaultValue is not properly set.
Check that the Settings > Field Edit behavior is working with all use cases (remove, add, update options x remove, add defaultValue).
Also check that the health check is complaining about defaultValue NULL + isNullable false
Locate Field Metadata Handling: Check fieldMetadata handling in src/settings/FieldEdit.js.
Update Default Value Logic: Ensure default values are set correctly when isNullable is false. Modify the logic in src/settings/FieldEdit.js around line where defaultValue is assigned.
if(!fieldMetadata.isNullable&&!fieldMetadata.defaultValue){fieldMetadata.defaultValue=fieldMetadata.options[0];// or appropriate default}
Health Check: Verify health check logic in src/health/FieldHealthCheck.js to ensure it flags defaultValue as NULL when isNullable is false.
if(!fieldMetadata.isNullable&&fieldMetadata.defaultValue===null){// Add health check warning or error}
Test Cases: Add test cases for removing, adding, and updating options and default values in src/tests/FieldEdit.test.js.
test('should handle non-nullable select field default value',()=>{// Add test implementation});
Scope & Context
I have noticed that we don't handle well select options enums update. When a select is non nullable (in fieldMetadata), this leads to an issue where the defaultValue is not properly set.
Check that the Settings > Field Edit behavior is working with all use cases (remove, add, update options x remove, add defaultValue).
Also check that the health check is complaining about defaultValue NULL + isNullable false
@ijreilly FYI
The text was updated successfully, but these errors were encountered: