Skip to content

Commit

Permalink
v1.1.0 changes (#43)
Browse files Browse the repository at this point in the history
* port over v1.1.0 changes

* attempt to fix nuget issue

* update nuget config relative path

* change runner back to windows

* update package-lock.json

* minor readme update

* update to current lts node ver

* fix publish step

* fix missing stats lib
  • Loading branch information
dsharp-battelle committed Apr 15, 2024
1 parent d57d2ab commit 3a61c1b
Show file tree
Hide file tree
Showing 334 changed files with 31,571 additions and 30,659 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
###############################################################################
* text=auto

*.js eol=lf
*.ts eol=lf
*.vue eol=lf
*.json eol=lf
###############################################################################
# Set default behavior for command prompt diff.
#
Expand Down
40 changes: 27 additions & 13 deletions .github/workflows/publish-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,47 @@ jobs:

runs-on: windows-latest

defaults:
run:
shell: pwsh

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1.101
dotnet-version: 6.0.x

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v4
with:
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
node-version: 16.x # optional
- name: Publish
run: dotnet publish Battelle.EPA.WideAreaDecon.API/Battelle.EPA.WideAreaDecon.API.csproj -r win10-x64 --configuration Release -o ./publish
node-version: 20.x

- name: Build
run: dotnet build Battelle.EPA.WideAreaDecon.API/Battelle.EPA.WideAreaDecon.API.csproj -c Release

- name: Test .NET
run: dotnet test Battelle.EPA.WideAreaDecon.API.Tests/Battelle.EPA.WideAreaDecon.API.Tests.csproj -r win10-x64 --no-build --configuration Release --verbosity normal
run: dotnet test Battelle.EPA.WideAreaDecon.API.Tests/Battelle.EPA.WideAreaDecon.API.Tests.csproj --no-build -c Release --verbosity normal

- name: Publish
run: dotnet publish Battelle.EPA.WideAreaDecon.API/Battelle.EPA.WideAreaDecon.API.csproj --no-build -c Release -o ./publish

- name: Copy Build Files
run: cp -R ./Battelle.EPA.WideAreaDecon.API/bin/Release/net6.0/gdal, ./Battelle.EPA.WideAreaDecon.API/bin/Release/net6.0/Battelle.RiskAssessment.Common.Statistics.Native.* ./publish

- name: Test Typescript
working-directory: Battelle.EPA.WideAreaDecon.Client
run: npm run test

- name: Create Archive
run: powershell Compress-Archive -Path ./publish/* -DestinationPath ./Battelle.EPA.WideAreaDecon.zip
run: Compress-Archive -Path ./publish/* -DestinationPath ./Battelle.EPA.WideAreaDecon.zip

- name: Create Installer
run: ./InstallerFiles/Battelle.Common.Utilities.ElectronAppInstallerCreator.exe ./InstallerFiles/CreateInstallerDeconTool.json

- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v4
with:
# Artifact name
name: application
# Directory containing files to upload
path: ./Installer
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,6 @@ ASALocalRun/
.mfractor/

Battelle.EPA.WideAreaDecon.API/dist/
!BuildPackages/*
!BuildPackages/*
Installer/*
*.zip
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -11,7 +11,7 @@
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="FluentAssertions" Version="5.10.2" />
<PackageReference Include="FluentAssertions" Version="6.7.0" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 0 additions & 7 deletions Battelle.EPA.WideAreaDecon.API.Tests/Nuget.Config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ namespace Battelle.EPA.WideAreaDecon.API.Tests.Providers
[TestFixture]
internal class ExcelDefineScenarioParameterListProviderTest
{
[SetUp]
public void SetUp()
{
}

private static string TestFileName => @"InputFiles\DefineScenario.xlsx";

[Test]
Expand All @@ -21,7 +16,8 @@ public void ReadFromExcel()
FileName = TestFileName
};

var paramList = defineScenario.GetParameterList();
_ = defineScenario.GetParameterList();

Assert.Pass();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
using Battelle.EPA.WideAreaDecon.InterfaceData.Providers;
using Battelle.EPA.WideAreaDecon.InterfaceData.Models.Constants;
using Battelle.EPA.WideAreaDecon.InterfaceData.Providers;
using NUnit.Framework;

namespace Battelle.EPA.WideAreaDecon.API.Tests.Providers
{
[TestFixture]
internal class ExcelModifyParameterParameterListProviderTest
{
[SetUp]
public void SetUp()
{
}

private static string TestFileName => @"InputFiles\ModifyParameters.xlsx";

[Test]
Expand All @@ -19,20 +15,21 @@ public void ReadFromExcel()
var modifyParameter = new ExcelModifyParameterParameterListProvider
{
FileName = TestFileName,
GenericSheetNames = new []
GenericSheetNames = new[]
{
"Incident Command",
"Characterization Sampling",
"Source Reduction",
"Decontamination",
"Clearance Sampling",
"Waste Sampling",
"Other",
"Cost per Parameter"
ParameterNames.IncidentCommand,
ParameterNames.CharacterizationSampling,
ParameterNames.SourceReduction,
ParameterNames.Decontamination,
ParameterNames.VerificationSampling,
ParameterNames.ClearanceSampling,
ParameterNames.WasteSampling,
ParameterNames.Other,
ParameterNames.Cost
}
};

var paramList = modifyParameter.GetParameterList();
_ = modifyParameter.GetParameterList();

Assert.Pass();
}
Expand Down
45 changes: 36 additions & 9 deletions Battelle.EPA.WideAreaDecon.API/Application/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System;
using System.IO;
using Battelle.EPA.WideAreaDecon.API.Hubs;
using Battelle.EPA.WideAreaDecon.API.Interfaces;
using Battelle.EPA.WideAreaDecon.InterfaceData.Interfaces;
using Battelle.EPA.WideAreaDecon.InterfaceData.Interfaces.Providers;
using Battelle.EPA.WideAreaDecon.API.Models.ClientConfiguration;
using Battelle.EPA.WideAreaDecon.InterfaceData.Providers;
using Battelle.EPA.WideAreaDecon.API.Models.Geospatial;
using Battelle.EPA.WideAreaDecon.API.Services;
using Battelle.EPA.WideAreaDecon.InterfaceData.Interfaces.Providers;
using Battelle.EPA.WideAreaDecon.InterfaceData.Providers;
using Battelle.EPA.WideAreaDecon.Model;
using Battelle.EPA.WideAreaDecon.Model.Interface;
using ElectronNET.API;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
Expand All @@ -16,8 +17,9 @@
using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;
using Newtonsoft.Json;
using System;
using System.IO;
using VueCliMiddleware;
using Battelle.EPA.WideAreaDecon.API.Hubs;

namespace Battelle.EPA.WideAreaDecon.API.Application
{
Expand Down Expand Up @@ -56,11 +58,11 @@ public void ConfigureServices(IServiceCollection services)
services.AddSwaggerGen(c =>
{
c.SwaggerDoc(
"v1",
"v1.1",
new OpenApiInfo
{
Title = "Wide Area Decon Rest API",
Version = "v1"
Version = "v1.1"
});
c.DocInclusionPredicate((docName, apiDesc) =>
Expand Down Expand Up @@ -117,6 +119,9 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApp
app.UseRouting()
.UseEndpoints(ConfigureEndpoints);

GdalConfiguration.ConfigureGdal();
GdalConfiguration.ConfigureOgr();

#if !DEBUG
app.UseSpa(spa =>
{
Expand All @@ -133,6 +138,18 @@ private void ConfigureModels(IServiceCollection services)
services.AddTransient(s =>
Configuration.GetSection("ClientConfiguration")
.Get<ClientConfiguration>());

var geospatialConfiguration = new GeospatialConfiguration();
Configuration.GetSection(nameof(GeospatialConfiguration))
.Bind(geospatialConfiguration);
services.AddSingleton(geospatialConfiguration);
// delete the directory when starting application
var fileDirectoryInfo = new DirectoryInfo(
Environment.ExpandEnvironmentVariables(geospatialConfiguration.SaveDirectory));
if (fileDirectoryInfo.Exists)
{
fileDirectoryInfo.Delete(true);
}
}

private void ConfigureProviders(IServiceCollection services)
Expand Down Expand Up @@ -160,12 +177,22 @@ private void ConfigureProviders(IServiceCollection services)

services.AddSingleton<IParameterListProvider>(new EmptyParameterListProvider());

services.AddTransient<IJobProgressUpdater, JobProgressUpdater>();
services.AddTransient<IJobStatusUpdater, JobStatusUpdater>();
services.AddSingleton<IJobManager, JobManager>();

services.AddTransient<JobStatusUpdater>();
services.AddTransient<JobProgressUpdater>();

services.AddSingleton<CityDataLinksService>();
services.AddTransient<IResultsCalculator, ResultsCalculator>();
services.AddTransient<ICalculatorManager, CalculatorManager>();

services.AddTransient<IEventModelRunner, EventModelRunner>();
services.AddTransient<IAssignmentGenerator, AssignmentGenerator>();
services.AddTransient<IScenarioModelRunner, ScenarioModelRunner>();

services.AddTransient<IGeospatialFileService, GeospatialFileService>();
}

private void ConfigureEndpoints(IEndpointRouteBuilder endpoints)
Expand All @@ -178,7 +205,7 @@ private void ConfigureEndpoints(IEndpointRouteBuilder endpoints)
#if DEBUG
endpoints.MapToVueCliProxy(
"{*path}",
new SpaOptions {SourcePath = "../Battelle.EPA.WideAreaDecon.Client"},
new SpaOptions { SourcePath = "../Battelle.EPA.WideAreaDecon.Client" },
npmScript: "serve",
regex: "App running at",
port: Configuration.GetValue<int>("Port") + 1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<IsPackable>false</IsPackable>
<SpaRoot>..\Battelle.EPA.WideAreaDecon.Client\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**;dist\</DefaultItemExcludes>
<Authors>Kevin Wegman</Authors>
<Authors>Kevin Wegman,Emily Peraza,Dan Sharp</Authors>
<Company>Battelle Memorial Institute</Company>
<Description>Application to calculate the decontamination costs associated with a wide area contamination event</Description>
<AssemblyName>Battelle.EPA.WideAreaDecon.API</AssemblyName>
<RootNamespace>Battelle.EPA.WideAreaDecon.API</RootNamespace>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ElectronNET.API" Version="7.30.2" />
<PackageReference Include="GDAL" Version="3.7.1" />
<PackageReference Include="GDAL.Native" Version="3.7.1" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.39" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.1" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="6.0.27" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" />
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.0" />
<PackageReference Include="VueCliMiddleware" Version="3.1.1" />
<PackageReference Include="System.IO.Compression.ZipFile" Version="4.3.0" />
<PackageReference Include="VueCliMiddleware" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
<PackageReference Include="DotNetCore.NPOI" Version="1.2.2" />
<PackageReference Include="CSM.SodaDotNet" Version="0.10.1" />
Expand Down
Loading

0 comments on commit 3a61c1b

Please sign in to comment.