Skip to content

Commit

Permalink
Require Reason Code if form Not Included
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleybot authored Aug 16, 2023
1 parent 3d5c523 commit ffe03f5
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/UDS.Net.Forms.Tests/UDS.Net.Forms.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<ReleaseVersion>1.0.3</ReleaseVersion>
<ReleaseVersion>1.0.4</ReleaseVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
Expand Down
6 changes: 3 additions & 3 deletions src/UDS.Net.Forms/Models/FormModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ public virtual IEnumerable<ValidationResult> Validate(ValidationContext validati
{
yield return new ValidationResult(
$"Form kind is required",
new[] { nameof(ReasonCodeNotIncluded) });
new[] { nameof(Kind) });
}
if (string.IsNullOrWhiteSpace(Version.Trim()))
{
yield return new ValidationResult(
$"Form version is required",
new[] { nameof(ReasonCodeNotIncluded) });
new[] { nameof(Version) });
}
if (string.IsNullOrWhiteSpace(CreatedBy.Trim()))
{
yield return new ValidationResult(
$"Created by is required",
new[] { nameof(ReasonCodeNotIncluded) });
new[] { nameof(CreatedBy) });
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/UDS.Net.Forms/Models/PageModels/FormPageModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using UDS.Net.Forms.Models;
using UDS.Net.Forms.Models.UDS3;
using UDS.Net.Forms.Pages.UDS3;
using UDS.Net.Services.Enums;
using UDS.Net.Services;

namespace UDS.Net.Forms.Models.PageModels
Expand Down Expand Up @@ -67,7 +68,7 @@ protected async Task<IActionResult> OnPostAsync(int id)
{
var visit = Visit.ToEntity();

if (BaseForm.Status == Services.Enums.FormStatus.Complete)
if (BaseForm.Status == FormStatus.Complete || BaseForm.Status == FormStatus.NotIncluded)
{
/*
* ValidationContext describes any member on which validation is performed. It also enables
Expand Down
2 changes: 1 addition & 1 deletion src/UDS.Net.Forms/Models/UDS3/B1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace UDS.Net.Forms.Models.UDS3
public class B1 : FormModel
{
[Display(Name = "Participant height (inches)")]
[RegularExpression("^(3[6-9].\\d|[4-7][0-9].\\d|8[0-7].\\d|88.8)$", ErrorMessage = "(36.0-87.9, 88.8 = not assessed)")]
[RegularExpression("^(3[6-9](.[0-9])?|[4-7][0-9](.[0-9])?|8[0-7](.[0-9])?|88.8)$", ErrorMessage = "(36.0-87.9, 88.8 = not assessed)")]
[RequiredOnComplete]
public double? HEIGHT { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions src/UDS.Net.Forms/UDS.Net.Forms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<ImplicitUsings>enable</ImplicitUsings>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<PackageId>UDS.Net.Forms</PackageId>
<Version>1.0.3</Version>
<Version>1.0.4</Version>
<Authors>Sanders-Brown Center on Aging</Authors>
<Description>UDS Forms razor class library</Description>
<Owners>UK-SBCoA</Owners>
<PackageDescription>Razor class library for rendering UDS forms</PackageDescription>
<RepositoryUrl>https://github.com/UK-SBCoA/uniform-data-set-dotnet-web</RepositoryUrl>
<ReleaseVersion>1.0.3</ReleaseVersion>
<ReleaseVersion>1.0.4</ReleaseVersion>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
Expand Down
2 changes: 1 addition & 1 deletion src/UDS.Net.Services.Test/UDS.Net.Services.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<ReleaseVersion>1.0.3</ReleaseVersion>
<ReleaseVersion>1.0.4</ReleaseVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/UDS.Net.Services/UDS.Net.Services.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<TargetFramework>netstandard2.1</TargetFramework>
<OutputType>Library</OutputType>
<PackageId>UDS.Net.Services</PackageId>
<Version>1.0.3</Version>
<Version>1.0.4</Version>
<Authors>Sanders-Brown Center on Aging</Authors>
<Description>Service contracts for implmenting your own back-end with MVC web app</Description>
<Owners>UK-SBCoA</Owners>
<PackageDescription>Service contracts required by MVC web app</PackageDescription>
<RepositoryUrl>https://github.com/UK-SBCoA/uniform-data-set-dotnet-web</RepositoryUrl>
<ReleaseVersion>1.0.3</ReleaseVersion>
<ReleaseVersion>1.0.4</ReleaseVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="UDS.Net.Dto" Version="1.4.1" />
Expand Down
4 changes: 2 additions & 2 deletions src/UDS.Net.Web.MVC.Services/UDS.Net.Web.MVC.Services.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<TargetFramework>netstandard2.1</TargetFramework>
<OutputType>Library</OutputType>
<PackageId>UDS.Net.MVC.Services</PackageId>
<Version>1.0.3</Version>
<Version>1.0.4</Version>
<Authors>Sanders-Brown Center on Aging</Authors>
<Description>Implemented service layer for using MVC front-end with API back-end</Description>
<Owners>UK-SBCoA</Owners>
<PackageDescription>Implemented service contract</PackageDescription>
<RepositoryUrl>https://github.com/UK-SBCoA/uniform-data-set-dotnet-web</RepositoryUrl>
<ReleaseVersion>1.0.3</ReleaseVersion>
<ReleaseVersion>1.0.4</ReleaseVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Json" Version="7.0.3" />
Expand Down
2 changes: 1 addition & 1 deletion src/UDS.Net.Web.MVC/UDS.Net.Web.MVC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-UDS.Net.Web.MVC-F92C0881-61B6-4292-8635-0004DE84CFE6</UserSecretsId>
<DockerComposeProjectPath>../docker-compose.dcproj</DockerComposeProjectPath>
<ReleaseVersion>1.0.3</ReleaseVersion>
<ReleaseVersion>1.0.4</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
Expand Down
18 changes: 9 additions & 9 deletions src/UDS.Net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ VisualStudioVersion = 17.6.33815.320
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UDS.Net.Web.MVC", "UDS.Net.Web.MVC\UDS.Net.Web.MVC.csproj", "{04FF91D5-180F-4F0A-9881-013A82B4CA14}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UDS.Net.Forms", "UDS.Net.Forms\UDS.Net.Forms.csproj", "{2041B528-CED9-41BD-8BFC-7F1B811BB33D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.Forms", "UDS.Net.Forms\UDS.Net.Forms.csproj", "{2041B528-CED9-41BD-8BFC-7F1B811BB33D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UDS.Net.Services", "UDS.Net.Services\UDS.Net.Services.csproj", "{BD35F74B-9134-46F3-850D-7DF05F7397E4}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.Services", "UDS.Net.Services\UDS.Net.Services.csproj", "{BD35F74B-9134-46F3-850D-7DF05F7397E4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UDS.Net.Forms.Tests", "UDS.Net.Forms.Tests\UDS.Net.Forms.Tests.csproj", "{7A359BF3-B7F2-4962-A948-DAB0A996DA0F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UDS.Net.Web.MVC.Services", "UDS.Net.Web.MVC.Services\UDS.Net.Web.MVC.Services.csproj", "{10B4A194-D9E4-491B-AF11-FF14F6108F5F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.Web.MVC.Services", "UDS.Net.Web.MVC.Services\UDS.Net.Web.MVC.Services.csproj", "{10B4A194-D9E4-491B-AF11-FF14F6108F5F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UDS.Net.Services.Test", "UDS.Net.Services.Test\UDS.Net.Services.Test.csproj", "{395296FB-4036-4FC9-A8DC-A50F96D35623}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{E45A0685-E9D3-41A9-8D16-9D763F47703D}"
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{8275443C-21F6-4D99-B4DE-2B589B42C69A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -47,10 +47,10 @@ Global
{395296FB-4036-4FC9-A8DC-A50F96D35623}.Debug|Any CPU.Build.0 = Debug|Any CPU
{395296FB-4036-4FC9-A8DC-A50F96D35623}.Release|Any CPU.ActiveCfg = Release|Any CPU
{395296FB-4036-4FC9-A8DC-A50F96D35623}.Release|Any CPU.Build.0 = Release|Any CPU
{E45A0685-E9D3-41A9-8D16-9D763F47703D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E45A0685-E9D3-41A9-8D16-9D763F47703D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E45A0685-E9D3-41A9-8D16-9D763F47703D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E45A0685-E9D3-41A9-8D16-9D763F47703D}.Release|Any CPU.Build.0 = Release|Any CPU
{8275443C-21F6-4D99-B4DE-2B589B42C69A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8275443C-21F6-4D99-B4DE-2B589B42C69A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8275443C-21F6-4D99-B4DE-2B589B42C69A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8275443C-21F6-4D99-B4DE-2B589B42C69A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -59,6 +59,6 @@ Global
SolutionGuid = {3268D734-1592-4E39-88A2-3A53468CC430}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
version = 1.0.3
version = 1.0.4
EndGlobalSection
EndGlobal

0 comments on commit ffe03f5

Please sign in to comment.