Add LeafInputDataSite info to Queue Details

This commit is contained in:
2020-06-23 15:47:30 -04:00
parent a4db61509d
commit 95e7de2a9b
5 changed files with 138 additions and 9 deletions
+14 -6
View File
@@ -9,7 +9,7 @@ using LeafWeb.Core.Utility;
namespace LeafWeb.WebCms.Models
{
public class LeafInputDetails
public class LeafInputDetails
{
[HiddenInput(DisplayValue = false)]
public int LeafInputId { get; set; }
@@ -52,7 +52,11 @@ namespace LeafWeb.WebCms.Models
[Display(Name = "Time In Progress")]
public TimeSpan TimeInProgress { get; set; }
[UIHint("LeafInputStatusViewModels")]
[UIHint("LeafInputDataSiteViewModels")]
public List<LeafInputDataSiteViewModel> Sites { get; set; }
[UIHint("LeafInputStatusViewModels")]
public List<LeafInputStatusViewModel> StatusHistory { get; set; }
[HiddenInput(DisplayValue = false)]
@@ -80,10 +84,14 @@ 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>()
.ForMember(dest => dest.LeafInputId, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.HasLeafChart, opt => opt.ResolveUsing(src => src.OutputFiles.Any(o => o.IsLeafChartFile)));
}
Mapper.CreateMap<LeafInputDataSite, LeafInputDataSiteViewModel>();
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)))
.ForMember(dest => dest.Sites, opt =>
opt.ResolveUsing(li => li.LeafInputData.Select(d => d.Site)));
}
public LeafInputDetails(LeafInput leafInput)
{