Details and queue management

This commit is contained in:
2017-01-06 08:43:22 -05:00
parent d14e40a36b
commit 42ac27e16f
24 changed files with 260 additions and 51 deletions
+6 -1
View File
@@ -2,6 +2,7 @@
using AutoMapper;
using LeafWeb.Core.DAL;
using LeafWeb.Core.Entities;
using LeafWeb.WebCms.Controllers;
namespace LeafWeb.WebCms.Models
{
@@ -20,7 +21,7 @@ namespace LeafWeb.WebCms.Models
[Display(Name = "Confirm email address")]
[Required(ErrorMessage = "Enter email exactly as above")]
[Compare("Email")]
[System.ComponentModel.DataAnnotations.Compare("Email")]
public string EmailConfirm { get; set; }
[Display(Name = "A unique identifier for this data")]
@@ -35,6 +36,10 @@ namespace LeafWeb.WebCms.Models
[Required(ErrorMessage = "A Photosynthetic pathway must be chosen")]
public SelectListViewModel PhotosynthesisType { get; set; }
[UIHint("TermsOfService")]
[EnforceTrue(ErrorMessage = "Terms of Service must be accepted to continue")]
public bool? TermsOfService { get; set; }
static LeafInputCreate()
{
Mapper.CreateMap<LeafInputCreate, LeafInput>()
+20 -1
View File
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web.Mvc;
using AutoMapper;
using LeafWeb.Core.Entities;
using LeafWeb.Core.Utility;
@@ -9,6 +11,9 @@ namespace LeafWeb.WebCms.Models
{
public class LeafInputDetails
{
[HiddenInput(DisplayValue = false)]
public int LeafInputId { get; set; }
[Display(Name = "Name")]
[Required(ErrorMessage = "Name required")]
[RegularExpression(@"[A-Za-z().]+(\s+[A-Za-z().]+)+", ErrorMessage = "Please provide full name")]
@@ -48,6 +53,18 @@ namespace LeafWeb.WebCms.Models
[UIHint("LeafInputStatusViewModels")]
public List<LeafInputStatusViewModel> StatusHistory { get; set; }
[HiddenInput(DisplayValue = false)]
public bool HasLeafChart { get; set; }
[HiddenInput(DisplayValue = false)]
public bool IsRunning { get; set; }
[HiddenInput(DisplayValue = false)]
public bool IsComplete { get; set; }
[HiddenInput(DisplayValue = false)]
public bool IsDeletable { get; set; }
static LeafInputDetails()
{
Mapper.CreateMap<LeafInputFile, string>().ConvertUsing(file => file?.Contents.GetString());
@@ -55,7 +72,9 @@ namespace LeafWeb.WebCms.Models
Mapper.CreateMap<LeafInputStatusType, string>().ConvertUsing(st => st.ToString());
Mapper.CreateMap<LeafInputStatusType, LeafInputStatus>().ConvertUsing(st => new LeafInputStatus());
Mapper.CreateMap<LeafInputStatus, LeafInputStatusViewModel>();
Mapper.CreateMap<LeafInput, LeafInputDetails>();
Mapper.CreateMap<LeafInput, LeafInputDetails>()
.ForMember(dest => dest.LeafInputId, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.HasLeafChart, opt => opt.ResolveUsing(src => src.OutputFiles.Any(o => o.IsLeafChartFile)));
}
public LeafInputDetails(LeafInput leafInput)
+5
View File
@@ -12,7 +12,12 @@ namespace LeafWeb.WebCms.Models
public string LeafInputSiteId { get; set; }
public string LeafInputPhotosynthesisType { get; set; }
public bool HasLeafChart { get; set; }
public bool IsRunning { get; set; }
public bool IsComplete { get; set; }
public bool IsDeletable { get; set; }
public bool IsPending { get; set; }
public string CurrentStatus { get; set; }
//public string[] ErrorMessages { get; set; }
//public string[] LeafOutputFilenames { get; set; }
//public bool HasLeafChartOutputFile { get; set; }