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
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ public IActionResult AddEditFrameworkCompetency(int frameworkId, int? frameworkC
public IActionResult AddEditFrameworkCompetency(int frameworkId, FrameworkCompetency frameworkCompetency, int? frameworkCompetencyGroupId, int frameworkCompetencyId = 0, int[] selectedFlagIds = null)
{
frameworkCompetency.Description = SanitizerHelper.SanitizeHtmlData(frameworkCompetency.Description);
frameworkCompetency.Description?.Trim();
var description = HttpUtility.HtmlDecode(HttpUtility.HtmlDecode(frameworkCompetency.Description));
if (string.IsNullOrWhiteSpace(description)) { frameworkCompetency.Description = null; }
if (!ModelState.IsValid)
{
ModelState.Remove(nameof(FrameworkCompetency.Name));
Expand All @@ -161,9 +164,7 @@ public IActionResult AddEditFrameworkCompetency(int frameworkId, FrameworkCompet
if (userRole < 2) return StatusCode((int)HttpStatusCode.Forbidden);
if (frameworkCompetency.Id > 0)
{
frameworkCompetency.Description?.Trim();
var description = HttpUtility.HtmlDecode(HttpUtility.HtmlDecode(frameworkCompetency.Description));
if (string.IsNullOrWhiteSpace(description)) { frameworkCompetency.Description = null; }


frameworkService.UpdateFrameworkCompetency(frameworkCompetencyId, frameworkCompetency.Name, frameworkCompetency.Description, adminId);
frameworkService.UpdateCompetencyFlags(frameworkId, frameworkCompetency.CompetencyID, selectedFlagIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,10 @@ public IActionResult AddCollaborators(string actionname, int frameworkId, bool e
Collaborators = collaborators,
Error = false,
};
if (TempData["FrameworkError"] != null)
{
ModelState.AddModelError("userEmail", TempData.Peek("FrameworkError").ToString());
}
return View("Developer/Collaborators", model);
}

Expand All @@ -680,11 +684,11 @@ public IActionResult AddCollaborator(string actionname, string userEmail, bool c
}
else if (collaboratorId == -2)
{
TempData["FrameworkError"] = $"User with the email address {userEmail} has been previously added";
TempData["FrameworkError"] = $"A user with the email address has been previously added";
}
else if (collaboratorId == -4)
{
TempData["FrameworkError"] = $"The email address {userEmail} must match registered DLS Admin account";
TempData["FrameworkError"] = $"The email address must match a registered DLS Admin account";
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
ViewData["Title"] = "Framework Collaborators";
ViewData["Application"] = "Framework Service";
ViewData["HeaderPathName"] = "Framework Service";
string errMsg = TempData["FrameworkError"]?.ToString();
string errMsg = TempData["FrameworkError"]?.ToString();
if (!string.IsNullOrWhiteSpace(errMsg)) { Model.Error = true; }
}
<link rel="stylesheet" href="@Url.Content("~/css/frameworks/frameworksShared.css")" asp-append-version="true">
@section NavMenuItems {
<partial name="Shared/_NavMenuItems" />
}
@if (Model.Error)
{
<vc:error-summary order-of-property-names="@(new string[] { "userEmail" })" />
}
@if ((string)ViewContext.RouteData.Values["actionname"] == "New")
{
@section NavBreadcrumbs {
Expand Down Expand Up @@ -61,12 +65,6 @@ else
{
<p class="nhsuk-lede-text">Your framework has been created. Use this page to identify individuals who will be working on it with you.</p>
}
@if (Model.Error)
{
<span class="nhsuk-error-message" id="no-admin-error">
<span class="nhsuk-u-visually-hidden">Error:</span> @errMsg
</span>
}
<div class="nhsuk-table__panel-with-heading-tab">
<h2 class="nhsuk-table__heading-tab">Working Group Members</h2>
<table role="presentation" class="nhsuk-table-responsive">
Expand Down