From 4cacf19b652db685dfdf8c18f69d72c507dd8887 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 9 Jan 2019 20:30:47 +0000 Subject: [PATCH] --- devdocs/specs/core-customize-form-fields.txt | 14 ++++++------ server/AyaNova/models/AyContext.cs | 1 + server/AyaNova/models/FormCustom.cs | 23 ++++++++++++++++++++ server/AyaNova/util/AySchema.cs | 4 ++-- 4 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 server/AyaNova/models/FormCustom.cs diff --git a/devdocs/specs/core-customize-form-fields.txt b/devdocs/specs/core-customize-form-fields.txt index 915cf378..14a8a7a8 100644 --- a/devdocs/specs/core-customize-form-fields.txt +++ b/devdocs/specs/core-customize-form-fields.txt @@ -34,13 +34,13 @@ UI FEATURE - The ability to customize forms: ## TODO - - Need a FormCustom table and model to hold the user's form customization data - - Like DataFilter, holds a JSON fragment in one field and the form key in another field - - JSON FRAGMENT holds items that differ from stock, no "core" fields allowed - - FieldKey - - Hide - - Required - - Type (checkbox, date, date time, decimal, number, picklist, and text) + - #DONE# Need a FormCustom table and model to hold the user's form customization data + - Like DataFilter, holds a JSON fragment in one field and the form key in another field + - JSON FRAGMENT holds items that differ from stock, no "core" fields allowed + - FieldKey + - Hide + - Required + - Type (checkbox, date, date time, decimal, number, picklist(FUTURE), and text) - #DONE# Need a FormAvailableFields static collection class that contains the fields available to each form - This should be independent from any other class tied to a particular route or controller or db table as it could be some or none of all of those things diff --git a/server/AyaNova/models/AyContext.cs b/server/AyaNova/models/AyContext.cs index 6be43950..5c50ab1b 100644 --- a/server/AyaNova/models/AyContext.cs +++ b/server/AyaNova/models/AyContext.cs @@ -22,6 +22,7 @@ namespace AyaNova.Models public virtual DbSet LocaleItem { get; set; } public virtual DbSet DataFilter { get; set; } public virtual DbSet Tag { get; set; } + public virtual DbSet FormCustom { get; set; } //Note: had to add this constructor to work with the code in startup.cs that gets the connection string from the appsettings.json file //and commented out the above on configuring diff --git a/server/AyaNova/models/FormCustom.cs b/server/AyaNova/models/FormCustom.cs new file mode 100644 index 00000000..7f0d9868 --- /dev/null +++ b/server/AyaNova/models/FormCustom.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; + +using System.ComponentModel.DataAnnotations; + +namespace AyaNova.Models +{ + + public partial class FormCustom + { + public long Id { get; set; } + public uint ConcurrencyToken { get; set; } + + [Required] + public long OwnerId { get; set; } + + [Required, MaxLength(255)] + public string FormKey { get; set; }//max 255 characters ascii set + public string Template { get; set; }//JSON fragment of form customization template + + } +} diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 6354c7d0..8e133edf 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -22,8 +22,8 @@ namespace AyaNova.Util //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!! private const int DESIRED_SCHEMA_LEVEL = 10; - internal const long EXPECTED_COLUMN_COUNT = 98; - internal const long EXPECTED_INDEX_COUNT = 22; + internal const long EXPECTED_COLUMN_COUNT = 102; + internal const long EXPECTED_INDEX_COUNT = 24; //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!