This commit is contained in:
@@ -33,11 +33,14 @@ Upon user selecting a filter to use the list query string has the regular paging
|
|||||||
- If list not found then it will return a 404 instead of the list
|
- If list not found then it will return a 404 instead of the list
|
||||||
- server loads the filter, generates the sql based on the stored filter, adds the sort by and offset / page, runs the query and then returns the data as json collection to the client
|
- server loads the filter, generates the sql based on the stored filter, adds the sort by and offset / page, runs the query and then returns the data as json collection to the client
|
||||||
|
|
||||||
|
NOTE: determined it would be too much trouble for too little gain to validate that the fields specified in the filter actually exist for that object
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LIST FILTERING TODO
|
LIST FILTERING TODO
|
||||||
- DONE test for fetching widget filter options (localized, so have two users test each for expected response)
|
- DONE test for fetching widget filter options (localized, so have two users test each for expected response)
|
||||||
|
Need way to check if fields are valid for the object list in question both from the list Datafilter route and future SQL builder
|
||||||
|
|
||||||
Add test for excercising all of DataFilterController route including rights to non personal alternative owner etc
|
Add test for excercising all of DataFilterController route including rights to non personal alternative owner etc
|
||||||
Add test for correctly validated Widget datafilter when saved or updated via datafiltercontroller (sanity check of the filter settings and options IFilterableObject implemented)
|
Add test for correctly validated Widget datafilter when saved or updated via datafiltercontroller (sanity check of the filter settings and options IFilterableObject implemented)
|
||||||
|
|
||||||
|
|||||||
@@ -261,8 +261,12 @@ namespace AyaNova.Biz
|
|||||||
var filterItem = v[i];
|
var filterItem = v[i];
|
||||||
if (filterItem["fld"] == null)
|
if (filterItem["fld"] == null)
|
||||||
AddError(ValidationErrorType.RequiredPropertyEmpty, "Filter", $"Filter array item {i}, object is missing required \"fld\" property ");
|
AddError(ValidationErrorType.RequiredPropertyEmpty, "Filter", $"Filter array item {i}, object is missing required \"fld\" property ");
|
||||||
else{
|
else
|
||||||
//todo: find the filteroptions object adn confirm this is a valid value for fld
|
{
|
||||||
|
var fld = filterItem["fld"].Value<string>();
|
||||||
|
if (string.IsNullOrWhiteSpace(fld))
|
||||||
|
AddError(ValidationErrorType.RequiredPropertyEmpty, "Filter", $"Filter array item {i}, \"fld\" property is empty and required");
|
||||||
|
|
||||||
}
|
}
|
||||||
if (filterItem["op"] == null)
|
if (filterItem["op"] == null)
|
||||||
AddError(ValidationErrorType.RequiredPropertyEmpty, "Filter", $"Filter array item {i}, object is missing required \"op\" property ");
|
AddError(ValidationErrorType.RequiredPropertyEmpty, "Filter", $"Filter array item {i}, object is missing required \"op\" property ");
|
||||||
@@ -270,10 +274,11 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
var opType = filterItem["op"].Value<string>();
|
var opType = filterItem["op"].Value<string>();
|
||||||
if (!FilterComparisonOperator.Operators.Contains(opType))
|
if (!FilterComparisonOperator.Operators.Contains(opType))
|
||||||
AddError(ValidationErrorType.InvalidValue, "Filter", $"Filter array item {i}, \"op\" value of \"{opType}\" is not a valid FilterComparisonOperator type");
|
AddError(ValidationErrorType.InvalidValue, "Filter", $"Filter array item {i}, \"op\" property value of \"{opType}\" is not a valid FilterComparisonOperator type");
|
||||||
}
|
}
|
||||||
if (filterItem["value"] == null)
|
if (filterItem["value"] == null)
|
||||||
AddError(ValidationErrorType.RequiredPropertyEmpty, "Filter", $"Filter array item {i}, object is missing required \"value\" property ");
|
AddError(ValidationErrorType.RequiredPropertyEmpty, "Filter", $"Filter array item {i}, object is missing required \"value\" property ");
|
||||||
|
//NOTE: value of nothing, null or empty is a valid value so no checking for it here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Newtonsoft.Json.JsonReaderException ex)
|
catch (Newtonsoft.Json.JsonReaderException ex)
|
||||||
|
|||||||
@@ -16,11 +16,6 @@ namespace AyaNova.Biz
|
|||||||
//FILTEROPTIONS COLLECTION
|
//FILTEROPTIONS COLLECTION
|
||||||
FilterOptions FilterOptions { get; }
|
FilterOptions FilterOptions { get; }
|
||||||
|
|
||||||
List<FilterField> FilterFields {get;}
|
|
||||||
|
|
||||||
//VALIDATE FILTER?
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,6 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<FilterField> FilterFields(){
|
|
||||||
List<FilterField> fields=new List<FilterField>();
|
|
||||||
fields.Add(new FilterField())
|
|
||||||
}
|
|
||||||
|
|
||||||
internal WidgetBiz(AyContext dbcontext, long currentUserId, long userLocaleId, AuthorizationRoles UserRoles)
|
internal WidgetBiz(AyContext dbcontext, long currentUserId, long userLocaleId, AuthorizationRoles UserRoles)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user