diff --git a/.github/workflows/build-and-deploy-production.yml b/.github/workflows/build-and-deploy-production.yml index 38d34a51c2..b1579fb2d1 100644 --- a/.github/workflows/build-and-deploy-production.yml +++ b/.github/workflows/build-and-deploy-production.yml @@ -19,10 +19,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup .NET Core SDK 6.0 + - name: Setup .NET Core SDK 8.0 uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Setup node uses: actions/setup-node@v4 with: diff --git a/.github/workflows/build-and-deploy-uat.yml b/.github/workflows/build-and-deploy-uat.yml index 9a82da00a9..e06b88c727 100644 --- a/.github/workflows/build-and-deploy-uat.yml +++ b/.github/workflows/build-and-deploy-uat.yml @@ -22,10 +22,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup .NET Core SDK 6.0 + - name: Setup .NET Core SDK 8.0 uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Setup node uses: actions/setup-node@v4 with: diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index d0019ac854..3b0ed25380 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -12,10 +12,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup .NET Core SDK 6.0 + - name: Setup .NET Core SDK 8.0 uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Add TechnologyEnhancedLearning as nuget package source run: dotnet nuget add source https://pkgs.dev.azure.com/e-LfH/_packaging/LearningHubFeed/nuget/v3/index.json --name TechnologyEnhancedLearning --username 'kevin.whittaker' --password ${{ secrets.AZURE_DEVOPS_PAT }} --store-password-in-clear-text diff --git a/DigitalLearningSolutions.Data.Migrations/202410071401_UpdateCandidateAssessmentSupervisorsTabl.cs b/DigitalLearningSolutions.Data.Migrations/202410071401_UpdateCandidateAssessmentSupervisorsTabl.cs deleted file mode 100644 index de95a04841..0000000000 --- a/DigitalLearningSolutions.Data.Migrations/202410071401_UpdateCandidateAssessmentSupervisorsTabl.cs +++ /dev/null @@ -1,21 +0,0 @@ - -namespace DigitalLearningSolutions.Data.Migrations -{ - using FluentMigrator; - - [Migration(202410071401)] - public class UpdateCandidateAssessmentSupervisorsTabl : ForwardOnlyMigration - { - public override void Up() - { - Execute.Sql($@"UPDATE cas - SET SelfAssessmentSupervisorRoleID = (SELECT ID FROM SelfAssessmentSupervisorRoles - WHERE SelfAssessmentID = ssr.SelfAssessmentID and AllowDelegateNomination = 1) - FROM CandidateAssessmentSupervisors cas INNER JOIN - SelfAssessmentSupervisorRoles ssr ON cas.SelfAssessmentSupervisorRoleID = ssr.ID - AND cas.Removed IS NULL AND ssr.AllowDelegateNomination = 0 INNER JOIN - SupervisorDelegates sd ON cas.SupervisorDelegateId = sd.ID INNER JOIN - AdminAccounts aa ON sd.SupervisorAdminID = aa.ID WHERE aa.IsSupervisor = 0 AND aa.IsNominatedSupervisor = 1"); - } - } -} diff --git a/DigitalLearningSolutions.Data/DataServices/RegistrationDataService.cs b/DigitalLearningSolutions.Data/DataServices/RegistrationDataService.cs index d6b229e721..ced09e50f3 100644 --- a/DigitalLearningSolutions.Data/DataServices/RegistrationDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/RegistrationDataService.cs @@ -197,7 +197,7 @@ public int RegisterAdmin( isSupervisor = registrationModel.IsSupervisor, isNominatedSupervisor = registrationModel.IsNominatedSupervisor, }; - + var adminUserId = connection.QuerySingle( @"INSERT INTO AdminAccounts ( @@ -219,7 +219,10 @@ OUTPUT Inserted.ID ( @userId, @centreId, - @categoryId, + CASE + WHEN @categoryID = 0 THEN NULL + ELSE @categoryID + END, @isCentreAdmin, @isCentreManager, @active, diff --git a/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentSupervisorDataService.cs b/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentSupervisorDataService.cs index 8ae5e54133..7c3a5d118f 100644 --- a/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentSupervisorDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentSupervisorDataService.cs @@ -95,7 +95,8 @@ int delegateUserId WHERE (sd.Removed IS NULL) AND (cas.Removed IS NULL) AND (sd.DelegateUserID = @delegateUserId) AND (ca.SelfAssessmentID = @selfAssessmentId) AND (sd.SupervisorAdminID IS NOT NULL) AND (coalesce(sasr.ResultsReview, 1) = 1) - AND au.Active = 1 + AND au.Active = 1 + AND (au.CategoryID = 0 OR au.CategoryID IN (select CategoryID from SelfAssessments where ID = @selfAssessmentId)) ORDER BY SupervisorName", new { selfAssessmentId, delegateUserId } ); diff --git a/DigitalLearningSolutions.Web/Controllers/SupervisorController/Supervisor.cs b/DigitalLearningSolutions.Web/Controllers/SupervisorController/Supervisor.cs index e051d12737..11d8ab1e7d 100644 --- a/DigitalLearningSolutions.Web/Controllers/SupervisorController/Supervisor.cs +++ b/DigitalLearningSolutions.Web/Controllers/SupervisorController/Supervisor.cs @@ -1314,7 +1314,7 @@ public IActionResult ConfirmNominateSupervisor(SupervisorDelegateViewModel super supervisorDelegateDetail.DelegateUserID, (int)User.GetCentreId() ); - supervisorDelegate.SelfAssessmentCategory = supervisorDelegate.SelfAssessmentCategory == 0 ? adminUser.CategoryId.Value : supervisorDelegate.SelfAssessmentCategory; + supervisorDelegate.SelfAssessmentCategory = supervisorDelegate.SelfAssessmentCategory == 0 ? (adminUser.CategoryId.HasValue ? adminUser.CategoryId.Value : 0) : supervisorDelegate.SelfAssessmentCategory; var centreName = adminUser.CentreName; var adminRoles = new AdminRoles(false, false, true, false, false, false, false, false);