Skip to content

Commit d82983b

Browse files
authored
Merge pull request #2798 from TechnologyEnhancedLearning/Develop/Fix/TD-4436-UTCdate-And-LocalDateTime
TD-4436 -Stored proc modified to update Completeby date and supervisor in the group enrolment
2 parents 913c148 + fa929ea commit d82983b

11 files changed

+147
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
5+
[Migration(202408271130)]
6+
public class Alter_GroupCustomisation_StoredProcs : Migration
7+
{
8+
public override void Up()
9+
{
10+
Execute.Sql(Properties.Resources.TD_4436_Alter_GroupCustomisation_Add_V2_UpdateCompleteBy_Supervisor_Up);
11+
Execute.Sql(Properties.Resources.TD_4436_Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Up);
12+
}
13+
public override void Down()
14+
{
15+
Execute.Sql(Properties.Resources.TD_4436_Alter_GroupCustomisation_Add_V2_UpdateCompleteBy_Supervisor_Down);
16+
Execute.Sql(Properties.Resources.TD_4436_Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Down);
17+
}
18+
19+
}
20+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
using System.Diagnostics.Metrics;
5+
6+
[Migration(202408271610)]
7+
public class AlterConstraintForProgressAddUtcDate : Migration
8+
{
9+
public override void Up()
10+
{
11+
Execute.Sql(@$"ALTER TABLE [dbo].[Progress] DROP CONSTRAINT [DF_Progress_FirstSubmittedTime];
12+
ALTER TABLE [dbo].[Progress] ADD CONSTRAINT [DF_Progress_FirstSubmittedTime] DEFAULT (GETUTCDATE()) FOR [FirstSubmittedTime];");
13+
}
14+
public override void Down()
15+
{
16+
Execute.Sql(@$"ALTER TABLE [dbo].[Progress] DROP CONSTRAINT [DF_Progress_FirstSubmittedTime];
17+
ALTER TABLE [dbo].[Progress] ADD CONSTRAINT [DF_Progress_FirstSubmittedTime] DEFAULT (GETDATE()) FOR [FirstSubmittedTime];");
18+
}
19+
20+
}
21+
}

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

Lines changed: 90 additions & 0 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,4 +418,16 @@
418418
<data name="TD_4436_Alter_uspCreateProgressRecord_V3_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
419419
<value>..\Scripts\TD-4436-Alter_uspCreateProgressRecord_V3_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
420420
</data>
421+
<data name="TD_4436_Alter_GroupCustomisation_Add_V2_UpdateCompleteBy_Supervisor_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
422+
<value>..\Scripts\TD-4436-Alter_GroupCustomisation_Add_V2_UpdateCompleteBy_Supervisor_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
423+
</data>
424+
<data name="TD_4436_Alter_GroupCustomisation_Add_V2_UpdateCompleteBy_Supervisor_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
425+
<value>..\Scripts\TD-4436-Alter_GroupCustomisation_Add_V2_UpdateCompleteBy_Supervisor_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
426+
</data>
427+
<data name="TD_4436_Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
428+
<value>..\Scripts\TD-4436-Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
429+
</data>
430+
<data name="TD_4436_Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
431+
<value>..\Scripts\TD-4436-Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
432+
</data>
421433
</root>

DigitalLearningSolutions.Web.Tests/Controllers/LearningPortal/LearningPortalControllerTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace DigitalLearningSolutions.Web.Tests.Controllers.LearningPortal
1313
using Microsoft.Extensions.Logging;
1414
using NUnit.Framework;
1515
using GDS.MultiPageFormData;
16+
using DigitalLearningSolutions.Web.Helpers;
1617

1718
public partial class LearningPortalControllerTests
1819
{
@@ -69,6 +70,7 @@ public void SetUp()
6970
"mock"
7071
)
7172
);
73+
DateHelper.userTimeZone = "Europe/London";
7274
controller = new LearningPortalController(
7375
centresService,
7476
courseService,

DigitalLearningSolutions.Web/Controllers/ApplicationSelectorController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class ApplicationSelectorController : Controller
1616
[SetSelectedTab(nameof(NavMenuTab.SwitchApplication))]
1717
public IActionResult Index()
1818
{
19+
DateHelper.userTimeZone = DateHelper.userTimeZone ?? User.GetUserTimeZone(CustomClaimTypes.UserTimeZone);
1920
var learningPortalAccess = User.GetCustomClaimAsBool(CustomClaimTypes.LearnUserAuthenticated) ?? false;
2021
var trackingSystemAccess = User.HasCentreAdminPermissions();
2122
var contentManagementSystemAccess =

0 commit comments

Comments
 (0)