This commit is contained in:
@@ -21,14 +21,6 @@ REALLY MAKING MORE PROGRESS WHEN CLIENT DEV DRIVES BACKEND DEV, STICK TO THAT!!
|
|||||||
|
|
||||||
GRID LISTS TODO NOW:
|
GRID LISTS TODO NOW:
|
||||||
|
|
||||||
- FormAvailableFields rename to ObjectFields
|
|
||||||
- It was previously used for only custom forms, but it also needs to exist for creating list templates
|
|
||||||
- Some list templates don't have exact corresponding biz object as they are compound or made up so need for all lists as well
|
|
||||||
- Need filterable property added so can control what can be filtered
|
|
||||||
- Need sortable property so can control what can be sorted
|
|
||||||
- This will now drive both form customization and list filters and possibly other shit in future
|
|
||||||
- Remove FilterOptions in list objects and use this instead
|
|
||||||
|
|
||||||
- Return JSON and internally work with JSON so the list can return dynamic object
|
- Return JSON and internally work with JSON so the list can return dynamic object
|
||||||
- https://devblogs.microsoft.com/dotnet/try-the-new-system-text-json-apis/
|
- https://devblogs.microsoft.com/dotnet/try-the-new-system-text-json-apis/
|
||||||
- https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#fast-built-in-json-support
|
- https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#fast-built-in-json-support
|
||||||
|
|||||||
@@ -247,17 +247,15 @@ namespace AyaNova.Biz
|
|||||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "ListKey");
|
AddError(ApiErrorCode.VALIDATION_REQUIRED, "ListKey");
|
||||||
|
|
||||||
|
|
||||||
List<ObjectField> ListValidFilterOptions = null;
|
List<ObjectField> FieldList = null;
|
||||||
if (!ObjectFields.IsValidObjectKey(inObj.ListKey))
|
if (!ObjectFields.IsValidObjectKey(inObj.ListKey))
|
||||||
{
|
{
|
||||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "ListKey", $"ListKey \"{inObj.ListKey}\" is empty or in-valid");
|
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "ListKey", $"ListKey \"{inObj.ListKey}\" is empty or in-valid");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ListValidFilterOptions = ObjectFields.ObjectFieldsList(inObj.ListKey);
|
FieldList = ObjectFields.ObjectFieldsList(inObj.ListKey);
|
||||||
}
|
}
|
||||||
// FilterOptions ListValidFilterOptions = FilterOptionsFromObjectKey.Get(inObj.ListKey);
|
|
||||||
// if (ListValidFilterOptions == null)
|
|
||||||
|
|
||||||
|
|
||||||
if (inObj.ListKey.Length > 255)
|
if (inObj.ListKey.Length > 255)
|
||||||
@@ -281,20 +279,10 @@ namespace AyaNova.Biz
|
|||||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Filter", $"Filter array item {i}, \"fld\" property is empty and required");
|
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Filter", $"Filter array item {i}, \"fld\" property is empty and required");
|
||||||
|
|
||||||
//validate the field name if we can
|
//validate the field name if we can
|
||||||
if (ListValidFilterOptions != null)
|
if (FieldList != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
// if (!ListValidFilterOptions.Flds.Exists(x => x.Fld == fld))
|
var TheField = FieldList.SingleOrDefault(x => x.PropertyName.ToLowerInvariant() == fld);
|
||||||
// {
|
|
||||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Filter", $"Filter array item {i}, fld property value \"{fld}\" is not a valid value for ListKey specified");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (!ListValidFilterOptions.Exists(x => x.PropertyName.ToLowerInvariant() == fld && x.Filterable))
|
|
||||||
// {
|
|
||||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Filter", $"Filter array item {i}, fld property value \"{fld}\" is not a valid value for ListKey specified");
|
|
||||||
// }
|
|
||||||
|
|
||||||
var TheField = ListValidFilterOptions.SingleOrDefault(x => x.PropertyName.ToLowerInvariant() == fld);
|
|
||||||
|
|
||||||
if (TheField == null)
|
if (TheField == null)
|
||||||
{
|
{
|
||||||
@@ -360,10 +348,10 @@ namespace AyaNova.Biz
|
|||||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Sort", $"Sort array item {i}, \"fld\" property is empty and required");
|
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Sort", $"Sort array item {i}, \"fld\" property is empty and required");
|
||||||
|
|
||||||
//validate the field name if we can
|
//validate the field name if we can
|
||||||
if (ListValidFilterOptions != null)
|
if (FieldList != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!ListValidFilterOptions.Exists(x => x.PropertyName.ToLowerInvariant() == fld && x.Filterable))
|
if (!FieldList.Exists(x => x.PropertyName.ToLowerInvariant() == fld && x.Filterable))
|
||||||
{
|
{
|
||||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Sort", $"Sort array item {i}, fld property value \"{fld}\" is not a valid value for ListKey specified");
|
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Sort", $"Sort array item {i}, fld property value \"{fld}\" is not a valid value for ListKey specified");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user