Skip to content

Commit

Permalink
EgressUnprocessed
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Vaughan committed May 2, 2024
1 parent 360fdb8 commit afbfdfd
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 24 deletions.
34 changes: 20 additions & 14 deletions src/Data-Egress-UI/Controllers/DataController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,30 @@ public IActionResult DownloadFile(int? fileId)
return File(file, GetContentType(egressFile.Name), egressFile.Name);
}


[HttpGet]
public IActionResult GetAllEgresses(bool unprocessedonly)
public IActionResult GetAllEgressesuUnprocessed()
{


var paramlist = new Dictionary<string, string>();

ViewBag.PageTitle = "Unprocessed Egresses";
paramlist.Add("unprocessedonly", true.ToString());


List<EgressSubmission> egresses = _dataClientHelper.CallAPIWithoutModel<List<EgressSubmission>>("/api/DataEgress/GetAllEgresses/", paramlist).Result;

return View(egresses);
}

[HttpGet]
public IActionResult GetAllEgresses()
{

var paramlist = new Dictionary<string, string>();
if (unprocessedonly)
{
ViewBag.PageTitle = "Unprocessed Egresses";
paramlist.Add("unprocessedonly", true.ToString());

}
else
{
ViewBag.PageTitle = "All Egresses";
paramlist.Add("unprocessedonly", false.ToString());

}

ViewBag.PageTitle = "All Egresses";
paramlist.Add("unprocessedonly", false.ToString());

List<EgressSubmission> egresses = _dataClientHelper
.CallAPIWithoutModel<List<EgressSubmission>>("/api/DataEgress/GetAllEgresses/", paramlist).Result;
Expand Down
2 changes: 1 addition & 1 deletion src/Data-Egress-UI/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task<IActionResult> Index()

return RedirectToAction("UpdateCredentials", "TreCredentials");
}
return RedirectToAction("GetAllEgresses", "Data", new { unprocessedonly = true });
return RedirectToAction("GetAllEgressesuUnprocessed", "Data");


}
Expand Down
13 changes: 4 additions & 9 deletions src/Data-Egress-UI/Views/Data/GetAllEgresses.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@


}




<div class="container-lg p-4">
<div class="d-flex align-items-center justify-content-between">
<h1 class="fs-3 mb-0">@ViewBag.PageTitle</h1>

</div>
<ul class="nav nav-underline border-bottom my-4 egress-menu">
<li class="nav-item" role="presentation">
@Html.ActionLink("Unprocessed Requests", "GetAllEgresses", new {unprocessedonly = true}, new {@class="nav-link text-dark"})
</li>
<li class="nav-item" role="presentation">
@Html.ActionLink("All Requests", "GetAllEgresses", new { unprocessedonly = false }, new { @class = "nav-link text-dark" })
@Html.ActionLink("Unprocessed Requests", "GetAllEgressesuUnprocessed", new {@class="nav-link text-dark"})
</li>
<li class="nav-item" role="presentation">
@Html.ActionLink("All Requests", "GetAllEgresses", new { @class = "nav-link text-dark" })
</li>
</ul>
<div class="table-responsive">
Expand Down
61 changes: 61 additions & 0 deletions src/Data-Egress-UI/Views/Data/GetAllEgressesuUnprocessed.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@Html.AntiForgeryToken()
@model List<BL.Models.EgressSubmission>
@{
ViewData["Title"] = ViewBag.PageTitle;


}
<div class="container-lg p-4">
<div class="d-flex align-items-center justify-content-between">
<h1 class="fs-3 mb-0">@ViewBag.PageTitle</h1>
</div>
<ul class="nav nav-underline border-bottom my-4 egress-menu">
<li class="nav-item" role="presentation">
@Html.ActionLink("Unprocessed Requests", "GetAllEgressesuUnprocessed", new {@class="nav-link text-dark"})
</li>
<li class="nav-item" role="presentation">
@Html.ActionLink("All Requests", "GetAllEgresses", new { @class = "nav-link text-dark" })
</li>
</ul>
<div class="table-responsive">
<table id="fileList" class="table">
<caption>List of Files</caption>
<thead>
<tr>
<th>Submission ID</th>
<th>Submission Name</th>
<th>Number of Files</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var egressSubmission in Model)
{
<tr>
<td>
<a href="@Url.Action("GetEgress", "Data", new { id = egressSubmission.Id })">
<h2 class="mb-0 fw-bold hover-underline fs-6">
@egressSubmission.EgressID()
</h2>
</a>
</td>
<td>
@egressSubmission.Name
</td>
<td>
@egressSubmission.Files.Count
</td>
<td>
@egressSubmission.EgressStatusDisplay
</td>
<td class="text-center">
<a href="@Url.Action("GetEgress", "Data", new { id = egressSubmission.Id })" class="btn btn-sm btn-outline-primary"><span class="small">Review</span></a>
</td>
</tr>
}
</tbody>
</table>

</div>
</div>

0 comments on commit afbfdfd

Please sign in to comment.