From a5832cefba225a02a433a462fb4dba0ecf6042d0 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 18 May 2020 16:38:28 +0000 Subject: [PATCH] --- devdocs/todo.txt | 9 ++++++++- server/AyaNova/Controllers/WidgetController.cs | 3 +++ server/AyaNova/biz/JobsBiz.cs | 3 +-- server/AyaNova/generator/CoreJobSweeper.cs | 7 ------- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 2d57452e..3e1af985 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -1,7 +1,12 @@ PRIORITY - ALWAYS Lowest level stuff first =-=-=-=- +{ + "login": "manager", + "password": "l3tm3in" +} -todo: apiokresponse returns readonly value every time, but I check it anyway at the client and biz object itself doesn't set it I don't think, so...should it be removed? + +//TODO: Does this need to create an event so we know which user created the job? todo: Is there a log that records past jobs, how long can they be viewed? todo: Rename the link to AyaNova App on the server page to just "AyaNova" todo: translation cjkindex, no way to set this value currently @@ -12,6 +17,8 @@ todo: OPS routes (SERVER AND CLIENT) - Backup, restore https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3369 - These need to be done fairly early on in order to have shit to play with for testing etc BACKUP & related stuff that should be in v.initial release https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3369 +todo: OPS notification created for failed jobs + also maybe direct immediate email bypassing generator? todo: (BREAK THIS OUT INTO LATER/NOW/CASES) there are several outstanding AUTHENTICATION related cases in rockfish for RAVEN e.g. https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/1924 https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/1835 diff --git a/server/AyaNova/Controllers/WidgetController.cs b/server/AyaNova/Controllers/WidgetController.cs index 907c3524..615fc19e 100644 --- a/server/AyaNova/Controllers/WidgetController.cs +++ b/server/AyaNova/Controllers/WidgetController.cs @@ -230,6 +230,9 @@ namespace AyaNova.Api.Controllers j.Name = "TestWidgetJob"; j.JobType = JobType.TestWidgetJob; await JobsBiz.AddJobAsync(j, ct); + //Log + await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.ServerJob, AyaEvent.Created, $"{j.JobType} {j.Name}"), ct); + return Accepted(new { JobId = j.GId });//202 accepted } diff --git a/server/AyaNova/biz/JobsBiz.cs b/server/AyaNova/biz/JobsBiz.cs index 08e1b70a..bf9b17f5 100644 --- a/server/AyaNova/biz/JobsBiz.cs +++ b/server/AyaNova/biz/JobsBiz.cs @@ -141,8 +141,7 @@ namespace AyaNova.Biz /// /// internal static async Task AddJobAsync(OpsJob newJob, AyContext ct) - { - //TODO: Does this need to create an event so we know which user created the job? + { await ct.OpsJob.AddAsync(newJob); await ct.SaveChangesAsync(); return newJob; diff --git a/server/AyaNova/generator/CoreJobSweeper.cs b/server/AyaNova/generator/CoreJobSweeper.cs index 681aabc3..cb363bad 100644 --- a/server/AyaNova/generator/CoreJobSweeper.cs +++ b/server/AyaNova/generator/CoreJobSweeper.cs @@ -1,15 +1,8 @@ using System; using System.Linq; using System.Threading.Tasks; -using System.Collections.Generic; using Microsoft.EntityFrameworkCore; -using Microsoft.AspNetCore.Mvc; - using Microsoft.Extensions.Logging; -using EnumsNET; -using AyaNova.Util; -using AyaNova.Api.ControllerHelpers; -using AyaNova.Biz; using AyaNova.Models;