This commit is contained in:
2020-09-08 22:53:19 +00:00
parent d41046eba6
commit af9263649a
8 changed files with 63 additions and 18 deletions

View File

@@ -280,7 +280,7 @@ namespace AyaNova.Biz
{
//TODO: this is shitty, needs to mention notifications to be maximally useful
if (await ct.NotifySubscription.AnyAsync(z => z.AttachReportId == inObj.Id) == true)
if (await ct.NotifySubscription.AnyAsync(z => z.LinkToReportId == inObj.Id) == true)
{
AddError(ApiErrorCode.INVALID_OPERATION, null, "LT:ErrorDBForeignKeyViolation");
return;
@@ -396,18 +396,23 @@ namespace AyaNova.Biz
await page.AddScriptTagAsync(new AddTagOptions() { Content = report.JsHelpers });
await page.AddStyleTagAsync(new AddTagOptions() { Content = report.Style });
//add Client meta data
//Client meta data
var clientMeta = "{}";
if (reportParam.ClientMeta != null)
clientMeta = reportParam.ClientMeta.ToString();
//add Server meta data
//Server meta data
var serverMeta = $"{{ayApiUrl:`{apiUrl}`}}";
//add Report meta data
//Report meta data
var reportMeta = $"{{Id:{report.Id},Name:`{report.Name}`,Notes:`{report.Notes}`,ObjectType:`{report.ObjectType}`,DataListKey:`{reportParam.DataListKey}`,ListView:`{reportParam.ListView}`,SelectedRowIds: `{string.Join(",", reportParam.SelectedRowIds)}`}}";
//duplicate meta data in report page wide variable for use by our internal functions
await page.AddScriptTagAsync(new AddTagOptions() { Content = $"var AYMETA={{ ayReportMetaData:{reportMeta}, ayClientMetaData:{clientMeta}, ayServerMetaData:{serverMeta} }}" });
#if (DEBUG)
//view page contents
var pagecontent = await page.GetContentAsync();