10 Commits

Author SHA1 Message Date
131abcd3cd Need DB III 2023-02-08 10:50:03 -07:00
78567f9e39 Testing II 2023-02-08 10:26:59 -07:00
8c6a2d92db Need DB II 2023-02-08 09:42:52 -07:00
7828493f27 Testing I 2023-02-08 09:33:28 -07:00
65a3c6e7f6 Need DB 2023-02-08 07:16:09 -07:00
90d58e8e9c Style changes 2023-02-04 15:32:20 -07:00
7173c0795a Added Blazor back 2023-02-04 10:37:35 -07:00
2f1353d36c Created View Project 2023-02-04 10:17:21 -07:00
ff64ac6d98 MudBlazor to IgniteUI.Blazor.Controls 2023-02-04 02:04:11 -07:00
dd30123d0f nuget updates 2023-02-02 14:21:41 -07:00
33 changed files with 200 additions and 433 deletions

2
.gitignore vendored
View File

@ -52,7 +52,7 @@ BenchmarkDotNet.Artifacts/
project.lock.json project.lock.json
project.fragment.lock.json project.fragment.lock.json
artifacts/ artifacts/
# **/Properties/launchSettings.json **/Properties/launchSettings.json
# StyleCop # StyleCop
StyleCopReport.xml StyleCopReport.xml

5
.vscode/launch.json vendored
View File

@ -66,11 +66,6 @@
"request": "attach", "request": "attach",
"preLaunchTask": "watchClientHub", "preLaunchTask": "watchClientHub",
"processName": "OI.Metrology.ClientHub.exe" "processName": "OI.Metrology.ClientHub.exe"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
} }
] ]
} }

2
.vscode/tasks.json vendored
View File

@ -44,7 +44,7 @@
"args": [ "args": [
"watch", "watch",
"--launch-profile", "--launch-profile",
"http", "https",
"run", "run",
"--project", "--project",
"${workspaceFolder}/Server/OI.Metrology.Server.csproj", "${workspaceFolder}/Server/OI.Metrology.Server.csproj",

View File

@ -1,25 +0,0 @@
{
"profiles": {
"profileA": {},
"Phares-Development": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7023;http://localhost:5027",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Phares-Production": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7023;http://localhost:5027",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
}
}
}
}

View File

@ -1,22 +0,0 @@
{
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5093",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7135;http://localhost:5093",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Archive", "Archive\OI.Metro
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\OI.Metrology.Shared.csproj", "{A807EAE3-7DCB-4E5E-BE54-0D7410D18B3E}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\OI.Metrology.Shared.csproj", "{A807EAE3-7DCB-4E5E-BE54-0D7410D18B3E}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "View", "View\OI.Metrology.View.csproj", "{D7988D0C-FE5D-429B-AA1C-911A1A29A468}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\OI.Metrology.Server.csproj", "{25C86DF8-EC1A-4D4B-AD4E-6561174824B9}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\OI.Metrology.Server.csproj", "{25C86DF8-EC1A-4D4B-AD4E-6561174824B9}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\OI.Metrology.Tests.csproj", "{B67FB8C4-402E-4D53-90A6-90F6FDB9D082}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\OI.Metrology.Tests.csproj", "{B67FB8C4-402E-4D53-90A6-90F6FDB9D082}"
@ -36,5 +38,9 @@ Global
{B67FB8C4-402E-4D53-90A6-90F6FDB9D082}.Debug|Any CPU.Build.0 = Debug|Any CPU {B67FB8C4-402E-4D53-90A6-90F6FDB9D082}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B67FB8C4-402E-4D53-90A6-90F6FDB9D082}.Release|Any CPU.ActiveCfg = Release|Any CPU {B67FB8C4-402E-4D53-90A6-90F6FDB9D082}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B67FB8C4-402E-4D53-90A6-90F6FDB9D082}.Release|Any CPU.Build.0 = Release|Any CPU {B67FB8C4-402E-4D53-90A6-90F6FDB9D082}.Release|Any CPU.Build.0 = Release|Any CPU
{D7988D0C-FE5D-429B-AA1C-911A1A29A468}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7988D0C-FE5D-429B-AA1C-911A1A29A468}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7988D0C-FE5D-429B-AA1C-911A1A29A468}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7988D0C-FE5D-429B-AA1C-911A1A29A468}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

View File

@ -44,7 +44,7 @@
"args": [ "args": [
"watch", "watch",
"--launch-profile", "--launch-profile",
"http", "https",
"run", "run",
"--project", "--project",
"${workspaceFolder}/OI.Metrology.Server.csproj", "${workspaceFolder}/OI.Metrology.Server.csproj",

View File

@ -9,25 +9,36 @@ using System.Text.Json;
public class PinController : Controller, IPinController<IActionResult> public class PinController : Controller, IPinController<IActionResult>
{ {
private readonly ILogger _Logger;
private readonly IPinRepository _PinRepository; private readonly IPinRepository _PinRepository;
private readonly IMetrologyRepository _MetrologyRepository; private readonly IMetrologyRepository _MetrologyRepository;
public PinController(ILogger<InboundController> logger, IMetrologyRepository metrologyRepository, IPinRepository pinRepository) public PinController(ILogger<InboundController> logger, IMetrologyRepository metrologyRepository, IPinRepository pinRepository)
{ {
_Logger = logger;
_MetrologyRepository = metrologyRepository; _MetrologyRepository = metrologyRepository;
_PinRepository = pinRepository; _PinRepository = pinRepository;
} }
[HttpPost("{toolTypeId}/markAsPinned")] [HttpPost("/api/pin/markAsPinned")]
public IActionResult MarkAsPinned(Shared.DataModels.HeaderCommon headerCommon) public IActionResult MarkAsPinned(Shared.DataModels.HeaderCommon headerCommon)
{ {
_PinRepository.SetPinnedTable(headerCommon); string toolTypeId = headerCommon.ToolTypeID.ToString();
string json = JsonSerializer.Serialize(headerCommon, new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
string? was = HttpContext.Session.GetString(toolTypeId);
if (was is not null)
_Logger.LogDebug($"{toolTypeId} was: {was}");
HttpContext.Session.SetString(toolTypeId, json);
return Ok(); return Ok();
} }
[HttpGet] [HttpGet]
[Route("{toolTypeId}/pinned")] [Route("{id}/pinned")]
public IActionResult GetPinnedTable(int toolTypeId, string? biorad_id = null, string? cde_id = null, string? rds = null) => public IActionResult GetPinnedTable(int id)
Json(_PinRepository.GetPinnedTable(_MetrologyRepository, toolTypeId, biorad_id, cde_id, rds), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true }); {
string? cde = HttpContext.Session.GetString(((int)IPinRepository.ToolId.CDE).ToString());
string? bioRad = HttpContext.Session.GetString(((int)IPinRepository.ToolId.BioRad).ToString());
return Json(_PinRepository.GetPinnedTable(_MetrologyRepository, id, bioRad, cde), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
}
} }

View File

@ -11,8 +11,6 @@ namespace OI.Metrology.Server.Controllers;
public class ExportController : Controller public class ExportController : Controller
{ {
private readonly string _ApiUrl;
private readonly ILogger _Logger; private readonly ILogger _Logger;
private readonly bool _IsTestDatabase; private readonly bool _IsTestDatabase;
private readonly AppSettings _AppSettings; private readonly AppSettings _AppSettings;
@ -24,7 +22,6 @@ public class ExportController : Controller
_AppSettings = appSettings; _AppSettings = appSettings;
_MetrologyRepository = metrologyRepository; _MetrologyRepository = metrologyRepository;
_IsTestDatabase = appSettings.ConnectionString.Contains("test", StringComparison.InvariantCultureIgnoreCase); _IsTestDatabase = appSettings.ConnectionString.Contains("test", StringComparison.InvariantCultureIgnoreCase);
_ApiUrl = string.IsNullOrEmpty(appSettings.ApiUrl) ? Url.Content("~/") : appSettings.ApiUrl[0] == '~' ? Url.Content(appSettings.ApiUrl) : appSettings.ApiUrl;
} }
public override void OnActionExecuted(ActionExecutedContext context) public override void OnActionExecuted(ActionExecutedContext context)
@ -32,7 +29,7 @@ public class ExportController : Controller
base.OnActionExecuted(context); base.OnActionExecuted(context);
ViewBag.IsTestDatabase = _IsTestDatabase; ViewBag.IsTestDatabase = _IsTestDatabase;
} }
[HttpGet] [HttpGet]
[Route("/Export")] [Route("/Export")]
public ActionResult Index() public ActionResult Index()
@ -44,7 +41,6 @@ public class ExportController : Controller
}; };
MonIn monIn = MonIn.GetInstance(); MonIn monIn = MonIn.GetInstance();
_ = monIn.SendStatus(_AppSettings.MonASite, _AppSettings.MonAResource, "Heartbeat", State.Up); _ = monIn.SendStatus(_AppSettings.MonASite, _AppSettings.MonAResource, "Heartbeat", State.Up);
ViewBag.ApiUrl = _ApiUrl;
return View(model); return View(model);
} }
@ -85,7 +81,6 @@ public class ExportController : Controller
_ = monIn.SendStatus(_AppSettings.MonASite, _AppSettings.MonAResource, "Heartbeat", State.Warning); _ = monIn.SendStatus(_AppSettings.MonASite, _AppSettings.MonAResource, "Heartbeat", State.Warning);
} }
} }
ViewBag.ApiUrl = _ApiUrl;
return View("Index", model); return View("Index", model);
} }

View File

@ -8,8 +8,6 @@ namespace OI.Metrology.Server.Controllers;
public class PagesController : Controller public class PagesController : Controller
{ {
private readonly string _ApiUrl;
private readonly bool _IsTestDatabase; private readonly bool _IsTestDatabase;
private readonly IMetrologyRepository _MetrologyRepository; private readonly IMetrologyRepository _MetrologyRepository;
@ -17,7 +15,6 @@ public class PagesController : Controller
{ {
_MetrologyRepository = metrologyRepository; _MetrologyRepository = metrologyRepository;
_IsTestDatabase = appSettings.ConnectionString.Contains("test", StringComparison.InvariantCultureIgnoreCase); _IsTestDatabase = appSettings.ConnectionString.Contains("test", StringComparison.InvariantCultureIgnoreCase);
_ApiUrl = string.IsNullOrEmpty(appSettings.ApiUrl) ? Url.Content("~/") : appSettings.ApiUrl[0] == '~' ? Url.Content(appSettings.ApiUrl) : appSettings.ApiUrl;
} }
public override void OnActionExecuted(ActionExecutedContext context) public override void OnActionExecuted(ActionExecutedContext context)
@ -28,20 +25,14 @@ public class PagesController : Controller
[HttpGet] [HttpGet]
[Route("/")] [Route("/")]
public IActionResult Index() public IActionResult Index() =>
{ View("AwaitingDispo");
ViewBag.ApiUrl = _ApiUrl;
return View("AwaitingDispo");
}
[HttpGet] [HttpGet]
[Route("/AwaitingDispo")] [Route("/AwaitingDispo")]
[Route("/Metrology/AwaitingDispo")] [Route("/Metrology/AwaitingDispo")]
public IActionResult AwaitingDispo() public IActionResult AwaitingDispo() =>
{ View();
ViewBag.ApiUrl = _ApiUrl;
return View();
}
[HttpGet] [HttpGet]
[Route("/RunInfo")] [Route("/RunInfo")]
@ -58,18 +49,14 @@ public class PagesController : Controller
{ {
m.HeaderAttachmentID = _MetrologyRepository.GetHeaderAttachmentID(tooltypeid, headerid); m.HeaderAttachmentID = _MetrologyRepository.GetHeaderAttachmentID(tooltypeid, headerid);
} }
ViewBag.ApiUrl = _ApiUrl;
return View(m); return View(m);
} }
[HttpGet] [HttpGet]
[Route("/RunHeaders")] [Route("/RunHeaders")]
[Route("/Metrology/RunHeaders")] [Route("/Metrology/RunHeaders")]
public IActionResult RunHeaders() public IActionResult RunHeaders() =>
{ View();
ViewBag.ApiUrl = _ApiUrl;
return View();
}
[HttpGet] [HttpGet]
[Route("/Crash")] [Route("/Crash")]

View File

@ -1,6 +0,0 @@
{
{
"Results": [],
"TotalRows": 0
}
}

View File

@ -5,7 +5,6 @@ namespace OI.Metrology.Server.Models;
public record AppSettings(string ApiLoggingContentTypes, public record AppSettings(string ApiLoggingContentTypes,
string ApiLoggingPathPrefixes, string ApiLoggingPathPrefixes,
string ApiLogPath, string ApiLogPath,
string ApiUrl,
string AttachmentPath, string AttachmentPath,
string BuildNumber, string BuildNumber,
string Company, string Company,

View File

@ -11,7 +11,6 @@ public class AppSettings
[Display(Name = "Api Logging Content Types"), Required] public string ApiLoggingContentTypes { get; set; } [Display(Name = "Api Logging Content Types"), Required] public string ApiLoggingContentTypes { get; set; }
[Display(Name = "Api Logging Path Prefixes"), Required] public string ApiLoggingPathPrefixes { get; set; } [Display(Name = "Api Logging Path Prefixes"), Required] public string ApiLoggingPathPrefixes { get; set; }
[Display(Name = "Api Log Path"), Required] public string ApiLogPath { get; set; } [Display(Name = "Api Log Path"), Required] public string ApiLogPath { get; set; }
[Display(Name = "Api URL"), Required] public string ApiUrl { get; set; }
[Display(Name = "Attachment Path"), Required] public string AttachmentPath { get; set; } [Display(Name = "Attachment Path"), Required] public string AttachmentPath { get; set; }
[Display(Name = "Build Number"), Required] public string BuildNumber { get; set; } [Display(Name = "Build Number"), Required] public string BuildNumber { get; set; }
[Display(Name = "Company"), Required] public string Company { get; set; } [Display(Name = "Company"), Required] public string Company { get; set; }
@ -47,8 +46,6 @@ public class AppSettings
throw new NullReferenceException(nameof(ApiLoggingPathPrefixes)); throw new NullReferenceException(nameof(ApiLoggingPathPrefixes));
if (appSettings.ApiLogPath is null) if (appSettings.ApiLogPath is null)
throw new NullReferenceException(nameof(ApiLogPath)); throw new NullReferenceException(nameof(ApiLogPath));
if (appSettings.ApiUrl is null)
throw new NullReferenceException(nameof(ApiUrl));
if (appSettings.AttachmentPath is null) if (appSettings.AttachmentPath is null)
throw new NullReferenceException(nameof(AttachmentPath)); throw new NullReferenceException(nameof(AttachmentPath));
if (appSettings.BuildNumber is null) if (appSettings.BuildNumber is null)
@ -83,7 +80,6 @@ public class AppSettings
appSettings.ApiLoggingContentTypes, appSettings.ApiLoggingContentTypes,
appSettings.ApiLoggingPathPrefixes, appSettings.ApiLoggingPathPrefixes,
appSettings.ApiLogPath, appSettings.ApiLogPath,
appSettings.ApiUrl,
appSettings.AttachmentPath, appSettings.AttachmentPath,
appSettings.BuildNumber, appSettings.BuildNumber,
appSettings.Company, appSettings.Company,

View File

@ -97,9 +97,6 @@
<None Include="Data\Tests\GetIpAddressApi.json"> <None Include="Data\Tests\GetIpAddressApi.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<None Include="Data\Tests\GetPinnedTableApi.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Data\Tests\GetToolTypeMetadataApi.json"> <None Include="Data\Tests\GetToolTypeMetadataApi.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>

View File

@ -102,7 +102,6 @@ public class Program
if (!webApplicationBuilder.Environment.IsDevelopment()) if (!webApplicationBuilder.Environment.IsDevelopment())
{ {
_ = webApplication.UseExceptionHandler("/Error"); _ = webApplication.UseExceptionHandler("/Error");
_ = webApplication.UseHttpsRedirection();
_ = webApplication.UseHsts(); _ = webApplication.UseHsts();
} }
else else
@ -121,6 +120,7 @@ public class Program
_ = webApplication.UseFileServer(enableDirectoryBrowsing: true); _ = webApplication.UseFileServer(enableDirectoryBrowsing: true);
_ = webApplication.UseStaticFiles(); _ = webApplication.UseStaticFiles();
_ = webApplication.UseSession(); _ = webApplication.UseSession();
_ = webApplication.UseHttpsRedirection();
_ = webApplication.UseMiddleware<ApiLoggingMiddleware>(); _ = webApplication.UseMiddleware<ApiLoggingMiddleware>();
_ = webApplication.MapControllers(); _ = webApplication.MapControllers();
log.Information("Starting Web Application"); log.Information("Starting Web Application");

View File

@ -1,31 +0,0 @@
{
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:5126",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:7130;http://localhost:5126",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https-prod": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:7130;http://localhost:5126",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
}
}
}
}

View File

@ -9,103 +9,76 @@ public class PinRepository : IPinRepository
private readonly string _MockRoot; private readonly string _MockRoot;
private readonly Serilog.ILogger _Log; private readonly Serilog.ILogger _Log;
private readonly Dictionary<string, Dictionary<long, HeaderCommon>> _RdsToHeaderCommonCollection;
public PinRepository(string mockRoot) public PinRepository(string mockRoot)
{ {
_MockRoot = mockRoot; _MockRoot = mockRoot;
_RdsToHeaderCommonCollection = new();
_Log = Serilog.Log.ForContext<PinRepository>(); _Log = Serilog.Log.ForContext<PinRepository>();
} }
void IPinRepository.SetPinnedTable(HeaderCommon headerCommon) Result<Pinned[]> IPinRepository.GetPinnedTable(IMetrologyRepository metrologyRepository, int id, string? bioRad, string? cde)
{
Dictionary<long, HeaderCommon>? toolIdToHeader;
if (!string.IsNullOrEmpty(headerCommon.RDS))
{
if (!_RdsToHeaderCommonCollection.TryGetValue(headerCommon.RDS, out toolIdToHeader))
{
_RdsToHeaderCommonCollection.Add(headerCommon.RDS, new());
if (!_RdsToHeaderCommonCollection.TryGetValue(headerCommon.RDS, out toolIdToHeader))
throw new Exception();
}
if (toolIdToHeader.ContainsKey(headerCommon.ToolTypeID))
toolIdToHeader[headerCommon.ToolTypeID] = headerCommon;
else
toolIdToHeader.Add(headerCommon.ToolTypeID, headerCommon);
}
}
private (HeaderCommon?, HeaderCommon?) GetBoth(string rds, long bioRadId, long cdeId)
{
Dictionary<long, HeaderCommon>? toolIdToHeader;
if (!_RdsToHeaderCommonCollection.TryGetValue(rds, out toolIdToHeader))
{
_RdsToHeaderCommonCollection.Add(rds, new());
if (!_RdsToHeaderCommonCollection.TryGetValue(rds, out toolIdToHeader))
throw new Exception();
}
_ = toolIdToHeader.TryGetValue(cdeId, out HeaderCommon? cdeHeader);
_ = toolIdToHeader.TryGetValue(bioRadId, out HeaderCommon? bioRadHeader);
return new(bioRadHeader, cdeHeader);
}
private static Pinned? GetPinned(IMetrologyRepository metrologyRepository, HeaderCommon headerCommon, int points, int column)
{
Pinned? result;
List<string> values;
System.Data.DataTable dataTable = metrologyRepository.GetData((int)headerCommon.ToolTypeID, headerCommon.ID);
if (dataTable.Rows.Count <= points || dataTable.Columns.Count <= column)
result = null;
else
{
values = new();
for (int i = 0; i < dataTable.Rows.Count - 1; i++)
{
if (dataTable.Rows[i]?.ItemArray[column] is null)
break;
values.Add(string.Concat(dataTable.Rows[i].ItemArray[column]));
}
if (values.Count <= points)
result = null;
else
result = new(headerCommon, values);
}
return result;
}
Result<Pinned[]> IPinRepository.GetPinnedTable(IMetrologyRepository metrologyRepository, int id, string? biorad_id, string? cde_id, string? rds)
{ {
Result<Pinned[]>? r; Result<Pinned[]>? r;
if (!string.IsNullOrEmpty(_MockRoot)) HeaderCommon? cdeHeader = cde is null ? null : JsonSerializer.Deserialize<HeaderCommon>(cde);
{ long cdeId = cdeHeader is null ? (long)IPinRepository.ToolId.CDE : cdeHeader.ToolTypeID;
string json = File.ReadAllText(Path.Combine(string.Concat(AppContext.BaseDirectory, _MockRoot), "GetPinnedTableApi.json")); HeaderCommon? bioRadHeader = bioRad is null ? null : JsonSerializer.Deserialize<HeaderCommon>(bioRad);
r = JsonSerializer.Deserialize<Result<Pinned[]>>(json); long bioRadId = bioRadHeader is null ? (long)IPinRepository.ToolId.BioRad : bioRadHeader.ToolTypeID;
if (r is null) if (cdeId != id && bioRadId != id)
throw new NullReferenceException(nameof(r)); r = new() { Results = Array.Empty<Pinned>(), TotalRows = 0 };
}
else else
{ {
if (string.IsNullOrEmpty(rds) || !long.TryParse(biorad_id, out long bioRadId) || !long.TryParse(cde_id, out long cdeId)) if (!string.IsNullOrEmpty(_MockRoot))
r = new() { Results = Array.Empty<Pinned>(), TotalRows = 0 }; {
string json = File.ReadAllText(Path.Combine(string.Concat(AppContext.BaseDirectory, _MockRoot), "GetPinnedTableApi.json"));
r = JsonSerializer.Deserialize<Result<Pinned[]>>(json);
if (r is null)
throw new NullReferenceException(nameof(r));
}
else else
{ {
List<string> values;
const int points = 9; const int points = 9;
Pinned headerCommond;
List<Pinned> results = new(); List<Pinned> results = new();
(HeaderCommon? bioRadHeader, HeaderCommon? cdeHeader) = GetBoth(rds, bioRadId, cdeId);
if (bioRadHeader is not null) if (bioRadHeader is not null)
{ {
const int thickness = 5; const int thickness = 5;
Pinned? pinned = GetPinned(metrologyRepository, bioRadHeader, points, column: thickness); System.Data.DataTable dataTable = metrologyRepository.GetData((int)bioRadHeader.ToolTypeID, bioRadHeader.ID);
if (pinned is not null) if (dataTable.Rows.Count > points && dataTable.Columns.Count > thickness)
results.Add(pinned); {
values = new();
for (int i = 0; i < dataTable.Rows.Count - 1; i++)
{
if (dataTable.Rows[i]?.ItemArray[thickness] is null)
break;
values.Add(string.Concat(dataTable.Rows[i].ItemArray[thickness]));
}
if (values.Count > points)
{
headerCommond = new(bioRadHeader, values);
results.Add(headerCommond);
}
}
} }
if (cdeHeader is not null) if (cdeHeader is not null)
{ {
const int rs = 6; const int rs = 6;
Pinned? pinned = GetPinned(metrologyRepository, cdeHeader, points, column: rs); System.Data.DataTable dataTable = metrologyRepository.GetData((int)cdeHeader.ToolTypeID, cdeHeader.ID);
if (pinned is not null) if (dataTable.Rows.Count > points && dataTable.Columns.Count > rs)
results.Add(pinned); {
values = new();
for (int i = 0; i < dataTable.Rows.Count - 1; i++)
{
if (dataTable.Rows[i]?.ItemArray[rs] is null)
break;
values.Add(string.Concat(dataTable.Rows[i].ItemArray[rs]));
}
if (values.Count > points)
{
headerCommond = new(cdeHeader, values);
results.Add(headerCommond);
}
}
} }
r = new() r = new()
{ {

View File

@ -47,11 +47,9 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var apiUrl = "@ViewBag.ApiUrl";
$("#ToolType").igCombo({ $("#ToolType").igCombo({
dataSource: apiUrl + '/tooltypes', dataSource: '@Url.Content("~/api/tooltypes")',
responseDataKey: "Results", responseDataKey: "Results",
textKey: "ToolTypeName", textKey: "ToolTypeName",
valueKey: "ID", valueKey: "ID",

View File

@ -21,7 +21,7 @@
$(document).ready(function () { $(document).ready(function () {
initAwaitingDisposition("@ViewBag.ApiUrl"); initAwaitingDisposition("@Url.Content("~/api")");
}); });

View File

@ -50,7 +50,7 @@
$(document).ready(function () { $(document).ready(function () {
initRunHeaders("@ViewBag.ApiUrl"); initRunHeaders("@Url.Content("~/api")");
}); });

View File

@ -74,11 +74,17 @@
</div> </div>
<div id="PinnedDiv">
<div style="padding-bottom: 20px;" id="PinnedGridDiv">
<table id="PinnedGrid"></table>
</div>
</div>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
initRunInfo("@ViewBag.ApiUrl", "@Model.ToolTypeID", "@Model.HeaderID", "@Model.HeaderAttachmentID"); initRunInfo("@Url.Content("~/api")", "@Model.ToolTypeID", "@Model.HeaderID", "@Model.HeaderAttachmentID");
}); });

View File

@ -1,10 +1,5 @@
{ {
"xApiUrl": "http://messa010ec.ec.local:50301/api",
"ApiUrl": "http://localhost:5126/api",
"xxxApiUrl": "http://localhost:50301/api",
"xxxxApiUrl": "http://messa010ec.ec.local:50301/api",
"ConnectionString": "Data Source=MESSAD1001\\TEST1,59583;Integrated Security=True;Initial Catalog=Metrology;", "ConnectionString": "Data Source=MESSAD1001\\TEST1,59583;Integrated Security=True;Initial Catalog=Metrology;",
"xConnectionString": "Data Source=messv01ec.ec.local\\PROD1,53959;Integrated Security=True;Initial Catalog=Metrology;",
"IsDevelopment": true, "IsDevelopment": true,
"xMockRoot": "/Data/Tests", "xMockRoot": "/Data/Tests",
"MockRoot": "", "MockRoot": "",

View File

@ -2,7 +2,6 @@
"AllowedHosts": "*", "AllowedHosts": "*",
"ApiLoggingContentTypes": "application/json", "ApiLoggingContentTypes": "application/json",
"ApiLoggingPathPrefixes": "/api/inbound", "ApiLoggingPathPrefixes": "/api/inbound",
"ApiUrl": "~/api",
"ApiLogPath": "D:\\Metrology\\MetrologyAPILogs", "ApiLogPath": "D:\\Metrology\\MetrologyAPILogs",
"AttachmentPath": "\\\\messv02ecc1.ec.local\\EC_Metrology_Si\\MetrologyAttachments", "AttachmentPath": "\\\\messv02ecc1.ec.local\\EC_Metrology_Si\\MetrologyAttachments",
"BuildNumber": "1", "BuildNumber": "1",

View File

@ -121,19 +121,9 @@ function ConstructMessageDialog() {
' </div> ' + ' </div> ' +
' <div class="modal-body"> ' + ' <div class="modal-body"> ' +
' <span id="spanMessageText"></span> ' + ' <span id="spanMessageText"></span> ' +
' <table id="ModalHeaderGrid"></table> ' +
' <table id="ModalBodyGrid"></table> ' +
' <textarea type="text" value="Hello World" id="textareaClipboard" style="display:none"></textarea> ' +
' </div> ' + ' </div> ' +
' <div class="modal-footer"> ' + ' <div class="modal-footer"> ' +
' <div class="row" style="margin-top: 10px; margin-bottom: 20px;"> ' + ' <button type="button" data-dismiss="modal">OK</button> ' +
' <div class="col-xs-1"> ' +
' <button type="button" data-dismiss="modal" onclick="copy()">Copy</button> ' +
' </div> ' +
' <div class="col-xs-1"> ' +
' <button type="button" data-dismiss="modal">OK</button> ' +
' </div> ' +
' </div> ' +
' </div> ' + ' </div> ' +
' </div> ' + ' </div> ' +
'</div>'; '</div>';

View File

@ -1,10 +1,8 @@
var _CdeId = null;
var _apiUrl = null; var _apiUrl = null;
var _BioRadId = null;
var _toolType = null;
var _initialHeaderId = null;
var _toolTypeMetaData = null;
var _initialHeaderAttachmentId = null; var _initialHeaderAttachmentId = null;
var _initialHeaderId = null;
var _toolType = null;
var _toolTypeMetaData = null;
$(document).ready(function () { $(document).ready(function () {
if (location.pathname == "/") { if (location.pathname == "/") {
@ -69,15 +67,13 @@ function initExport(apiUrl, startTimeValue, endTimeValue) {
_apiUrl = apiUrl; _apiUrl = apiUrl;
var endTime = new Date(endTimeValue); var endTime = new Date(endTimeValue);
var startTime = new Date(startTimeValue); var startTime = new Date(startTimeValue);
$.getJSON(_apiUrl + '/tooltypes', function (data) { $("#ToolType").igCombo({
$("#ToolType").igCombo({ dataSource: _apiUrl + '/tooltypes',
dataSource: data, responseDataKey: "Results",
responseDataKey: "Results", textKey: "ToolTypeName",
textKey: "ToolTypeName", valueKey: "ID",
valueKey: "ID", mode: "dropdown",
mode: "dropdown", width: 150
width: 150
});
}); });
$("#StartDateControl").igDatePicker({ $("#StartDateControl").igDatePicker({
dateInputFormat: "date", dateInputFormat: "date",
@ -178,6 +174,19 @@ function loadRunInfoRunHeaders() {
function initRunHeaders(apiUrl) { function initRunHeaders(apiUrl) {
_apiUrl = apiUrl; _apiUrl = apiUrl;
// $("#ToolType").igCombo({
// dataSource: _apiUrl + '/tooltypes',
// responseDataKey: "Results",
// textKey: "ToolTypeName",
// valueKey: "ID",
// mode: "dropdown",
// width: 150,
// dataBound: function (evt, ui) {
// $("#ToolType").igCombo("index", 0);
// loadHeaderGridRunHeaders();
// },
// selectionChanged: loadHeaderGridRunHeaders,
// });
loadHeaderGridRunHeaders(); loadHeaderGridRunHeaders();
$("#RefreshButton").click(function () { $("#RefreshButton").click(function () {
$("#HeaderGrid").igGrid("dataBind"); $("#HeaderGrid").igGrid("dataBind");
@ -212,6 +221,31 @@ function loadHeaderGridRunInfo() {
DisplayWSMessage("error", "There was an error getting tooltype info.", e); DisplayWSMessage("error", "There was an error getting tooltype info.", e);
} }
}); });
// $.ajax({
// type: "GET",
// url: _apiUrl + "/pin/" + toolTypeID + "/pinned",
// success: function (r) {
// if ((r.Results == null) || (r.Results.HeaderId == null))
// DisplayWSMessage("error", "B) There was an error getting pinned info.");
// else
// DisplayWSMessage("info", r.Results.HeaderId);
// },
// error: function (e) {
// DisplayWSMessage("error", "There was an error getting pinned info.", e);
// }
// });
$("#PinnedGrid").igGrid({
width: "70%",
height: "100%",
dataSource: _apiUrl + "/pin/" + toolTypeID + "/pinned",
responseDataKey: "Results",
tabIndex: 1,
features: [
{ name: "Selection", mode: "row", multipleSelection: false },
{ name: "Filtering", type: "local" },
{ name: "Sorting", type: "local" },
]
});
} }
function disableHeaderButtonsRunInfo() { function disableHeaderButtonsRunInfo() {
@ -460,67 +494,17 @@ function reviewButtonRunInfo() {
} }
function pinButtonRunInfo() { function pinButtonRunInfo() {
var toolTypeId = $("#ToolTypeID").text();
var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow(); var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow();
if (selectedRow !== null) { if (selectedRow !== null) {
$("#PinButton").prop("disabled", true); $("#PinButton").prop("disabled", true);
var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index]; var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index];
var stringified = JSON.stringify(rowData);
stringified = stringified.replace(/"Tool":/gm, '"MesEntity":');
stringified = stringified.replace(/"Equipment ID":/gm, '"MesEntity":');
var jsonObject = JSON.parse(stringified);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: _apiUrl + '/pin/' + toolTypeId + "/markAsPinned", url: _apiUrl + "/pin/markAsPinned",
data: jsonObject, data: rowData,
success: function (e) { success: function (e) {
DisplayWSMessage("info", "Marked as pinned", e); DisplayWSMessage("info", "Marked as pinned", e);
// DisplayWSMessage("info", stringified, e);
$("#PinButton").prop("disabled", false); $("#PinButton").prop("disabled", false);
$.getJSON(_apiUrl + '/pin/' + toolTypeId + "/pinned?biorad_id=" + _BioRadId + "&cde_id=" + _CdeId + "&rds=" + rowData.RDS, function (data) {
$("#ModalHeaderGrid").igGrid({
dataSource: data,
features: [
{ name: 'Resizing' }
],
columns: [
{ key: "ID", dataType: "number", hidden: true, },
{ key: "ToolTypeID", dataType: "number", hidden: true, },
{ headerText: "Tool", key: "MesEntity", dataType: "string", width: "10%" },
{ key: "Reactor", dataType: "string", width: "10%" },
{ key: "RDS", dataType: "string", width: "10%" },
{ key: "PSN", dataType: "string", width: "10%" },
{ key: "Layer", dataType: "string", width: "10%" },
{ key: "Zone", dataType: "string", width: "10%" }
],
responseDataKey: "Results",
});
var text = "";
for (var i = 0; i < data.Results.length; i++) {
text = text + data.Results[i].Point1 + "\t" + data.Results[i].Point2 + "\t" + data.Results[i].Point3 + "\t" + data.Results[i].Point4 + "\t" + data.Results[i].Point5 + "\t" + data.Results[i].Point6 + "\t" + data.Results[i].Point7 + "\t" + data.Results[i].Point8 + "\t" + data.Results[i].Point9 + "\r";
}
$("#textareaClipboard").val(text);
$("#ModalBodyGrid").igGrid({
dataSource: data,
features: [
{ name: 'Resizing' }
],
columns: [
{ key: "ID", dataType: "number", hidden: true, },
{ key: "ToolTypeID", dataType: "number", hidden: true, },
{ headerText: "Point 1", key: "Point1", dataType: "number", width: "10%" },
{ headerText: "Point 2", key: "Point2", dataType: "number", width: "10%" },
{ headerText: "Point 3", key: "Point3", dataType: "number", width: "10%" },
{ headerText: "Point 4", key: "Point4", dataType: "number", width: "10%" },
{ headerText: "Point 5", key: "Point5", dataType: "number", width: "10%" },
{ headerText: "Point 6", key: "Point6", dataType: "number", width: "10%" },
{ headerText: "Point 7", key: "Point7", dataType: "number", width: "10%" },
{ headerText: "Point 8", key: "Point8", dataType: "number", width: "10%" },
{ headerText: "Point 9", key: "Point9", dataType: "number", width: "10%" },
],
responseDataKey: "Results",
});
});
}, },
error: function (e, ajaxOptions, ex) { error: function (e, ajaxOptions, ex) {
DisplayWSMessage("error", "There was an error marking header as pinned.", e, ex); DisplayWSMessage("error", "There was an error marking header as pinned.", e, ex);
@ -576,28 +560,18 @@ function initRunInfo(apiUrl, initialToolTypeID, initialHeaderId, initialHeaderAt
_apiUrl = apiUrl; _apiUrl = apiUrl;
_initialHeaderId = initialHeaderId; _initialHeaderId = initialHeaderId;
_initialHeaderAttachmentId = initialHeaderAttachmentId; _initialHeaderAttachmentId = initialHeaderAttachmentId;
$.getJSON(_apiUrl + '/tooltypes', function (data) { $("#ToolType").igCombo({
for (var i = 0; i < data.Results.length; i++) { dataSource: _apiUrl + '/tooltypes',
if (data.Results[i].ToolTypeName === "CDE") { responseDataKey: "Results",
_CdeId = data.Results[i].ID; textKey: "ToolTypeName",
} valueKey: "ID",
else if (data.Results[i].ToolTypeName === "BioRad") { mode: "dropdown",
_BioRadId = data.Results[i].ID; width: 150,
} itemsRendered: function (evt, ui) {
} loadHeaderGridRunInfo();
$("#ToolType").igCombo({ },
dataSource: data, selectionChanged: loadHeaderGridRunInfo,
responseDataKey: "Results", initialSelectedItems: [{ value: initialToolTypeID }]
textKey: "ToolTypeName",
valueKey: "ID",
mode: "dropdown",
width: 150,
itemsRendered: function (evt, ui) {
loadHeaderGridRunInfo();
},
selectionChanged: loadHeaderGridRunInfo,
initialSelectedItems: [{ value: initialToolTypeID }]
});
}); });
setInitialDateTimesRunInfo(); setInitialDateTimesRunInfo();
$("#HeaderGrid").on("dblclick", "tr", loadDetailsRunInfo); $("#HeaderGrid").on("dblclick", "tr", loadDetailsRunInfo);
@ -623,15 +597,4 @@ function triggerFileDownload(fileName, url) {
} }
function initIndex() { function initIndex() {
}
function copy() {
var copyText = document.getElementById("textareaClipboard");
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
} }

View File

@ -104,31 +104,3 @@ div.modal-content-warning {
.icon-bar { .icon-bar {
background-color: black; background-color: black;
} }
@media screen and (min-width: 1024px) {
.modal-dialog {
right: auto;
left: 50%;
width: 768px;
padding-top: 30px;
padding-bottom: 30px;
}
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
}
@media screen and (min-width: 1368px) {
.modal-dialog {
right: auto;
left: 50%;
width: 1280px;
padding-top: 30px;
padding-bottom: 30px;
}
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
}

View File

@ -2,31 +2,15 @@
public class HeaderCommon public class HeaderCommon
{ {
public long ID { get; set; } public long ID { get; set; }
public DateTime InsertDate { get; set; } public DateTime InsertDate { get; set; }
public Guid AttachmentID { get; set; } public Guid AttachmentID { get; set; }
public string? Title { get; set; } public string? Title { get; set; }
public string? Recipe { get; set; }
public DateTime Date { get; set; } public DateTime Date { get; set; }
public long ToolTypeID { get; set; } public long ToolTypeID { get; set; }
public string? ToolTypeName { get; set; } public string? ToolTypeName { get; set; }
// [Newtonsoft.Json.JsonProperty("Tool")]
// [System.Text.Json.Serialization.JsonPropertyName("Tool")]
// public string? Tool { get; set; }
// [Newtonsoft.Json.JsonProperty("Equipment ID")]
// [System.Text.Json.Serialization.JsonPropertyName("Equipment ID")]
// public string? Equipment_ID { get; set; }
public string? MesEntity { get; set; }
public string? Employee { get; set; }
public string? Layer { get; set; }
public string? PSN { get; set; }
public string? RDS { get; set; }
public string? Reactor { get; set; } public string? Reactor { get; set; }
public string? Recipe { get; set; } public string? RDS { get; set; }
public string? Zone { get; set; } public string? PSN { get; set; }
} }

View File

@ -3,15 +3,15 @@
public class Pinned : HeaderCommon public class Pinned : HeaderCommon
{ {
public string Point1 { get; set; } public string PointA { get; set; }
public string Point2 { get; set; } public string PointB { get; set; }
public string Point3 { get; set; } public string PointC { get; set; }
public string Point4 { get; set; } public string PointD { get; set; }
public string Point5 { get; set; } public string PointE { get; set; }
public string Point6 { get; set; } public string PointF { get; set; }
public string Point7 { get; set; } public string PointG { get; set; }
public string Point8 { get; set; } public string PointH { get; set; }
public string Point9 { get; set; } public string PointI { get; set; }
public Pinned(HeaderCommon headerCommon, List<string> values) public Pinned(HeaderCommon headerCommon, List<string> values)
{ {
@ -19,29 +19,22 @@ public class Pinned : HeaderCommon
InsertDate = headerCommon.InsertDate; InsertDate = headerCommon.InsertDate;
AttachmentID = headerCommon.AttachmentID; AttachmentID = headerCommon.AttachmentID;
Title = headerCommon.Title; Title = headerCommon.Title;
Recipe = headerCommon.Recipe;
Date = headerCommon.Date; Date = headerCommon.Date;
ToolTypeID = headerCommon.ToolTypeID; ToolTypeID = headerCommon.ToolTypeID;
ToolTypeName = headerCommon.ToolTypeName; ToolTypeName = headerCommon.ToolTypeName;
MesEntity = headerCommon.MesEntity;
Employee = headerCommon.Employee;
Layer = headerCommon.Layer;
PSN = headerCommon.PSN;
RDS = headerCommon.RDS;
Reactor = headerCommon.Reactor; Reactor = headerCommon.Reactor;
Recipe = headerCommon.Recipe; RDS = headerCommon.RDS;
Zone = headerCommon.Zone; PSN = headerCommon.PSN;
PointA = values[0];
Point1 = values[0]; PointB = values[1];
Point2 = values[1]; PointC = values[2];
Point3 = values[2]; PointD = values[3];
Point4 = values[3]; PointE = values[4];
Point5 = values[4]; PointF = values[5];
Point6 = values[5]; PointG = values[6];
Point7 = values[6]; PointH = values[7];
Point8 = values[7]; PointI = values[8];
Point9 = values[8];
} }
} }

View File

@ -11,6 +11,5 @@ public interface IPinController<T>
static string GetRouteName() => nameof(IPinController<T>)[1..^10]; static string GetRouteName() => nameof(IPinController<T>)[1..^10];
T MarkAsPinned(DataModels.HeaderCommon headerCommon); T MarkAsPinned(DataModels.HeaderCommon headerCommon);
T GetPinnedTable(int toolTypeId, string? biorad_id = null, string? cde_id = null, string? rds = null);
} }

View File

@ -5,7 +5,16 @@ namespace OI.Metrology.Shared.Models.Stateless;
public interface IPinRepository public interface IPinRepository
{ {
Result<Pinned[]> GetPinnedTable(IMetrologyRepository metrologyRepository, int id, string? biorad_id, string? cde_id, string? rds); enum ToolId
void SetPinnedTable(HeaderCommon headerCommon); {
BioRad = 1,
CDE = 2,
Tencor = 3,
HgCV = 4,
Stratus = 5,
SP1 = 6,
}
Result<Pinned[]> GetPinnedTable(IMetrologyRepository metrologyRepository, int id, string? bioRad, string? cde);
} }

View File

@ -37,26 +37,30 @@ public class UnitTestPinController
} }
[TestMethod] [TestMethod]
public void GetPinnedTable() public void GetHeaderTitles()
{ {
_Logger.Information("Starting Web Application"); _Logger.Information("Starting Web Application");
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
IMetrologyRepository metrologyRepository = serviceProvider.GetRequiredService<IMetrologyRepository>(); IMetrologyRepository metrologyRepository = serviceProvider.GetRequiredService<IMetrologyRepository>();
IPinRepository pinRepository = serviceProvider.GetRequiredService<IPinRepository>(); IPinRepository pinRepository = serviceProvider.GetRequiredService<IPinRepository>();
Result<Pinned[]> result = pinRepository.GetPinnedTable(metrologyRepository, id: 1, cde_id: null, biorad_id: null, rds: null); string? cde = System.Text.Json.JsonSerializer.Serialize(new HeaderCommon { ID = 196984, ToolTypeID = 2 });
string? bioRad = System.Text.Json.JsonSerializer.Serialize(new HeaderCommon { ID = 321568, ToolTypeID = 1 });
Result<Pinned[]> result = pinRepository.GetPinnedTable(metrologyRepository, id: 1, bioRad, cde);
Assert.IsNotNull(result?.Results); Assert.IsNotNull(result?.Results);
Assert.IsTrue(result.Results.Any());
_Logger.Information($"{_TestContext?.TestName} completed"); _Logger.Information($"{_TestContext?.TestName} completed");
} }
[TestMethod] [TestMethod]
public async Task GetPinnedTableApi() public async Task GetHeaderTitlesApi()
{ {
HttpClient httpClient = _WebApplicationFactory.CreateClient(); HttpClient httpClient = _WebApplicationFactory.CreateClient();
_Logger.Information("Starting Web Application"); _Logger.Information("Starting Web Application");
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/-1/pinned"); string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/-1/headertitles");
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{nameof(GetPinnedTableApi)}.json"), json); File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{nameof(GetHeaderTitlesApi)}.json"), json);
Result<Pinned[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<Pinned[]>>(json); Result<Pinned[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<Pinned[]>>(json);
Assert.IsNotNull(result?.Results); Assert.IsNotNull(result?.Results);
Assert.IsTrue(result.Results.Any());
_Logger.Information($"{_TestContext?.TestName} completed"); _Logger.Information($"{_TestContext?.TestName} completed");
} }

View File

@ -76,15 +76,11 @@ steps:
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)' - script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
workingDirectory: Server workingDirectory: Server
displayName: "Core Build - Server" displayName: "Core Build - Server"
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
workingDirectory: "$(System.DefaultWorkingDirectory)/.vscode"
displayName: 'PowerShell Script'
- script: "dotnet test --configuration $(Configuration)" - script: "dotnet test --configuration $(Configuration)"
workingDirectory: Tests workingDirectory: Tests
displayName: "Core Test" displayName: "Core Test"
# enabled: false enabled: false
- script: '"C:\program files\dotnet\dotnet.exe" tool restore' - script: '"C:\program files\dotnet\dotnet.exe" tool restore'
workingDirectory: Server workingDirectory: Server
@ -96,22 +92,6 @@ steps:
displayName: "Report Generator" displayName: "Report Generator"
enabled: false enabled: false
- task: PublishTestResults@2
displayName: "Publish Test Results **/*.trx"
inputs:
testResultsFormat: VSTest
testResultsFiles: "**/*.trx"
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
displayName: "Create work item"
inputs:
teamProject: "Mesa_FI"
workItemType: Bug
title: $(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)
assignedTo: "$(Build.RequestedForId)"
enabled: false
- script: '"C:\program files\dotnet\dotnet.exe" publish --configuration $(Configuration) --runtime win-x64 --self-contained -o $(Build.ArtifactStagingDirectory)\Server --source $(NugetSource)' - script: '"C:\program files\dotnet\dotnet.exe" publish --configuration $(Configuration) --runtime win-x64 --self-contained -o $(Build.ArtifactStagingDirectory)\Server --source $(NugetSource)'
workingDirectory: Server workingDirectory: Server
displayName: "Core Publish" displayName: "Core Publish"