Skip to content

Commit

Permalink
Cleanup and remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleybot committed Nov 4, 2024
1 parent 272f463 commit fe74699
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 30 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>4.1.3-preview.4</ReleaseVersion>
<ReleaseVersion>4.1.3-preview.5</ReleaseVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
Expand Down
20 changes: 0 additions & 20 deletions src/UDS.Net.Forms/Pages/Visits/Create.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public class CreateModel : PageModel
protected readonly IParticipationService _participationService;
protected readonly IVisitService _visitService;

public SelectList ParticipationsSelectList { get; private set; }

[BindProperty]
public VisitModel? Visit { get; set; }

Expand All @@ -46,27 +44,11 @@ private void PopulateVisitKindOptions(int udsv4VisitCount)
}
}

private async Task PopulateParticipationsDropDownList(int? selectedParticipationId)
{
Participation selectedParticipation = null;
var participations = await _participationService.List("");

if (selectedParticipationId.HasValue)
selectedParticipation = participations.FirstOrDefault(p => p.Id == selectedParticipationId);

ParticipationsSelectList = new SelectList(participations,
nameof(Participation.Id),
nameof(Participation.LegacyId),
selectedParticipation.Id);
}

public async Task<IActionResult> OnGetAsync(int? participationId)
{
if (!participationId.HasValue)
return NotFound();

await PopulateParticipationsDropDownList(participationId);

Participation = await _participationService.GetById(User.Identity.Name, participationId.Value);

var shortenedInitials = "UNK";
Expand Down Expand Up @@ -97,8 +79,6 @@ public async Task<IActionResult> OnPostAsync(int participationId)
{
if (!ModelState.IsValid)
{
await PopulateParticipationsDropDownList(participationId);

Participation = await _participationService.GetById(User.Identity.Name, participationId);

PopulateVisitKindOptions(Visit.VISITNUM);
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>4.1.3-preview.4</Version>
<Version>4.1.3-preview.5</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>4.1.3-preview.4</ReleaseVersion>
<ReleaseVersion>4.1.3-preview.5</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>4.1.3-preview.4</ReleaseVersion>
<ReleaseVersion>4.1.3-preview.5</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>4.1.3-preview.4</Version>
<Version>4.1.3-preview.5</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>4.1.3-preview.4</ReleaseVersion>
<ReleaseVersion>4.1.3-preview.5</ReleaseVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="UDS.Net.Dto" Version="4.1.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>4.1.3-preview.4</Version>
<Version>4.1.3-preview.5</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>4.1.3-preview.4</ReleaseVersion>
<ReleaseVersion>4.1.3-preview.5</ReleaseVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.5" />
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>4.1.3-preview.4</ReleaseVersion>
<ReleaseVersion>4.1.3-preview.5</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
Expand Down
2 changes: 1 addition & 1 deletion src/UDS.Net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ Global
SolutionGuid = {3268D734-1592-4E39-88A2-3A53468CC430}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
version = 4.1.3-preview.4
version = 4.1.3-preview.5
EndGlobalSection
EndGlobal

0 comments on commit fe74699

Please sign in to comment.