From e6c7bd3a134110f931dd01a931bfaee37ef70006 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 14 Jan 2020 23:03:16 +0000 Subject: [PATCH] --- devdocs/todo.txt | 8 -------- server/AyaNova/biz/DataFilterBiz.cs | 24 ++++++------------------ 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 67c56e1f..248c4c78 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -21,14 +21,6 @@ REALLY MAKING MORE PROGRESS WHEN CLIENT DEV DRIVES BACKEND DEV, STICK TO THAT!! 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 - 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 diff --git a/server/AyaNova/biz/DataFilterBiz.cs b/server/AyaNova/biz/DataFilterBiz.cs index 9c2c518a..78ba785f 100644 --- a/server/AyaNova/biz/DataFilterBiz.cs +++ b/server/AyaNova/biz/DataFilterBiz.cs @@ -247,17 +247,15 @@ namespace AyaNova.Biz AddError(ApiErrorCode.VALIDATION_REQUIRED, "ListKey"); - List ListValidFilterOptions = null; + List FieldList = null; if (!ObjectFields.IsValidObjectKey(inObj.ListKey)) { AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "ListKey", $"ListKey \"{inObj.ListKey}\" is empty or in-valid"); } 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) @@ -281,20 +279,10 @@ namespace AyaNova.Biz AddError(ApiErrorCode.VALIDATION_REQUIRED, "Filter", $"Filter array item {i}, \"fld\" property is empty and required"); //validate the field name if we can - if (ListValidFilterOptions != null) + if (FieldList != null) { - // if (!ListValidFilterOptions.Flds.Exists(x => x.Fld == 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); + var TheField = FieldList.SingleOrDefault(x => x.PropertyName.ToLowerInvariant() == fld); 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"); //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"); }