Skip to content

Commit 30bfd64

Browse files
committed
RC changes - WebUI
1 parent e590e1a commit 30bfd64

File tree

78 files changed

+3607
-635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3607
-635
lines changed

LearningHub.Nhs.WebUI/Controllers/Api/CatalogueController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public async Task<IActionResult> GetLatestCatalogueAccessRequestAsync(int catalo
133133
[HttpPost("catalogue/RequestAccess/{reference}")]
134134
public async Task<IActionResult> RequestAccess(string reference, CatalogueAccessRequestViewModel vm)
135135
{
136-
return this.Ok(await this.catalogueService.RequestAccessAsync(reference, vm));
136+
return this.Ok(await this.catalogueService.RequestAccessAsync(reference, vm, "access"));
137137
}
138138

139139
/// <summary>

LearningHub.Nhs.WebUI/Controllers/Api/ContributeController.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,19 @@ public async Task<ActionResult> SaveScormDetailAsync([FromBody] ScormUpdateReque
390390
return this.Ok(resourceVersionId);
391391
}
392392

393+
/// <summary>
394+
/// The SaveHtmlDetailAsync.
395+
/// </summary>
396+
/// <param name="request">Request.</param>
397+
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
398+
[HttpPost]
399+
[Route("SaveHtmlDetail")]
400+
public async Task<ActionResult> SaveHtmlDetailAsync([FromBody] HtmlResourceUpdateRequestViewModel request)
401+
{
402+
int resourceVersionId = await this.contributeService.SaveHtmlDetailAsync(request);
403+
return this.Ok(resourceVersionId);
404+
}
405+
393406
/// <summary>
394407
/// The SaveImageDetailAsync.
395408
/// </summary>

LearningHub.Nhs.WebUI/Controllers/Api/MyLearningController.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ namespace LearningHub.Nhs.WebUI.Controllers.Api
66
{
77
using System.Threading.Tasks;
88
using LearningHub.Nhs.Models.MyLearning;
9+
using LearningHub.Nhs.WebUI.Helpers;
910
using LearningHub.Nhs.WebUI.Interfaces;
11+
using LearningHub.Nhs.WebUI.Models;
1012
using Microsoft.AspNetCore.Authorization;
1113
using Microsoft.AspNetCore.Mvc;
1214

@@ -58,5 +60,27 @@ public async Task<IActionResult> GetPlayedSegments(int resourceId, int majorVers
5860
var activityModel = await this.myLearningService.GetPlayedSegments(resourceId, majorVersion);
5961
return this.Ok(activityModel);
6062
}
63+
64+
/// <summary>
65+
/// The CheckCertificateAvailability.
66+
/// </summary>
67+
/// <param name="resourceReferenceId">The reesource reference id.</param>
68+
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
69+
[HttpGet]
70+
[Route("CheckCertificateAvailability/{resourceReferenceId}")]
71+
public async Task<bool> CheckCertificateAvailabilityAsync(int resourceReferenceId)
72+
{
73+
var certDetails = await this.myLearningService.GetResourceCertificateDetails(resourceReferenceId);
74+
if (certDetails.Item2 != null && certDetails.Item2.IsCurrentResourceVersion)
75+
{
76+
var activityDetailedItemViewModel = new ActivityDetailedItemViewModel(certDetails.Item2);
77+
if (activityDetailedItemViewModel != null && ViewActivityHelper.CanDownloadCertificate(activityDetailedItemViewModel))
78+
{
79+
return true;
80+
}
81+
}
82+
83+
return false;
84+
}
6185
}
6286
}

LearningHub.Nhs.WebUI/Controllers/Api/ResourceController.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,18 @@ public async Task<ActionResult> GetGenericFileDetailsByIdAsync(int id)
198198
return this.Ok(await this.resourceService.GetGenericFileDetailsByIdAsync(id));
199199
}
200200

201+
/// <summary>
202+
/// The GetHtmlDetailsByIdAsync.
203+
/// </summary>
204+
/// <param name="id">Id.</param>
205+
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
206+
[HttpGet]
207+
[Route("GetHtmlDetailsById/{id}")]
208+
public async Task<ActionResult> GetHtmlDetailsByIdAsync(int id)
209+
{
210+
return this.Ok(await this.resourceService.GetHtmlDetailsByIdAsync(id));
211+
}
212+
201213
/// <summary>
202214
/// The GetScormDetailsByIdAsync.
203215
/// </summary>
@@ -217,10 +229,10 @@ public async Task<ActionResult> GetScormDetailsByIdAsync(int id)
217229
/// <param name="id">id.</param>
218230
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
219231
[HttpGet]
220-
[Route("GetScormContentDetails/{id}")]
221-
public async Task<ActionResult> GetScormContentDetailsAsync(int id)
232+
[Route("GetExternalContentDetails/{id}")]
233+
public async Task<ActionResult> GetExternalContentDetailsAsync(int id)
222234
{
223-
return this.Ok(await this.resourceService.GetScormContentDetailsAsync(id));
235+
return this.Ok(await this.resourceService.GetExternalContentDetailsAsync(id));
224236
}
225237

226238
/// <summary>

0 commit comments

Comments
 (0)