Skip to content

Commit 80835b0

Browse files
authored
Merge pull request #2972 from TechnologyEnhancedLearning/DLS-Release-v1.1.0
Dls release v1.1.0 to UAT
2 parents 67b1ac8 + 01259c3 commit 80835b0

File tree

29 files changed

+339
-175
lines changed

29 files changed

+339
-175
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+
}

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/DataServices/CourseDataService.cs

Lines changed: 5 additions & 5 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-
545545
if (candidateAssessmentId > 1 && supervisorDelegateId !=0)
546-
547546
{
548547
string sqlQuery = $@"
549548
BEGIN TRANSACTION
@@ -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

DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentDataService.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int candidateAssessmentSupervisorId
120120

121121
SupervisorComment? GetSupervisorComments(int delegateUserId, int resultId);
122122

123-
IEnumerable<Administrator> GetValidSupervisorsForActivity(int centreId, int selfAssessmentId, int delegateUserId);
123+
IEnumerable<Administrator> GetValidSupervisorsForActivity(int selfAssessmentId, int delegateUserId);
124124

125125
Administrator GetSupervisorByAdminId(int supervisorAdminId);
126126

@@ -172,6 +172,7 @@ int GetSelfAssessmentActivityDelegatesExportCount(string searchString, string so
172172
bool IsUnsupervisedSelfAssessment(int selfAssessmentId);
173173
bool IsCentreSelfAssessment(int selfAssessmentId, int centreId);
174174
bool HasMinimumOptionalCompetencies(int selfAssessmentId, int delegateUserId);
175+
int GetSelfAssessmentCategoryId(int selfAssessmentId);
175176
}
176177

177178
public partial class SelfAssessmentDataService : ISelfAssessmentDataService
@@ -229,13 +230,13 @@ FROM SelfAssessments
229230
sa.SupervisorSelfAssessmentReview,
230231
sa.SupervisorResultsReview";
231232

232-
var fromTableQuery = $@" FROM dbo.SelfAssessments AS sa
233+
var fromTableQuery = $@" FROM dbo.SelfAssessments AS sa
233234
INNER JOIN dbo.CandidateAssessments AS ca WITH (NOLOCK) ON sa.ID = ca.SelfAssessmentID
234235
INNER JOIN dbo.CentreSelfAssessments AS csa WITH (NOLOCK) ON sa.ID = csa.SelfAssessmentID
235236
INNER JOIN dbo.DelegateAccounts da WITH (NOLOCK) ON ca.CentreID = da.CentreID AND ca.DelegateUserID = da.UserID AND da.CentreID = csa.CentreID
236237
INNER JOIN dbo.Users u WITH (NOLOCK) ON DA.UserID = u.ID
237238
LEFT JOIN UserCentreDetails AS ucd WITH (NOLOCK) ON ucd.UserID = da.UserID AND ucd.centreID = da.CentreID
238-
LEFT OUTER JOIN AdminAccounts AS aaEnrolledBy WITH (NOLOCK) ON aaEnrolledBy.ID = ca.EnrolledByAdminID
239+
LEFT OUTER JOIN AdminAccounts AS aaEnrolledBy WITH (NOLOCK) ON aaEnrolledBy.ID = ca.EnrolledByAdminID
239240
LEFT OUTER JOIN Users AS uEnrolledBy WITH (NOLOCK) ON uEnrolledBy.ID = aaEnrolledBy.UserID
240241
LEFT JOIN dbo.CandidateAssessmentSupervisors AS cas WITH (NOLOCK) ON ca.ID = cas.CandidateAssessmentID
241242
LEFT JOIN dbo.CandidateAssessmentSupervisorVerifications AS casv WITH (NOLOCK) ON cas.ID = casv.CandidateAssessmentSupervisorID AND
@@ -760,5 +761,13 @@ INNER JOIN SelfAssessments AS SA
760761
new { selfAssessmentId, delegateUserId }
761762
);
762763
}
764+
765+
public int GetSelfAssessmentCategoryId(int selfAssessmentId)
766+
{
767+
return connection.ExecuteScalar<int>(
768+
@"SELECT CategoryID FROM SelfAssessments WHERE ID = @selfAssessmentId",
769+
new { selfAssessmentId }
770+
);
771+
}
763772
}
764773
}

0 commit comments

Comments
 (0)