From cbfad0803d1f09e866757910d6f8b382bd96dd0c Mon Sep 17 00:00:00 2001 From: Tom Karasch Date: Thu, 8 Feb 2024 15:09:39 -0500 Subject: [PATCH] WIP partial fix of review issues --- FMS.Domain/Dto/Facility/FacilityDetailDto.cs | 10 +++++++--- FMS.Domain/Dto/Facility/FacilitySpec.cs | 3 +-- FMS.Domain/Entities/Facility.cs | 14 +++++++------- .../Repositories/FacilityRepository.cs | 2 +- FMS/Helpers/FacilityDetailDtoScalar.cs | 2 -- FMS/Helpers/URLHelper.cs | 2 +- FMS/Pages/Facilities/Add.cshtml | 2 +- FMS/Pages/Facilities/Details.cshtml | 5 +++-- FMS/Pages/Facilities/Details.cshtml.cs | 12 ++++-------- FMS/Pages/Facilities/Edit.cshtml | 15 --------------- FMS/Pages/Facilities/Index.cshtml | 2 +- .../DevHelpers/SeedData/FacilitySeedData.cs | 1 - FMS/wwwroot/js/formSearch.js | 2 +- README.md | 2 +- 14 files changed, 28 insertions(+), 46 deletions(-) diff --git a/FMS.Domain/Dto/Facility/FacilityDetailDto.cs b/FMS.Domain/Dto/Facility/FacilityDetailDto.cs index 0984a47e..7a66bbda 100644 --- a/FMS.Domain/Dto/Facility/FacilityDetailDto.cs +++ b/FMS.Domain/Dto/Facility/FacilityDetailDto.cs @@ -31,9 +31,11 @@ public FacilityDetailDto(Facility facility) PostalCode = facility.PostalCode; Latitude = facility.Latitude; Longitude = facility.Longitude; + HasERecord = facility.HasERecord; + Comments = facility.Comments; + // *** these properties only apply to Release Notifications *** HSInumber = facility.HSInumber; DeterminationLetterDate = facility.DeterminationLetterDate; - Comments = facility.Comments; PreRQSMcleanup = facility.PreRQSMcleanup; ImageChecked = facility.ImageChecked; DeferredOnSiteScoring = facility.DeferredOnSiteScoring; @@ -43,7 +45,7 @@ public FacilityDetailDto(Facility facility) HistoricalUnit = facility.HistoricalUnit; HistoricalComplianceOfficer = facility.HistoricalComplianceOfficer; TaxId = facility.TaxId; - HasERecord = facility.HasERecord; + // *** End release Notification Only Properties IsRetained = facility.IsRetained; Cabinets = new List(); RetentionRecords = facility.RetentionRecords? @@ -112,7 +114,7 @@ public FacilityDetailDto(Facility facility) [Display(Name = "HSI Number")] public string HSInumber { get; set; } - [Display(Name = "Determination Letter Date")] + [Display(Name = "Determination Letter Date", Prompt = "None Entered")] public DateOnly? DeterminationLetterDate { get; set; } [Display(Name = "Comments")] @@ -145,6 +147,8 @@ public FacilityDetailDto(Facility facility) [Display(Name = "Tax ID")] public string TaxId { get; set; } + // End release notification Only Properties + [Display(Name = "Has Electronic Records")] public bool HasERecord { get; set; } diff --git a/FMS.Domain/Dto/Facility/FacilitySpec.cs b/FMS.Domain/Dto/Facility/FacilitySpec.cs index 8086c4ce..e7e8f04c 100644 --- a/FMS.Domain/Dto/Facility/FacilitySpec.cs +++ b/FMS.Domain/Dto/Facility/FacilitySpec.cs @@ -82,8 +82,7 @@ public class FacilitySpec [Display(Name = "VRP Referral")] public bool VRPReferral { get; set; } - - [AllowNull] + [Display(Name = "Date Received")] public DateOnly RNDateReceived { get; set; } diff --git a/FMS.Domain/Entities/Facility.cs b/FMS.Domain/Entities/Facility.cs index 377767f4..a5e1965e 100644 --- a/FMS.Domain/Entities/Facility.cs +++ b/FMS.Domain/Entities/Facility.cs @@ -29,16 +29,16 @@ public Facility(FacilityCreateDto newFacility) PostalCode = newFacility.PostalCode; Latitude = newFacility.Latitude ?? 0; Longitude = newFacility.Longitude ?? 0; + HasERecord = newFacility.HasERecord; + Comments = newFacility.Comments; // The following properties only apply to Release Notifications HSInumber = newFacility.HSInumber; DeterminationLetterDate = newFacility.DeterminationLetterDate; - Comments = newFacility.Comments; PreRQSMcleanup = newFacility.PreRQSMcleanup; ImageChecked = newFacility.ImageChecked; DeferredOnSiteScoring = newFacility.DeferredOnSiteScoring; AdditionalDataRequested = newFacility.AdditionalDataRequested; VRPReferral = newFacility.VRPReferral; - HasERecord = newFacility.HasERecord; RNDateReceived = newFacility.RNDateReceived; HistoricalUnit = newFacility.HistoricalUnit; HistoricalComplianceOfficer = newFacility.HistoricalComplianceOfficer; @@ -103,15 +103,17 @@ public Facility(FacilityCreateDto newFacility) public bool IsRetained { get; set; } = true; + public bool HasERecord { get; set; } = false; + + [StringLength(1000)] + public string Comments { get; set; } + // The following properties only apply to Release Notifications [StringLength(5)] public string HSInumber { get; set; } public DateOnly? DeterminationLetterDate { get; set; } - [StringLength(1000)] - public string Comments { get; set; } - public bool PreRQSMcleanup { get; set; } = false; public bool ImageChecked { get; set; } = false; @@ -122,8 +124,6 @@ public Facility(FacilityCreateDto newFacility) public bool VRPReferral { get; set; } = false; - public bool HasERecord { get; set; } = false; - public DateOnly? RNDateReceived { get; set; } public string HistoricalUnit { get; set; } diff --git a/FMS.Infrastructure/Repositories/FacilityRepository.cs b/FMS.Infrastructure/Repositories/FacilityRepository.cs index 3d7fcc03..90189ce2 100644 --- a/FMS.Infrastructure/Repositories/FacilityRepository.cs +++ b/FMS.Infrastructure/Repositories/FacilityRepository.cs @@ -58,7 +58,7 @@ private IQueryable QueryFacilities(FacilitySpec spec) => _context.Faci .Where(e => string.IsNullOrEmpty(spec.Name) || e.Name.Contains(spec.Name)) .Where(e => !spec.CountyId.HasValue || e.County.Id == spec.CountyId.Value) .Where(e => spec.ShowDeleted || e.Active) - .Where(e => !spec.ShowPendingOnly || (spec.ShowPendingOnly && !e.DeterminationLetterDate.HasValue)) + .Where(e => !spec.ShowPendingOnly || !e.DeterminationLetterDate.HasValue) .Where(e => string.IsNullOrEmpty(spec.FacilityNumber) || e.FacilityNumber.Contains(spec.FacilityNumber)) .Where(e => !spec.FacilityStatusId.HasValue || e.FacilityStatus.Id.Equals(spec.FacilityStatusId)) .Where(e => !spec.FacilityTypeId.HasValue || e.FacilityType.Id.Equals(spec.FacilityTypeId)) diff --git a/FMS/Helpers/FacilityDetailDtoScalar.cs b/FMS/Helpers/FacilityDetailDtoScalar.cs index d77d365c..19ae007e 100644 --- a/FMS/Helpers/FacilityDetailDtoScalar.cs +++ b/FMS/Helpers/FacilityDetailDtoScalar.cs @@ -1,8 +1,6 @@ using ClosedXML.Attributes; -using DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing; using System; using System.ComponentModel.DataAnnotations; -using System.Numerics; namespace FMS.Domain.Dto { diff --git a/FMS/Helpers/URLHelper.cs b/FMS/Helpers/URLHelper.cs index a287fac7..7d00796a 100644 --- a/FMS/Helpers/URLHelper.cs +++ b/FMS/Helpers/URLHelper.cs @@ -9,7 +9,7 @@ public static string GetWorkingFolderLink(string hsiNumber) { return hsiNumber == string.Empty ? string.Empty - : string.Concat("https://gets.sharepoint.com/sites/ResponseandRemediationProgram/HSI/Shared%20Documents/", hsiNumber, "/Working-Docs"); + : string.Concat("https://gets.sharepoint.com/sites/ResponseandRemediationProgram/HSI/Shared%20Documents/", hsiNumber); } } } diff --git a/FMS/Pages/Facilities/Add.cshtml b/FMS/Pages/Facilities/Add.cshtml index 393e9bd9..d93a2922 100644 --- a/FMS/Pages/Facilities/Add.cshtml +++ b/FMS/Pages/Facilities/Add.cshtml @@ -199,7 +199,7 @@
- +
diff --git a/FMS/Pages/Facilities/Details.cshtml b/FMS/Pages/Facilities/Details.cshtml index 6bc04a85..1d9b2555 100644 --- a/FMS/Pages/Facilities/Details.cshtml +++ b/FMS/Pages/Facilities/Details.cshtml @@ -1,5 +1,6 @@ @page "{id:Guid?}" @using FMS.Domain.Entities.Users +@using FMS.Platform.Extensions @model FMS.Pages.Facilities.DetailsModel @section Scripts { @@ -204,10 +205,10 @@
- RRP Template Folder + RRP Template Folder @if (Model.FacilityDetail.HSInumber != null) { - HSI Working Docs Folder + HSI Folder }
diff --git a/FMS/Pages/Facilities/Details.cshtml.cs b/FMS/Pages/Facilities/Details.cshtml.cs index 3d88f8a5..3cf4be9c 100644 --- a/FMS/Pages/Facilities/Details.cshtml.cs +++ b/FMS/Pages/Facilities/Details.cshtml.cs @@ -28,8 +28,6 @@ public class DetailsModel : PageModel [TempData] public Guid HighlightRecord { get; set; } - public string TemplateFolderLink { get; set; } = GlobalConstants.TemplateFolderLink; - public string WorkingFolderLink { get; set; } = string.Empty; public async Task OnGetAsync(Guid? id, Guid? hr) @@ -69,18 +67,16 @@ public async Task OnPostRetentionRecordAsync() return NotFound(); } + WorkingFolderLink = UrlHelper.GetWorkingFolderLink(FacilityDetail.HSInumber); + + FacilityId = FacilityDetail.Id; + return Page(); } RecordCreate.TrimAll(); HighlightRecord = await _repository.CreateRetentionRecordAsync(FacilityId, RecordCreate); - FacilityDetail = await _repository.GetFacilityAsync(FacilityId); - - if (FacilityDetail == null) - { - return NotFound(); - } return RedirectToPage(); } diff --git a/FMS/Pages/Facilities/Edit.cshtml b/FMS/Pages/Facilities/Edit.cshtml index 8365a99d..b215091a 100644 --- a/FMS/Pages/Facilities/Edit.cshtml +++ b/FMS/Pages/Facilities/Edit.cshtml @@ -8,21 +8,6 @@ - @* *@ } @{ diff --git a/FMS/Pages/Facilities/Index.cshtml b/FMS/Pages/Facilities/Index.cshtml index 565847b2..0552e16e 100644 --- a/FMS/Pages/Facilities/Index.cshtml +++ b/FMS/Pages/Facilities/Index.cshtml @@ -112,7 +112,7 @@
- +
diff --git a/FMS/Platform/DevHelpers/SeedData/FacilitySeedData.cs b/FMS/Platform/DevHelpers/SeedData/FacilitySeedData.cs index 676f481a..eccf1e22 100644 --- a/FMS/Platform/DevHelpers/SeedData/FacilitySeedData.cs +++ b/FMS/Platform/DevHelpers/SeedData/FacilitySeedData.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing; using FMS.Domain.Entities; // ReSharper disable StringLiteralTypo diff --git a/FMS/wwwroot/js/formSearch.js b/FMS/wwwroot/js/formSearch.js index 203829a6..6d954e9f 100644 --- a/FMS/wwwroot/js/formSearch.js +++ b/FMS/wwwroot/js/formSearch.js @@ -18,7 +18,7 @@ $(document).ready(function formSearch() { $("#RNBlock").removeClass("d-none"); } else { $("#RNBlock").addClass("d-none"); - $("#ShowPendingCB").prop("checked",false) + $("#Spec_ShowPendingOnly").prop("checked",false) } }); }); diff --git a/README.md b/README.md index d0fe6905..ebadc952 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,4 @@ Instructions for adding a new Entity Framework database migration: `dotnet ef migrations add NAME_OF_MIGRATION --msbuildprojectextensionspath ..\artifacts\FMS.Infrastructure\obj\` - `TK's path: repos\FMS> dotnet ef migrations add NAME_OF_MIGRATION --msbuildprojectextensionspath ..\artifacts\FMS.Infrastructure\obj\` + `TK's path: D:\source\repos\FMS\fms.infrastructure> dotnet ef migrations add NAME_OF_MIGRATION --msbuildprojectextensionspath ..\artifacts\FMS.Infrastructure\obj\`