Skip to content

Commit

Permalink
CU-8689cupyv fixed some quill issues on archived call and new log
Browse files Browse the repository at this point in the history
  • Loading branch information
ucswift committed Aug 18, 2024
1 parent 4b253d4 commit d28d710
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 16 deletions.
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 = {}));

0 comments on commit d28d710

Please sign in to comment.