Skip to content

Commit b65a21b

Browse files
committed
TD-5925 Tweaks and implement ICaching TODOs
1 parent 5ceb081 commit b65a21b

File tree

15 files changed

+9
-23
lines changed

15 files changed

+9
-23
lines changed

AdminUI/LearningHub.Nhs.AdminUI/Models/ContactViewModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
using System.ComponentModel.DataAnnotations;
44
using LearningHub.Nhs.Caching.Binders;
5-
using LearningHub.Nhs.Models.Binders;
65

76
/// <summary>
87
/// Defines the <see cref="ContactViewModel" />.

LearningHub.Nhs.Shared/Interfaces/Http/IAPIHttpClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Net.Http;
2-
using System.Threading.Tasks;
3-
42
namespace LearningHub.Nhs.Shared.Interfaces.Http
53
{
4+
using System.Threading.Tasks;
5+
66
/// <summary>
77
/// Represents an HTTP client for a specific API.
88
/// </summary>

LearningHub.Nhs.Shared/LearningHub.Nhs.Shared.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<!--Shared so more restrictive so does not include aspnet.core-->
4+
<!--Shared needs to be agnostic so uses netstandard 2.1 so can be widely consumed as it has maximum compatibility-->
55
<TargetFrameworks>netstandard2.1</TargetFrameworks>
6-
<!--<TargetFramework>net8.0</TargetFramework>-->
76
<Nullable>enable</Nullable>
87
</PropertyGroup>
98
<Target Name="CheckForIncompatiblePackages" BeforeTargets="Restore">

LearningHub.Nhs.WebUI.BlazorClient/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using TELBlazor.Components.Core.Configuration;
2525
using TELBlazor.Components.Core.Services.HelperServices;
2626
using TELBlazor.Components.OptionalImplementations.Core.Services.HelperServices;
27+
using LearningHub.Nhs.Models.WebUtilitiesInterfaces;
2728

2829
var builder = WebAssemblyHostBuilder.CreateDefault(args);
2930

@@ -88,7 +89,7 @@
8889
builder.Services.AddScoped<LoggingLevelSwitch>(sp => levelSwitch);
8990
builder.Services.AddScoped<ILogLevelSwitcherService, SerilogLogLevelSwitcherService>();
9091

91-
// TODO (QQQQ) implement post TD-5925 builder.Services.AddScoped<ICacheService, WasmCacheServiceStub>();
92+
builder.Services.AddScoped<ICacheService, WasmCacheServiceStub>();
9293

9394
await builder.Build().RunAsync();
9495
}

LearningHub.Nhs.WebUI.BlazorClient/Services/WasmCacheServiceStub.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// TODO (QQQQ) implement post TD-5925: using LearningHub.Nhs.Models;
1+
using LearningHub.Nhs.Models.WebUtilitiesInterfaces;
22

33
namespace LearningHub.Nhs.WebUI.BlazorClient.Services
44
{
55
/// <summary>
66
/// We may use storage, we may just stub it and throw an error, we cant directly use redis we may access it via an api
77
/// The cachestub currently just returns there is nothing available so the caller then will revert to calling the api.
88
/// </summary>
9-
public class WasmCacheServiceStub // TODO (QQQQ) implement post TD-5925 and get from NHS.Models: ICacheService
9+
public class WasmCacheServiceStub : ICacheService
1010
{
1111
public Task<T> GetAsync<T>(string key)
1212
{

LearningHub.Nhs.WebUI.Shared/LearningHub.Nhs.WebUI.Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<!--Shared needs to be agnostic so uses netstandard 2.1 so can be widely consumed as it has maximum compatibility-->
45
<TargetFrameworks>netstandard2.1</TargetFrameworks>
5-
<!--<TargetFramework>net8.0</TargetFramework>-->
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88
<Target Name="CheckForIncompatiblePackages" BeforeTargets="Restore">

LearningHub.Nhs.WebUI/Controllers/LoginWizardController.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ public async Task<IActionResult> SelectSecurityQuestion(int questionIndex, strin
306306

307307
var viewModel = new SecurityQuestionSelectViewModel
308308
{
309-
// qqqq
310309
SecurityQuestions = securityViewModel.SecurityQuestions.Select(q => new SelectListItem { Value = q.Value, Text = q.Text }).ToList(),
311310
QuestionIndex = questionIndex,
312311
SelectedSecurityQuestionId = userQuestion.SecurityQuestionId,
@@ -358,7 +357,6 @@ public async Task<IActionResult> SelectSecurityQuestionPost(SecurityQuestionSele
358357
{
359358
var viewModel = new SecurityQuestionSelectViewModel
360359
{
361-
// qqqq
362360
SecurityQuestions = securityViewModel.SecurityQuestions.Select(q => new SelectListItem { Value = q.Value, Text = q.Text }).ToList(),
363361
QuestionIndex = model.QuestionIndex,
364362
};
@@ -425,7 +423,6 @@ public async Task<IActionResult> AnswerSecurityQuestionPost(SecurityQuestionAnsw
425423
{
426424
var viewModel = new SecurityQuestionSelectViewModel
427425
{
428-
// qqqq
429426
SecurityQuestions = securityViewModel.SecurityQuestions.Select(q => new SelectListItem { Value = q.Value, Text = q.Text }).ToList(),
430427
QuestionIndex = model.QuestionIndex,
431428
};

LearningHub.Nhs.WebUI/Controllers/MyAccountController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ public async Task<IActionResult> SecurityQuestionsDetails(int questionIndex)
302302
SecurityQuestionSelectViewModel securityViewModel = new SecurityQuestionSelectViewModel();
303303
var model = await this.loginWizardService.GetSecurityQuestionsModel(this.CurrentUserId);
304304

305-
// qqqq
306305
securityViewModel.SecurityQuestions = model.SecurityQuestions.Select(q => new SelectListItem { Value = q.Value, Text = q.Text }).ToList();
307306
securityViewModel.QuestionIndex = questionIndex;
308307
securityViewModel.SelectedSecurityQuestionId = model.UserSecurityQuestions.ElementAt(questionIndex).SecurityQuestionId;

LearningHub.Nhs.WebUI/Controllers/UserController.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,6 @@ public async Task<IActionResult> AdditionalSecurity(SecurityQuestionsViewModel s
252252
else
253253
{
254254
var questions = await this.loginWizardService.GetSecurityQuestions();
255-
256-
// qqqq securityQuestionsModel.SecurityQuestions = questions.Select(q => new SelectListItem() { Value = q.Id.ToString(), Text = q.Text }).ToList();
257-
// securityQuestionsModel.SecurityQuestions = questions.Select(q => new List<(string Value, string Text)>() { Value = q.Id.ToString(), Text = q.Text }).ToList();
258255
securityQuestionsModel.SecurityQuestions = questions.Select(q => (Value: q.Id.ToString(), Text: q.Text)).ToList();
259256
}
260257

LearningHub.Nhs.WebUI/ServiceCollectionExtension.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using AspNetCoreRateLimit;
77
using LearningHub.Nhs.Caching;
88
using LearningHub.Nhs.Caching.Binders;
9-
using LearningHub.Nhs.Models.Binders;
109
using LearningHub.Nhs.Models.Enums;
1110
using LearningHub.Nhs.Models.Extensions;
1211
using LearningHub.Nhs.WebUI.Configuration;

0 commit comments

Comments
 (0)