Skip to content

Commit 49013d4

Browse files
committed
Merge branch 'master' into Release-DLS-2023.22
2 parents fa34f84 + 3a8fbb6 commit 49013d4

File tree

27 files changed

+223
-97
lines changed

27 files changed

+223
-97
lines changed

DigitalLearningSolutions.Data.Migrations/2023090611401334_updateCookiePolicyContentHtml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
namespace DigitalLearningSolutions.Data.Migrations
99
{
10-
[Migration(202309141452)]
10+
[Migration(202309191452)]
1111

1212
public class UpdateCookiePolicyContentHtml : Migration
1313
{
1414
public override void Up()
1515
{
16-
var CookiePolicyContentHtml = Properties.Resources.TD_1943_CookiePolicyContentHtml;
16+
var CookiePolicyContentHtml = Properties.Resources.TD_1943_CookiesPolicyContentHtml;
1717

1818
Execute.Sql(
1919
@"UPDATE Config SET ConfigText =N'" + CookiePolicyContentHtml + "' " +

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

Lines changed: 11 additions & 11 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
<data name="TD_1943_CookiePolicyContentHtmlOldRecord" type="System.Resources.ResXFileRef, System.Windows.Forms">
305305
<value>..\Resources\TD_1943_CookiePolicyContentHtmlOldRecord.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
306306
</data>
307-
<data name="TD_1943_CookiePolicyContentHtml" type="System.Resources.ResXFileRef, System.Windows.Forms">
308-
<value>..\Resources\TD_1943_CookiePolicyContentHtml.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
307+
<data name="TD_1943_CookiesPolicyContentHtml" type="System.Resources.ResXFileRef, System.Windows.Forms">
308+
<value>..\Resources\TD_1943_CookiesPolicyContentHtml.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
309309
</data>
310310
</root>

DigitalLearningSolutions.Data.Migrations/Resources/TD_1943_CookiePolicyContentHtml.txt renamed to DigitalLearningSolutions.Data.Migrations/Resources/TD_1943_CookiesPolicyContentHtml.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ When you close the browser (if you do not use the banner) or 1 year (if you use
102102
<p><a href=http://www.dls.nhs.uk/ data-cke-saved-href=http://www.dls.nhs.uk/ title=http://www.dls.nhs.uk>www.dls.nhs.uk</a></td>
103103
<td class="nhsuk-table__cell" data-label="Purpose" role="cell">
104104
<span class="nhsuk-table-responsive__heading">Purpose</span>
105-
<p>Several of these are used to remember your filter selections when using the application. Including:
106-
<ul><li>AdminFilter<li>DelegateFilter<li>DelegateGroupsFilter<li>CourseFilter</ul></td>
105+
<p><div>Several of these are used to remember your filter selections when using the application. Including:<p>
106+
<ul><li>AdminFilter<li>DelegateFilter<li>DelegateGroupsFilter<li>CourseFilter</ul></div></td>
107107
<td class="nhsuk-table__cell" data-label="Expiry" role="cell">
108108
<span class="nhsuk-table-responsive__heading">Expiry</span>5 months </td>
109109
</tr>
@@ -127,7 +127,7 @@ Legacy tracking system cookies</td>
127127
<p><a href=http://www.dls.nhs.uk/ data-cke-saved-href=http://www.dls.nhs.uk/ title=http://www.dls.nhs.uk>www.dls.nhs.uk</a></td>
128128
<td class="nhsuk-table__cell" data-label="Purpose" role="cell">
129129
<span class="nhsuk-table-responsive__heading">Purpose</span>
130-
<p>Several of these are used to remember your grid search, filter and sort selections when using the legacy applications. Including:<ul><li>cms_courses_aspx_MainContent_<ul><li>bsgvCourses</ul><li>tracking_tickets_aspx_MainContent_<ul><li>bsgvTickets<li>bsgvCentreDelegates<li>bsgvCustomisations<li>bsgvAdminUsers<li>bsgvSuperviseDelegates</ul></ul></td>
130+
<p><div>Several of these are used to remember your grid search, filter and sort selections when using the legacy applications. Including:<p><ul><li>cms_courses_aspx_MainContent_<ul><li>bsgvCourses</ul><li>tracking_tickets_aspx_MainContent_<ul><li>bsgvTickets<li>bsgvCentreDelegates<li>bsgvCustomisations<li>bsgvAdminUsers<li>bsgvSuperviseDelegates</ul></ul></div></td>
131131
<td class="nhsuk-table__cell" data-label="Expiry" role="cell"><span class="nhsuk-table-responsive__heading">Expiry</span>12 months</td>
132132
</tr>
133133
<tr class="nhsuk-table__row" role="row">
@@ -173,7 +173,7 @@ Google analytics cookies</td>
173173
<a href=http://www.dls.nhs.uk/ data-cke-saved-href=http://www.dls.nhs.uk/ title=http://www.dls.nhs.uk>www.dls.nhs.uk</a></td>
174174
<td class="nhsuk-table__cell" data-label="Purpose" role="cell">
175175
<span class="nhsuk-table-responsive__heading">Purpose</span>
176-
<p>These cookies are used to collect information about how visitors use our site, which we use to help improve it. The cookies collect information in an anonymous form, including the number of visitors to the site, where visitors have come to the site from and the pages they visited. These cookies may also be identified as originating from england.nhs.uk<p>These include cookies with names starting "_ga"<p><a href=http://www.google.com/intl/en-GB/policies/technologies/cookies/ >More information about Google cookies</a>.</td>
176+
<p><div>These cookies are used to collect information about how visitors use our site, which we use to help improve it. The cookies collect information in an anonymous form, including the number of visitors to the site, where visitors have come to the site from and the pages they visited.<p>These cookies may also be identified as originating from england.nhs.uk<p>These include cookies with names starting "_ga"<p><a href=http://www.google.com/intl/en-GB/policies/technologies/cookies/ >More information about Google cookies</a>.</div></td>
177177
<td class="nhsuk-table__cell" data-label="Expiry" role="cell"><span class="nhsuk-table-responsive__heading">Expiry</span>13 months</td>
178178
</tr>
179179
<tr class="nhsuk-table__row" role="row">
@@ -185,11 +185,11 @@ Hotjar cookies</td>
185185
<a href=http://www.dls.nhs.uk/ data-cke-saved-href=http://www.dls.nhs.uk/ title=http://www.dls.nhs.uk>www.dls.nhs.uk</a></td>
186186
<td class="nhsuk-table__cell" data-label="Purpose" role="cell">
187187
<span class="nhsuk-table-responsive__heading">Purpose</span>
188-
<p>Hotjar Tracking Code cookies are set on a visitor''s browser when they visit a website that loads the Hotjar Tracking Code. These cookies allow the Hotjar Tracking Code to function correctly. Apart from cookies, the Hotjar Tracking Code uses local and session storage as well.<p>These include cookies with names starting "_hj".<p><a href=https://help.hotjar.com/hc/en-us/articles/6952777582999-Cookies-Set-by-the-Hotjar-Tracking-Code>More information about Hotjar cookies</a>.</td>
188+
<p><div>Hotjar Tracking Code cookies are set on a visitor''s browser when they visit a website that loads the Hotjar Tracking Code. These cookies allow the Hotjar Tracking Code to function correctly. Apart from cookies, the Hotjar Tracking Code uses local and session storage as well.<p>These include cookies with names starting "_hj".<p><a href=https://help.hotjar.com/hc/en-us/articles/6952777582999-Cookies-Set-by-the-Hotjar-Tracking-Code>More information about Hotjar cookies</a>.</div></td>
189189
<td class="nhsuk-table__cell" data-label="Expiry" role="cell">
190190
<span class="nhsuk-table-responsive__heading">Expiry</span>1 year</td>
191191
</tr>
192192
</table>
193193
</div>
194194
</div>
195-
</details>
195+
</details>

DigitalLearningSolutions.Data.Tests/DataServices/ActivityDataServiceTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public void GetFilteredActivity_gets_expected_activity()
3333
// when
3434
var result = service.GetFilteredActivity(
3535
101,
36-
DateTime.Parse("2014-01-01 00:00:00.000"),
37-
DateTime.Parse("2014-01-31 23:59:59.999"),
36+
DateTime.Parse("2014-01-01"),
37+
DateTime.Parse("2014-01-31"),
3838
null,
3939
null,
4040
null
@@ -48,22 +48,22 @@ public void GetFilteredActivity_gets_expected_activity()
4848
result.Count().Should().Be(9);
4949

5050
var first = result.First();
51-
first.LogDate.Should().Be(DateTime.Parse("2014-01-08 11:04:35.753"));
51+
first.LogDate.Should().Be(DateTime.Parse("2014-01-08"));
5252
first.LogYear.Should().Be(2014);
5353
first.LogQuarter.Should().Be(1);
5454
first.LogMonth.Should().Be(1);
55-
first.Completed.Should().BeFalse();
56-
first.Evaluated.Should().BeFalse();
57-
first.Registered.Should().BeTrue();
55+
first.Completed.Should().Equals(0);
56+
first.Evaluated.Should().Equals(0);
57+
first.Registered.Should().Equals(1);
5858

5959
var last = result.Last();
60-
last.LogDate.Should().Be(DateTime.Parse("2014-01-31 09:43:28.840"));
60+
last.LogDate.Should().Be(DateTime.Parse("2014-01-31"));
6161
last.LogYear.Should().Be(2014);
6262
last.LogQuarter.Should().Be(1);
6363
last.LogMonth.Should().Be(1);
64-
last.Completed.Should().BeFalse();
65-
last.Evaluated.Should().BeFalse();
66-
last.Registered.Should().BeTrue();
64+
last.Completed.Should().Equals(0);
65+
last.Evaluated.Should().Equals(0);
66+
last.Registered.Should().Equals(1);
6767
}
6868
}
6969

DigitalLearningSolutions.Data/DataServices/ActivityDataService.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ public IEnumerable<ActivityLog> GetFilteredActivity(
4040
{
4141
return connection.Query<ActivityLog>(
4242
@"SELECT
43-
LogDate,
43+
Cast(LogDate As Date) As LogDate,
4444
LogYear,
4545
LogQuarter,
4646
LogMonth,
47-
Registered,
48-
Completed,
49-
Evaluated
47+
SUM(CAST(Registered AS Int)) AS Registered,
48+
SUM(CAST(Completed AS Int)) AS Completed,
49+
SUM(CAST(Evaluated AS Int)) AS Evaluated
5050
FROM tActivityLog AS al
5151
WHERE (LogDate >= @startDate
5252
AND (@endDate IS NULL OR LogDate <= @endDate)
@@ -59,7 +59,10 @@ AND EXISTS (
5959
SELECT ap.ApplicationID
6060
FROM Applications ap
6161
WHERE ap.ApplicationID = al.ApplicationID
62-
AND ap.DefaultContentTypeID <> 4)",
62+
AND ap.DefaultContentTypeID <> 4)
63+
GROUP BY Cast(LogDate As Date), LogYear,
64+
LogQuarter,
65+
LogMonth",
6366
new
6467
{
6568
centreId,

DigitalLearningSolutions.Data/DataServices/PlatformReportsDataService.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class PlatformReportsDataService : IPlatformReportsDataService
4141
{
4242
private readonly IDbConnection connection;
4343
private readonly ILogger<PlatformReportsDataService> logger;
44-
private readonly string selectSelfAssessmentActivity = @"SELECT al.ActivityDate, al.Enrolled, al.Submitted | al.SignedOff AS Completed
44+
private readonly string selectSelfAssessmentActivity = @"SELECT Cast(al.ActivityDate As Date) As ActivityDate, SUM(CAST(al.Enrolled AS Int)) AS Enrolled, SUM(CAST((al.Submitted | al.SignedOff) AS Int)) AS Completed
4545
FROM ReportSelfAssessmentActivityLog AS al WITH (NOLOCK) INNER JOIN
4646
Centres AS ce WITH (NOLOCK) ON al.CentreID = ce.CentreID INNER JOIN
4747
SelfAssessments AS sa WITH (NOLOCK) ON sa.ID = al.SelfAssessmentID
@@ -116,7 +116,7 @@ public IEnumerable<SelfAssessmentActivity> GetSelfAssessmentActivity(
116116
{
117117
var whereClause = GetSelfAssessmentWhereClause(supervised);
118118
return connection.Query<SelfAssessmentActivity>(
119-
$@"{selectSelfAssessmentActivity} AND {whereClause}",
119+
$@"{selectSelfAssessmentActivity} AND {whereClause} GROUP BY Cast(al.ActivityDate As Date)",
120120
new
121121
{
122122
centreId,
@@ -157,13 +157,13 @@ public IEnumerable<ActivityLog> GetFilteredCourseActivity(
157157
{
158158
return connection.Query<ActivityLog>(
159159
@"SELECT
160-
LogDate,
161-
LogYear,
160+
Cast(LogDate As Date) As LogDate,
161+
LogYear,
162162
LogQuarter,
163163
LogMonth,
164-
Registered,
165-
Completed,
166-
Evaluated
164+
SUM(CAST(Registered AS Int)) AS Registered,
165+
SUM(CAST(Completed AS Int)) AS Completed,
166+
SUM(CAST(Evaluated AS Int)) AS Evaluated
167167
FROM tActivityLog AS al WITH(NOLOCK) INNER JOIN
168168
Applications AS ap WITH(NOLOCK) ON ap.ApplicationID = al.ApplicationID INNER JOIN
169169
Centres AS ce WITH(NOLOCK) ON al.CentreID = ce.CentreID
@@ -178,7 +178,10 @@ Centres AS ce WITH(NOLOCK) ON al.CentreID = ce.CentreID
178178
AND (@centreTypeID IS NULL OR ce.CentreTypeID = @centreTypeID)
179179
AND (@brandId IS NULL OR al.BrandID = @brandId)
180180
AND (al.Registered = 1 OR al.Completed = 1 OR al.Evaluated = 1)
181-
AND (@coreContent IS NULL OR ap.CoreContent = @coreContent)",
181+
AND (@coreContent IS NULL OR ap.CoreContent = @coreContent)
182+
GROUP BY Cast(LogDate As Date), LogYear,
183+
LogQuarter,
184+
LogMonth",
182185
new
183186
{
184187
centreId,

DigitalLearningSolutions.Data/Models/PlatformReports/SelfAssessmentActivity.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
public class SelfAssessmentActivity
55
{
66
public DateTime ActivityDate { get; set; }
7-
public bool Enrolled { get; set; }
8-
public bool Completed { get; set; }
7+
public int Enrolled { get; set; }
8+
public int Completed { get; set; }
99
}
1010
}

DigitalLearningSolutions.Data/Models/TrackingSystem/ActivityLog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ public class ActivityLog
88
public int LogYear { get; set; }
99
public int LogQuarter { get; set; }
1010
public int LogMonth { get; set; }
11-
public bool Registered { get; set; }
12-
public bool Completed { get; set; }
13-
public bool Evaluated { get; set; }
11+
public int Registered { get; set; }
12+
public int Completed { get; set; }
13+
public int Evaluated { get; set; }
1414
}
1515
}

DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Centre/ReportsControllerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void EditFilters_post_sets_cookie_value()
7070
var result = reportsController.EditFilters(model);
7171

7272
// Then
73-
A.CallTo(() => httpResponse.Cookies.Append("ReportsFilterCookie", A<string>._, A<CookieOptions>._))
73+
A.CallTo(() => httpResponse.Cookies.Append("CourseUsageReportFilterCookie", A<string>._, A<CookieOptions>._))
7474
.MustHaveHappened();
7575
result.Should().BeRedirectToActionResult().WithActionName("Index");
7676
}

0 commit comments

Comments
 (0)