Use data type configuration to determine default value for empty toggle and slider property values (#17854)

* Use data type configuration to determine default value for empty toggle property values.

* Added/updated unit tests.

* Fixed failing integration tests.

* Applied similar default value display for the slider property editor and aligned implementation of true/false with this.

* Fixed unit tests.

* Removed "duplicate" JsonPropertyName attributes and added a custom TypeInfoResolver for data type configuration so we can re-use the existing ConfigurationField attributes.

* Minor cleanup

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
This commit is contained in:
Andy Butland
2025-01-08 11:42:13 +01:00
committed by GitHub
parent b7f424756c
commit 413398afc6
9 changed files with 192 additions and 41 deletions

View File

@@ -137,7 +137,7 @@ public class DataTypeBuilder
var sortOrder = _sortOrder ?? 0;
var serializer = new SystemTextConfigurationEditorJsonSerializer();
return new DataType(editor, serializer, parentId)
var dataType = new DataType(editor, serializer, parentId)
{
Id = id,
Key = key,
@@ -152,5 +152,7 @@ public class DataTypeBuilder
DatabaseType = databaseType,
SortOrder = sortOrder
};
return dataType;
}
}