diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 52e27ee3..e43d5cdf 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -6,19 +6,14 @@ eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOiIxNTcxODU5OTU0IiwiZXhwIjoiMTU3MjQ ## IMMEDIATE ITEMS UnMock MOCK_WIDGET_DISPLAY_TEMPLATE_JSON into db with objects and with seeded data for test and or all lists - - One single object with all templates in JSON maybe? since there are not going to be multiple templates for same list object anyway - - Server can load it up and cache it like LT? - - Can it just make a default template if none is found? (no they are all required) - - Once both lists are working: + - Add controller for it with validation callable from DataListTemplate (Validate(string template) method) + - Add validation in DataListFetcher to ensure template is still valid (commented with TODO) -Rename DataFilter model / table etc to DataListFilter +Make up the USER datalists -Make up the user Object datalists +DataList object naming scheme, should it be prepended so they all align well and are easy to spot in the project or since they are exposed should it not? + - Cadillac problem? -DataList object naming scheme, should it be prepended to they all align well? - -AyaFormFieldDefinitions still has UI field datatype in it, but I don't think I'll need it so ponder this by looking at tests and client and make a decision - - Consider if there is some possible future use for this or YAGNI INTEGRATION TEST UPDATE Update tests when appropriate (when it's working fully and not mocked) diff --git a/server/AyaNova/DataList/DataListFetcher.cs b/server/AyaNova/DataList/DataListFetcher.cs index 4d8d187c..9fa459c8 100644 --- a/server/AyaNova/DataList/DataListFetcher.cs +++ b/server/AyaNova/DataList/DataListFetcher.cs @@ -31,8 +31,20 @@ namespace AyaNova.DataList throw new System.NotSupportedException("User roles insufficient for this datalist"); } - //TODO: FETCH DATALISTTEMPLATE HERE OR USE DEFAULT IF FAULTY OR NOT FOUND - var JSONDataListTemplate = DataList.DefaultDataListDisplayTemplate; + //FETCH DATALISTTEMPLATE HERE OR USE DEFAULT IF FAULTY OR NOT FOUND + + //start with default + string JSONDataListTemplate=DataList.DefaultDataListDisplayTemplate; + + var CustomDataListTemplate = await ct.DataListTemplate.FirstOrDefaultAsync(x => x.DataListKey == listOptions.DataListKey); + //Null is expected unless user has created a new one + if(CustomDataListTemplate!=null){ + //todo: validate the template first here need a new method to do that + //Assuming it's valid then use it + JSONDataListTemplate = CustomDataListTemplate.Template; + } + + //PARSE THE TEMPLATE INTO A STRING ARRAY //SO WE KNOW WHICH FIELDS TO RETURN FROM QUERY diff --git a/server/AyaNova/Startup.cs b/server/AyaNova/Startup.cs index 3671331e..58c11f3f 100644 --- a/server/AyaNova/Startup.cs +++ b/server/AyaNova/Startup.cs @@ -408,7 +408,7 @@ namespace AyaNova // ******************** TESTING WIPE DB ***************************** // //Set this to true to wipe the db and reinstall a trial license and re-seed the data - var TESTING_REFRESH_DB = true;//####################################################################################### + var TESTING_REFRESH_DB = false;//####################################################################################### #if (DEBUG) diff --git a/server/AyaNova/util/DbUtil.cs b/server/AyaNova/util/DbUtil.cs index 254bf80f..cbc07332 100644 --- a/server/AyaNova/util/DbUtil.cs +++ b/server/AyaNova/util/DbUtil.cs @@ -288,7 +288,8 @@ namespace AyaNova.Util EraseTable("afileattachment", conn); EraseTable("awidget", conn); EraseTable("aevent", conn); - EraseTable("adatafilter", conn); + EraseTable("adatalistfilter", conn); + EraseTable("adatalisttemplate", conn); EraseTable("aformcustom", conn); EraseTable("asearchkey", conn); EraseTable("asearchdictionary", conn);