feature: saved exports view/edit/trigger
This commit is contained in:
@@ -41,6 +41,9 @@
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.Entity" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -195,7 +198,10 @@
|
||||
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateBulkGenerate.cs" />
|
||||
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateCreatePackageModel.cs" />
|
||||
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateCreateModel.cs" />
|
||||
<Compile Include="UI\Config\Export\ConfigEnrolmentIndexModel.cs" />
|
||||
<Compile Include="UI\Config\Export\ConfigExportShowModel.cs" />
|
||||
<Compile Include="UI\Config\Export\ConfigExportEditModel.cs" />
|
||||
<Compile Include="UI\Config\Export\ConfigExportIndexModel.cs" />
|
||||
<Compile Include="UI\Config\Export\ConfigExportCreateModel.cs" />
|
||||
<Compile Include="UI\Config\Expressions\ConfigExpressionsBrowserModel.cs" />
|
||||
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateImportStatusModel.cs" />
|
||||
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateIndexModel.cs" />
|
||||
|
||||
@@ -8,5 +8,26 @@ namespace Disco.Models.Services.Exporting
|
||||
public byte WeekDays { get; set; }
|
||||
public byte StartHour { get; set; }
|
||||
public byte? EndHour { get; set; }
|
||||
|
||||
public bool IncludesDay(DayOfWeek day)
|
||||
=> (WeekDays & (1 << (int)day)) != 0;
|
||||
|
||||
public string StartHourFriendly()
|
||||
=> HourFriendly(StartHour);
|
||||
|
||||
public string EndHourFriendly()
|
||||
=> EndHour.HasValue ? HourFriendly(EndHour.Value) : string.Empty;
|
||||
|
||||
private static string HourFriendly(int hour)
|
||||
{
|
||||
if (hour == 0)
|
||||
return "12:00 AM";
|
||||
else if (hour < 12)
|
||||
return $"{hour}:00 AM";
|
||||
else if (hour == 12)
|
||||
return "12:00 PM";
|
||||
else
|
||||
return $"{hour - 12}:00 PM";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Disco.Models.UI.Config.Export
|
||||
{
|
||||
public interface ConfigExportCreateModel : ConfigExportEditModel
|
||||
{
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -3,13 +3,14 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Models.UI.Config.Export
|
||||
{
|
||||
public interface ConfigExportCreateModel : BaseUIModel
|
||||
public interface ConfigExportEditModel : BaseUIModel
|
||||
{
|
||||
string ExportTypeName { get; set; }
|
||||
Guid Id { get; set; }
|
||||
|
||||
string Name { get; set; }
|
||||
string Description { get; set; }
|
||||
bool IsEnabled { get; set; }
|
||||
|
||||
string FilePath { get; set; }
|
||||
bool TimestampSuffix { get; set; }
|
||||
@@ -0,0 +1,12 @@
|
||||
using Disco.Models.Services.Exporting;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Models.UI.Config.Export
|
||||
{
|
||||
public interface ConfigExportIndexModel : BaseUIModel
|
||||
{
|
||||
List<SavedExport> SavedExports { get; set; }
|
||||
Dictionary<string, string> ExportTypeNames { get; set; }
|
||||
Dictionary<string, Repository.User> CreatedUsers { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Disco.Models.UI.Config.Export
|
||||
{
|
||||
public interface ConfigExportShowModel : ConfigExportEditModel
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="13.0.2" targetFramework="net45" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user