Skip to content

Commit 8af244f

Browse files
Merge branch 'release-v1.1.0' into Develop/Fixes/TD-4168-Framework_Upgrade
2 parents f53adc6 + 0117c8e commit 8af244f

File tree

195 files changed

+4278
-2399
lines changed

Some content is hidden

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

195 files changed

+4278
-2399
lines changed

.github/azure-pipeline-webui-ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,57 @@ jobs:
5151
inputs:
5252
command: restore
5353
projects: $(BuildParameters.RestoreBuildProjects)
54+
# Step 1: Get the version tag from the repository
55+
- script: |
56+
echo "Extracting version from Git tag: $(versionTag)"
57+
VERSION=$(echo $(versionTag) | sed 's/^v//')
58+
echo "VERSION=$VERSION" >> $(Build.ArtifactStagingDirectory)/version.txt
59+
displayName: 'Extract version tag'
60+
61+
# Step 2: Update AssemblyVersion in Web UI .csproj
62+
- powershell: |
63+
$versionFile = "$(Build.ArtifactStagingDirectory)/version.txt"
64+
$version = Get-Content $versionFile
65+
$version = $version.Trim()
66+
67+
# Path to your .csproj file (adjust if necessary)
68+
$csprojFile = "$(Build.SourcesDirectory)\LearningHub.Nhs.WebUI\LearningHub.Nhs.WebUI.csproj"
69+
70+
Write-Host "Updating AssemblyVersion and FileVersion and Version in $csprojFile to $version"
71+
72+
# Load the .csproj XML file
73+
[xml]$csprojXml = Get-Content -Path $csprojFile
74+
75+
# Update the AssemblyVersion and FileVersion
76+
$csprojXml.Project.PropertyGroup.AssemblyVersion = $version
77+
$csprojXml.Project.PropertyGroup.FileVersion = $version
78+
$csprojXml.Project.PropertyGroup.Version = $version
79+
80+
# Save the updated .csproj file
81+
$csprojXml.Save($csprojFile)
82+
displayName: 'Update AssemblyVersion in WebUI .csproj'
83+
# Step 2: Update AssemblyVersion in Admin UI .csproj
84+
- powershell: |
85+
$versionFile = "$(Build.ArtifactStagingDirectory)/version.txt"
86+
$version = Get-Content $versionFile
87+
$version = $version.Trim()
88+
89+
# Path to your .csproj file (adjust if necessary)
90+
$csprojFile = "$(Build.SourcesDirectory)\AdminUI\LearningHub.Nhs.AdminUI\LearningHub.Nhs.AdminUI.csproj"
91+
92+
Write-Host "Updating AssemblyVersion and FileVersion and Version in $csprojFile to $version"
93+
94+
# Load the .csproj XML file
95+
[xml]$csprojXml = Get-Content -Path $csprojFile
96+
97+
# Update the AssemblyVersion and FileVersion
98+
$csprojXml.Project.PropertyGroup.AssemblyVersion = $version
99+
$csprojXml.Project.PropertyGroup.FileVersion = $version
100+
$csprojXml.Project.PropertyGroup.Version = $version
101+
102+
# Save the updated .csproj file
103+
$csprojXml.Save($csprojFile)
104+
displayName: 'Update AssemblyVersion in AdminUI .csproj'
54105
- task: DotNetCoreCLI@2
55106
displayName: Build
56107
inputs:

.github/pull_request_template.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
### JIRA link
2-
_TD-###_
2+
[TD-####](https://hee-tis.atlassian.net/browse/TD-####)
33

44
### Description
5-
_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._
5+
_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._
66

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

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

1414
I have:
15-
- [ ] Run the formatter and made sure there are no IDE errors
16-
- [ ] Written appropriate unit tests for the changes, including:
17-
- accessibility tests for new views
18-
- tests for new controller methods
19-
- tests for new or modified API endpoints
20-
- [ ] Manually tested my work with and without JavaScript
21-
- [ ] 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
22-
- [ ] 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:
15+
- [ ] Run the IDE auto formatter on all files I’ve worked on and made sure there are no IDE errors relating to them
16+
- [ ] 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
17+
- [ ] Manually tested my work with and without JavaScript (adding notes where functionality requires JavaScript)
18+
- [ ] 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
19+
- [ ] 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
20+
- [ ] 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
21+
Either:
22+
- [ ] 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:
2323
- [doc_1_here](link_1_here)
24-
- [ ] 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
25-
- [ ] Scanned over my pull request in GitHub and addressed any warnings from the GitHub Build and Test checks.
24+
Or:
25+
- [ ] Confirmed that none of the work that I have undertaken requires any updates to documentation

AdminUI/LearningHub.Nhs.AdminUI/Controllers/ResourceController.cs

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,15 @@ public ResourceController(
9191
/// The Details.
9292
/// </summary>
9393
/// <param name="id">The id<see cref="int"/>.</param>
94+
/// <param name="activeTab">The activeTab<see cref="string"/>.</param>
95+
/// <param name="status">The status<see cref="string"/>.</param>
9496
/// <returns>The <see cref="Task{IActionResult}"/>.</returns>
9597
[HttpGet]
96-
public async Task<IActionResult> Details(int id)
98+
public async Task<IActionResult> Details(int id, string activeTab = "details", string status = "")
9799
{
98100
var resource = await this.resourceService.GetResourceVersionExtendedViewModelAsync(id);
101+
this.ViewBag.ActiveTab = activeTab;
102+
this.ViewBag.Status = status;
99103
return this.View(resource);
100104
}
101105

@@ -138,6 +142,46 @@ public async Task<IActionResult> GetValidationResults(int resourceVersionId)
138142
return this.PartialView("_ValidationResults", vm);
139143
}
140144

145+
/// <summary>
146+
/// The GetDevIdDetails.
147+
/// </summary>
148+
/// <param name="resourceVersionId">The resourceVersionId<see cref="int"/>.</param>
149+
/// <returns>The <see cref="Task{IActionResult}"/>.</returns>
150+
[HttpPost]
151+
public async Task<IActionResult> GetDevIdDetails(int resourceVersionId)
152+
{
153+
var vm = await this.resourceService.GetResourceVersionDevIdDetailsAsync(resourceVersionId);
154+
155+
return this.PartialView("_DevIdDetails", vm);
156+
}
157+
158+
/// <summary>
159+
/// The update the dev Id details.
160+
/// </summary>
161+
/// <param name="model">The model.</param>
162+
/// <returns>The <see cref="Task{IActionResult}"/>.</returns>
163+
[HttpPost]
164+
public async Task<IActionResult> UpdateDevIdDetails(ResourceVersionDevIdViewModel model)
165+
{
166+
var message = string.Empty;
167+
if (string.IsNullOrEmpty(model.DevId))
168+
{
169+
message = "Enter a Dev id for the resource";
170+
}
171+
else if (await this.resourceService.DoesDevIdExistsAsync(model.DevId.Trim()))
172+
{
173+
message = "Duplicate";
174+
}
175+
else
176+
{
177+
model.DevId = model.DevId.Trim();
178+
await this.resourceService.UpdateDevIdDetailsAsync(model);
179+
message = "Success";
180+
}
181+
182+
return this.RedirectToAction("Details", new { id = model.ResourceVersionId, activeTab = "devId", status = message });
183+
}
184+
141185
/// <summary>
142186
/// The Index.
143187
/// </summary>

AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IResourceService.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,30 @@ public interface IResourceService
3232
/// The GetResourceVersionValidationResultAsync.
3333
/// </summary>
3434
/// <param name="resourceVersionId">The resourceVersionId<see cref="int"/>.</param>
35-
/// <returns>The <see cref="Task{ResourceVersionEventViewModel}}"/>.</returns>
35+
/// <returns>The <see cref="Task{ResourceVersionValidationResultViewModel}}"/>.</returns>
3636
Task<ResourceVersionValidationResultViewModel> GetResourceVersionValidationResultAsync(int resourceVersionId);
3737

38+
/// <summary>
39+
/// The GetResourceVersionDevIdDetailsAsync.
40+
/// </summary>
41+
/// <param name="resourceVersionId">The resourceVersionId<see cref="int"/>.</param>
42+
/// <returns>The <see cref="Task{ResourceVersionDevIdViewModel}}"/>.</returns>
43+
Task<ResourceVersionDevIdViewModel> GetResourceVersionDevIdDetailsAsync(int resourceVersionId);
44+
45+
/// <summary>
46+
/// Check dev id already exist against a resource.
47+
/// </summary>
48+
/// <param name="devId">string devId.</param>
49+
/// <returns>The <see cref="Task{bool}"/>.</returns>
50+
Task<bool> DoesDevIdExistsAsync(string devId);
51+
52+
/// <summary>
53+
/// To update dev id details for a resource.
54+
/// </summary>
55+
/// <param name="model">the ResourceVersionDevIdViewModel.</param>
56+
/// <returns>The <see cref="Task{ResourceVersionDevIdViewModel}}"/>.</returns>
57+
Task UpdateDevIdDetailsAsync(ResourceVersionDevIdViewModel model);
58+
3859
/// <summary>
3960
/// The GetResourceVersionExtendedViewModelAsync.
4061
/// </summary>

0 commit comments

Comments
 (0)