This commit is contained in:
@@ -395,9 +395,15 @@ namespace AyaNova.Biz
|
||||
|
||||
//add report pre-render, helpers and style
|
||||
//TODO: Add code to vet / evaluate these scripts and see if they are safe and contain valid methods expected
|
||||
if(string.IsNullOrWhiteSpace(report.JsPrerender)){
|
||||
report.JsPrerender="async function ayPrepareData(reportData){return reportData;}";
|
||||
}
|
||||
await page.AddScriptTagAsync(new AddTagOptions() { Content = report.JsPrerender });
|
||||
await page.AddScriptTagAsync(new AddTagOptions() { Content = report.JsHelpers });
|
||||
await page.AddStyleTagAsync(new AddTagOptions() { Content = report.Style });
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(report.JsHelpers))
|
||||
await page.AddScriptTagAsync(new AddTagOptions() { Content = report.JsHelpers });
|
||||
if (!string.IsNullOrWhiteSpace(report.Style))
|
||||
await page.AddStyleTagAsync(new AddTagOptions() { Content = report.Style });
|
||||
|
||||
|
||||
log.LogDebug($"Preparing page: adding Client meta data");
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"Name":"EXAMPLE WIKI helper","Active":true,"Notes":"","Roles":124927,"ObjectType":2,"Template":"<html>\n\n<body>\n\t{{#each ayReportData}}\n\t<h1>Object name:</h1> \n\t{{ Name }}\n\t<h1>Object WIKI:</h1>\n\t{{ ayWiki Wiki }}\n\t{{/each}}\n</body>\n\n</html>","Style":"","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\n","RenderType":0}
|
||||
Reference in New Issue
Block a user