Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #147

Merged
merged 4 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions Core/Resgrid.Config/OidcConfig.cs
Original file line number Diff line number Diff line change
@@ -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 = "";

/// <summary>
///
/// </summary>
public static string ConnectionString = "Server=rgdevserver;Database=ResgridOIDC;User Id=resgrid_odic;Password=resgrid123;MultipleActiveResultSets=True;TrustServerCertificate=True;";

public static int AccessTokenExpiryMinutes = 1440;
Expand All @@ -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
7 changes: 7 additions & 0 deletions Providers/Resgrid.Providers.Whatsapp/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Resgrid.Providers.Whatsapp
{
public class Class1
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="WhatsappBusiness.CloudApi" Version="1.0.35" />
</ItemGroup>

<ItemGroup>
<Folder Include="Whatsapp\" />
</ItemGroup>

</Project>
27 changes: 27 additions & 0 deletions Resgrid.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
<PackageReference Include="System.Reflection.Metadata" Version="8.0.0" />
<PackageReference Include="System.ServiceModel.Syndication" Version="8.0.0" />
<PackageReference Include="WhatsappBusiness.CloudApi" Version="1.0.35" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\Resgrid.Config\Resgrid.Config.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,9 @@ public async Task<IActionResult> AddArchivedCall()
public async Task<IActionResult> 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)
{
Expand Down
2 changes: 1 addition & 1 deletion Web/Resgrid.WebCore/Areas/User/Views/Logs/NewLog.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
</div>

<form id="newLogForm" class="form-horizontal" role="form" asp-controller="Logs" asp-action="NewLog" asp-route-area="User" method="post">
<form id="newLogForm" class="form-horizontal" role="form" asp-controller="Logs" asp-action="NewLog" asp-route-area="User" method="post" onsubmit="resgrid.logs.newlog.onNewLogSubmit()">
<div class="row">
<div class="col-xs-12">
<div class="wrapper wrapper-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 = {}));
8 changes: 2 additions & 6 deletions Workers/Resgrid.Workers.Framework/Logic/AuditQueueLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,7 @@ public class AuditQueueLogic
case AuditLogTypes.DocumentEdited:
if (!String.IsNullOrWhiteSpace(auditEvent.Before))
{
var documentEditedBefore= JsonConvert.DeserializeObject<Document>(auditEvent.Before);

auditLog.Message = $"{profile.FullName.AsFirstNameLastName} edited Document {documentEditedBefore.Name}";
auditLog.Message = $"{profile.FullName.AsFirstNameLastName} edited Document {auditEvent.Before}";
}
else
{
Expand All @@ -488,9 +486,7 @@ public class AuditQueueLogic
case AuditLogTypes.DocumentRemoved:
if (!String.IsNullOrWhiteSpace(auditEvent.Before))
{
var documentRemovedBefore = JsonConvert.DeserializeObject<Document>(auditEvent.Before);

auditLog.Message = $"{profile.FullName.AsFirstNameLastName} removed Document {documentRemovedBefore.Name}";
auditLog.Message = $"{profile.FullName.AsFirstNameLastName} removed Document {auditEvent.Before}";
}
else
{
Expand Down
Loading