feature: initial comments template

completes #150
This commit is contained in:
Gary Sharp
2025-01-24 17:28:27 +11:00
parent 408e1c4c14
commit 0853bcee50
39 changed files with 956 additions and 527 deletions
@@ -11,6 +11,30 @@ namespace Disco.Web.Areas.API.Controllers
{
public partial class JobPreferencesController : AuthorizedDatabaseController
{
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
public virtual ActionResult UpdateInitialCommentsTemplate(string initialCommentsTemplate, bool redirect = false)
{
string expression = null;
if (!string.IsNullOrWhiteSpace(initialCommentsTemplate))
{
expression = initialCommentsTemplate.Trim();
}
if (Database.DiscoConfiguration.JobPreferences.InitialCommentsTemplate != expression)
{
Database.DiscoConfiguration.JobPreferences.InitialCommentsTemplate = expression;
Database.SaveChanges();
Jobs.InitialCommentsTemplateInvalidateCache();
}
if (redirect)
return RedirectToAction(MVC.Config.JobPreferences.Index());
else
return Json("OK", JsonRequestBehavior.AllowGet);
}
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
public virtual ActionResult UpdateLongRunningJobDaysThreshold(int LongRunningJobDaysThreshold, bool redirect = false)
{