This commit is contained in:
@@ -36,6 +36,8 @@ UI FEATURE - The ability to customize forms:
|
|||||||
- According to the docs https://www.postgresql.org/docs/9.1/datatype-character.html this is pretty efficient
|
- According to the docs https://www.postgresql.org/docs/9.1/datatype-character.html this is pretty efficient
|
||||||
- I don't like the idea of an outside table holding all custom values, it would be hammered pretty hard, this way the data stays with it's record
|
- I don't like the idea of an outside table holding all custom values, it would be hammered pretty hard, this way the data stays with it's record
|
||||||
- The server doesn't validate it or anything, just stores what the client provides and retrieves what the client needs and the client co-erces the value to the correct type
|
- The server doesn't validate it or anything, just stores what the client provides and retrieves what the client needs and the client co-erces the value to the correct type
|
||||||
|
- If a user changes the underlying objects type then the client must handle discrepencies and attempt to fix it.
|
||||||
|
- So the client end must handle adapting the value if the type changes
|
||||||
|
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ namespace AyaNova.Api.Controllers
|
|||||||
/// Any
|
/// Any
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="formkey"></param>
|
/// <param name="formkey">The official form key used by AyaNova</param>
|
||||||
/// <param name="concurrencyToken"></param>
|
/// <param name="concurrencyToken">A prior concurrency token used to check if there are any changes without using up bandwidth sending unnecessary data</param>
|
||||||
/// <returns>A single FormCustom</returns>
|
/// <returns>A single FormCustom</returns>
|
||||||
[HttpGet("{formkey}")]
|
[HttpGet("{formkey}")]
|
||||||
public async Task<IActionResult> GetFormCustom([FromRoute] string formkey, [FromQuery] uint? concurrencyToken)
|
public async Task<IActionResult> GetFormCustom([FromRoute] string formkey, [FromQuery] uint? concurrencyToken)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace AyaNova.Biz
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
List<string> l = new List<string>{
|
List<string> l = new List<string>{
|
||||||
WIDGET_FORM_KEY//,USER_CRUD, WIDGET etc
|
WIDGET_FORM_KEY, USER_FORM_KEY
|
||||||
};
|
};
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,25 @@ namespace AyaNova.Util
|
|||||||
ct.SaveChanges();
|
ct.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//WIDGET sample form customization
|
||||||
|
{
|
||||||
|
var ct = ServiceProviderProvider.DBContext;
|
||||||
|
var fc = new FormCustom()
|
||||||
|
{
|
||||||
|
FormKey = "widget",
|
||||||
|
Template = "{template:[{fld:\"WidgetNotes\",required:\"true\"}" +
|
||||||
|
",{fld:\"WidgetCustom1\",hide:\"false\",required:\"false\", type:\"date\"}" +
|
||||||
|
",{fld:\"WidgetCustom2\",hide:\"false\",required:\"true\", type:\"text\"}" +
|
||||||
|
",{fld:\"WidgetCustom3\",hide:\"false\",required:\"false\", type:\"int\"}" +
|
||||||
|
",{fld:\"WidgetCustom4\",hide:\"false\",required:\"false\", type:\"bool\"}" +
|
||||||
|
",{fld:\"WidgetCustom5\",hide:\"false\",required:\"false\", type:\"decimal\"}" +
|
||||||
|
"]"
|
||||||
|
};
|
||||||
|
|
||||||
|
ct.FormCustom.Add(fc);
|
||||||
|
ct.SaveChanges();
|
||||||
|
}
|
||||||
|
|
||||||
//Seed special test data for integration testing
|
//Seed special test data for integration testing
|
||||||
//log.LogInformation("Seeding known users");
|
//log.LogInformation("Seeding known users");
|
||||||
@@ -462,6 +481,7 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (int x = 0; x < count; x++)
|
for (int x = 0; x < count; x++)
|
||||||
{
|
{
|
||||||
Widget o = new Widget();
|
Widget o = new Widget();
|
||||||
@@ -475,6 +495,21 @@ namespace AyaNova.Util
|
|||||||
o.Roles = randomRole;
|
o.Roles = randomRole;
|
||||||
o.Notes = f.Lorem.Paragraph();
|
o.Notes = f.Lorem.Paragraph();
|
||||||
o.Tags = RandomTags(f);
|
o.Tags = RandomTags(f);
|
||||||
|
|
||||||
|
|
||||||
|
//RANDOM CUSTOM FIELD DATA
|
||||||
|
var custDate=GetSomeDateHereThatIsThenMadeIntoText;
|
||||||
|
|
||||||
|
// Template = "{template:[{fld:\"WidgetNotes\",required:\"true\"}" +
|
||||||
|
// ",{fld:\"WidgetCustom1\",hide:\"false\",required:\"false\", type:\"date\"}" +
|
||||||
|
// ",{fld:\"WidgetCustom2\",hide:\"false\",required:\"true\", type:\"text\"}" +
|
||||||
|
// ",{fld:\"WidgetCustom3\",hide:\"false\",required:\"false\", type:\"int\"}" +
|
||||||
|
// ",{fld:\"WidgetCustom4\",hide:\"false\",required:\"false\", type:\"bool\"}" +
|
||||||
|
// ",{fld:\"WidgetCustom5\",hide:\"false\",required:\"false\", type:\"decimal\"}" +
|
||||||
|
// "]"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var NewObject = Biz.Create(ServiceProviderProvider.DBContext, o);
|
var NewObject = Biz.Create(ServiceProviderProvider.DBContext, o);
|
||||||
if (NewObject == null)
|
if (NewObject == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user