This commit is contained in:
2018-12-04 00:36:32 +00:00
parent a5f32466ef
commit aaf21ce881
5 changed files with 23 additions and 19 deletions

4
.vscode/launch.json vendored
View File

@@ -31,8 +31,8 @@
}, },
"env": { "env": {
"ASPNETCORE_ENVIRONMENT": "Development", "ASPNETCORE_ENVIRONMENT": "Development",
//"AYANOVA_LOG_LEVEL": "Info", "AYANOVA_LOG_LEVEL": "Info",
"AYANOVA_LOG_LEVEL": "Debug", //"AYANOVA_LOG_LEVEL": "Debug",
"AYANOVA_DEFAULT_LANGUAGE": "en", "AYANOVA_DEFAULT_LANGUAGE": "en",
//LOCALE MUST BE en for Integration TESTING //LOCALE MUST BE en for Integration TESTING
//"AYANOVA_PERMANENTLY_ERASE_DATABASE": "true", //"AYANOVA_PERMANENTLY_ERASE_DATABASE": "true",

View File

@@ -98,7 +98,7 @@ namespace AyaNova
bool LOG_SENSITIVE_DATA = false; bool LOG_SENSITIVE_DATA = false;
#if (DEBUG) #if (DEBUG)
LOG_SENSITIVE_DATA = true; //LOG_SENSITIVE_DATA = true;
#endif #endif
@@ -434,7 +434,7 @@ namespace AyaNova
//to support html5 pushstate routing in spa //to support html5 pushstate routing in spa
//this ensures that a refresh at the client will not 404 but rather force back to the index.html app page and then handled internally by the client //this ensures that a refresh at the client will not 404 but rather force back to the index.html app page and then handled internally by the client
await next(); await next();
if (context.Request.Path.Value!= "/docs" && context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value)) if (context.Request.Path.Value != "/docs" && context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value))
{ {
context.Request.Path = "/index.html"; context.Request.Path = "/index.html";
context.Response.StatusCode = 200; context.Response.StatusCode = 200;

View File

@@ -8,10 +8,7 @@ namespace AyaNova.Biz
{ {
public static class FilterSqlCriteriaBuilder public static class FilterSqlCriteriaBuilder
{ {
//"SELECT *, xmin FROM AWIDGET name Like 'BoolDataFilterTest%' AND active = true AND "
public static string DataFilterToSQLCriteria(AyaNova.Models.DataFilter dataFilter, FilterOptions filterOptions) public static string DataFilterToSQLCriteria(AyaNova.Models.DataFilter dataFilter, FilterOptions filterOptions)
{ {
@@ -34,9 +31,13 @@ namespace AyaNova.Biz
var dataType = filterOptions.Flds.Find(x => x.Fld == fld).Type; var dataType = filterOptions.Flds.Find(x => x.Fld == fld).Type;
sb.Append(DataFilterToColumnCriteria(fld, dataType, opType, val)); sb.Append(DataFilterToColumnCriteria(fld, dataType, opType, val));
if (i < FilterArray.Count - 1)
{
sb.Append(" AND ");
}
} }
return sb.ToString(); return " where " + sb.ToString();
} }
/// <summary> /// <summary>
@@ -783,9 +784,6 @@ namespace AyaNova.Biz
#endregion #endregion
}//end of nonnull path }//end of nonnull path
//
//if(log.IsDebugEnabled)
// //case 1039 //log.Debug("GridToSqlCriteria: returning[" + sb.ToString() + "]");
return sb.ToString(); return sb.ToString();

View File

@@ -159,7 +159,7 @@ namespace AyaNova.Biz
//If no datafilter then it can just run this regular code which already works, I think? //If no datafilter then it can just run this regular code which already works, I think?
//no, order by is brokeh //no, order by is brokeh
pagingOptions.Offset = pagingOptions.Offset ?? PagingOptions.DefaultOffset; pagingOptions.Offset = pagingOptions.Offset ?? PagingOptions.DefaultOffset;
pagingOptions.Limit = pagingOptions.Limit ?? PagingOptions.DefaultLimit; pagingOptions.Limit = pagingOptions.Limit ?? PagingOptions.DefaultLimit;
@@ -174,11 +174,17 @@ namespace AyaNova.Biz
//base query //base query
var q = "SELECT *, xmin FROM AWIDGET "; var q = "SELECT *, xmin FROM AWIDGET ";
//BUILD WHERE AND APPEND IT //GET THE FILTER
q=q+FilterSqlCriteriaBuilder.DataFilterToSQLCriteria(theFilter,WidgetBiz.FilterOptions); if (pagingOptions.DataFilterId > 0)
{
var TheFilter = await ct.DataFilter.FirstOrDefaultAsync(x => x.Id == pagingOptions.DataFilterId);
//BUILD WHERE AND APPEND IT
q = q + FilterSqlCriteriaBuilder.DataFilterToSQLCriteria(TheFilter, WidgetBiz.FilterOptions());
}
//BUILD ORDER BY AND APPEND IT //BUILD ORDER BY AND APPEND IT
//TODO: Code a separate order by builder block
var items = await ct.Widget var items = await ct.Widget
.AsNoTracking() .AsNoTracking()

View File

@@ -150,10 +150,10 @@ namespace raven_integration
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
Util.ValidateHTTPStatusCode(a, 200); Util.ValidateHTTPStatusCode(a, 200);
//assert aAll contains exactly two records //assert contains at least two records
((JArray)a.ObjectResponse["data"]).Count.Should().Be(2); ((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(1);
//TODO: ensure the results match the appropriate matching widgetIDList made earlier //TODO: ensure the results match the appropriate matching widgetIDList made earlier