Skip to content

Commit

Permalink
WIP partial fix of review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-karasch committed Feb 8, 2024
1 parent 35b44af commit cbfad08
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 46 deletions.
10 changes: 7 additions & 3 deletions FMS.Domain/Dto/Facility/FacilityDetailDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<string>();
RetentionRecords = facility.RetentionRecords?
Expand Down Expand Up @@ -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")]
Expand Down Expand Up @@ -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; }

Expand Down
3 changes: 1 addition & 2 deletions FMS.Domain/Dto/Facility/FacilitySpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down
14 changes: 7 additions & 7 deletions FMS.Domain/Entities/Facility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion FMS.Infrastructure/Repositories/FacilityRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private IQueryable<Facility> 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))
Expand Down
2 changes: 0 additions & 2 deletions FMS/Helpers/FacilityDetailDtoScalar.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion FMS/Helpers/URLHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
2 changes: 1 addition & 1 deletion FMS/Pages/Facilities/Add.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
<div class="mb-3 row">
<div class="col-md-6">
<label asp-for="Facility.RNDateReceived"></label>
<input asp-for="Facility.RNDateReceived" class="form-control datepicker" type="date" />
<input asp-for="Facility.RNDateReceived" class="form-control datepicker" type="date" placeholder=""/>
<span asp-validation-for="Facility.RNDateReceived" class="text-danger"></span>
</div>
<div class="col-md-6">
Expand Down
5 changes: 3 additions & 2 deletions FMS/Pages/Facilities/Details.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "{id:Guid?}"
@using FMS.Domain.Entities.Users
@using FMS.Platform.Extensions
@model FMS.Pages.Facilities.DetailsModel

@section Scripts {
Expand Down Expand Up @@ -204,10 +205,10 @@
</div>

<div class="container bg-light-subtle p-3 m-1 rounded-3">
<a class="btn btn-sm btn-primary" target="_blank" href=@Model.TemplateFolderLink>RRP Template Folder</a>
<a class="btn btn-sm btn-primary" target="_blank" href=@GlobalConstants.TemplateFolderLink>RRP Template Folder</a>
@if (Model.FacilityDetail.HSInumber != null)
{
<a class="btn btn-sm btn-primary" target="_blank" href=@Model.WorkingFolderLink>HSI Working Docs Folder</a>
<a class="btn btn-sm btn-primary" target="_blank" href=@Model.WorkingFolderLink>HSI Folder</a>
}
</div>

Expand Down
12 changes: 4 additions & 8 deletions FMS/Pages/Facilities/Details.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IActionResult> OnGetAsync(Guid? id, Guid? hr)
Expand Down Expand Up @@ -69,18 +67,16 @@ public async Task<IActionResult> 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();
}
Expand Down
15 changes: 0 additions & 15 deletions FMS/Pages/Facilities/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,6 @@
<script src="~/js/mapGeocode.js"></script>
<partial name="_ValidationScriptsPartial" />
<script src="~/js/formEdit.js"></script>
@* <script>
function ShowRNBlock() {
// Get Element by id
var select = document.getElementById("FileTypeSelect");
//Get the option text
var index = select.selectedIndex;
var text = select.options[index].text;
// show or hide the RN Block
if (text === "RN (Release Notification)") {
document.getElementById("RNBlock").style.display = "block";
} else {
document.getElementById("RNBlock").style.display = "none";
}
}
</script> *@
}

@{
Expand Down
2 changes: 1 addition & 1 deletion FMS/Pages/Facilities/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<div class="col-md">
<div id="RNBlock" class="@(Model.ShowPendingOnly ? "" : "d-none")">
<div class="form-check">
<input asp-for="Spec.ShowPendingOnly" id="ShowPendingCB" />
<input asp-for="Spec.ShowPendingOnly" />
<label asp-for="Spec.ShowPendingOnly" class="form-check-label"></label>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion FMS/Platform/DevHelpers/SeedData/FacilitySeedData.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing;
using FMS.Domain.Entities;

// ReSharper disable StringLiteralTypo
Expand Down
2 changes: 1 addition & 1 deletion FMS/wwwroot/js/formSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
});
});
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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\`

0 comments on commit cbfad08

Please sign in to comment.