Skip to content
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
28 changes: 16 additions & 12 deletions src/Ops.Controllers/Areas/Services/RenewCardController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public async Task<IActionResult> Details(int id)
_logger.LogWarning("Unable to find Polaris record for the barcode {Barcode}",
request.Barcode);
ShowAlertDanger($"Unable to find Polaris record for the barcode '{request.Barcode}'");
return RedirectToAction(nameof(Index));
}
}
catch (OcudaException oex)
Expand All @@ -122,10 +121,25 @@ await _siteSettingService.GetSettingStringAsync(Models
.RenewCard
.AssessorLookupUrl),
Customer = customer,
CustomerName = $"{customer.NameFirst} {customer.NameLast}",
CustomerName = $"{customer?.NameFirst} {customer?.NameLast}",
Request = request
};

var leapPatronUrl = await _siteSettingService.GetSettingStringAsync(Models
.Keys
.SiteSetting
.RenewCard
.LeapPatronUrl);
if (!string.IsNullOrWhiteSpace(leapPatronUrl))
{
viewModel.LeapPath = leapPatronUrl + request.CustomerId + LeapPatronRecordsPath;
}

if (customer == null)
{
return View("NotFound", viewModel);
}

if (!request.ProcessedAt.HasValue)
{
var responses = await _renewCardService.GetAvailableResponsesAsync();
Expand Down Expand Up @@ -225,16 +239,6 @@ await _siteSettingService.GetSettingStringAsync(Models
viewModel.CustomerAge = age;
}

var leapPatronUrl = await _siteSettingService.GetSettingStringAsync(Models
.Keys
.SiteSetting
.RenewCard
.LeapPatronUrl);
if (!string.IsNullOrWhiteSpace(leapPatronUrl))
{
viewModel.LeapPath = leapPatronUrl + request.CustomerId + LeapPatronRecordsPath;
}

return View(viewModel);
}

Expand Down
94 changes: 94 additions & 0 deletions src/Ops.Web/Areas/Services/Views/RenewCard/NotFound.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
@using Ocuda.Ops.Controllers.Areas.Services
@model Ocuda.Ops.Controllers.Areas.Services.ViewModels.RenewCard.DetailsViewModel

@section header {
<div class="d-flex justify-content-between mb-2">
<h1>
Card Renewal Request
</h1>
<div>
<a asp-action="@nameof(RenewCardController.Index)"
asp-area="@RenewCardController.Area"
asp-controller="@RenewCardController.Name"
class="btn btn-outline-dark ms-2">Back</a>
</div>
</div>
}
<div class="row">
<div class="col-12 col-md-6 offset-md-3 alert alert-warning">
<p>
Something has gone wrong. A customer submitted a renewal request through the Web site,
providing their barcode and PIN/password - but since they made that submission their
barcode has been removed from Polaris. It is likely they went into a library and had
their barcode changed for whatever reason.
</p>

<p>
Please investigate this before clearing this renewal request.
</p>

<button type="button"
class="btn btn-warning"
data-bs-toggle="modal"
data-bs-target="#discardModal">
<span class="fa-solid fa-trash-can"></span>
Discard Request, do not send email
</button>
</div>
</div>
<div class="row">
<div class="col-12 col-md-6 offset-md-3">
<table class="table table-sm table-bordered">
<tr>
<th style="width: 10rem;">Record id</th>
<td>
@Model.Request.CustomerId
@if (!string.IsNullOrEmpty(Model.LeapPath))
{
<a href="@Model.LeapPath" target="_blank" title="View in Leap">
<span class="fa-solid fa-arrow-up-right-from-square fa-fw"></span>
</a>
}
</td>
</tr>
<tr>
<th>Request barcode</th>
<td>@Model.Request.Barcode</td>
</tr>
<tr>
<th>Request language</th>
<td>@Model.Request.Language.Description</td>
</tr>
</table>
</div>
</div>
<form asp-action="@nameof(RenewCardController.Discard)"
enctype="multipart/form-data"
method="post"
role="form">
<input id="discardId" asp-for="RequestId" value="@Model.Request.Id" type="hidden" />

<div class="modal" tabindex="-1" id="discardModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Discard Request</h5>
<button type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Are you sure you want to discard this request?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-outline-warning">
<span class="fa fa-trash" aria-hidden="true"></span>
Discard
</button>
</div>
</div>
</div>
</div>
</form>
2 changes: 1 addition & 1 deletion src/Ops.Web/Ops.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<CodeAnalysisRuleSet>../../OcudaRuleSet.ruleset</CodeAnalysisRuleSet>
<Company>Maricopa County Library District</Company>
<Copyright>Copyright 2018 Maricopa County Library District</Copyright>
<FileVersion>1.0.0.351</FileVersion>
<FileVersion>1.0.0.352</FileVersion>
<LangVersion>Latest</LangVersion>
<PackageLicenseUrl>https://github.com/MCLD/ocuda/blob/develop/LICENSE</PackageLicenseUrl>
<Product>Ocuda</Product>
Expand Down
2 changes: 1 addition & 1 deletion src/Promenade.Web/Promenade.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<CodeAnalysisRuleSet>../../OcudaRuleSet.ruleset</CodeAnalysisRuleSet>
<Company>Maricopa County Library District</Company>
<Copyright>Copyright 2018 Maricopa County Library District</Copyright>
<FileVersion>1.0.0.351</FileVersion>
<FileVersion>1.0.0.352</FileVersion>
<LangVersion>Latest</LangVersion>
<PackageLicenseUrl>https://github.com/MCLD/ocuda/blob/develop/LICENSE</PackageLicenseUrl>
<Product>Ocuda</Product>
Expand Down
Loading