Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
663fc38
Set login page primary language
akdalin-hee Jul 29, 2024
760d44c
Merge pull request #43 from TechnologyEnhancedLearning/Develop/Featur…
AnjuJose011 Oct 10, 2024
1a66225
Merge pull request #75 from TechnologyEnhancedLearning/release-v1.0.0
AnjuJose011 Nov 25, 2024
b78fe04
Update continuous-integration-workflow.yml
AnjuJose011 Nov 25, 2024
6275be9
Update continuous-integration-workflow.yml
AnjuJose011 Nov 25, 2024
ef7d9aa
Update package.json
AnjuJose011 Nov 25, 2024
d0e4148
Update package.json
AnjuJose011 Nov 25, 2024
564ba98
Update continuous-integration-workflow.yml
AnjuJose011 Nov 25, 2024
613aed3
Update IQueryableExtensions.cs
AnjuJose011 Nov 25, 2024
19915f3
Update azure-pipelines-ci.yml
AnjuJose011 Nov 25, 2024
decf813
Update azure-pipelines-ci.yml
AnjuJose011 Nov 25, 2024
8f1acb2
Update azure-pipelines-ci.yml
AnjuJose011 Nov 26, 2024
4ad7de5
Update azure-pipelines-ci.yml
AnjuJose011 Nov 26, 2024
92fbe8c
Upgrade node version in package.json
binon Nov 26, 2024
b261802
TD-4184: DIG414: Focus doesn't move to field or error on submit
Swapnamol Nov 29, 2024
0cf5818
Merge pull request #77 from TechnologyEnhancedLearning/Develop/Fixes/…
Swapnamol Dec 2, 2024
9836bb4
TD-4184:https://hee-tis.atlassian.net/browse/TD-4184
Swapnamol Dec 5, 2024
3f15b98
Merge pull request #78 from TechnologyEnhancedLearning/Develop/Fixes/…
Swapnamol Dec 6, 2024
25a8675
TD-4180: Moved client side validations to server side.
ArunimaGeorge Dec 17, 2024
6c8004e
Merge pull request #79 from TechnologyEnhancedLearning/Develop/Fixes/…
ArunimaGeorge Dec 18, 2024
c4aedd4
Test
ArunimaGeorge Dec 20, 2024
b946bcf
Merge pull request #80 from TechnologyEnhancedLearning/TestFix
Swapnamol Dec 20, 2024
c7e8835
View component model version updated
Swapnamol Dec 20, 2024
c97b158
Merge pull request #81 from TechnologyEnhancedLearning/Develop/Fixes/…
AnjuJose011 Dec 20, 2024
5f46c96
fixes
AnjuJose011 Jan 2, 2025
67f1ddc
Merge pull request #82 from TechnologyEnhancedLearning/TD-4184-NOTRem…
AnjuJose011 Jan 2, 2025
7ddbd35
fixesforpassword
AnjuJose011 Jan 6, 2025
f66a70e
Merge pull request #83 from TechnologyEnhancedLearning/TD-4184-FIX-Fo…
AnjuJose011 Jan 6, 2025
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
8 changes: 4 additions & 4 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ jobs:
- name: Use Node 12.19
uses: actions/setup-node@v4
with:
node-version: '12.19'

node-version: '18'
- name: Install dependencies
run: |
cd ./Auth/LearningHub.Nhs.Auth
npm install -f
yarn install

- name: Run Webpack build
run: |
cd ./Auth/LearningHub.Nhs.Auth
npm run build
yarn build:webpack

- name: Setup MSBuild
uses: microsoft/[email protected]
Expand Down
1 change: 1 addition & 0 deletions Auth/LearningHub.Nhs.Auth/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ private async Task<LoginViewModel> BuildLoginViewModelAsync(LoginInputModel mode
{
var vm = await this.BuildLoginViewModelAsync(model.ReturnUrl);
vm.Username = model.Username;
vm.Password = model.Password;
vm.RememberLogin = model.RememberLogin;
return vm;
}
Expand Down
2 changes: 1 addition & 1 deletion Auth/LearningHub.Nhs.Auth/LearningHub.Nhs.Auth.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.0" />
<PackageReference Include="NHSUKViewComponents.Web" Version="1.0.23" />
<PackageReference Include="NHSUKViewComponents.Web" Version="1.0.27" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
Expand Down
5 changes: 3 additions & 2 deletions Auth/LearningHub.Nhs.Auth/Views/Account/LHLogin.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@{
ViewData["Title"] = "Login";
ViewData["Layout"] = "learninghub/_Layout";
ViewData["DisableValidation"] = true;
// OpenAthens url needs to makes sure that the return to WebUI first hits the authorisationrequired endpoint,
// which contains it's own redirect to within the UI.
// If a return url is specified we want to use it for the authorisationrequired original url
Expand Down Expand Up @@ -54,7 +55,7 @@

<vc:text-input asp-for="Username"
label="Enter your username"
populate-with-current-value="false"
populate-with-current-value="true"
type="text"
spell-check="false"
hint-text="A username is different to an email address"
Expand All @@ -65,7 +66,7 @@

<vc:text-input asp-for="Password"
label="Enter your password"
populate-with-current-value="false"
populate-with-current-value="true"
type="password"
spell-check="false"
hint-text=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
var yearErrorCss = Model.HasYearError ? "nhsuk-input--error" : "";
var hintTextLine = string.Empty;
}

@* Removed pattern property *@
<div class="@Model.CssClass @errorCss" id="@Model.Id">
<fieldset class="nhsuk-fieldset" aria-describedby="@Model.Id-hint" role="group">
<legend class="nhsuk-fieldset__legend nhsuk-label">
Expand Down Expand Up @@ -54,12 +54,12 @@
id="@Model.DayId"
name="@Model.DayId"
value="@Model.DayValue"
type="number"
pattern="[0-9]*"
type="text"
min="1"
max="31"
step="1"
inputmode="numeric" />
inputmode="numeric"
aria-describedby="date-error" aria-invalid="false" />
</div>
</div>
<div class="nhsuk-date-input__item">
Expand All @@ -69,12 +69,12 @@
id="@Model.MonthId"
name="@Model.MonthId"
value="@Model.MonthValue"
type="number"
pattern="[0-9]*"
type="text"
min="1"
max="12"
step="1"
inputmode="numeric" />
inputmode="numeric"
aria-describedby="date-error" aria-invalid="false" />
</div>
</div>
<div class="nhsuk-date-input__item">
Expand All @@ -84,12 +84,12 @@
id="@Model.YearId"
name="@Model.YearId"
value="@Model.YearValue"
type="number"
pattern="[0-9]*"
type="text"
min="1900"
max="9999"
step="1"
inputmode="numeric" />
inputmode="numeric"
aria-describedby="date-error" aria-invalid="false" />
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
</ul>
</div>
</div>
<script>
const errorSummary = document.querySelector("#error-summary-title").parentElement;
errorSummary.focus();
</script>
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<div class="nhsuk-form-group @(Model.HasError ? "nhsuk-form-group--error" : "")">

<fieldset class="nhsuk-fieldset" aria-describedby="@(!string.IsNullOrEmpty(Model.HintText) ? $"{Model.Label.RemoveWhitespace()}-hint" : string.Empty)">
<fieldset id="@Model.AspFor" class="nhsuk-fieldset" aria-describedby="@(!string.IsNullOrEmpty(Model.HintText) ? $"{Model.Label.RemoveWhitespace()}-hint" : string.Empty)">
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--m">
@if (Model.IsPageHeading.GetValueOrDefault() == true)
{
Expand Down Expand Up @@ -44,7 +44,7 @@

@if (Model.Required && !Model.HasError)
{
<div data-valmsg-for="@Model.AspFor" data-valmsg-replace="true" class="error-message--margin-bottom-1 nhsuk-error-message field-validation-valid nhsuk-u-padding-top-1 nhsuk-u-padding-bottom-3">
<div data-valmsg-for="@Model.AspFor" data-valmsg-replace="true" class="error-message--margin-bottom-1 nhsuk-error-message field-validation-valid nhsuk-u-padding-top-1 nhsuk-u-padding-bottom-3" aria-live="assertive" role="alert">
</div>
}

Expand Down Expand Up @@ -131,5 +131,4 @@

</div>
</fieldset>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
@using NHSUKViewComponents.Web.Helpers
@model TextInputViewModel
<div class="nhsuk-form-group @(Model.HasError ? "nhsuk-form-group--error" : "")">
<label class="nhsuk-label" for="@Model.Name">
@Model.Label
<label class="nhsuk-label @(string.IsNullOrWhiteSpace(Model.Label) ? "nhsuk-u-visually-hidden" : "")" for="@Model.Name">
@(string.IsNullOrWhiteSpace(Model.Label) ? "N/A" : @Model.Label)
</label>
@if (Model.HintText != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
}
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<environment include="Development">
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
</environment>
<environment exclude="Development">
@if (!ViewData["DisableValidation"]?.Equals(true) ?? true)
{
<environment include="Development">
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
</environment>
<environment exclude="Development">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.min.js"
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator"
Expand All @@ -15,32 +17,48 @@
crossorigin="anonymous"
integrity="sha256-9GycpJnliUjJDVDqP0UEu/bsm9U+3dnQUH8+3W10vkY=">
</script>
</environment>
</environment>
}
<script type="text/javascript">
// Add/remove class 'input-validation-error' to the div containing the control with error
$(function () {
$('form').each(function () {
if ($(this).data("validator")) {
var valSettings = $(this).data("validator").settings
valSettings.highlight = wrap($.validator.defaults.highlight, highlightDecorator)
valSettings.unhighlight = wrap($.validator.defaults.unhighlight, unhighlightDecorator)
}
// Add/remove class 'input-validation-error' to the div containing the control with error.

let errorElements = [];
let submitAttempted = false;
document.querySelector('form').onsubmit = () => { submitAttempted = true; errorElements = []; }

$(function () {
$('form').each(function () {
if ($(this).data("validator")) {
var valSettings = $(this).data("validator").settings;
valSettings.highlight = wrap($.validator.defaults.highlight, highlightDecorator);
valSettings.unhighlight = wrap($.validator.defaults.unhighlight, unhighlightDecorator);
}
});
});
});

function wrap(functionToWrap, beforeFunction) {
return function () {
var args = Array.prototype.slice.call(arguments);
beforeFunction.apply(this, args);
return functionToWrap.apply(this, args);
function wrap(functionToWrap, beforeFunction) {
return function () {
var args = Array.prototype.slice.call(arguments);
beforeFunction.apply(this, args);
if (errorElements.length && submitAttempted) {
errorElements[0]['obj'].focus();
submitAttempted = false;
}

return functionToWrap.apply(this, args);
};
};
};

function highlightDecorator(element, errorClass, validClass) {
$(element).closest("div").addClass(errorClass).removeClass(validClass);
}
function unhighlightDecorator(element, errorClass, validClass) {
$(element).closest("div").addClass(validClass).removeClass(errorClass);
}
function highlightDecorator(element, errorClass, validClass) {
$(element).closest("div").addClass(errorClass).removeClass(validClass);
let itemExists = errorElements.some(obj => obj['id'] == element.id);
if (!itemExists) {
errorElements.push({ 'id': element.id, 'obj': element });
}
}
function unhighlightDecorator(element, errorClass, validClass) {
$(element).closest("div").addClass(validClass).removeClass(errorClass);
errorElements = errorElements.filter((elm) => elm.id != element.id);
}

</script>
2 changes: 1 addition & 1 deletion Auth/LearningHub.Nhs.Auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"concurrently": "^7.2.0",
"core-js": "^3.6.5",
"nhsuk-frontend": "^7.0.0",
"node": "^12.19.1"
"node": "^18"
},
"devDependencies": {
"@babel/core": "^7.14.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static async Task<T> FirstOrDefaultWithNoLockAsync<T>(this IQueryable<T>
}

/// <summary>
/// ToListWithNoLock.
/// ToListWithNoLock..
/// </summary>
/// <typeparam name="T">Type.</typeparam>
/// <param name="query">Query.</param>
Expand Down
Loading