LISTS WORKING cleanup afterwords

This commit is contained in:
2021-02-08 20:10:28 +00:00
parent 4a7f9f06ca
commit 658b345378
48 changed files with 50 additions and 2586 deletions

View File

@@ -15,49 +15,10 @@ namespace AyaNova.DataList
+ "left join auser uassby on (areview.assignedbyuserid=uassby.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
// //######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
// //Default ListView
// dynamic dlistView = new JArray();
// dynamic cm = null;
// cm = new JObject();
// cm.fld = "ReviewCompletedDate";
// cm.sort = "-";
// dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "ReviewDueDate";
// cm.sort = "+";
// dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "ReviewName";
// dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "Object";
// dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "AyaType";
// dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "ReviewNotes";
// dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "ReviewUserId";
// dlistView.Add(cm);
// DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
DefaultColumns = new List<string>() { "ReviewCompletedDate", "ReviewDueDate", "ReviewName", "Object", "AyaType", "ReviewNotes", "ReviewUserId" };
DefaultSortBy = new Dictionary<string, string>() { { "ReviewCompletedDate", "-" }, { "ReviewDueDate", "+" } };
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely
FieldDefinitions = new List<DataListFieldDefinition>();
FieldDefinitions.Add(new DataListFieldDefinition
@@ -202,51 +163,8 @@ namespace AyaNova.DataList
}
// string IAyaDataListServerCriteria.DataListServerCriteria(long currentUserId, AyaNova.Biz.AuthorizationRoles userRoles, DataListOptions dataListOptions)
// {
// bool HasSupervisorRole =
// userRoles.HasFlag(AuthorizationRoles.BizAdminFull) ||
// userRoles.HasFlag(AuthorizationRoles.DispatchFull) ||
// userRoles.HasFlag(AuthorizationRoles.InventoryFull) ||
// userRoles.HasFlag(AuthorizationRoles.SalesFull) ||
// userRoles.HasFlag(AuthorizationRoles.AccountingFull);
// if (!HasSupervisorRole)
// return "[{\"fld\":\"metareviewuser\",\"filter\":{\"items\":[{\"op\":\"=\",\"value\":" + currentUserId.ToString() + "}]}}]";
// return "[]";//this means effectively don't process this at all
// }
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
{
//TODO: support this clientcriteria
// if (vm.objectId && vm.objectId != 0 && vm.objectType) {
// //REMOVE COMMENT BLOCK AFTER TESTING
// // //pre-filter
// // vm.metaView = JSON.stringify([
// // {
// // fld: "metareviewobjectid",
// // filter: {
// // items: [{ op: "=", value: vm.objectId }]
// // }
// // },
// // {
// // fld: "AyaType",
// // filter: {
// // items: [{ op: "=", value: vm.objectType }]
// // }
// // }
// // ]);
// // vm.name = await window.$gz.api.fetchBizObjectName(
// // vm.objectType,
// // vm.objectId
// // );
// //OBJECTID,AYATYPE
// vm.clientCriteria = `${vm.objectId},${vm.objectType}`;
// }
List<DataListFilterOption> ret = new List<DataListFilterOption>();
bool HasSupervisorRole =
userRoles.HasFlag(AuthorizationRoles.BizAdminFull)