Skip to content

Commit 6c8004e

Browse files
Merge pull request #79 from TechnologyEnhancedLearning/Develop/Fixes/TD-4180-DIG409-An-error-is-present-and-correct-however-isnot-programmatically-associatedwith-field
TD-4180: Moved client side validations to server side.
2 parents 3f15b98 + 25a8675 commit 6c8004e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Auth/LearningHub.Nhs.Auth/Views/Account/LHLogin.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@{
33
ViewData["Title"] = "Login";
44
ViewData["Layout"] = "learninghub/_Layout";
5+
ViewData["DisableValidation"] = true;
56
// OpenAthens url needs to makes sure that the return to WebUI first hits the authorisationrequired endpoint,
67
// which contains it's own redirect to within the UI.
78
// If a return url is specified we want to use it for the authorisationrequired original url

Auth/LearningHub.Nhs.Auth/Views/Shared/_ValidationScriptsPartial.cshtml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<environment include="Development">
2-
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
3-
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
4-
</environment>
5-
<environment exclude="Development">
1+
@if (!ViewData["DisableValidation"]?.Equals(true) ?? true)
2+
{
3+
<environment include="Development">
4+
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
5+
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
6+
</environment>
7+
<environment exclude="Development">
68
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.min.js"
79
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
810
asp-fallback-test="window.jQuery && window.jQuery.validator"
@@ -15,7 +17,8 @@
1517
crossorigin="anonymous"
1618
integrity="sha256-9GycpJnliUjJDVDqP0UEu/bsm9U+3dnQUH8+3W10vkY=">
1719
</script>
18-
</environment>
20+
</environment>
21+
}
1922
<script type="text/javascript">
2023
// Add/remove class 'input-validation-error' to the div containing the control with error
2124

0 commit comments

Comments
 (0)