Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Reports and Details page as per Jason Metzger #369

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions FMS.Infrastructure/Repositories/FacilityRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,17 @@

var ordered = OrderFacilityQuery(included, spec.SortBy);

var items = await ordered.Select(e => new FacilityDetailDto(e)).ToListAsync();

if (!spec.FileLabel.IsNullOrEmpty())
var items = await ordered.Select(e => new FacilityDetailDto(e)).ToListAsync();

var cabinets = await _context.GetCabinetListAsync(false);

foreach (var item in items)
{
var cabinets = await _context.GetCabinetListAsync(false);
foreach (var item in items)
if (!item.FileLabel.IsNullOrEmpty())
{
item.Cabinets = cabinets.GetCabinetsForFile(item.FileLabel);
}
}

}

return items;
Expand Down Expand Up @@ -221,7 +223,7 @@
throw new ArgumentException($"Facility Number '{newFacility.FacilityNumber}' already exists.");
}

if(newFacility.FacilityNumber.IsNullOrEmpty() && newFacility.FacilityTypeName == "RN")
if (newFacility.FacilityNumber.IsNullOrEmpty() && newFacility.FacilityTypeName == "RN")
{
newFacility.FacilityNumber = await CreateRNFacilityNumberInternalAsync();
}
Expand Down Expand Up @@ -304,7 +306,7 @@
if (file == null)
throw new ArgumentException($"File Label {facilityUpdates.FileLabel} does not exist.");
facility.File = file;
facility.FileId = file?.Id;

Check warning on line 309 in FMS.Infrastructure/Repositories/FacilityRepository.cs

View workflow job for this annotation

GitHub Actions / Run unit tests

Change this expression which always evaluates to the same result. (https://rules.sonarsource.com/csharp/RSPEC-2589)

Check warning on line 309 in FMS.Infrastructure/Repositories/FacilityRepository.cs

View workflow job for this annotation

GitHub Actions / Analyze with CodeQL (csharp)

Change this expression which always evaluates to the same result. (https://rules.sonarsource.com/csharp/RSPEC-2589)
}
}

Expand Down
56 changes: 28 additions & 28 deletions FMS/Helpers/FacilityDetailDtoScalar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,39 @@ public class FacilityDetailDtoScalar
{
public FacilityDetailDtoScalar(FacilityDetailDto facility)
{
FileLabel = facility.FileLabel;

FacilityNumber = facility.FacilityNumber;
Name = facility.Name;
Active = facility.Active;
County = facility.County.Name;
FacilityStatus = facility.FacilityStatus?.Name;
FacilityType = facility.FacilityType?.Name;
BudgetCode = facility.BudgetCode?.Name;
OrganizationalUnit = facility.OrganizationalUnit?.Name;
ComplianceOfficer = facility.ComplianceOfficer?.Name;
Location = facility.Location;
FileLabel = facility.FileLabel;
Address = facility.Address;
City = facility.City;
State = facility.State;
PostalCode = facility.PostalCode;
Latitude = facility.Latitude;
Longitude = facility.Longitude;
Location = facility.Location;
RNDateReceived = facility.RNDateReceived;
DeterminationLetterDate = facility.DeterminationLetterDate;
ImageChecked = facility.ImageChecked;
Comments = facility.Comments;
HSInumber = facility.HSInumber;
DeterminationLetterDate = facility.DeterminationLetterDate;
Comments = facility.Comments;
PreRQSMcleanup = facility.PreRQSMcleanup;
ImageChecked = facility.ImageChecked;
DeferredOnSiteScoring = facility.DeferredOnSiteScoring;
AdditionalDataRequested = facility.AdditionalDataRequested;
VRPReferral = facility.VRPReferral;
RNDateReceived = facility.RNDateReceived;
BudgetCode = facility.BudgetCode?.Name;
HistoricalUnit = facility.HistoricalUnit;
HistoricalComplianceOfficer = facility.HistoricalComplianceOfficer;
HasERecord = facility.HasERecord;
IsRetained = facility.IsRetained;
Cabinets = facility.CabinetsToString;
RetentionRecords = facility.RetentionRecordsToString;
Active = facility.Active;
}

[XLColumn(Header = "Facility Number")]
Expand All @@ -48,9 +49,6 @@ public FacilityDetailDtoScalar(FacilityDetailDto facility)
[XLColumn(Header = "Facility Name")]
public string Name { get; }

[XLColumn(Header = "Active Site")]
public bool Active { get; }

[XLColumn(Header = "County")]
public string County { get; }

Expand All @@ -60,9 +58,6 @@ public FacilityDetailDtoScalar(FacilityDetailDto facility)
[XLColumn(Header = "Type/Environmental Interest")]
public string FacilityType { get; }

[XLColumn(Header = "Budget Code")]
public string BudgetCode { get; }

[XLColumn(Header = "Organizational Unit")]
public string OrganizationalUnit { get; }

Expand All @@ -72,9 +67,6 @@ public FacilityDetailDtoScalar(FacilityDetailDto facility)
[XLColumn(Header = "File Label")]
public string FileLabel { get; }

[XLColumn(Header = "Location Description")]
public string Location { get; }

[XLColumn(Header = "Street Address")]
public string Address { get; }

Expand All @@ -95,33 +87,38 @@ public FacilityDetailDtoScalar(FacilityDetailDto facility)
[DisplayFormat(DataFormatString = "{0:F6}")]
public decimal Longitude { get; }

// The following properties only apply to Release Notifications
[XLColumn(Header = "HSI Number")]
public string HSInumber { get; set; }
[XLColumn(Header = "Location Description")]
public string Location { get; }

[XLColumn(Header = "Date Received")]
public DateOnly? RNDateReceived { get; set; }

[XLColumn(Header = "Determination Letter Date")]
public DateOnly? DeterminationLetterDate { get; set; }

[XLColumn(Header = "Image Checked")]
public bool ImageChecked { get; set; }

[XLColumn(Header = "Comments")]
public string Comments { get; set; }

[XLColumn(Header = "HSI Number")]
public string HSInumber { get; set; }

[XLColumn(Header = "Pre-RQSM Cleanup")]
public bool PreRQSMcleanup { get; set; }

[XLColumn(Header = "Image Checked")]
public bool ImageChecked { get; set; }

[XLColumn(Header = "Deferred OnSite Scoring")]
[XLColumn(Header = "Brownfield Deferral")]
public bool DeferredOnSiteScoring { get; set; }

[XLColumn(Header = "Additional Data Requested")]
public bool AdditionalDataRequested { get; set; }

[XLColumn(Header = "VRP Referral")]
[XLColumn(Header = "VRP Deferral")]
public bool VRPReferral { get; set; }

[XLColumn(Header = "Date Received")]
public DateOnly? RNDateReceived { get; set; }
[XLColumn(Header = "Budget Code")]
public string BudgetCode { get; }

[XLColumn(Header = "Historical Unit")]
public string HistoricalUnit { get; set; }
Expand All @@ -139,6 +136,9 @@ public FacilityDetailDtoScalar(FacilityDetailDto facility)
public string Cabinets { get; }

[XLColumn(Header = "Retention Records")]
public string RetentionRecords { get; }
public string RetentionRecords { get; }

[XLColumn(Header = "Active Site")]
public bool Active { get; }
}
}
14 changes: 7 additions & 7 deletions FMS/Helpers/FacilityPendingDtoScalar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public FacilityPendingDtoScalar(FacilityDetailDto facility)
OrganizationalUnit = facility.OrganizationalUnit?.Name;
ComplianceOfficer = facility.ComplianceOfficer?.Name;
RNDateReceived = facility.RNDateReceived;
Comments = facility.Comments;
PreRQSMcleanup = facility.PreRQSMcleanup;
ImageChecked = facility.ImageChecked;
DeferredOnSiteScoring = facility.DeferredOnSiteScoring;
AdditionalDataRequested = facility.AdditionalDataRequested;
VRPReferral = facility.VRPReferral;
Comments = facility.Comments;
ImageChecked = facility.ImageChecked;
}

[XLColumn(Header = "Notification ID")]
Expand All @@ -37,12 +37,12 @@ public FacilityPendingDtoScalar(FacilityDetailDto facility)
[XLColumn(Header = "Date Received")]
public DateOnly? RNDateReceived { get; set; }

[XLColumn(Header = "Comments")]
public string Comments { get; set; }

[XLColumn(Header = "Pre-RQSM Cleanup")]
public bool PreRQSMcleanup { get; set; }

[XLColumn(Header = "Image Checked")]
public bool ImageChecked { get; set; }

[XLColumn(Header = "Brownfield Deferral")]
public bool DeferredOnSiteScoring { get; set; }

Expand All @@ -52,7 +52,7 @@ public FacilityPendingDtoScalar(FacilityDetailDto facility)
[XLColumn(Header = "VRP Deferral")]
public bool VRPReferral { get; set; }

[XLColumn(Header = "Comments")]
public string Comments { get; set; }
[XLColumn(Header = "Image Checked")]
public bool ImageChecked { get; set; }
}
}
44 changes: 24 additions & 20 deletions FMS/Pages/Facilities/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
</h1>
<hr />
<partial name="_AlertPartial" for="Message" id="alert"/>
<partial name="_AlertPartial" for="Message" id="alert" />

<div class="container-fluid">
<div class="parent-container d-lg-inline-flex">
Expand Down Expand Up @@ -214,25 +214,29 @@
</div>
}
</div>
<div class="container bg-light-subtle p-3 m-1 rounded-3">
<a class="btn btn-sm btn-primary" target="_blank" [email protected]>RRP Template Folder</a>
@if (!string.IsNullOrEmpty(Model.HSIFolderLink))
{
<a class="btn btn-sm btn-primary" target="_blank" [email protected]>HSI Folder</a>
}
@if (!string.IsNullOrEmpty(Model.NotificationFolderLink))
{
<a class="btn btn-sm btn-primary" target="_blank" [email protected]>Release Notification(s)</a>
}
@if (!string.IsNullOrEmpty(Model.PendingNotificationFolderLink))
{
<a class="btn btn-sm btn-primary" target="_blank" [email protected]>Pending Release Notification</a>
}
@if (!string.IsNullOrEmpty(Model.RNHSIFolderLink))
{
<a class="btn btn-sm btn-primary" target="_blank" [email protected]>HSI Folder</a>
}
</div>
@if (Model.FacilityDetail.FacilityType.Name == "RN" || Model.FacilityDetail.FacilityType.Name == "HSI")
{
<div class="container bg-light-subtle p-3 m-1 rounded-3">
<a class="btn btn-sm btn-primary" target="_blank" [email protected]>RRP Template Folder</a>

@if (!string.IsNullOrEmpty(Model.HSIFolderLink))
{
<a class="btn btn-sm btn-primary" target="_blank" [email protected]>HSI Folder</a>
}
@if (!string.IsNullOrEmpty(Model.NotificationFolderLink))
{
<a class="btn btn-sm btn-primary" target="_blank" [email protected]>Release Notification(s)</a>
}
@if (!string.IsNullOrEmpty(Model.PendingNotificationFolderLink))
{
<a class="btn btn-sm btn-primary" target="_blank" [email protected]>Pending Release Notification</a>
}
@if (!string.IsNullOrEmpty(Model.RNHSIFolderLink))
{
<a class="btn btn-sm btn-primary" target="_blank" [email protected]>HSI Folder</a>
}
</div>
}

@if (Model.FacilityDetail.FacilityType.Name != "RN")
{
Expand Down
Loading