Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
01cf678
Fix text exiting box constraints when font size changes
akdalin-hee May 31, 2024
257dc65
Remove alternative back button for Role search page
akdalin-hee Jun 4, 2024
3591fd9
Add non breaking space symbol to symulate space-bar space. Separate n…
akdalin-hee Jun 10, 2024
1752d7e
Remove external footer tag
akdalin-hee Jun 10, 2024
87b2111
Replace Notification page Delete anchor with button
akdalin-hee Jun 11, 2024
c27c2a7
Add alternative hidden text to be displayed when certificate is not a…
akdalin-hee Jun 12, 2024
c75cc97
Contain video play button centered within parent boundaries
akdalin-hee Jun 21, 2024
aa0bb30
Display pagination landmark only when pagination show is enabled
akdalin-hee Jun 26, 2024
9156145
Associate error label with target input
akdalin-hee Jun 28, 2024
ff76d8f
pulled from scorpius and added openapicontrollerbase
Phil-NHS Jul 5, 2024
1b3d60d
current userid into controller
Phil-NHS Jul 5, 2024
645c2b3
update models
Phil-NHS Jul 5, 2024
7105627
Updating models
Phil-NHS Jul 5, 2024
bc43f74
End points major version
Phil-NHS Jul 5, 2024
20ffea7
Not nullable should be empty list
Phil-NHS Jul 5, 2024
66df1d0
Updating tests
Phil-NHS Jul 5, 2024
ebce590
Add stored procedure GetResourceActivityPErResource<ajorVersion
Phil-NHS Jul 8, 2024
8f1765b
fix stored proc
Phil-NHS Jul 8, 2024
d3df951
Added tests
Phil-NHS Jul 8, 2024
bbfef4d
Merge branch 'releases/LHVirgo' of https://github.com/TechnologyEnhan…
Phil-NHS Jul 8, 2024
888a2bf
Branched from td-2895 virgo to avoid clashes with td-2895, catalogue
Phil-NHS Jul 9, 2024
e716f18
Change to parameterised end point and added to json description
Phil-NHS Jul 10, 2024
1a93652
Stored procedures GetAcheivedCertificateResourcesWithOptionalPagination
Phil-NHS Jul 11, 2024
02cc324
typo
Phil-NHS Jul 11, 2024
1138be9
spelling stored proc
Phil-NHS Jul 11, 2024
70ad3a7
Remove unneeded end points
Phil-NHS Jul 11, 2024
a1e1e58
Tests
Phil-NHS Jul 11, 2024
8a99395
correction
Phil-NHS Jul 11, 2024
1bebb6e
Update continuous-integration-workflow.yml
AnjuJose011 Jul 11, 2024
fb19f24
LHVirgo fix merge in
Phil-NHS Jul 11, 2024
8ff889f
Virgo Fix
Phil-NHS Jul 11, 2024
f03e984
virgo change
Phil-NHS Jul 11, 2024
cbab323
merge virgo fix
Phil-NHS Jul 11, 2024
b6367ac
Merge pull request #463 from TechnologyEnhancedLearning/RC
AnjuJose011 Jul 12, 2024
58aa35d
pull merge virgo
Phil-NHS Jul 12, 2024
330eafd
pull virgo
Phil-NHS Jul 12, 2024
6e18eac
MergeIn Activity-Status-2 Branch
Phil-NHS Jul 15, 2024
f629282
Merge pull request #466 from TechnologyEnhancedLearning/RC
AnjuJose011 Jul 16, 2024
aa428f7
Comment on openapibase
Phil-NHS Jul 16, 2024
6ff76a7
commit reword
Phil-NHS Jul 16, 2024
dce4f0b
Merge pull request #459 from TechnologyEnhancedLearning/Develop/Featu…
Phil-NHS Jul 16, 2024
046daa4
Merge in virgo
Phil-NHS Jul 16, 2024
8f86d2e
Add role to header-dropdown-menu-control
akdalin-hee Jul 16, 2024
ff325b5
Add custom error message for Country Search input errors
akdalin-hee Jul 25, 2024
25c7402
Add custom input error id to aria-describedby
akdalin-hee Jul 25, 2024
e80080e
TD-4411: Fixed filter result for "Completed" filter along with "Asses…
ArunimaGeorge Jul 26, 2024
e04b3a3
Update GetUserLearningActivities.sql
ArunimaGeorge Jul 26, 2024
cc89580
Update GetUserLearningActivitiesCount.sql
ArunimaGeorge Jul 26, 2024
fc3d67a
Update GetUserLearningActivities.sql
ArunimaGeorge Jul 26, 2024
671ef24
Update GetUserLearningActivities.sql
ArunimaGeorge Jul 26, 2024
d462067
Update GetUserLearningActivitiesCount.sql
ArunimaGeorge Jul 26, 2024
2740353
Update GetUserLearningActivities.sql
ArunimaGeorge Jul 26, 2024
e28850e
Update GetUserLearningActivitiesCount.sql
ArunimaGeorge Jul 26, 2024
d5586e6
Merge Rc cahnges
AnjuJose011 Jul 31, 2024
1323a4d
Merge pull request #508 from TechnologyEnhancedLearning/MergeRc-To-Virgo
AnjuJose011 Jul 31, 2024
98c04ea
Before merge due to pr conflict
Phil-NHS Jul 31, 2024
a457c7d
Merge pull request #499 from TechnologyEnhancedLearning/Develop/fixes…
ArunimaGeorge Jul 31, 2024
9af7b56
#Safe part to merge first half
Phil-NHS Jul 31, 2024
1a19f43
#merge part 2 these are just adds so we can take them
Phil-NHS Jul 31, 2024
b14e80e
backup will be removed later
Phil-NHS Jul 31, 2024
bc3e0fc
fixes
AnjuJose011 Aug 1, 2024
0a89387
Merge pull request #509 from TechnologyEnhancedLearning/Fixes/TD-4388
AnjuJose011 Aug 1, 2024
4d29e9e
pre publish to update local db
Phil-NHS Aug 1, 2024
403f094
cleaning up
Phil-NHS Aug 1, 2024
e6d9972
Add more spaces
akdalin-hee Aug 2, 2024
9c14763
TD-4430 : Issue-when-adding-duplicate-keywords-on-Keywords-section-wh…
ArunimaGeorge Aug 2, 2024
4e9a215
Merge pull request #465 from TechnologyEnhancedLearning/Develop/Featu…
Phil-NHS Aug 2, 2024
db19ab2
Correct placeholder contrast for firefox
akdalin-hee Aug 4, 2024
35c510c
Constraint text within dom element boundaries
akdalin-hee Aug 4, 2024
1e22b32
Merge pull request #512 from TechnologyEnhancedLearning/Develope/fixe…
ArunimaGeorge Aug 5, 2024
f08aa23
Apply NHS design system focus highlight style to the button and repla…
akdalin-hee Aug 8, 2024
16242ce
Correct search button focus styling
akdalin-hee Aug 13, 2024
6553973
Merge pull request #486 from TechnologyEnhancedLearning/Develop/Featu…
akdalin-hee Aug 23, 2024
5f7259f
Merge pull request #489 from TechnologyEnhancedLearning/Develop/Featu…
akdalin-hee Aug 23, 2024
ad1d839
Merge pull request #490 from TechnologyEnhancedLearning/Develop/Featu…
akdalin-hee Aug 23, 2024
2e10bf4
Merge pull request #491 from TechnologyEnhancedLearning/Develop/Featu…
akdalin-hee Aug 23, 2024
8761240
Merge pull request #492 from TechnologyEnhancedLearning/Develop/Featu…
akdalin-hee Aug 23, 2024
7e3a4f9
Merge pull request #493 from TechnologyEnhancedLearning/Develop/Featu…
akdalin-hee Aug 23, 2024
2ded6b5
Merge pull request #495 from TechnologyEnhancedLearning/Develop/Featu…
akdalin-hee Aug 23, 2024
4cf1442
Merge pull request #496 from TechnologyEnhancedLearning/features/TD-4…
akdalin-hee Aug 23, 2024
738f510
Merge pull request #497 from TechnologyEnhancedLearning/Develop/Featu…
akdalin-hee Aug 23, 2024
699d9d2
Correct page of the following pages "Summary List, Notifications, M…
akdalin-hee Aug 23, 2024
f98210a
Make page focus on top-most element with validation error
akdalin-hee Aug 23, 2024
85b4540
Update NMC Number field error message
akdalin-hee Aug 28, 2024
1d6a34b
TD-4343: Script to remove duplicate rows in UserUserGroup table
ArunimaGeorge Sep 5, 2024
e793fe6
Merge pull request #572 from TechnologyEnhancedLearning/Develop/Fixes…
ArunimaGeorge Sep 5, 2024
ee58d0b
delay for image/articile
AnjuJose011 Sep 9, 2024
cbf518e
Merge pull request #576 from TechnologyEnhancedLearning/TD-4299-Avoid…
AnjuJose011 Sep 10, 2024
3cd4ebf
Merge pull request #541 from TechnologyEnhancedLearning/Develop/Featu…
akdalin-hee Sep 11, 2024
3d88402
URL Chnage
AnjuJose011 Sep 17, 2024
772df47
Merge pull request #585 from TechnologyEnhancedLearning/TD-4651-Updat…
AnjuJose011 Sep 17, 2024
f98cc68
Identify Radio Buttons Error Messages PT2
akdalin-hee Sep 19, 2024
6a6a7e5
Add title attribute to iframe element
akdalin-hee Sep 19, 2024
16edce8
Merge pull request #597 from TechnologyEnhancedLearning/Develop/Featu…
AnjuJose011 Sep 25, 2024
09b9737
TD-4704: LH Live: Issue not showing the 'elfh' logo on 'Catalogue det…
ArunimaGeorge Sep 27, 2024
b76051d
Merge pull request #614 from TechnologyEnhancedLearning/Develop/Fixes…
ArunimaGeorge Sep 27, 2024
8cc79d8
TD-4726: Issue showing blank screen when clicked the 'Go back' link o…
Swapnamol Sep 30, 2024
13c99d5
Merge pull request #619 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Sep 30, 2024
54eccb5
TD-4432: Issue with the 'Keywords' when given in upper case changed t…
Swapnamol Oct 1, 2024
c1057a2
Merge pull request #622 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Oct 1, 2024
190478d
TD-4738: Issue showing console errors on 'Learning hub' home page whe…
Swapnamol Oct 4, 2024
149d7e4
Fixed the console errors
Swapnamol Oct 4, 2024
9163af8
Merge pull request #635 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Oct 4, 2024
cda4ced
Merge pull request #598 from TechnologyEnhancedLearning/Develop/Featu…
AnjuJose011 Oct 10, 2024
4311b0d
Merge RC changes
AnjuJose011 Oct 11, 2024
b022dd9
Merge pull request #644 from TechnologyEnhancedLearning/MergeRcChange…
AnjuJose011 Oct 11, 2024
4070549
TD-4261: Duplicate entries for the assessment results(elearning) in t…
ArunimaGeorge Oct 11, 2024
7c3b543
Merge pull request #648 from TechnologyEnhancedLearning/Develop/Fixes…
ArunimaGeorge Oct 17, 2024
9d6b807
TD-2396: Add ability to insert Dev ID
Swapnamol Oct 22, 2024
f9b1b1a
Merge release-v1.0.0
akdalin-hee Oct 23, 2024
0f75497
Merge release-v1.0.0
akdalin-hee Oct 23, 2024
a6cdffe
Merge release-v1.0.0
akdalin-hee Oct 23, 2024
7fdb92f
Merge release-v1.0.0
akdalin-hee Oct 23, 2024
e8a8925
Merge release-v1.0.0
akdalin-hee Oct 23, 2024
a57ab71
Merge pull request #679 from TechnologyEnhancedLearning/Develop/Featu…
AnjuJose011 Oct 24, 2024
999f33e
Merge pull request #678 from TechnologyEnhancedLearning/Develop/Featu…
AnjuJose011 Oct 24, 2024
2672ddc
Merge pull request #677 from TechnologyEnhancedLearning/Develop/Featu…
AnjuJose011 Oct 24, 2024
de78ba1
Merge pull request #673 from TechnologyEnhancedLearning/Develop/Featu…
AnjuJose011 Oct 24, 2024
226fe2e
Merge pull request #672 from TechnologyEnhancedLearning/Develop/Featu…
AnjuJose011 Oct 24, 2024
3c6076b
Merge pull request #671 from TechnologyEnhancedLearning/Develop/Featu…
AnjuJose011 Oct 24, 2024
c9f722f
Merge pull request #666 from TechnologyEnhancedLearning/Develop/Featu…
AnjuJose011 Oct 24, 2024
6d08f96
Make content of Change Catalogue menu interactive
akdalin-hee Oct 24, 2024
d2d66eb
Merge pull request #664 from TechnologyEnhancedLearning/Develop/Featu…
Swapnamol Oct 25, 2024
8d75895
Merge pull request #693 from TechnologyEnhancedLearning/Develop/Featu…
AnjuJose011 Oct 28, 2024
79501e7
fixes
AnjuJose011 Oct 29, 2024
054bf24
conflicts resloved
AnjuJose011 Oct 29, 2024
4e01687
fix for menu change
AnjuJose011 Oct 29, 2024
d0aa207
Merge pull request #702 from TechnologyEnhancedLearning/TD-4197-Fixes
AnjuJose011 Oct 29, 2024
722ef39
TD-4081:DIG306: Labels for form fields are missing
Swapnamol Oct 29, 2024
80109aa
conflicts resloved
AnjuJose011 Oct 29, 2024
3757f3c
Merge pull request #705 from TechnologyEnhancedLearning/MergeRc-V1.0.0
AnjuJose011 Oct 29, 2024
f2b6f12
Merge RC changes to V1.0.0
Swapnamol Oct 30, 2024
a1e235c
Merge pull request #713 from TechnologyEnhancedLearning/Latest-RC-to-…
Swapnamol Oct 30, 2024
0657ee7
TD-4070: Removed text from alt attribute for decorative images.
ArunimaGeorge Oct 30, 2024
6fdf582
Update pull_request_template.md
kevwhitt-hee Oct 31, 2024
bf06752
TD-4072: DIG201 Content has heading markup, but is not a heading issu…
ArunimaGeorge Oct 31, 2024
976e0c3
Merge pull request #717 from TechnologyEnhancedLearning/Develop/Fixes…
AnjuJose011 Oct 31, 2024
1c0792f
Merge pull request #706 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Oct 31, 2024
405baeb
Merge pull request #719 from TechnologyEnhancedLearning/Develop/Fixes…
ArunimaGeorge Oct 31, 2024
f89d568
TD-4080: DIG302: Placeholder text cannot be used to label forms
Swapnamol Nov 1, 2024
3f021d0
Merge pull request #725 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Nov 4, 2024
9a41832
TD:4079: DIG301: Form fields are not associated with text labels
Swapnamol Nov 4, 2024
6f37266
accessbility fixes
Swapnamol Nov 4, 2024
1508bc7
Accessibility fixes
Swapnamol Nov 4, 2024
b318bb3
Merge pull request #731 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Nov 5, 2024
d64b641
TD-4079: Form elements should have an id attribute
Swapnamol Nov 6, 2024
af256dd
Merge pull request #733 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Nov 6, 2024
acb9ad5
Merge pull request #734 from TechnologyEnhancedLearning/RC
AnjuJose011 Nov 6, 2024
1067f5c
TD-4194:DIG1302: Focus order is incorrect or illogical
Swapnamol Nov 6, 2024
04fe904
Merge pull request #735 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Nov 6, 2024
4f15fb2
Merge pull request #714 from TechnologyEnhancedLearning/Develop/Fixes…
ArunimaGeorge Nov 14, 2024
d6272a2
TD-4824: Implemented click logs for Auto suggestions.
ArunimaGeorge Nov 19, 2024
e0ce050
Merge pull request #747 from TechnologyEnhancedLearning/Develop/Featu…
ArunimaGeorge Nov 22, 2024
15e6706
conflicts resloved
AnjuJose011 Nov 22, 2024
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
26 changes: 13 additions & 13 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
### JIRA link
_TD-###_
[TD-####](https://hee-tis.atlassian.net/browse/TD-####)

### Description
_Describe what has changed and how that will affect the app. If relevant, add references to the resources you used. Use this as your opportunity to highlight anything odd and give people context around particular decisions._
_Describe what has changed and how that will affect the app. If relevant, add links to any sources/documentation you used. Highlight anything unusual and give people context around particular decisions._

### Screenshots
_Attach screenshots on mobile, tablet and desktop._
_Paste screenshots for all views created or changed: mobile, tablet and desktop, wave analyser showing no errors._

-----
### Developer checks
(Leave tasks unticked if they haven't been appropriate for your ticket.)

I have:
- [ ] Run the formatter and made sure there are no IDE errors
- [ ] Written appropriate unit tests for the changes, including:
- accessibility tests for new views
- tests for new controller methods
- tests for new or modified API endpoints
- [ ] Manually tested my work with and without JavaScript
- [ ] Tested any Views or partials created or changed with [Wave Chrome plugin](https://chrome.google.com/webstore/detail/wave-evaluation-tool/jbbplnpkjmmeebjpijfedlgcdilocofh/related) and addressed any valid accessibility issues
- [ ] Updated/added documentation in [Confluence](https://hee-tis.atlassian.net/wiki/spaces/TP/pages/3477930003/Learning+Hub) and/or [GitHub Readme](https://github.com/TechnologyEnhancedLearning/LearningHub.Nhs.UserApi/blob/master/README.md). List of documentation links added/changed:
- [ ] Run the IDE auto formatter on all files I’ve worked on and made sure there are no IDE errors relating to them
- [ ] Written or updated tests for the changes (accessibility ui tests for views, tests for controller, data services, services, view models created or modified) and made sure all tests are passing
- [ ] Manually tested my work with and without JavaScript (adding notes where functionality requires JavaScript)
- [ ] Tested any Views or partials created or changed with [Wave Chrome plugin](https://chrome.google.com/webstore/detail/wave-evaluation-tool/jbbplnpkjmmeebjpijfedlgcdilocofh/related). Addressed any valid accessibility issues and documented any invalid errors
- [ ] Updated my Jira ticket with testing notes, including information about other parts of the system that were touched as part of the MR and need to be tested to ensure nothing is broken
- [ ] Scanned over my pull request in GitHub and addressed any warnings from the GitHub Build and Test checks in the GitHub PR ‘Files Changed’ tab
Either:
- [ ] Documented my work in [Confluence](https://hee-tis.atlassian.net/wiki/spaces/TP/pages/3461087233/Development), updating any business rules applied or modified. Updated GitHub readme/documentation for the repository if appropriate. List of documentation links added/changed:
- [doc_1_here](link_1_here)
- [ ] Updated my Jira ticket with information about other parts of the system that were touched as part of the MR and have to be sanity tested to ensure nothing is broken
- [ ] Scanned over my pull request in GitHub and addressed any warnings from the GitHub Build and Test checks.
Or:
- [ ] Confirmed that none of the work that I have undertaken requires any updates to documentation
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ public ResourceController(
/// The Details.
/// </summary>
/// <param name="id">The id<see cref="int"/>.</param>
/// <param name="activeTab">The activeTab<see cref="string"/>.</param>
/// <param name="status">The status<see cref="string"/>.</param>
/// <returns>The <see cref="Task{IActionResult}"/>.</returns>
[HttpGet]
public async Task<IActionResult> Details(int id)
public async Task<IActionResult> Details(int id, string activeTab = "details", string status = "")
{
var resource = await this.resourceService.GetResourceVersionExtendedViewModelAsync(id);
this.ViewBag.ActiveTab = activeTab;
this.ViewBag.Status = status;
return this.View(resource);
}

Expand Down Expand Up @@ -138,6 +142,41 @@ public async Task<IActionResult> GetValidationResults(int resourceVersionId)
return this.PartialView("_ValidationResults", vm);
}

/// <summary>
/// The GetDevIdDetails.
/// </summary>
/// <param name="resourceVersionId">The resourceVersionId<see cref="int"/>.</param>
/// <returns>The <see cref="Task{IActionResult}"/>.</returns>
[HttpPost]
public async Task<IActionResult> GetDevIdDetails(int resourceVersionId)
{
var vm = await this.resourceService.GetResourceVersionDevIdDetailsAsync(resourceVersionId);

return this.PartialView("_DevIdDetails", vm);
}

/// <summary>
/// The update the dev Id details.
/// </summary>
/// <param name="model">The model.</param>
/// <returns>The <see cref="Task{IActionResult}"/>.</returns>
[HttpPost]
public async Task<IActionResult> UpdateDevIdDetails(ResourceVersionDevIdViewModel model)
{
var message = string.Empty;
if (await this.resourceService.DoesDevIdExistsAsync(model.DevId))
{
message = "Duplicate";
}
else
{
await this.resourceService.UpdateDevIdDetailsAsync(model);
message = "Success";
}

return this.RedirectToAction("Details", new { id = model.ResourceVersionId, activeTab = "devId", status = message });
}

/// <summary>
/// The Index.
/// </summary>
Expand Down
23 changes: 22 additions & 1 deletion AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IResourceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,30 @@
/// The GetResourceVersionValidationResultAsync.
/// </summary>
/// <param name="resourceVersionId">The resourceVersionId<see cref="int"/>.</param>
/// <returns>The <see cref="Task{ResourceVersionEventViewModel}}"/>.</returns>
/// <returns>The <see cref="Task{ResourceVersionValidationResultViewModel}}"/>.</returns>

Check warning on line 35 in AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IResourceService.cs

View workflow job for this annotation

GitHub Actions / Build and test

XML comment has syntactically incorrect cref attribute 'Task{ResourceVersionValidationResultViewModel}}'
Task<ResourceVersionValidationResultViewModel> GetResourceVersionValidationResultAsync(int resourceVersionId);

/// <summary>
/// The GetResourceVersionDevIdDetailsAsync.
/// </summary>
/// <param name="resourceVersionId">The resourceVersionId<see cref="int"/>.</param>
/// <returns>The <see cref="Task{ResourceVersionDevIdViewModel}}"/>.</returns>

Check warning on line 42 in AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IResourceService.cs

View workflow job for this annotation

GitHub Actions / Build and test

XML comment has syntactically incorrect cref attribute 'Task{ResourceVersionDevIdViewModel}}'
Task<ResourceVersionDevIdViewModel> GetResourceVersionDevIdDetailsAsync(int resourceVersionId);

/// <summary>
/// Check dev id already exist against a resource.
/// </summary>
/// <param name="devId">string devId.</param>
/// <returns>The <see cref="Task{bool}"/>.</returns>

Check warning on line 49 in AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IResourceService.cs

View workflow job for this annotation

GitHub Actions / Build and test

XML comment has syntactically incorrect cref attribute 'Task{bool}'

Check warning on line 49 in AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IResourceService.cs

View workflow job for this annotation

GitHub Actions / Build and test

Type parameter declaration must be an identifier not a type. See also error CS0081.
Task<bool> DoesDevIdExistsAsync(string devId);

/// <summary>
/// To update dev id details for a resource.
/// </summary>
/// <param name="model">the ResourceVersionDevIdViewModel.</param>
/// <returns>The <see cref="Task{ResourceVersionDevIdViewModel}}"/>.</returns>
Task UpdateDevIdDetailsAsync(ResourceVersionDevIdViewModel model);

/// <summary>
/// The GetResourceVersionExtendedViewModelAsync.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<PackageReference Include="HtmlSanitizer" Version="6.0.453" />
<PackageReference Include="IdentityModel" Version="4.4.0" />
<PackageReference Include="LearningHub.Nhs.Caching" Version="2.0.2" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.43" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.44" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.19.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
Expand Down
84 changes: 84 additions & 0 deletions AdminUI/LearningHub.Nhs.AdminUI/Services/ResourceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
Expand Down Expand Up @@ -105,7 +106,7 @@
/// The GetResourceVersionValidationResultAsync.
/// </summary>
/// <param name="resourceVersionId">The resourceVersionId<see cref="int"/>.</param>
/// <returns>The <see cref="Task{List{ResourceVersionValidationResultViewModel}}"/>.</returns>

Check warning on line 109 in AdminUI/LearningHub.Nhs.AdminUI/Services/ResourceService.cs

View workflow job for this annotation

GitHub Actions / Build and test

XML comment has syntactically incorrect cref attribute 'Task{List{ResourceVersionValidationResultViewModel}}'

Check warning on line 109 in AdminUI/LearningHub.Nhs.AdminUI/Services/ResourceService.cs

View workflow job for this annotation

GitHub Actions / Build and test

Type parameter declaration must be an identifier not a type. See also error CS0081.
public async Task<ResourceVersionValidationResultViewModel> GetResourceVersionValidationResultAsync(int resourceVersionId)
{
ResourceVersionValidationResultViewModel viewmodel = null;
Expand All @@ -130,6 +131,89 @@
return viewmodel;
}

/// <summary>
/// The GetResourceVersionDevIdDetailsAsync.
/// </summary>
/// <param name="resourceVersionId">The resourceVersionId<see cref="int"/>.</param>
/// <returns>The <see cref="List{ResourceVersionDevIdViewModel}"/>.</returns>
public async Task<ResourceVersionDevIdViewModel> GetResourceVersionDevIdDetailsAsync(int resourceVersionId)
{
ResourceVersionDevIdViewModel viewmodel = null;

var client = await this.LearningHubHttpClient.GetClientAsync();

var request = $"Resource/GetResourceVersionDevIdDetails/{resourceVersionId.ToString()}";
var response = await client.GetAsync(request).ConfigureAwait(false);

if (response.IsSuccessStatusCode)
{
var result = response.Content.ReadAsStringAsync().Result;
viewmodel = JsonConvert.DeserializeObject<ResourceVersionDevIdViewModel>(result);
}
else if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized
||
response.StatusCode == System.Net.HttpStatusCode.Forbidden)
{
throw new Exception("AccessDenied");
}

return viewmodel;
}

/// <summary>
/// The GetResourceVersionDevIdDetailsAsync.
/// </summary>
/// <param name="devId">The devId<see cref="string"/>.</param>
/// <returns>The <see cref="List{ResourceVersionDevIdViewModel}"/>.</returns>
public async Task<bool> DoesDevIdExistsAsync(string devId)
{
var client = await this.LearningHubHttpClient.GetClientAsync();

var request = $"Resource/DoesDevIdExists/{devId}";
var response = await client.GetAsync(request).ConfigureAwait(false);
var doesDevIdExist = false;
if (response.IsSuccessStatusCode)
{
var result = response.Content.ReadAsStringAsync().Result;
doesDevIdExist = JsonConvert.DeserializeObject<bool>(result);
}
else if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized
||
response.StatusCode == System.Net.HttpStatusCode.Forbidden)
{
throw new Exception("AccessDenied");
}

return doesDevIdExist;
}

/// <summary>
/// Update dev id details for a resource.
/// </summary>
/// <param name="model">The model.</param>
/// <returns>The <see cref="List{ResourceVersionDevIdViewModel}"/>.</returns>
/// <exception cref="Exception">the exception.</exception>
public async Task UpdateDevIdDetailsAsync(ResourceVersionDevIdViewModel model)
{
var json = JsonConvert.SerializeObject(model);
var stringContent = new StringContent(json, UnicodeEncoding.UTF8, "application/json");

var client = await this.LearningHubHttpClient.GetClientAsync();

var request = $"Resource/UpdateDevId";
var response = await client.PutAsync(request, stringContent).ConfigureAwait(false);

if (response.StatusCode == HttpStatusCode.Unauthorized || response.StatusCode == HttpStatusCode.Forbidden)
{
throw new Exception("AccessDenied");
}

if (!response.IsSuccessStatusCode)
{
throw new Exception("Update first name failed!");
}
}

/// <summary>
/// The GetResourceVersionExtendedViewModelAsync.
/// </summary>
Expand Down
Loading
Loading