This commit is contained in:
2020-01-14 23:03:16 +00:00
parent 596a9adeb9
commit e6c7bd3a13
2 changed files with 6 additions and 26 deletions

View File

@@ -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

View File

@@ -247,17 +247,15 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_REQUIRED, "ListKey");
List<ObjectField> ListValidFilterOptions = null;
List<ObjectField> 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");
}