This commit is contained in:
2020-02-14 21:20:32 +00:00
parent 8c0bdb05de
commit 5acf0b8a80
11 changed files with 16 additions and 14 deletions

View File

@@ -5,6 +5,8 @@
## IMMEDIATE ITEMS ## IMMEDIATE ITEMS
TODO: BizRoles.cs seems to get hammered on every single request, is it efficient?
- Why is it not cached in some way?
TODO: HOw is it that I'm able to login and view widgets while the server is seeding? TODO: HOw is it that I'm able to login and view widgets while the server is seeding?
- shouldn't it be locked out for any non-ops actions? - shouldn't it be locked out for any non-ops actions?

View File

@@ -71,7 +71,7 @@ nav:
- 'Review': 'form-ay-review.md' - 'Review': 'form-ay-review.md'
- 'History': 'form-ay-history.md' - 'History': 'form-ay-history.md'
- 'Customize': 'form-ay-customize.md' - 'Customize': 'form-ay-customize.md'
- 'Sort & filter': 'form-ay-sort-filter.md' - 'Data list view': 'form-ay-data-list-view.md'
- 'Log': 'form-ay-log.md' - 'Log': 'form-ay-log.md'
- Customer: - Customer:
- 'Workorders': 'form-customer-workorders.md' - 'Workorders': 'form-customer-workorders.md'

View File

@@ -37,7 +37,7 @@ namespace AyaNova.Biz
case AyaType.FileAttachment: case AyaType.FileAttachment:
return await ct.FileAttachment.AnyAsync(m => m.Id == id); return await ct.FileAttachment.AnyAsync(m => m.Id == id);
case AyaType.DataListView: case AyaType.DataListView:
return await ct.DataListSortFilter.AnyAsync(m => m.Id == id); return await ct.DataListView.AnyAsync(m => m.Id == id);
case AyaType.FormCustom: case AyaType.FormCustom:
return await ct.FormCustom.AnyAsync(m => m.Id == id); return await ct.FormCustom.AnyAsync(m => m.Id == id);

View File

@@ -171,7 +171,7 @@ namespace AyaNova.Biz
//ONGOING VALIDATION TO CATCH MISMATCH WHEN NEW ROLES ADDED (wont' catch changes to existing unfortunately) //ONGOING VALIDATION TO CATCH MISMATCH WHEN NEW ROLES ADDED (wont' catch changes to existing unfortunately)
//var lastRoles = "{\"User\":{\"Change\":2,\"ReadFullRecord\":1},\"UserOptions\":{\"Change\":2,\"ReadFullRecord\":1},\"Widget\":{\"Change\":34,\"ReadFullRecord\":17},\"ServerState\":{\"Change\":16384,\"ReadFullRecord\":32767},\"License\":{\"Change\":16386,\"ReadFullRecord\":8193},\"LogFile\":{\"Change\":0,\"ReadFullRecord\":24576},\"JobOperations\":{\"Change\":16384,\"ReadFullRecord\":8195},\"AyaNova7Import\":{\"Change\":16384,\"ReadFullRecord\":0},\"Metrics\":{\"Change\":0,\"ReadFullRecord\":24576},\"Locale\":{\"Change\":16386,\"ReadFullRecord\":32767},\"DataListFilter\":{\"Change\":2,\"ReadFullRecord\":32767},\"FormCustom\":{\"Change\":2,\"ReadFullRecord\":32767}}"; //var lastRoles = "{\"User\":{\"Change\":2,\"ReadFullRecord\":1},\"UserOptions\":{\"Change\":2,\"ReadFullRecord\":1},\"Widget\":{\"Change\":34,\"ReadFullRecord\":17},\"ServerState\":{\"Change\":16384,\"ReadFullRecord\":32767},\"License\":{\"Change\":16386,\"ReadFullRecord\":8193},\"LogFile\":{\"Change\":0,\"ReadFullRecord\":24576},\"JobOperations\":{\"Change\":16384,\"ReadFullRecord\":8195},\"AyaNova7Import\":{\"Change\":16384,\"ReadFullRecord\":0},\"Metrics\":{\"Change\":0,\"ReadFullRecord\":24576},\"Locale\":{\"Change\":16386,\"ReadFullRecord\":32767},\"DataListFilter\":{\"Change\":2,\"ReadFullRecord\":32767},\"FormCustom\":{\"Change\":2,\"ReadFullRecord\":32767}}";
var lastRoles = "{\"User\":{\"Change\":2,\"ReadFullRecord\":1},\"UserOptions\":{\"Change\":2,\"ReadFullRecord\":1},\"Widget\":{\"Change\":34,\"ReadFullRecord\":17},\"ServerState\":{\"Change\":16384,\"ReadFullRecord\":131071},\"License\":{\"Change\":16386,\"ReadFullRecord\":8193},\"LogFile\":{\"Change\":0,\"ReadFullRecord\":24576},\"JobOperations\":{\"Change\":16384,\"ReadFullRecord\":8195},\"AyaNova7Import\":{\"Change\":16384,\"ReadFullRecord\":0},\"Metrics\":{\"Change\":0,\"ReadFullRecord\":24576},\"Locale\":{\"Change\":16386,\"ReadFullRecord\":131071},\"DataListSortFilter\":{\"Change\":2,\"ReadFullRecord\":131071},\"FormCustom\":{\"Change\":2,\"ReadFullRecord\":131071}}"; var lastRoles = "{\"User\":{\"Change\":2,\"ReadFullRecord\":1},\"UserOptions\":{\"Change\":2,\"ReadFullRecord\":1},\"Widget\":{\"Change\":34,\"ReadFullRecord\":17},\"ServerState\":{\"Change\":16384,\"ReadFullRecord\":131071},\"License\":{\"Change\":16386,\"ReadFullRecord\":8193},\"LogFile\":{\"Change\":0,\"ReadFullRecord\":24576},\"JobOperations\":{\"Change\":16384,\"ReadFullRecord\":8195},\"AyaNova7Import\":{\"Change\":16384,\"ReadFullRecord\":0},\"Metrics\":{\"Change\":0,\"ReadFullRecord\":24576},\"Locale\":{\"Change\":16386,\"ReadFullRecord\":131071},\"DataListView\":{\"Change\":2,\"ReadFullRecord\":131071},\"FormCustom\":{\"Change\":2,\"ReadFullRecord\":131071}}";
Dictionary<AyaType, BizRoleSet> lastRolesDeserialized = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<AyaType, BizRoleSet>>(lastRoles); Dictionary<AyaType, BizRoleSet> lastRolesDeserialized = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<AyaType, BizRoleSet>>(lastRoles);
if (lastRolesDeserialized.Count != roles.Count) if (lastRolesDeserialized.Count != roles.Count)
{ {

View File

@@ -40,7 +40,7 @@ namespace AyaNova.Biz
//EXISTS //EXISTS
internal async Task<bool> ExistsAsync(long id) internal async Task<bool> ExistsAsync(long id)
{ {
return await ct.DataListSortFilter.AnyAsync(e => e.Id == id); return await ct.DataListView.AnyAsync(e => e.Id == id);
} }
@@ -59,7 +59,7 @@ namespace AyaNova.Biz
outObj.UserId = UserId; outObj.UserId = UserId;
await ct.DataListSortFilter.AddAsync(outObj); await ct.DataListView.AddAsync(outObj);
await ct.SaveChangesAsync(); await ct.SaveChangesAsync();
//Handle child and associated items: //Handle child and associated items:
@@ -84,7 +84,7 @@ namespace AyaNova.Biz
internal async Task<DataListView> GetAsync(long fetchId, bool logTheGetEvent = true) internal async Task<DataListView> GetAsync(long fetchId, bool logTheGetEvent = true)
{ {
//This is simple so nothing more here, but often will be copying to a different output object or some other ops //This is simple so nothing more here, but often will be copying to a different output object or some other ops
var ret = await ct.DataListSortFilter.SingleOrDefaultAsync(m => m.Id == fetchId && (m.Public == true || m.UserId == UserId)); var ret = await ct.DataListView.SingleOrDefaultAsync(m => m.Id == fetchId && (m.Public == true || m.UserId == UserId));
if (logTheGetEvent && ret != null) if (logTheGetEvent && ret != null)
{ {
//Log //Log
@@ -102,7 +102,7 @@ namespace AyaNova.Biz
List<NameIdItem> items = new List<NameIdItem>(); List<NameIdItem> items = new List<NameIdItem>();
if (!string.IsNullOrWhiteSpace(listKey)) if (!string.IsNullOrWhiteSpace(listKey))
{ {
items = await ct.DataListSortFilter items = await ct.DataListView
.AsNoTracking() .AsNoTracking()
.Where(m => m.ListKey == listKey && (m.Public == true || m.UserId == UserId)) .Where(m => m.ListKey == listKey && (m.Public == true || m.UserId == UserId))
.OrderBy(m => m.Name) .OrderBy(m => m.Name)
@@ -164,7 +164,7 @@ namespace AyaNova.Biz
if (HasErrors) if (HasErrors)
return false; return false;
ct.DataListSortFilter.Remove(dbObj); ct.DataListView.Remove(dbObj);
await ct.SaveChangesAsync(); await ct.SaveChangesAsync();
//Delete sibling objects //Delete sibling objects
@@ -209,7 +209,7 @@ namespace AyaNova.Biz
if (!PropertyHasErrors("Name")) if (!PropertyHasErrors("Name"))
{ {
//Use Any command is efficient way to check existance, it doesn't return the record, just a true or false //Use Any command is efficient way to check existance, it doesn't return the record, just a true or false
if (await ct.DataListSortFilter.AnyAsync(m => m.Name == inObj.Name && m.Id != inObj.Id)) if (await ct.DataListView.AnyAsync(m => m.Name == inObj.Name && m.Id != inObj.Id))
{ {
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name"); AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
} }

View File

@@ -17,7 +17,7 @@ namespace AyaNova.Models
public virtual DbSet<OpsJobLog> OpsJobLog { get; set; } public virtual DbSet<OpsJobLog> OpsJobLog { get; set; }
public virtual DbSet<Locale> Locale { get; set; } public virtual DbSet<Locale> Locale { get; set; }
public virtual DbSet<LocaleItem> LocaleItem { get; set; } public virtual DbSet<LocaleItem> LocaleItem { get; set; }
public virtual DbSet<DataListView> DataListSortFilter { get; set; } public virtual DbSet<DataListView> DataListView { get; set; }
public virtual DbSet<Tag> Tag { get; set; } public virtual DbSet<Tag> Tag { get; set; }
public virtual DbSet<FormCustom> FormCustom { get; set; } public virtual DbSet<FormCustom> FormCustom { get; set; }

View File

@@ -1612,5 +1612,5 @@
"NotificationSettings": "Benachrichtigungseinstellungen", "NotificationSettings": "Benachrichtigungseinstellungen",
"Review": "Überprüfung", "Review": "Überprüfung",
"UserSettings": "Benutzereinstellungen", "UserSettings": "Benutzereinstellungen",
"DataListSortFilter": "Sortieren und Filtern" "DataListView": "Datenlistenansicht"
} }

View File

@@ -1611,7 +1611,7 @@
"NotificationSettings": "Notification settings", "NotificationSettings": "Notification settings",
"Review": "Review", "Review": "Review",
"UserSettings": "User settings", "UserSettings": "User settings",
"DataListSortFilter": "Sort & filter" "DataListView": "Data list view"

View File

@@ -1612,7 +1612,7 @@
"NotificationSettings": "Configuración de notificaciones", "NotificationSettings": "Configuración de notificaciones",
"Review": "Revisión", "Review": "Revisión",
"UserSettings": "Configuración de usuario", "UserSettings": "Configuración de usuario",
"DataListSortFilter": "Ordenar y filtrar" "DataListView": "Vista de lista de datos"
} }

View File

@@ -1611,7 +1611,7 @@
"NotificationSettings": "Paramètres de notification", "NotificationSettings": "Paramètres de notification",
"Review": "Évaluation", "Review": "Évaluation",
"UserSettings": "Paramètres utilisateur", "UserSettings": "Paramètres utilisateur",
"DataListSortFilter": "Trier et filtrer" "DataListView": "Affichage de la liste des données"
} }