Skip to content

Commit 08fdcc2

Browse files
authored
Merge pull request #3053 from TechnologyEnhancedLearning/DLS-Release-v1.1.0
Dls release v1.1.0
2 parents 2d83b17 + 00856ce commit 08fdcc2

File tree

45 files changed

+20191
-441
lines changed

Some content is hidden

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

45 files changed

+20191
-441
lines changed

.github/pull_request_template.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
### JIRA link
2-
_DLSV2-XXXX_
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 (see [info on Text Editor settings](https://hee-tis.atlassian.net/wiki/spaces/TP/pages/3546185813/DLS+Dev+Process) to avoid whitespace changes)
16-
- [ ] Written tests for the changes (accessibility tests, unit tests for controller, data services, services, view models, etc)
17-
- [ ] Manually tested my work with and without 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) and addressed any valid accessibility issues
19-
- [ ] Updated/added documentation in [Confluence](https://hee-tis.atlassian.net/wiki/spaces/TP/pages/3546939432/DLS+Code) and/or [GitHub Readme](https://github.com/TechnologyEnhancedLearning/DLSV2/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:
2023
- [doc_1_here](link_1_here)
21-
- [ ] 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’s broken
22-
- [ ] 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
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+

2+
3+
namespace DigitalLearningSolutions.Data.Migrations
4+
{
5+
using FluentMigrator;
6+
7+
[Migration(202410231405)]
8+
public class Alter_GetActivitiesForDelegateEnrolment : Migration
9+
{
10+
public override void Up()
11+
{
12+
Execute.Sql(Properties.Resources.TD_4878_Alter_GetActivitiesForDelegateEnrolment_Up);
13+
}
14+
public override void Down()
15+
{
16+
Execute.Sql(Properties.Resources.TD_4878_Alter_GetActivitiesForDelegateEnrolment_Down);
17+
}
18+
}
19+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
5+
[Migration(202412020900)]
6+
public class UpdateCandidateAssessmentSupervisorsTable : ForwardOnlyMigration
7+
{
8+
public override void Up()
9+
{
10+
Execute.Sql($@"UPDATE cas
11+
SET SelfAssessmentSupervisorRoleID = (SELECT ID FROM SelfAssessmentSupervisorRoles
12+
WHERE SelfAssessmentID = ssr.SelfAssessmentID and AllowDelegateNomination = 1)
13+
FROM CandidateAssessmentSupervisors cas INNER JOIN
14+
SelfAssessmentSupervisorRoles ssr ON cas.SelfAssessmentSupervisorRoleID = ssr.ID
15+
AND cas.Removed IS NULL AND ssr.AllowDelegateNomination = 0 INNER JOIN
16+
SupervisorDelegates sd ON cas.SupervisorDelegateId = sd.ID INNER JOIN
17+
AdminAccounts aa ON sd.SupervisorAdminID = aa.ID
18+
WHERE aa.IsSupervisor = 0 AND aa.IsNominatedSupervisor = 1
19+
-- to exclude duplicate CandidateAssessmentID from update
20+
AND cas.CandidateAssessmentID NOT IN (
21+
SELECT CandidateAssessmentID FROM CandidateAssessmentSupervisors WHERE CandidateAssessmentID in (
22+
SELECT Cas2.CandidateAssessmentID
23+
FROM CandidateAssessmentSupervisors cas2 with (nolock) INNER JOIN
24+
SelfAssessmentSupervisorRoles ssr2 with (nolock) ON cas2.SelfAssessmentSupervisorRoleID = ssr2.ID
25+
AND cas2.Removed IS NULL AND ssr2.AllowDelegateNomination = 0 INNER JOIN
26+
SupervisorDelegates sd2 with (nolock) ON cas2.SupervisorDelegateId = sd2.ID INNER JOIN
27+
AdminAccounts aa2 with (nolock) ON sd2.SupervisorAdminID = aa2.ID
28+
WHERE aa2.IsSupervisor = 0 AND aa2.IsNominatedSupervisor = 1
29+
)
30+
GROUP BY CandidateAssessmentID,SupervisorDelegateId
31+
HAVING COUNT(*)>1
32+
)"
33+
);
34+
}
35+
}
36+
}

DigitalLearningSolutions.Data.Migrations/DigitalLearningSolutions.Data.Migrations.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
</ItemGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="Dapper" Version="2.1.24" />
20-
<PackageReference Include="FluentMigrator" Version="3.3.2" />
21-
<PackageReference Include="FluentMigrator.Extensions.SqlServer" Version="3.3.2" />
22-
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.5" />
19+
<PackageReference Include="Dapper" Version="2.1.35" />
20+
<PackageReference Include="FluentMigrator" Version="6.2.0" />
21+
<PackageReference Include="FluentMigrator.Extensions.SqlServer" Version="6.2.0" />
22+
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs

Lines changed: 46 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,19 +448,25 @@
448448
<data name="TD_4634_Alter_GetCompletedCoursesForCandidate_UP" type="System.Resources.ResXFileRef, System.Windows.Forms">
449449
<value>..\Scripts\TD_4634_Alter_GetCompletedCoursesForCandidate_UP.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
450450
</data>
451-
<data name="TD_4950_Alter_GetAssessmentResultsByDelegate_DOWN" type="System.Resources.ResXFileRef, System.Windows.Forms">
452-
<value>..\Scripts\TD_4950_Alter_GetAssessmentResultsByDelegate_DOWN.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
453-
</data>
454-
<data name="TD_4950_Alter_GetAssessmentResultsByDelegate_UP" type="System.Resources.ResXFileRef, System.Windows.Forms">
455-
<value>..\Scripts\TD_4950_Alter_GetAssessmentResultsByDelegate_UP.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
456-
</data>
457451
<data name="TD-4950-dboGetOtherCentresForSelfAssessmentCreateOrAlter" type="System.Resources.ResXFileRef, System.Windows.Forms">
458452
<value>..\Resources\TD-4950-dboGetOtherCentresForSelfAssessmentCreateOrAlter.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
459453
</data>
454+
<data name="TD_4878_Alter_GetActivitiesForDelegateEnrolment_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
455+
<value>..\Scripts\TD-4878-Alter_GetActivitiesForDelegateEnrolment_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
456+
</data>
457+
<data name="TD_4878_Alter_GetActivitiesForDelegateEnrolment_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
458+
<value>..\Scripts\TD-4878-Alter_GetActivitiesForDelegateEnrolment_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
459+
</data>
460460
<data name="TD_4950_AlterGetCandidateAssessmentResultsById_DOWN" type="System.Resources.ResXFileRef, System.Windows.Forms">
461461
<value>..\Resources\TD-4950-AlterGetCandidateAssessmentResultsById_DOWN.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
462462
</data>
463463
<data name="TD_4950_AlterGetCandidateAssessmentResultsById_UP" type="System.Resources.ResXFileRef, System.Windows.Forms">
464464
<value>..\Resources\TD-4950-AlterGetCandidateAssessmentResultsById_UP.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
465465
</data>
466+
<data name="TD_4950_Alter_GetAssessmentResultsByDelegate_DOWN" type="System.Resources.ResXFileRef, System.Windows.Forms">
467+
<value>..\Scripts\TD_4950_Alter_GetAssessmentResultsByDelegate_DOWN.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
468+
</data>
469+
<data name="TD_4950_Alter_GetAssessmentResultsByDelegate_UP" type="System.Resources.ResXFileRef, System.Windows.Forms">
470+
<value>..\Scripts\TD_4950_Alter_GetAssessmentResultsByDelegate_UP.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
471+
</data>
466472
</root>

DigitalLearningSolutions.Data.Tests/DigitalLearningSolutions.Data.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PackageReference Include="FluentMigrator" Version="5.0.0" />
1919
<PackageReference Include="FluentMigrator.Runner" Version="5.0.0" />
2020
<PackageReference Include="FluentMigrator.Runner.SqlServer" Version="5.0.0" />
21-
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.2" />
21+
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.3" />
2222
<PackageReference Include="NBuilder" Version="6.1.0" />
2323
<PackageReference Include="nunit" Version="3.14.0" />
2424
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />

DigitalLearningSolutions.Data/DataServices/CourseDataService.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ int EnrolOnActivitySelfAssessment(int selfAssessmentId, int candidateId, int sup
136136

137137
public IEnumerable<CourseStatistics> GetDelegateCourseStatisticsAtCentre(string searchString, int centreId, int? categoryId, bool allCentreCourses, bool? hideInLearnerPortal, string isActive, string categoryName, string courseTopic, string hasAdminFields);
138138

139-
public IEnumerable<DelegateAssessmentStatistics> GetDelegateAssessmentStatisticsAtCentre(string searchString, int centreId, string categoryName, string isActive);
139+
public IEnumerable<DelegateAssessmentStatistics> GetDelegateAssessmentStatisticsAtCentre(string searchString, int centreId, string categoryName, string isActive, int? categoryId);
140+
140141
bool IsSelfEnrollmentAllowed(int customisationId);
141142
Customisation? GetCourse(int customisationId);
142143
}
@@ -541,9 +542,7 @@ LEFT OUTER JOIN UserCentreDetails AS UCD ON
541542
new { candidateAssessmentId, enrolmentMethodId, completeByDateDynamic }
542543
);
543544
}
544-
545-
if (candidateAssessmentId > 1 && supervisorDelegateId !=0)
546-
545+
if (candidateAssessmentId > 1 && supervisorDelegateId != 0)
547546
{
548547
string sqlQuery = $@"
549548
BEGIN TRANSACTION
@@ -552,17 +551,17 @@ BEGIN TRANSACTION
552551
553552
UPDATE CandidateAssessmentSupervisors SET Removed = NULL
554553
{((selfAssessmentSupervisorRoleId > 0) ? " ,SelfAssessmentSupervisorRoleID = @selfAssessmentSupervisorRoleID" : string.Empty)}
555-
WHERE CandidateAssessmentID = @candidateAssessmentId
554+
WHERE CandidateAssessmentID = @candidateAssessmentId AND SupervisorDelegateId = @supervisorDelegateId
556555
557556
COMMIT TRANSACTION";
558557

559558
connection.Execute(sqlQuery
560-
, new { candidateAssessmentId, selfAssessmentSupervisorRoleId, enrolmentMethodId, completeByDateDynamic });
559+
, new { candidateAssessmentId, selfAssessmentSupervisorRoleId, enrolmentMethodId, completeByDateDynamic, supervisorDelegateId });
561560
}
562561

563562
if (supervisorId > 0)
564563
{
565-
564+
566565
var adminUserId = Convert.ToInt32(connection.ExecuteScalar(@"SELECT UserID FROM AdminAccounts WHERE (AdminAccounts.ID = @supervisorId)",
567566
new { supervisorId })
568567
);
@@ -1976,7 +1975,7 @@ AND ap.DefaultContentTypeID <> 4
19761975
return courseStatistics;
19771976
}
19781977

1979-
public IEnumerable<DelegateAssessmentStatistics> GetDelegateAssessmentStatisticsAtCentre(string searchString, int centreId, string categoryName, string isActive)
1978+
public IEnumerable<DelegateAssessmentStatistics> GetDelegateAssessmentStatisticsAtCentre(string searchString, int centreId, string categoryName, string isActive, int? categoryId)
19801979
{
19811980
string assessmentStatisticsSelectQuery = $@"SELECT
19821981
sa.Name AS Name,
@@ -2006,11 +2005,12 @@ from CentreSelfAssessments AS csa
20062005
WHERE csa.CentreID= @centreId
20072006
AND sa.[Name] LIKE '%' + @searchString + '%'
20082007
AND ((@categoryName = 'Any') OR (cc.CategoryName = @categoryName))
2008+
AND (ISNULL(@categoryId, 0) = 0 OR sa.CategoryID = @categoryId)
20092009
AND ((@isActive = 'Any') OR (@isActive = 'true' AND sa.ArchivedDate IS NULL) OR (@isActive = 'false' AND sa.ArchivedDate IS NOT NULL))
20102010
";
20112011

20122012
IEnumerable<DelegateAssessmentStatistics> delegateAssessmentStatistics = connection.Query<DelegateAssessmentStatistics>(assessmentStatisticsSelectQuery,
2013-
new { searchString, centreId, categoryName, isActive }, commandTimeout: 3000);
2013+
new { searchString, centreId, categoryName, isActive, categoryId }, commandTimeout: 3000);
20142014
return delegateAssessmentStatistics;
20152015
}
20162016

0 commit comments

Comments
 (0)