This commit is contained in:
2021-02-01 18:40:11 +00:00
parent 205ac4d54d
commit fa40aef432
2 changed files with 15 additions and 9 deletions

View File

@@ -17,18 +17,18 @@ namespace AyaNova.DataList
// Get the data list data requested
//
//
internal static async Task<DataListReturnData> GetResponseAsync(AyContext ct, DataListTableProcessingOptions dataListTableProcessingOptions,IDataListProcessing DataList, AuthorizationRoles userRoles, ILogger log, long userId)
internal static async Task<DataListReturnData> GetResponseAsync(AyContext ct, DataListTableProcessingOptions dataListTableProcessingOptions, IDataListProcessing DataList, AuthorizationRoles userRoles, ILogger log, long userId)
{
// var DataList = DataListFactory.GetAyaDataList(dataListTableRequest.DataListKey);
// var DataList = DataListFactory.GetAyaDataList(dataListTableRequest.DataListKey);
//was the name not found as a list?
// if (DataList == null)
// throw new System.ArgumentOutOfRangeException($"DataList \"{dataListTableRequest.DataListKey}\" specified does not exist");
//turn the DataListTableRequest into a DataListTableProcesingOptions object here
//turn the DataListTableRequest into a DataListTableProcesingOptions object here
//hydrates filter and column selections etc
// = new DataListTableProcessingOptions(dataListTableRequest, DataList, ct);
// = new DataListTableProcessingOptions(dataListTableRequest, DataList, ct);
//#### TODO: below block into above method to clean it up and centralize it
@@ -44,7 +44,7 @@ namespace AyaNova.DataList
//Get the combination of all unique fields from both StaticServerFilterOptions and listOptions
//NOTE: this assumes no list options filter colums that don't exist in listoptions.columns
// var AllUniqueFieldKeysRequiredForQuery = dataListTableOptions.Columns.Union(StaticServerFilterOptions.Select(z => z.Column).ToList()).ToList();
// var AllUniqueFieldKeysRequiredForQuery = dataListTableOptions.Columns.Union(StaticServerFilterOptions.Select(z => z.Column).ToList()).ToList();
// //Add the internal filters into the listoptions existing filters
// //NOTE: There is currently no overlap between internal filtered columns and filters coming from the client
@@ -228,7 +228,7 @@ namespace AyaNova.DataList
//BUILD THE COLUMNS RETURN PROPERTY JSON FRAGMENT
Newtonsoft.Json.Linq.JArray ColumnsJSON = null;
ColumnsJSON = DataList.GenerateReturnListColumns(dataListTableProcessingOptions.Columns);
return new DataListReturnData(rows, totalRecordCount, ColumnsJSON);
return new DataListReturnData(rows, totalRecordCount, ColumnsJSON, dataListTableProcessingOptions.SortBy, dataListTableProcessingOptions.Filter);
}
@@ -236,7 +236,7 @@ namespace AyaNova.DataList
// Get a list of id's of the datalist results for reporting
//
//
internal static async Task<long[]> GetIdListResponseAsync(AyContext ct, DataListSelectedProcessingOptions dataListSelectionOptions,IDataListProcessing DataList, AuthorizationRoles userRoles, ILogger log, long userId)
internal static async Task<long[]> GetIdListResponseAsync(AyContext ct, DataListSelectedProcessingOptions dataListSelectionOptions, IDataListProcessing DataList, AuthorizationRoles userRoles, ILogger log, long userId)
{
// // var DataList = DataListFactory.GetAyaDataList(dataListSelectionOptions.DataListKey);
// // //was the name not found as a list?

View File

@@ -1,3 +1,5 @@
using System.Collections.Generic;
using AyaNova.Models;
namespace AyaNova.DataList
{
@@ -6,13 +8,17 @@ namespace AyaNova.DataList
public object Data { get; }
public long TotalRecordCount { get; }
public object Columns {get;}
public object Columns { get; }
public Dictionary<string, string> SortBy { get; set; }
public List<DataListFilterOption> Filter { get; set; }
public DataListReturnData(object returnItems, long totalRecordCount, Newtonsoft.Json.Linq.JArray columns)
public DataListReturnData(object returnItems, long totalRecordCount, Newtonsoft.Json.Linq.JArray columns, Dictionary<string, string> sortBy, List<DataListFilterOption> filter)
{
Data = returnItems;
TotalRecordCount = totalRecordCount;
Columns = columns;
SortBy = sortBy;
Filter = filter;
}
}//eoc