This commit is contained in:
2022-12-22 21:37:57 +00:00
parent 24a8a5e20c
commit 50390ee8b3
2 changed files with 4 additions and 19 deletions

View File

@@ -49,7 +49,6 @@ namespace Sockeye.Biz
else else
{ {
newObject.Tags = TagBiz.NormalizeTags(newObject.Tags); newObject.Tags = TagBiz.NormalizeTags(newObject.Tags);
newObject.CustomFields = JsonUtil.CompactJson(newObject.CustomFields);
await ct.TrialLicenseRequest.AddAsync(newObject); await ct.TrialLicenseRequest.AddAsync(newObject);
await ct.SaveChangesAsync(); await ct.SaveChangesAsync();
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, BizType, SockEvent.Created), ct); await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, BizType, SockEvent.Created), ct);
@@ -91,7 +90,6 @@ namespace Sockeye.Biz
} }
putObject.Tags = TagBiz.NormalizeTags(putObject.Tags); putObject.Tags = TagBiz.NormalizeTags(putObject.Tags);
putObject.CustomFields = JsonUtil.CompactJson(putObject.CustomFields);
await ValidateAsync(putObject, dbObject); await ValidateAsync(putObject, dbObject);
if (HasErrors) return null; if (HasErrors) return null;
ct.Replace(dbObject, putObject); ct.Replace(dbObject, putObject);
@@ -198,9 +196,7 @@ namespace Sockeye.Biz
.AddText(obj.EmailConfirmCode) .AddText(obj.EmailConfirmCode)
.AddText(obj.RejectReason) .AddText(obj.RejectReason)
.AddText(obj.Key) .AddText(obj.Key)
.AddText(obj.Wiki) .AddText(obj.Tags);
.AddText(obj.Tags)
.AddCustomFields(obj.CustomFields);
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
@@ -222,8 +218,6 @@ namespace Sockeye.Biz
//validate users choices for required non custom fields //validate users choices for required non custom fields
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj); RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);
//validate custom fields
CustomFieldsValidator.Validate(this, FormCustomization, proposedObj.CustomFields);
} }
} }
@@ -264,7 +258,6 @@ namespace Sockeye.Biz
foreach (TrialLicenseRequest w in orderedList) foreach (TrialLicenseRequest w in orderedList)
{ {
if (!ReportRenderManager.KeepGoing(jobId)) return null; if (!ReportRenderManager.KeepGoing(jobId)) return null;
await PopulateVizFields(w);
var jo = JObject.FromObject(w); var jo = JObject.FromObject(w);
if (!JsonUtil.JTokenIsNullOrEmpty(jo["CustomFields"])) if (!JsonUtil.JTokenIsNullOrEmpty(jo["CustomFields"]))
jo["CustomFields"] = JObject.Parse((string)jo["CustomFields"]); jo["CustomFields"] = JObject.Parse((string)jo["CustomFields"]);
@@ -278,15 +271,6 @@ namespace Sockeye.Biz
private VizCache vc = new VizCache(); private VizCache vc = new VizCache();
//populate viz fields from provided object
private async Task PopulateVizFields(TrialLicenseRequest o)
{
if (!vc.Has("customer", o.CustomerId))
{
vc.Add(await ct.Customer.AsNoTracking().Where(x => x.Id == o.CustomerId).Select(x => x.Name).FirstOrDefaultAsync(), "customer", o.CustomerId);
}
o.CustomerViz = vc.Get("customer", o.CustomerId);
}
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -62,6 +62,7 @@ namespace Sockeye.Models
public virtual DbSet<Purchase> Purchase { get; set; } public virtual DbSet<Purchase> Purchase { get; set; }
public virtual DbSet<TrialLicenseRequest> TrialLicenseRequest { get; set; } public virtual DbSet<TrialLicenseRequest> TrialLicenseRequest { get; set; }
public virtual DbSet<GZCase> GZCase { get; set; } public virtual DbSet<GZCase> GZCase { get; set; }
public virtual DbSet<SubscriptionServer> SubscriptionServer { 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 //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 //and commented out the above on configuring