Skip to content

Commit b9a1ced

Browse files
authored
Merge pull request #2822 from TechnologyEnhancedLearning/Develop/Fix/TD-4634-Inactive-courses
TD-4634- Customisation active check added in the completed activities
2 parents 4ebf27e + 217fbb1 commit b9a1ced

File tree

8 files changed

+90
-18
lines changed

8 files changed

+90
-18
lines changed
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(202409051645)]
8+
public class Alter_GetCompletedCoursesForCandidate_CourseActive : Migration
9+
{
10+
public override void Up()
11+
{
12+
Execute.Sql(Properties.Resources.TD_4634_Alter_GetCompletedCoursesForCandidate_UP);
13+
}
14+
public override void Down()
15+
{
16+
Execute.Sql(Properties.Resources.TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN);
17+
}
18+
}
19+
}

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

Lines changed: 60 additions & 16 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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,4 +442,10 @@
442442
<data name="TD_4436_Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
443443
<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>
444444
</data>
445-
</root>
445+
<data name="TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN" type="System.Resources.ResXFileRef, System.Windows.Forms">
446+
<value>..\Scripts\TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
447+
</data>
448+
<data name="TD_4634_Alter_GetCompletedCoursesForCandidate_UP" type="System.Resources.ResXFileRef, System.Windows.Forms">
449+
<value>..\Scripts\TD_4634_Alter_GetCompletedCoursesForCandidate_UP.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
450+
</data>
451+
</root>

DigitalLearningSolutions.Data/Models/BaseLearningItem.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public abstract class BaseLearningItem : BaseSearchableItem
1212
public bool IsSelfAssessment { get; set; }
1313
public bool SelfRegister { get; set; }
1414
public bool IncludesSignposting { get; set; }
15+
public bool Active { get; set; }
1516
public int? CurrentVersion { get; set; }
1617
public override string SearchableName
1718
{

DigitalLearningSolutions.Web/ViewModels/LearningPortal/BaseLearningItemViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ protected BaseLearningItemViewModel(BaseLearningItem course)
1414
IsSelfAssessment = course.IsSelfAssessment;
1515
SelfRegister = course.SelfRegister;
1616
IncludesSignposting = course.IncludesSignposting;
17+
Active = course.Active;
1718
}
1819

1920
public string Name { get; set; }
@@ -24,5 +25,6 @@ protected BaseLearningItemViewModel(BaseLearningItem course)
2425
public bool IsSelfAssessment { get; }
2526
public bool SelfRegister { get; }
2627
public bool IncludesSignposting { get; }
28+
public bool Active { get; }
2729
}
2830
}

DigitalLearningSolutions.Web/Views/LearningPortal/Completed/CompletedCourseCard/_CompletedCourseCard.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</details>
3232

3333
<div class="flex-row">
34-
@if (Model.ArchivedDate == null && Model.RemovedDate == null && Model.CheckUnpublishedCourse > 0)
34+
@if (Model.ArchivedDate == null && Model.RemovedDate == null && Model.CheckUnpublishedCourse > 0 && Model.Active)
3535
{
3636
<a class="nhsuk-button nhsuk-u-margin-bottom-2 nhsuk-u-margin-right-2"
3737
aria-describedby="@Model.Id-name"

0 commit comments

Comments
 (0)