From f1128e722e0c440748be23b140a54d8f7030fec5 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 28 Nov 2019 23:30:25 +0000 Subject: [PATCH] --- devdocs/todo.txt | 2 ++ server/AyaNova/biz/FormAvailableFields.cs | 7 +++++-- server/AyaNova/biz/WidgetBiz.cs | 4 ---- server/AyaNova/models/Widget.cs | 2 +- server/AyaNova/util/AySchema.cs | 5 ++++- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/devdocs/todo.txt b/devdocs/todo.txt index b051a279..6bf566c6 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -26,6 +26,8 @@ DO CLIENT STUFF NOW COME BACK TO THIS STUFF LATER TODO: 2019-06-07 10:47:57.8894|WARN|Microsoft.AspNetCore.Cors.Infrastructure.CorsService|The CORS protocol does not allow specifying a wildcard (any) origin and credentials at the same time. Configure the policy by listing individual origins if credentials needs to be supported. 2 + + TODO: DO I NOT HAVE AN ERASE DB ROUTE? - wouldn't that make the below possible?? TODO: NEEDS A THINK, SOME CHANGES REQUIRE DB ERASURE BEFORE STARTUP diff --git a/server/AyaNova/biz/FormAvailableFields.cs b/server/AyaNova/biz/FormAvailableFields.cs index b0b773cf..7989b09e 100644 --- a/server/AyaNova/biz/FormAvailableFields.cs +++ b/server/AyaNova/biz/FormAvailableFields.cs @@ -27,13 +27,16 @@ namespace AyaNova.Biz public static List FormFields(string key) { - +/* +***************************** WARNING: Be careful here, if a standard field is hideable and also it's DB SCHEMA is set to NON NULLABLE then the CLIENT end needs to set a default +***************************** Otherwise the hidden field can't be set and the object can't be saved EVER +*/ List l = new List(); switch (key) { case WIDGET_FORM_KEY: l.Add(new FormField("WidgetName", "Name", false, false));//is not shared localized text key and not hideable as it is in the validation rules for widget - l.Add(new FormField("WidgetSerial", "Serial"));//not in validation rules...you get the idea + l.Add(new FormField("WidgetSerial", "Serial"));//not in validation rules BUT, is HIDEABLE and is set to NOT NULLABLE in the schema so this field MUST MUST have a default value in client l.Add(new FormField("WidgetDollarAmount", "DollarAmount")); l.Add(new FormField("WidgetCount", "Count")); l.Add(new FormField("WidgetRoles", "Roles")); diff --git a/server/AyaNova/biz/WidgetBiz.cs b/server/AyaNova/biz/WidgetBiz.cs index 22b7387f..0ea40ab4 100644 --- a/server/AyaNova/biz/WidgetBiz.cs +++ b/server/AyaNova/biz/WidgetBiz.cs @@ -6,11 +6,7 @@ using Microsoft.AspNetCore.JsonPatch; using EnumsNET; using AyaNova.Util; using AyaNova.Api.ControllerHelpers; -using AyaNova.Biz; using AyaNova.Models; -using System.Collections.Generic; - -using Microsoft.Extensions.Logging; namespace AyaNova.Biz { diff --git a/server/AyaNova/models/Widget.cs b/server/AyaNova/models/Widget.cs index 191fbef3..e6141b15 100644 --- a/server/AyaNova/models/Widget.cs +++ b/server/AyaNova/models/Widget.cs @@ -28,7 +28,7 @@ namespace AyaNova.Models public Widget() { - Tags = new List(); + Tags = new List(); } } diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 89417b45..59c34ade 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -41,6 +41,9 @@ namespace AyaNova.Util Other indexes should be created with care and after a huge load and integration test periodically look for unused indexes and see how they are performing see core-performance.txt for the relevant queries to view this info + ***************************** WARNING: Be careful here, if a standard field is hideable and also it's DB SCHEMA is set to NON NULLABLE then the CLIENT end needs to set a default + ***************************** Otherwise the hidden field can't be set and the object can't be saved EVER + */ static int startingSchema = -1; @@ -255,7 +258,7 @@ namespace AyaNova.Util setSchemaLevel(++currentSchema); } - + ////////////////////////////////////////////////// //DATAFILTER table if (currentSchema < 7)