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 @@ -22,6 +22,7 @@ interface PlayerConfig {
}

interface SourceConfig {
enableLowLatency: boolean;
hls: string;
drm: {
clearkey: ClearKeyConfig;
Expand Down Expand Up @@ -57,6 +58,7 @@ function getSourceConfig(
authenticationToken: string
): SourceConfig {
return {
enableLowLatency: true,
hls: locatorUri,
drm: {
clearkey: {
Expand All @@ -81,6 +83,7 @@ function initializePlayer(videoContainer: HTMLElement, playerConfig: MKPlayerCon
};

const sourceConfig: SourceConfig = {
enableLowLatency: true,
hls: playBackUrl,
drm: {
clearkey: clearKeyConfig
Expand Down
7 changes: 6 additions & 1 deletion LearningHub.Nhs.WebUI/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace LearningHub.Nhs.WebUI.Controllers
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using elfhHub.Nhs.Models.Common;
using LearningHub.Nhs.Models.Content;
using LearningHub.Nhs.Models.Enums.Content;
using LearningHub.Nhs.Models.Extensions;
Expand All @@ -20,6 +21,7 @@ namespace LearningHub.Nhs.WebUI.Controllers
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.FeatureManagement;
Expand Down Expand Up @@ -52,6 +54,7 @@ public class HomeController : BaseController
/// <param name="dashboardService">Dashboard service.</param>
/// <param name="contentService">Content service.</param>
/// <param name="featureManager"> featureManager.</param>
/// <param name="configuration"> config.</param>
public HomeController(
IHttpClientFactory httpClientFactory,
IWebHostEnvironment hostingEnvironment,
Expand All @@ -62,7 +65,8 @@ public HomeController(
LearningHubAuthServiceConfig authConfig,
IDashboardService dashboardService,
IContentService contentService,
IFeatureManager featureManager)
IFeatureManager featureManager,
Microsoft.Extensions.Configuration.IConfiguration configuration)
: base(hostingEnvironment, httpClientFactory, logger, settings.Value)
{
this.authConfig = authConfig;
Expand All @@ -71,6 +75,7 @@ public HomeController(
this.dashboardService = dashboardService;
this.contentService = contentService;
this.featureManager = featureManager;
this.configuration = configuration;
}

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions LearningHub.Nhs.WebUI/Scripts/vuesrc/mkiomediaplayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface PlayerConfig {
}

interface SourceConfig {
enableLowLatency: boolean;
hls: string;
drm: {
clearkey: ClearKeyConfig;
Expand Down Expand Up @@ -64,6 +65,7 @@ function getPlayerConfig(mkioKey: string, onPlayerReady: () => void, onSubtitleA
function initializePlayer(videoContainer: HTMLElement, playerConfig: MKPlayerConfig, playBackUrl: string): any {
const player = new MKPlayer(videoContainer, playerConfig);
const sourceConfig: SourceConfig = {
enableLowLatency: true,
hls: playBackUrl,
drm: {
clearkey: getClearKeyConfig()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
showNotification(notification: NotificationModel) {
this.selectedNotification = notification;
this.showMessage = true;
setTimeout(() => { $('html,body').scrollTop($("#backToList").offset().top); }, 100);
setTimeout(() => { $('html,body').scrollTop($(".nhsuk-back-link").offset().top); }, 100);

},
showNotificationList(event: any) {
Expand Down
2 changes: 1 addition & 1 deletion LearningHub.Nhs.WebUI/Views/Shared/_LoginBanner.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class="nhsuk-button nhsuk-button--secondary">OpenAthens Log in</a>
</div>
<p class="nhsuk-u-margin-bottom-2">
<a asp-controller="Account" asp-action="ForgotPassword" class="">Forgotten username or password</a>
<a asp-controller="Account" asp-action="ForgotUserPassword" class="">Forgotten username or password</a>
</p>
<p>
<a asp-controller="Account" asp-action="CreateAnAccount">Create new account</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace LearningHub.Nhs.OpenApi.Repositories.Repositories
/// <inheritdoc />
public class ResourceRepository : GenericRepository<Resource>, IResourceRepository
{
private LearningHubDbContext dbContext;

/// <summary>
/// Initializes a new instance of the <see cref="ResourceRepository"/> class.
Expand All @@ -31,7 +30,7 @@ public ResourceRepository(LearningHubDbContext dbContext, ITimezoneOffsetManager
/// <inheritdoc />
public async Task<IEnumerable<Resource>> GetResourcesFromIds(IEnumerable<int> resourceIds)
{
var resources = await this.dbContext.Resource
var resources = await this.DbContext.Resource
.Where(r => resourceIds.Contains(r.Id))
.Where(r => !r.Deleted)
.Include(r => r.ResourceReference)
Expand Down Expand Up @@ -62,7 +61,7 @@ public async Task<IEnumerable<Resource>> GetResourcesFromIds(IEnumerable<int> re
public async Task<IEnumerable<ResourceReference>> GetResourceReferencesByOriginalResourceReferenceIds(
IEnumerable<int> originalResourceReferenceIds)
{
return await this.dbContext.ResourceReference
return await this.DbContext.ResourceReference
.Where(rr => originalResourceReferenceIds.Contains(rr.OriginalResourceReferenceId))
.Where(rr => !rr.Deleted)
.Where(rr => (int)rr.NodePath.Node.NodeTypeEnum != 4)
Expand All @@ -83,7 +82,7 @@ public async Task<List<int>> GetAchievedCertificatedResourceIds(int currentUserI
var param0 = new SqlParameter("@userId", SqlDbType.Int) { Value = currentUserId };
var param4 = new SqlParameter("@TotalRecords", SqlDbType.Int) { Direction = ParameterDirection.Output };

var result = this.dbContext.DashboardResourceDto.FromSqlRaw("resources.GetAchievedCertificatedResourcesWithOptionalPagination @userId = @userId, @TotalRecords = @TotalRecords output", param0, param4).ToList();
var result = this.DbContext.DashboardResourceDto.FromSqlRaw("resources.GetAchievedCertificatedResourcesWithOptionalPagination @userId = @userId, @TotalRecords = @TotalRecords output", param0, param4).ToList();
List<int> achievedCertificatedResourceIds = result.Select(drd => drd.ResourceId).Distinct().ToList<int>();

return achievedCertificatedResourceIds;
Expand All @@ -108,7 +107,7 @@ public async Task<IEnumerable<ResourceActivityDTO>> GetResourceActivityPerResour
var resourceIdsParameter = new SqlParameter("@p0", resourceIdsParam ?? (object)DBNull.Value);
var userIdsParameter = new SqlParameter("@p1", userIdsParam ?? (object)DBNull.Value);

List<ResourceActivityDTO> resourceActivityDTOs = await dbContext.ResourceActivityDTO
List<ResourceActivityDTO> resourceActivityDTOs = await this.DbContext.ResourceActivityDTO
.FromSqlRaw(
"[activity].[GetResourceActivityPerResourceMajorVersion] @p0, @p1",
resourceIdsParameter,
Expand All @@ -126,7 +125,7 @@ public async Task<IEnumerable<ResourceActivityDTO>> GetResourceActivityPerResour
/// <returns>The <see cref="Task"/>.</returns>
public async Task<Resource> GetByIdAsync(int id)
{
return await this.dbContext.Resource.AsNoTracking().FirstOrDefaultAsync(r => r.Id == id && !r.Deleted);
return await this.DbContext.Resource.AsNoTracking().FirstOrDefaultAsync(r => r.Id == id && !r.Deleted);
}

/// <summary>
Expand All @@ -136,7 +135,7 @@ public async Task<Resource> GetByIdAsync(int id)
/// <returns>If the user has any resources published.</returns>
public async Task<bool> UserHasPublishedResourcesAsync(int userId)
{
return await this.dbContext.Resource.AsNoTracking()
return await this.DbContext.Resource.AsNoTracking()
.Where(r => r.CreateUserId == userId && !r.Deleted)
.AnyAsync();
}
Expand All @@ -161,7 +160,7 @@ public async Task<int> CreateResourceAsync(ResourceTypeEnum resourceType, string
var param4 = new SqlParameter("@p4", SqlDbType.Int) { Value = this.TimezoneOffsetManager.UserTimezoneOffset ?? (object)DBNull.Value };
var param5 = new SqlParameter("@p5", SqlDbType.Int) { Direction = ParameterDirection.Output };

await this.dbContext.Database.ExecuteSqlRawAsync("resources.ResourceCreate @p0, @p1, @p2, @p3, @p4, @p5 output", param0, param1, param2, param3, param4, param5);
await this.DbContext.Database.ExecuteSqlRawAsync("resources.ResourceCreate @p0, @p1, @p2, @p3, @p4, @p5 output", param0, param1, param2, param3, param4, param5);

int resourceVersionId = (int)param5.Value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public RoleUserGroupRepository(LearningHubDbContext dbContext, ITimezoneOffsetMa
/// <returns>The <see cref="Task"/>.</returns>
public async Task<RoleUserGroup> GetByIdAsync(int id)
{
return await DbContext.RoleUserGroup
return await this.DbContext.RoleUserGroup
.Include(n => n.UserGroup).ThenInclude(u => u.UserGroupAttribute)
.Include(n => n.Role)
.Include(n => n.Scope).AsNoTracking().FirstOrDefaultAsync(n => n.Id == id);
Expand All @@ -48,7 +48,7 @@ public async Task<RoleUserGroup> GetByIdAsync(int id)
/// <returns>The <see cref="Task"/>.</returns>
public async Task<RoleUserGroup> GetByRoleIdUserGroupIdScopeIdAsync(int roleId, int userGroupId, int scopeId)
{
return await DbContext.RoleUserGroup.AsNoTracking().FirstOrDefaultAsync(n => n.RoleId == roleId && n.UserGroupId == userGroupId && n.ScopeId == scopeId);
return await this.DbContext.RoleUserGroup.AsNoTracking().FirstOrDefaultAsync(n => n.RoleId == roleId && n.UserGroupId == userGroupId && n.ScopeId == scopeId);
}

/// <summary>
Expand All @@ -57,7 +57,7 @@ public async Task<RoleUserGroup> GetByRoleIdUserGroupIdScopeIdAsync(int roleId,
/// <returns>The <see cref="Task"/>.</returns>
public new IQueryable<RoleUserGroup> GetAll()
{
return DbContext.Set<RoleUserGroup>()
return this.DbContext.Set<RoleUserGroup>()
.Include(n => n.UserGroup).ThenInclude(u => u.UserGroupAttribute)
.Include(n => n.Role)
.Include(n => n.Scope)
Expand All @@ -72,7 +72,7 @@ public async Task<RoleUserGroup> GetByRoleIdUserGroupIdScopeIdAsync(int roleId,
/// <returns>The <see cref="Task"/>.</returns>
public async Task<List<RoleUserGroup>> GetAllforSearch(int catalogueNodeId, int userId)
{
return await DbContext.RoleUserGroup.Where(rug => rug.Scope.CatalogueNodeId == catalogueNodeId)
return await this.DbContext.RoleUserGroup.Where(rug => rug.Scope.CatalogueNodeId == catalogueNodeId)
.Include(n => n.UserGroup).ThenInclude(u => u.UserUserGroup.Where(p => p.UserId == userId))
.Include(n => n.Scope).AsNoTracking()
.ToListAsync();
Expand All @@ -86,7 +86,7 @@ public async Task<List<RoleUserGroup>> GetAllforSearch(int catalogueNodeId, int
/// <returns>The <see cref="Task"/>.</returns>
public async Task<List<RoleUserGroup>> GetByRoleIdCatalogueId(int roleId, int catalogueNodeId)
{
return await DbContext.RoleUserGroup.Where(rug => rug.RoleId == roleId && rug.Scope.CatalogueNodeId == catalogueNodeId)
return await this.DbContext.RoleUserGroup.Where(rug => rug.RoleId == roleId && rug.Scope.CatalogueNodeId == catalogueNodeId)
.Include(n => n.UserGroup).ThenInclude(u => u.UserGroupAttribute)
.Include(n => n.Role)
.Include(n => n.Scope).AsNoTracking().OrderByDescending(rug => rug.RoleId).ToListAsync();
Expand All @@ -100,7 +100,7 @@ public async Task<List<RoleUserGroup>> GetByRoleIdCatalogueId(int roleId, int ca
/// <returns>The <see cref="Task"/>.</returns>
public async Task<List<RoleUserGroup>> GetByRoleIdCatalogueIdWithUsers(int roleId, int catalogueNodeId)
{
return await DbContext.RoleUserGroup.Where(rug => rug.RoleId == roleId && rug.Scope.CatalogueNodeId == catalogueNodeId)
return await this.DbContext.RoleUserGroup.Where(rug => rug.RoleId == roleId && rug.Scope.CatalogueNodeId == catalogueNodeId)
.Include(n => n.UserGroup).ThenInclude(u => u.UserUserGroup).Where(u => u.UserGroup != null && u.UserGroup.UserUserGroup.Count() > 0)
.Include(n => n.Role)
.Include(n => n.Scope).AsNoTracking().ToListAsync();
Expand All @@ -115,7 +115,7 @@ public async Task<List<RoleUserGroupViewModel>> GetRoleUserGroupViewModelsByUser
{
var param0 = new SqlParameter("@userGroupId", SqlDbType.Int) { Value = userGroupId };

var vm = await DbContext.RoleUserGroupViewModel.FromSqlRaw("hub.RoleUserGroupGetByUserGroupId @userGroupId", param0).AsNoTracking().ToListAsync();
var vm = await this.DbContext.RoleUserGroupViewModel.FromSqlRaw("hub.RoleUserGroupGetByUserGroupId @userGroupId", param0).AsNoTracking().ToListAsync();
return vm;
}

Expand All @@ -128,7 +128,7 @@ public async Task<List<RoleUserGroupViewModel>> GetRoleUserGroupViewModelsByUser
{
var param0 = new SqlParameter("@userId", SqlDbType.Int) { Value = userId };

var vm = await DbContext.RoleUserGroupViewModel.FromSqlRaw("hub.RoleUserGroupGetByUserId @userId", param0).AsNoTracking().ToListAsync();
var vm = await this.DbContext.RoleUserGroupViewModel.FromSqlRaw("hub.RoleUserGroupGetByUserId @userId", param0).AsNoTracking().ToListAsync();
return vm;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public async Task<SearchAllCatalogueResultModel> GetAllCatalogueSearchResultsAsy
var offset = catalogSearchRequestModel.PageIndex * catalogSearchRequestModel.PageSize;
var client = await this.findwiseClient.GetClient(this.findwiseConfig.SearchBaseUrl);
var request = string.Format(
this.findwiseConfig.SearchEndpointPath + "?offset={1}&hits={2}&q={3}&token={4}",
this.findwiseConfig.SearchEndpointPath + "{0}?offset={1}&hits={2}&q={3}&token={4}",
this.findwiseConfig.CollectionIds.Catalogue,
offset,
catalogSearchRequestModel.PageSize,
Expand Down Expand Up @@ -180,7 +180,7 @@ public async Task<AutoSuggestionModel> GetAutoSuggestionResultsAsync(string term
{
var client = await this.findwiseClient.GetClient(this.findwiseConfig.SearchBaseUrl);
var request = string.Format(
this.findwiseConfig.SearchEndpointPath + "?q={1}&token={2}",
this.findwiseConfig.SearchEndpointPath + "{0}?q={1}&token={2}",
this.findwiseConfig.CollectionIds.AutoSuggestion,
this.EncodeSearchText(term),
this.findwiseConfig.Token);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ await this.searchService.Search(
/// </summary>
/// <param name="originalResourceReferenceId">id.</param>
/// <returns>Resource data.</returns>
[HttpGet("{originalResourceReferenceId}")]
[HttpGet("GetResourceReferenceByOriginalId/{originalResourceReferenceId}")]
public async Task<ResourceReferenceWithResourceDetailsViewModel> GetResourceReferenceByOriginalId(int originalResourceReferenceId)
{
return await this.resourceService.GetResourceReferenceByOriginalId(originalResourceReferenceId, this.CurrentUserId.GetValueOrDefault());
Expand Down
2 changes: 1 addition & 1 deletion WebAPI/LearningHub.Nhs.API/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"ResourceReadonlyAccess": "<p>You can continue to search for and access resources in the Learning Hub, however you cannot contribute to it.</p><p class='pt-4'>If you have any questions about this, please contact the <a href='[SupportContact]' target='_blank'>support team.</a></p>",
"ResourceContributeAccess": "<p>You can now contribute to the Learning Hub and continue to search for and access resources.</p><p class='pt-4'>If you have any questions about this, please contact the <a href='[SupportContact]' target='_blank'>support team.</a></p>"
},
"SupportContact": "https://support.learninghub.nhs.uk/conversation/new/2",
"SupportContact": "https://support.learninghub.nhs.uk/support/tickets/new",
"SpecialSearchCharacters": "#:&()/-[]%^{}~\"",
"ElfhCacheSettings": {
"ElfhRedisKeyPrefix": "",
Expand Down
Loading