From 217fbb13e2d58456cc9ed0c0f5b7b3fb7c455eab Mon Sep 17 00:00:00 2001 From: Auldrin Possa Date: Thu, 5 Sep 2024 17:27:12 +0100 Subject: [PATCH] TD-4634- Customisation active check added in the completed activities --- ...mpletedCoursesForCandidate_CourseActive.cs | 19 +++++ .../Properties/Resources.Designer.cs | 76 ++++++++++++++---- .../Properties/Resources.resx | 8 +- ...r_GetCompletedCoursesForCandidate_DOWN.sql | Bin 0 -> 5268 bytes ...ter_GetCompletedCoursesForCandidate_UP.sql | Bin 0 -> 5290 bytes .../Models/BaseLearningItem.cs | 1 + .../BaseLearningItemViewModel.cs | 2 + .../_CompletedCourseCard.cshtml | 2 +- 8 files changed, 90 insertions(+), 18 deletions(-) create mode 100644 DigitalLearningSolutions.Data.Migrations/202409051645_Alter_GetCompletedCoursesForCandidate_CourseActive.cs create mode 100644 DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN.sql create mode 100644 DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_UP.sql diff --git a/DigitalLearningSolutions.Data.Migrations/202409051645_Alter_GetCompletedCoursesForCandidate_CourseActive.cs b/DigitalLearningSolutions.Data.Migrations/202409051645_Alter_GetCompletedCoursesForCandidate_CourseActive.cs new file mode 100644 index 0000000000..da53fa6ded --- /dev/null +++ b/DigitalLearningSolutions.Data.Migrations/202409051645_Alter_GetCompletedCoursesForCandidate_CourseActive.cs @@ -0,0 +1,19 @@ + + +namespace DigitalLearningSolutions.Data.Migrations +{ + using FluentMigrator; + + [Migration(202409051645)] + public class Alter_GetCompletedCoursesForCandidate_CourseActive : Migration + { + public override void Up() + { + Execute.Sql(Properties.Resources.TD_4634_Alter_GetCompletedCoursesForCandidate_UP); + } + public override void Down() + { + Execute.Sql(Properties.Resources.TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN); + } + } +} diff --git a/DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs b/DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs index a20af7d334..79d378b42e 100644 --- a/DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs +++ b/DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs @@ -2036,22 +2036,22 @@ internal static string TD_4243_Alter_GetCurrentCoursesForCandidate_V2_proc_down } /// - /// Looks up a localized string similar to - /// - ////****** Object: StoredProcedure [dbo].[GetCurrentCoursesForCandidate_V2] Script Date: 22/07/2024 10:11:35 ******/ - ///SET ANSI_NULLS ON - ///GO - /// - ///SET QUOTED_IDENTIFIER ON - ///GO - /// - ///-- ============================================= - ///-- Author: Kevin Whittaker - ///-- Create date: 16/12/2016 - ///-- Description: Returns a list of active progress records for the candidate. - ///-- Change 18/09/2018: Adds logic to exclude Removed courses from returned results. - ///-- ============================================= - ///ALTER PROCEDURE [dbo].[Ge [rest of string was truncated]";. + /// Looks up a localized string similar to + /// + ////****** Object: StoredProcedure [dbo].[GetCurrentCoursesForCandidate_V2] Script Date: 22/07/2024 10:11:35 ******/ + ///SET ANSI_NULLS ON + ///GO + /// + ///SET QUOTED_IDENTIFIER ON + ///GO + /// + ///-- ============================================= + ///-- Author: Kevin Whittaker + ///-- Create date: 16/12/2016 + ///-- Description: Returns a list of active progress records for the candidate. + ///-- Change 18/09/2018: Adds logic to exclude Removed courses from returned results. + ///-- ============================================= + ///ALTER PROC [rest of string was truncated]";. /// internal static string TD_4243_Alter_GetCurrentCoursesForCandidate_V2_proc_up { get { @@ -2193,6 +2193,50 @@ internal static string TD_4436_Alter_uspCreateProgressRecordWithCompleteWithinMo } } + /// + /// Looks up a localized string similar to /****** Object: StoredProcedure [dbo].[GetCompletedCoursesForCandidate] Script Date: 05/09/2024 16:24:49 ******/ + ///SET ANSI_NULLS ON + ///GO + /// + ///SET QUOTED_IDENTIFIER ON + ///GO + /// + ///-- ============================================= + ///-- Author: Kevin Whittaker + ///-- Create date: 16/12/2016 + ///-- Description: Returns a list of completed courses for the candidate. + ///-- 21/06/2021: Adds Applications.ArchivedDate field to output. + ///-- ============================================= + ///ALTER PROCEDURE [dbo].[GetCompletedCoursesFo [rest of string was truncated]";. + /// + internal static string TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN { + get { + return ResourceManager.GetString("TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /****** Object: StoredProcedure [dbo].[GetCompletedCoursesForCandidate] Script Date: 05/09/2024 16:24:49 ******/ + ///SET ANSI_NULLS ON + ///GO + /// + ///SET QUOTED_IDENTIFIER ON + ///GO + /// + ///-- ============================================= + ///-- Author: Kevin Whittaker + ///-- Create date: 16/12/2016 + ///-- Description: Returns a list of completed courses for the candidate. + ///-- 21/06/2021: Adds Applications.ArchivedDate field to output. + ///-- ============================================= + ///ALTER PROCEDURE [dbo].[GetCompletedCoursesFo [rest of string was truncated]";. + /// + internal static string TD_4634_Alter_GetCompletedCoursesForCandidate_UP { + get { + return ResourceManager.GetString("TD_4634_Alter_GetCompletedCoursesForCandidate_UP", resourceCulture); + } + } + /// /// Looks up a localized string similar to /****** Object: StoredProcedure [dbo].[GetActiveAvailableCustomisationsForCentreFiltered_V6] Script Date: 29/09/2022 19:11:04 ******/ ///SET ANSI_NULLS ON diff --git a/DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx b/DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx index 9cb68a023c..cf95b25f1e 100644 --- a/DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx +++ b/DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx @@ -442,4 +442,10 @@ ..\Scripts\TD-4436-Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16 - + + ..\Scripts\TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16 + + + ..\Scripts\TD_4634_Alter_GetCompletedCoursesForCandidate_UP.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16 + + \ No newline at end of file diff --git a/DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN.sql b/DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN.sql new file mode 100644 index 0000000000000000000000000000000000000000..55b1405eec4276c567079847d8b6bf044b3cc68d GIT binary patch literal 5268 zcmc(jZEqVz5XbjzkoXS!4j0;_u?kXCia25?bsOwZH>waqmE)wX!FDYBQuy?g-+#xO zd&r$1Xd`sGyS?4n*?IWS%M-x*l`eNb-i6Em~c^J806O{jz5M1NVTDr+0QqMq4Anx~Y2~ z?0VpKxL#n-4_I)D1g{wxF`i<_Kk1(b?QG^DUzbb!`WsKk(z59u&*sw7`p#BtF>3)9 zqL)UjJ;nMvSVI_)x2I5eczcjAqAg!uxwkxryo(62z6>KCI-$ff>pdJbUdGFAPM#)` z3Kx>uaIqf{oS@T1kRt(2!sIA$N_k7-1-MOEXBcesft4<9@Fp2X^o;3~99KMr;}kx6 z=GVVlFDIZ>_!H7jdG?4Nq4A7%o4(H*h4S*w4YFjv%nLKTFz22GFAGcZaoJb$b<7$b zYu(Np@~Mz#YyDV}4HRb{`%mE|s)RVz`zJI$Chja=qnt6iyTLX+ETaguxE2Pbg?tfSNyFIqybGH4s` zwb4-W$TF7gWI^dB1ez6A>F^}bh%V+xTfYMjNjQg7HTTRr>--Qo7bTt{pJo1cOUo=m z4!qBL4YZP9gu&PD8SgHwA-3CPj$y(B?oiyUs(SdHZI5xrS_OU5JCQrxC!vrdjaREl_$GFIX!g>wA_ zYZUWl9Br}AfM}RPq1BXm``nfpBGoCrIH7MCYLjVbp6oCy;kI2vroZhtWNT#+&8xS1 zKTt&EJquQ?lB=X59f z8r8B~H_)V*gNhVd&GLJL%%nImgk%w#@BK7c;>t&%>i&$^s;|u@&LcV@ zDim4T3#B2e-lY!JlCSPvr+2+Js+fkc0Y3UXURW(_^{CY)+b0z%RK3c3O51fjMRv>P zRpaI()dZ`6b#<=HYZYCQr)6F3qGd%%vrpdn|7>_1(0@j>dG=qw@+{`nE|N~DXxfKl z2-c2EJ0hzNDdS_#PfaM4{VbCjLh|vtP3|d2T|P4uC6q5R$%$`R#b- zG1?$%s!l2ynyfn3Q{7vkX{@?!yfVNa*F3GZ#}S>*$6;hfmYtE!t0-;XRDEtT59$D;@H+ y$71%sEBZfHu=+}864jl~ts?dCvHpn3(^ead-)$*GrTw8a*a=TNS?N3ecl#IV_~tnP literal 0 HcmV?d00001 diff --git a/DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_UP.sql b/DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_UP.sql new file mode 100644 index 0000000000000000000000000000000000000000..3e81b198c0755af2299c20dc7e45dfb05cfc1ad4 GIT binary patch literal 5290 zcmc(jYi}Dx6o%((koXVt4Hw#^u?kXCidbSNbsOwZH>waqmE)wX!FDWrQ~33i=bhup zUb5>8ZG=|4J3Dh`&h0(t%&ngPyKtwxuNYJN zI`nz>8|`y?e|NjIj~PqdA>R`>bK~$OYV~Nwf}Vvt;%iRdz)cw&aSxbv$r|ElT!&DM zSR>`TwH%j358bzJkLP2aP2NrSh~9no9rCJu!2Ot>yk2|mOZNquwB0L464#~Oac_8^ zxf8BFy*<7}bxcd|{ET0q>oK>DByX76qSfWQgC-r?FKgyMa1R)HdS{npG#&}oP2Kxo z*8{i1^#Xf-z=BgGc+JR&@f17$N&h@(XEP7^x?I}V-*`fnmQD9~HkX#xcgC^BtOZzz zUK+uBiuHG}hA<#+PoeOv?LoqbwtRWz-trvsE+WMGGK_fWgc8rJ_pGS#GG2Cb@-&fD zxRA_-i~WG$1f4E|90_O=CP!hVl(!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fb3037ba5 100644 --- a/DigitalLearningSolutions.Data/Models/BaseLearningItem.cs +++ b/DigitalLearningSolutions.Data/Models/BaseLearningItem.cs @@ -12,6 +12,7 @@ public abstract class BaseLearningItem : BaseSearchableItem public bool IsSelfAssessment { get; set; } public bool SelfRegister { get; set; } public bool IncludesSignposting { get; set; } + public bool Active { get; set; } public int? CurrentVersion { get; set; } public override string SearchableName { diff --git a/DigitalLearningSolutions.Web/ViewModels/LearningPortal/BaseLearningItemViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/LearningPortal/BaseLearningItemViewModel.cs index f5b8337830..838e054765 100644 --- a/DigitalLearningSolutions.Web/ViewModels/LearningPortal/BaseLearningItemViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/LearningPortal/BaseLearningItemViewModel.cs @@ -14,6 +14,7 @@ protected BaseLearningItemViewModel(BaseLearningItem course) IsSelfAssessment = course.IsSelfAssessment; SelfRegister = course.SelfRegister; IncludesSignposting = course.IncludesSignposting; + Active = course.Active; } public string Name { get; set; } @@ -24,5 +25,6 @@ protected BaseLearningItemViewModel(BaseLearningItem course) public bool IsSelfAssessment { get; } public bool SelfRegister { get; } public bool IncludesSignposting { get; } + public bool Active { get; } } } diff --git a/DigitalLearningSolutions.Web/Views/LearningPortal/Completed/CompletedCourseCard/_CompletedCourseCard.cshtml b/DigitalLearningSolutions.Web/Views/LearningPortal/Completed/CompletedCourseCard/_CompletedCourseCard.cshtml index 319dd1fa76..bbca9c6251 100644 --- a/DigitalLearningSolutions.Web/Views/LearningPortal/Completed/CompletedCourseCard/_CompletedCourseCard.cshtml +++ b/DigitalLearningSolutions.Web/Views/LearningPortal/Completed/CompletedCourseCard/_CompletedCourseCard.cshtml @@ -31,7 +31,7 @@
- @if (Model.ArchivedDate == null && Model.RemovedDate == null && Model.CheckUnpublishedCourse > 0) + @if (Model.ArchivedDate == null && Model.RemovedDate == null && Model.CheckUnpublishedCourse > 0 && Model.Active) {