From aa07534327ea10df3d760f186c17870e8018546f Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Thu, 15 Aug 2024 11:35:15 -0700 Subject: [PATCH 1/2] CU-8688ucrbp fixing bug adding new project. --- Core/Resgrid.Config/OidcConfig.cs | 13 ++++++--- .../Resgrid.Providers.Whatsapp/Class1.cs | 7 +++++ .../Resgrid.Providers.Messaging.csproj | 17 ++++++++++++ Resgrid.sln | 27 +++++++++++++++++++ .../Resgrid.Web.ServicesCore.csproj | 1 + .../Controllers/CustomStatusesController.cs | 2 +- .../Logic/AuditQueueLogic.cs | 8 ++---- 7 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 Providers/Resgrid.Providers.Whatsapp/Class1.cs create mode 100644 Providers/Resgrid.Providers.Whatsapp/Resgrid.Providers.Messaging.csproj diff --git a/Core/Resgrid.Config/OidcConfig.cs b/Core/Resgrid.Config/OidcConfig.cs index c45128f0..45b8cd9a 100644 --- a/Core/Resgrid.Config/OidcConfig.cs +++ b/Core/Resgrid.Config/OidcConfig.cs @@ -1,12 +1,13 @@ -namespace Resgrid.Config +#pragma warning disable S2223 // Non-constant static fields should not be visible +#pragma warning disable CA2211 // Non-constant fields should not be visible +#pragma warning disable S1104 // Fields should not have public accessibility + +namespace Resgrid.Config { public static class OidcConfig { public static string Key = ""; - /// - /// - /// public static string ConnectionString = "Server=rgdevserver;Database=ResgridOIDC;User Id=resgrid_odic;Password=resgrid123;MultipleActiveResultSets=True;TrustServerCertificate=True;"; public static int AccessTokenExpiryMinutes = 1440; @@ -20,3 +21,7 @@ public static class OidcConfig public static string SigningCert = ""; } } + +#pragma warning restore CA2211 // Non-constant fields should not be visible +#pragma warning restore S2223 // Non-constant static fields should not be visible +#pragma warning restore S1104 // Fields should not have public accessibility diff --git a/Providers/Resgrid.Providers.Whatsapp/Class1.cs b/Providers/Resgrid.Providers.Whatsapp/Class1.cs new file mode 100644 index 00000000..9a612a05 --- /dev/null +++ b/Providers/Resgrid.Providers.Whatsapp/Class1.cs @@ -0,0 +1,7 @@ +namespace Resgrid.Providers.Whatsapp +{ + public class Class1 + { + + } +} diff --git a/Providers/Resgrid.Providers.Whatsapp/Resgrid.Providers.Messaging.csproj b/Providers/Resgrid.Providers.Whatsapp/Resgrid.Providers.Messaging.csproj new file mode 100644 index 00000000..af6c391b --- /dev/null +++ b/Providers/Resgrid.Providers.Whatsapp/Resgrid.Providers.Messaging.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + diff --git a/Resgrid.sln b/Resgrid.sln index e33f0b70..3447b276 100644 --- a/Resgrid.sln +++ b/Resgrid.sln @@ -86,6 +86,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Resgrid.Repositories.NoSqlR EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Resgrid.Localization", "Core\Resgrid.Localization\Resgrid.Localization.csproj", "{E39D63BA-5CCA-43EC-A3F9-375FA87EFE2F}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Resgrid.Providers.Messaging", "Providers\Resgrid.Providers.Whatsapp\Resgrid.Providers.Messaging.csproj", "{DF0E7C31-64AF-4935-9441-F3162586AFA4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Azure|Any CPU = Azure|Any CPU @@ -798,6 +800,30 @@ Global {E39D63BA-5CCA-43EC-A3F9-375FA87EFE2F}.Staging|Any CPU.Build.0 = Debug|Any CPU {E39D63BA-5CCA-43EC-A3F9-375FA87EFE2F}.Staging|x86.ActiveCfg = Debug|Any CPU {E39D63BA-5CCA-43EC-A3F9-375FA87EFE2F}.Staging|x86.Build.0 = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Azure|Any CPU.ActiveCfg = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Azure|Any CPU.Build.0 = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Azure|x86.ActiveCfg = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Azure|x86.Build.0 = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Cloud|Any CPU.ActiveCfg = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Cloud|Any CPU.Build.0 = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Cloud|x86.ActiveCfg = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Cloud|x86.Build.0 = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Debug|x86.ActiveCfg = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Debug|x86.Build.0 = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Docker|Any CPU.ActiveCfg = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Docker|Any CPU.Build.0 = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Docker|x86.ActiveCfg = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Docker|x86.Build.0 = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Release|Any CPU.Build.0 = Release|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Release|x86.ActiveCfg = Release|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Release|x86.Build.0 = Release|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Staging|Any CPU.ActiveCfg = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Staging|Any CPU.Build.0 = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Staging|x86.ActiveCfg = Debug|Any CPU + {DF0E7C31-64AF-4935-9441-F3162586AFA4}.Staging|x86.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -832,6 +858,7 @@ Global {FFCBA7D4-853A-4D25-935B-F242851752EE} = {F06D475C-635C-4DE4-82BA-C49A90BA8FCD} {086A3F5A-F7D3-4E38-B9CD-B422DD3A709E} = {206D5D48-99B0-4913-B1E2-4BA11D021740} {E39D63BA-5CCA-43EC-A3F9-375FA87EFE2F} = {D43D1D6B-66A9-4A57-9EA3-8DECC92FA583} + {DF0E7C31-64AF-4935-9441-F3162586AFA4} = {F06D475C-635C-4DE4-82BA-C49A90BA8FCD} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35;packages\Unity.Interception.2.1.505.2\lib\NET35;packages\EnterpriseLibrary.Common.5.0.505.0\lib\NET35;packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4;packages\EnterpriseLibrary.WindowsAzure.TransientFaultHandling.5.1.1212.0\lib\NET4;packages\EnterpriseLibrary.WindowsAzure.TransientFaultHandling.5.1.1212.0\DesignTime diff --git a/Web/Resgrid.Web.ServicesCore/Resgrid.Web.ServicesCore.csproj b/Web/Resgrid.Web.ServicesCore/Resgrid.Web.ServicesCore.csproj index b8d11334..158281e5 100644 --- a/Web/Resgrid.Web.ServicesCore/Resgrid.Web.ServicesCore.csproj +++ b/Web/Resgrid.Web.ServicesCore/Resgrid.Web.ServicesCore.csproj @@ -109,6 +109,7 @@ + diff --git a/Web/Resgrid.WebCore/Areas/User/Controllers/CustomStatusesController.cs b/Web/Resgrid.WebCore/Areas/User/Controllers/CustomStatusesController.cs index 633b14d4..384538e2 100644 --- a/Web/Resgrid.WebCore/Areas/User/Controllers/CustomStatusesController.cs +++ b/Web/Resgrid.WebCore/Areas/User/Controllers/CustomStatusesController.cs @@ -309,7 +309,7 @@ where key.ToString().StartsWith("buttonText_") auditEvent.DepartmentId = DepartmentId; auditEvent.UserId = UserId; auditEvent.Type = AuditLogTypes.CustomStatusUpdated; - auditEvent.After = details.CloneJsonToString(); + auditEvent.After = state.CloneJsonToString(); auditEvent.Successful = true; auditEvent.IpAddress = IpAddressHelper.GetRequestIP(Request, true); auditEvent.ServerName = Environment.MachineName; diff --git a/Workers/Resgrid.Workers.Framework/Logic/AuditQueueLogic.cs b/Workers/Resgrid.Workers.Framework/Logic/AuditQueueLogic.cs index a252235c..46fedede 100644 --- a/Workers/Resgrid.Workers.Framework/Logic/AuditQueueLogic.cs +++ b/Workers/Resgrid.Workers.Framework/Logic/AuditQueueLogic.cs @@ -476,9 +476,7 @@ public class AuditQueueLogic case AuditLogTypes.DocumentEdited: if (!String.IsNullOrWhiteSpace(auditEvent.Before)) { - var documentEditedBefore= JsonConvert.DeserializeObject(auditEvent.Before); - - auditLog.Message = $"{profile.FullName.AsFirstNameLastName} edited Document {documentEditedBefore.Name}"; + auditLog.Message = $"{profile.FullName.AsFirstNameLastName} edited Document {auditEvent.Before}"; } else { @@ -488,9 +486,7 @@ public class AuditQueueLogic case AuditLogTypes.DocumentRemoved: if (!String.IsNullOrWhiteSpace(auditEvent.Before)) { - var documentRemovedBefore = JsonConvert.DeserializeObject(auditEvent.Before); - - auditLog.Message = $"{profile.FullName.AsFirstNameLastName} removed Document {documentRemovedBefore.Name}"; + auditLog.Message = $"{profile.FullName.AsFirstNameLastName} removed Document {auditEvent.Before}"; } else { From d28d7101a1f5b46be305f9587f1c650ef72425bb Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Sun, 18 Aug 2024 11:01:24 -0700 Subject: [PATCH 2/2] CU-8689cupyv fixed some quill issues on archived call and new log --- .../User/Controllers/DispatchController.cs | 3 ++ .../Areas/User/Views/Logs/NewLog.cshtml | 2 +- .../resgrid.dispatch.addArchivedCall.js | 4 +- .../app/internal/logs/resgrid.logs.newlog.js | 47 ++++++++++++++----- 4 files changed, 40 insertions(+), 16 deletions(-) diff --git a/Web/Resgrid.WebCore/Areas/User/Controllers/DispatchController.cs b/Web/Resgrid.WebCore/Areas/User/Controllers/DispatchController.cs index 2bd72fe8..bdbe5c97 100644 --- a/Web/Resgrid.WebCore/Areas/User/Controllers/DispatchController.cs +++ b/Web/Resgrid.WebCore/Areas/User/Controllers/DispatchController.cs @@ -833,6 +833,9 @@ public async Task AddArchivedCall() public async Task AddArchivedCall(NewCallView model, IFormCollection collection, CancellationToken cancellationToken) { model = await FillNewCallView(model); + model.CallStates = model.CallState.ToSelectList(); + model.Call.LoggedOn = DateTime.UtcNow.TimeConverter(model.Department); + model.Call.ReportingUserId = UserId; if (ModelState.IsValid) { diff --git a/Web/Resgrid.WebCore/Areas/User/Views/Logs/NewLog.cshtml b/Web/Resgrid.WebCore/Areas/User/Views/Logs/NewLog.cshtml index 603b5ce2..04405042 100644 --- a/Web/Resgrid.WebCore/Areas/User/Views/Logs/NewLog.cshtml +++ b/Web/Resgrid.WebCore/Areas/User/Views/Logs/NewLog.cshtml @@ -30,7 +30,7 @@ -
+
diff --git a/Web/Resgrid.WebCore/wwwroot/js/app/internal/dispatch/resgrid.dispatch.addArchivedCall.js b/Web/Resgrid.WebCore/wwwroot/js/app/internal/dispatch/resgrid.dispatch.addArchivedCall.js index c865e2cc..7bcac9a4 100644 --- a/Web/Resgrid.WebCore/wwwroot/js/app/internal/dispatch/resgrid.dispatch.addArchivedCall.js +++ b/Web/Resgrid.WebCore/wwwroot/js/app/internal/dispatch/resgrid.dispatch.addArchivedCall.js @@ -20,8 +20,8 @@ var resgrid; }); $(document).on('submit', '#addArchivedCallForm', function () { - $('#NatureOfCall').val(quill.root.innerHTML); - $('#CallNotes').val(quill2.root.innerHTML); + $('#Call_NatureOfCall').val(quill.root.innerHTML); + $('#Call_Notes').val(quill2.root.innerHTML); return true; }); diff --git a/Web/Resgrid.WebCore/wwwroot/js/app/internal/logs/resgrid.logs.newlog.js b/Web/Resgrid.WebCore/wwwroot/js/app/internal/logs/resgrid.logs.newlog.js index c5645e51..c361b561 100644 --- a/Web/Resgrid.WebCore/wwwroot/js/app/internal/logs/resgrid.logs.newlog.js +++ b/Web/Resgrid.WebCore/wwwroot/js/app/internal/logs/resgrid.logs.newlog.js @@ -5,8 +5,25 @@ var resgrid; (function (logs) { var newlog; (function (newlog) { + let quill1; + let quill2; + let quill3; + let quill4; + $(document).ready(function () { newlog.validationFilter = ".training-validation, .work-validation, .meeting-validation, .coroner-validation, .callback-validation"; + + + //$('#newLogForm').on('submit', function (e) { + // e.preventDefault(); + // $('#Log_Narrative').val(quill1.root.innerHTML); + // $('#Call_NatureOfCall').val(quill2.root.innerHTML); + // $('#Log_Cause').val(quill3.root.innerHTML); + // $('#Log_InitialReport').val(quill4.root.innerHTML); + + // return true; + //}); + supressValidation(); $('#Call_LoggedOn').kendoDateTimePicker({ interval: 1 @@ -56,34 +73,27 @@ var resgrid; return false; }); - let quill1 = new Quill('#editor-container', { + quill1 = new Quill('#editor-container', { placeholder: '', theme: 'snow' }); - let quill2 = new Quill('#editor-container2', { + quill2 = new Quill('#editor-container2', { placeholder: '', theme: 'snow' }); - let quill3 = new Quill('#editor-container3', { + quill3 = new Quill('#editor-container3', { placeholder: '', theme: 'snow' }); - let quill4 = new Quill('#editor-container4', { + quill4 = new Quill('#editor-container4', { placeholder: '', theme: 'snow' }); - $(document).on('submit', '#newLogForm', function () { - $('#Log_Narrative').val(quill1.root.innerHTML); - $('#Call_NatureOfCall').val(quill2.root.innerHTML); - $('#Log_Cause').val(quill3.root.innerHTML); - $('#Log_InitialReport').val(quill4.root.innerHTML); - - return true; - }); + $("#files").kendoUpload({ multiple: true, @@ -311,10 +321,21 @@ var resgrid; supressValidation(); } function supressValidation() { - var settngs = $.data($('#newLogForm')[0], 'validator').settings; + let settngs = $.data($('#newLogForm')[0], 'validator').settings; settngs.ignore = newlog.validationFilter; } newlog.supressValidation = supressValidation; + + function onNewLogSubmit() { + $('#Log_Narrative').val(quill1.root.innerHTML); + $('#Call_NatureOfCall').val(quill2.root.innerHTML); + $('#Log_Cause').val(quill3.root.innerHTML); + $('#Log_InitialReport').val(quill4.root.innerHTML); + + return true; + } + newlog.onNewLogSubmit = onNewLogSubmit; + })(newlog = logs.newlog || (logs.newlog = {})); })(logs = resgrid.logs || (resgrid.logs = {})); })(resgrid || (resgrid = {}));