sf-i-events 1.0.804 → 1.0.805

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sf-i-events.js CHANGED
@@ -113,7 +113,8 @@ let SfIEvents = class SfIEvents extends LitElement {
113
113
  this.COLOR_NOT_COMPLIED = "#C80036";
114
114
  this.COLOR_PARTIALLY_COMPLIED = "#F79256";
115
115
  this.COLOR_COMPLIED = "#50cf01";
116
- this.COLOR_COMPLIED_WITH_EXCEPTION = "#ffe505";
116
+ this.COLOR_COMPLIED_WITH_GAPS = "#ffe505";
117
+ this.COLOR_REPORTED_NON_COMPLIANCE = "#840B0F";
117
118
  this.STATUS_NOT_STARTED = "not-started";
118
119
  this.STATUS_PENDING_APPROVAL = "pending-approval";
119
120
  this.STATUS_REJECTED = "rejected";
@@ -428,9 +429,12 @@ let SfIEvents = class SfIEvents extends LitElement {
428
429
  .color-complied {
429
430
  color: #50cf01;
430
431
  }
431
- .color-complied-with-exception {
432
+ .color-complied-with-gaps {
432
433
  color: #ffe505;
433
434
  }
435
+ .color-reported-non-compliance {
436
+ color: #840B0F;
437
+ }
434
438
  .color-scheduled {
435
439
  color: #888888;
436
440
  }
@@ -636,9 +640,12 @@ let SfIEvents = class SfIEvents extends LitElement {
636
640
  .color-complied {
637
641
  color: #50cf01;
638
642
  }
639
- .color-complied-with-exception {
643
+ .color-complied-with-gaps {
640
644
  color: #ffe505;
641
645
  }
646
+ .color-reported-non-compliance {
647
+ color: #840B0F;
648
+ }
642
649
  .color-scheduled {
643
650
  color: #888888;
644
651
  }
@@ -1852,8 +1859,11 @@ let SfIEvents = class SfIEvents extends LitElement {
1852
1859
  if (arrComplianceData[name]["complied"] == null) {
1853
1860
  arrComplianceData[name]["complied"] = 0;
1854
1861
  }
1855
- if (arrComplianceData[name]["complied-with-exception"] == null) {
1856
- arrComplianceData[name]["complied-with-exception"] = 0;
1862
+ if (arrComplianceData[name]["complied-with-gaps"] == null) {
1863
+ arrComplianceData[name]["complied-with-gaps"] = 0;
1864
+ }
1865
+ if (arrComplianceData[name]["reported-non-compliance"] == null) {
1866
+ arrComplianceData[name]["reported-non-compliance"] = 0;
1857
1867
  }
1858
1868
  arrComplianceData[name][complianceStatus]++;
1859
1869
  }
@@ -2122,8 +2132,12 @@ let SfIEvents = class SfIEvents extends LitElement {
2122
2132
  }
2123
2133
  else {
2124
2134
  if (timeliness == "in-time" || timeliness == "late-reported" || timeliness == "late-approved") {
2125
- if (percentage != null && parseInt(percentage) < 100) {
2126
- return "complied-with-exception";
2135
+ if (percentage != null && parseInt(percentage) == 0) {
2136
+ console.log('reported non compliance');
2137
+ return "reported-non-compliance";
2138
+ }
2139
+ else if (percentage != null && parseInt(percentage) < 100) {
2140
+ return "complied-with-gaps";
2127
2141
  }
2128
2142
  else {
2129
2143
  return "complied";
@@ -2284,7 +2298,8 @@ let SfIEvents = class SfIEvents extends LitElement {
2284
2298
  html += '<div part="badge-dashboard" id="chip-compliance-1" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-icons color-not-complied">disabled_by_default</span>&nbsp;&nbsp;<span>Not Complied:</span>&nbsp;<span id="graph-not-complied">DASHBOARD_NOT_COMPLIED</span></div>';
2285
2299
  html += '<div part="badge-dashboard" id="chip-compliance-2" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-icons color-partially-complied">rule</span>&nbsp;&nbsp;<span>Partially Complied:</span>&nbsp;<span id="graph-partially-complied">DASHBOARD_PARTIALLY_COMPLIED</span></div>';
2286
2300
  html += '<div part="badge-dashboard" id="chip-compliance-3" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-complied">sweep</span>&nbsp;&nbsp;<span>Complied:</span>&nbsp;<span id="graph-complied">DASHBOARD_COMPLIED</span></div>';
2287
- html += '<div part="badge-dashboard" id="chip-compliance-4" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-complied-with-exception">rule</span>&nbsp;&nbsp;<span>Complied With Exception:</span>&nbsp;<span id="graph-complied-with-exception">DASHBOARD_COMPLIED_WITH_EXCEPTION</span></div>';
2301
+ html += '<div part="badge-dashboard" id="chip-compliance-4" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-complied-with-gaps">rule</span>&nbsp;&nbsp;<span>Complied With Gaps:</span>&nbsp;<span id="graph-complied-with-gaps">DASHBOARD_COMPLIED_WITH_GAPS</span></div>';
2302
+ html += '<div part="badge-dashboard" id="chip-compliance-5" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-reported-non-compliance">rule</span>&nbsp;&nbsp;<span>Reported Non Compliance:</span>&nbsp;<span id="graph-reported-non-compliance">DASHBOARD_REPORTED_NON_COMPLIANCE</span></div>';
2288
2303
  html += '</div>';
2289
2304
  html += '<div id="stream-event-filter" part="stream-event-total" class="d-flex flex-wrap"></div>';
2290
2305
  return html;
@@ -2306,7 +2321,8 @@ let SfIEvents = class SfIEvents extends LitElement {
2306
2321
  html += '<div part="badge-dashboard" id="chip-compliance-1" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-icons color-not-complied">disabled_by_default</span>&nbsp;&nbsp;<span>Not Complied:</span>&nbsp;<span id="graph-not-complied">DASHBOARD_NOT_COMPLIED</span></div>';
2307
2322
  html += '<div part="badge-dashboard" id="chip-compliance-2" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-icons color-partially-complied">rule</span>&nbsp;&nbsp;<span>Partially Complied:</span>&nbsp;<span id="graph-partially-complied">DASHBOARD_PARTIALLY_COMPLIED</span></div>';
2308
2323
  html += '<div part="badge-dashboard" id="chip-compliance-3" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-complied">sweep</span>&nbsp;&nbsp;<span>Complied:</span>&nbsp;<span id="graph-complied">DASHBOARD_COMPLIED</span></div>';
2309
- html += '<div part="badge-dashboard" id="chip-compliance-4" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-complied-with-exception">rule</span>&nbsp;&nbsp;<span>Complied With Exception:</span>&nbsp;<span id="graph-complied-with-exception">DASHBOARD_COMPLIED_WITH_EXCEPTION</span></div>';
2324
+ html += '<div part="badge-dashboard" id="chip-compliance-4" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-complied-with-gaps">rule</span>&nbsp;&nbsp;<span>Complied With Gaps:</span>&nbsp;<span id="graph-complied-with-gaps">DASHBOARD_COMPLIED_WITH_GAPS</span></div>';
2325
+ html += '<div part="badge-dashboard" id="chip-compliance-5" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-reported-non-compliance">rule</span>&nbsp;&nbsp;<span>Reported Non Compliance:</span>&nbsp;<span id="graph-reported-non-compliance">DASHBOARD_REPORTED_NON_COMPLIANCE</span></div>';
2310
2326
  html += '</div>';
2311
2327
  html += '<div id="stream-event-filter" part="stream-event-total" class="d-flex flex-wrap"></div>';
2312
2328
  return html;
@@ -2636,7 +2652,8 @@ let SfIEvents = class SfIEvents extends LitElement {
2636
2652
  html += (complianceStatus == "not-complied" ? '<span class="material-symbols-outlined color-not-complied color-not-complied-item color-not-complied-item-' + i + '">disabled_by_default</span>' : '');
2637
2653
  html += (complianceStatus == "partially-complied" ? '<span class="material-symbols-outlined color-partially-complied color-partially-complied-item color-partially-complied-item-' + i + '">rule</span>' : '');
2638
2654
  html += (complianceStatus == "complied" ? '<span class="material-symbols-outlined color-complied color-complied-item color-complied-item-' + i + '">sweep</span>' : '');
2639
- html += (complianceStatus == "complied-with-exception" ? '<span class="material-symbols-outlined color-complied-with-exception color-complied-with-exception-item color-complied-with-exception-item-' + i + '">rule</span>' : '');
2655
+ html += (complianceStatus == "complied-with-gaps" ? '<span class="material-symbols-outlined color-complied-with-gaps color-complied-with-gaps-item color-complied-with-gaps-item-' + i + '">rule</span>' : '');
2656
+ html += (complianceStatus == "reported-non-compliance" ? '<span class="material-symbols-outlined color-reported-non-compliance color-reported-non-compliance-item color-reported-non-compliance-item-' + i + '">rule</span>' : '');
2640
2657
  html += (partStatus == "not-started" ? '<span class="material-symbols-outlined color-not-started color-not-started-item color-not-started-item-' + i + '">schedule</span>' : '');
2641
2658
  html += (partStatus == "pending-approval" ? '<span class="material-symbols-outlined color-pending color-pending-item color-pending-item-' + i + '">pending</span>' : '');
2642
2659
  html += (partStatus == "rejected" ? '<span class="material-symbols-outlined color-rejected color-rejected-item color-rejected-item-' + i + '">block</span>' : '');
@@ -2692,7 +2709,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2692
2709
  return html;
2693
2710
  };
2694
2711
  this.renderEvents = (_firstDay, _endDay, iInit, iLast, showGraph, index, month, period, firstDate = null, parametersTitle, showBackgroundButton) => {
2695
- var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0, compliedWithException = 0;
2712
+ var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0, compliedWithGaps = 0, reportedNonCompliance = 0;
2696
2713
  var html = '';
2697
2714
  this.selectedItemIds = [];
2698
2715
  this.selectedItems = [];
@@ -2773,7 +2790,8 @@ let SfIEvents = class SfIEvents extends LitElement {
2773
2790
  partiallyComplied = partiallyComplied + (complianceStatus == "partially-complied" ? 1 : 0);
2774
2791
  notComplied = notComplied + (complianceStatus == "not-complied" ? 1 : 0);
2775
2792
  complied = complied + (complianceStatus == "complied" ? 1 : 0);
2776
- compliedWithException = compliedWithException + (complianceStatus == "complied-with-exception" ? 1 : 0);
2793
+ compliedWithGaps = compliedWithGaps + (complianceStatus == "complied-with-gaps" ? 1 : 0);
2794
+ reportedNonCompliance = reportedNonCompliance + (complianceStatus == "reported-non-compliance" ? 1 : 0);
2777
2795
  this.events[mmdd][j][this.FLOW_GRAPH_COMPLETENESS] = partStatus;
2778
2796
  this.events[mmdd][j][this.FLOW_GRAPH_TIMELINESS] = lateStatus;
2779
2797
  this.events[mmdd][j][this.FLOW_GRAPH_COMPLIANCE] = complianceStatus;
@@ -2895,15 +2913,16 @@ let SfIEvents = class SfIEvents extends LitElement {
2895
2913
  html = html.replace("DASHBOARD_NOT_COMPLIED", notComplied + "");
2896
2914
  html = html.replace("DASHBOARD_PARTIALLY_COMPLIED", partiallyComplied + "");
2897
2915
  html = html.replace("DASHBOARD_COMPLIED", complied + "");
2898
- html = html.replace("DASHBOARD_COMPLIED_WITH_EXCEPTION", compliedWithException + "");
2899
- this.csvDataStats = 'Period,Total,Not Started,Approved,Pending Approval,Rejected,Past Due Date,Late Reported,Late Executed,Late Approved,Scheduled,Not Complied,Partially Complied,Complied\n';
2900
- this.csvDataStats += this.period + "," + total + "," + notStarted + "," + approved + "," + pendingApproval + "," + rejected + "," + pastDueDate + "," + lateReported + "," + lateExecuted + "," + lateApproved + "," + scheduled + "," + notComplied + "," + partiallyComplied + "," + complied;
2916
+ html = html.replace("DASHBOARD_COMPLIED_WITH_GAPS", compliedWithGaps + "");
2917
+ html = html.replace("DASHBOARD_REPORTED_NON_COMPLIANCE", reportedNonCompliance + "");
2918
+ this.csvDataStats = 'Period,Total,Not Started,Approved,Pending Approval,Rejected,Past Due Date,Late Reported,Late Executed,Late Approved,Scheduled,Not Complied,Partially Complied,Complied,Complied With Gaps,Reported Non Compliance\n';
2919
+ this.csvDataStats += this.period + "," + total + "," + notStarted + "," + approved + "," + pendingApproval + "," + rejected + "," + pastDueDate + "," + lateReported + "," + lateExecuted + "," + lateApproved + "," + scheduled + "," + notComplied + "," + partiallyComplied + "," + complied + "," + compliedWithGaps + "," + reportedNonCompliance;
2901
2920
  this.htmlDataStats = 'Completeness<br /><br /><table class="w-100"><tr><th class="w-14">Total</th><th class="w-14">Not Started</th><th class="w-14">Approved</th><th class="w-14">Pending Approval</th><th class="w-14">Rejected</th><tr>';
2902
2921
  this.htmlDataStats += '<tr><td class="w-14 text-center td-odd">' + total + '</td><td class="w-14 text-center td-odd">' + notStarted + '</td><td class="w-14 text-center td-odd">' + approved + '</td><td class="w-14 text-center td-odd">' + pendingApproval + '</td><td class="w-14 text-center td-odd">' + rejected + '</td></table>';
2903
2922
  this.htmlDataStats += '<br /><br />Timeliness<br /><br /><table class="mt-20 w-100"><tr><th class="w-14">Total</th><th class="w-14">In Time</th><th class="w-14">Past Due Date</th><th class="w-14">Late Reported</th><th class="w-14">Late Executed</th><th class="w-14">Late Approved</th><tr>';
2904
2923
  this.htmlDataStats += '<tr><td class="w-14 text-center td-odd">' + total + '</td><td class="w-14 text-center td-odd">' + (total - (pastDueDate + lateApproved + lateExecuted)) + '</td><td class="w-14 text-center td-odd">' + pastDueDate + '</td><td class="w-14 text-center td-odd">' + lateReported + '</td><td class="w-14 text-center td-odd">' + lateExecuted + '</td><td class="w-14 text-center td-odd">' + lateApproved + '</td><tr></table>';
2905
- this.htmlDataStats += '<br /><br />Compliance<br /><br /><table class="w-100"><tr><th class="w-14">Total</th><th class="w-14">Scheduled</th><th class="w-14">Not Complied</th><th class="w-14">Partially Complied</th><th class="w-14">Complied</th><tr>';
2906
- this.htmlDataStats += '<tr><td class="w-14 text-center td-odd">' + total + '</td><td class="w-14 text-center td-odd">' + scheduled + '</td><td class="w-14 text-center td-odd">' + notComplied + '</td><td class="w-14 text-center td-odd">' + partiallyComplied + '</td><td class="w-14 text-center td-odd">' + complied + '</td><tr></table>';
2924
+ this.htmlDataStats += '<br /><br />Compliance<br /><br /><table class="w-100"><tr><th class="w-14">Total</th><th class="w-14">Scheduled</th><th class="w-14">Not Complied</th><th class="w-14">Partially Complied</th><th class="w-14">Complied</th><th class="w-14">Complied With Gaps</th><th class="w-14">Reported Non Compliance</th><tr>';
2925
+ this.htmlDataStats += '<tr><td class="w-14 text-center td-odd">' + total + '</td><td class="w-14 text-center td-odd">' + scheduled + '</td><td class="w-14 text-center td-odd">' + notComplied + '</td><td class="w-14 text-center td-odd">' + partiallyComplied + '</td><td class="w-14 text-center td-odd">' + complied + '</td><td class="w-14 text-center td-odd">' + compliedWithGaps + '</td><td class="w-14 text-center td-odd">' + reportedNonCompliance + '</td><tr></table>';
2907
2926
  return html;
2908
2927
  };
2909
2928
  this.renderStatistics = (_firstDay, _endDay, iInit, iLast, showGraph, index, month, period, firstDate = null, parametersTitle) => {
@@ -3193,6 +3212,7 @@ let SfIEvents = class SfIEvents extends LitElement {
3193
3212
  html += '<input id="input-reporter-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" max="' + (new Date().toISOString().substring(0, 10)) + '"/><br />';
3194
3213
  html += '<label part="input-label">Completion Percentage*</label>';
3195
3214
  html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1"/><br />';
3215
+ html += '<div part="input-reporter-percentage-message" class="input-reporter-percentage-message mb-20">For reporting full non-compliance, choose 0%. For reporting compliance with gaps, choose the appropriate % value.</div><br />';
3196
3216
  // if(docsOptional.length === 0) {
3197
3217
  html += '<label part="input-label">Supporting Documents' + ((docsOptional.length > 0) ? '' : '*') + '</label>';
3198
3218
  if (event['uploadguidance'] != null && event['uploadguidance'].length > 0) {
@@ -3232,6 +3252,7 @@ let SfIEvents = class SfIEvents extends LitElement {
3232
3252
  html += '<input id="input-auditor-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" max="' + (new Date().toISOString().substring(0, 10)) + '" readonly/><br />';
3233
3253
  html += '<label part="input-label">Percentage</label>';
3234
3254
  html += '<input id="input-reporter-percentage" part="input" type="number" max="100" min="0" step="1" value="' + percentage + '" disabled/><br />';
3255
+ html += '<div part="input-reporter-percentage-message" class="input-reporter-percentage-message mb-20">For reporting full non-compliance, choose 0%. For reporting compliance with gaps, choose the appropriate % value.</div><br />';
3235
3256
  html += '<div>';
3236
3257
  html += '<label part="input-label">Approve?</label><br />';
3237
3258
  html += '<div class="mt-5">';
@@ -3609,10 +3630,11 @@ let SfIEvents = class SfIEvents extends LitElement {
3609
3630
  if (listReportingContainer.querySelector('#input-reporter-percentage') != null) {
3610
3631
  percentage = listReportingContainer.querySelector('#input-reporter-percentage').value;
3611
3632
  }
3612
- if (docs.length == 0 && event.docsOptional != null && event.docsOptional.length === 0) {
3633
+ console.log('percentage', percentage, listReportingContainer.querySelector('#input-reporter-percentage').value);
3634
+ if (Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
3613
3635
  //console.log('reporter comments 3', reportercomments);
3614
3636
  buttonClick.innerHTML = "Save";
3615
- this.setError('No documents uploaded!');
3637
+ this.setError('Invalid Percentage!');
3616
3638
  setTimeout(() => {
3617
3639
  this.clearMessages();
3618
3640
  }, 3000);
@@ -8389,29 +8411,31 @@ let SfIEvents = class SfIEvents extends LitElement {
8389
8411
  var dataScheduled = divContainer.querySelector('#graph-scheduled').innerHTML;
8390
8412
  var dataPartiallyComplied = divContainer.querySelector('#graph-partially-complied').innerHTML;
8391
8413
  var dataComplied = divContainer.querySelector('#graph-complied').innerHTML;
8392
- var dataCompliedWithException = divContainer.querySelector('#graph-complied-with-exception').innerHTML;
8414
+ var dataCompliedWithGaps = divContainer.querySelector('#graph-complied-with-gaps').innerHTML;
8415
+ var dataReportedNonComplaince = divContainer.querySelector('#graph-reported-non-compliance').innerHTML;
8393
8416
  const ctx = divContainer.querySelector('#myChart');
8394
8417
  this.showGraph(divContainer, 1);
8395
8418
  this.clearGraph(divContainer, 2);
8396
8419
  this.clearGraph(divContainer, 3);
8397
8420
  this.clearGraph(divContainer, 4);
8398
8421
  const data = {
8399
- labels: ['Scheduled', 'Not Complied', 'Partially Complied', 'Complied', 'Complied With Exception'],
8422
+ labels: ['Scheduled', 'Not Complied', 'Partially Complied', 'Complied', 'Complied With Gaps', 'Reported Non Compliance'],
8400
8423
  datasets: [{
8401
8424
  label: 'Compliances',
8402
- data: [dataScheduled, dataNotComplied, dataPartiallyComplied, dataComplied, dataCompliedWithException],
8425
+ data: [dataScheduled, dataNotComplied, dataPartiallyComplied, dataComplied, dataCompliedWithGaps, dataReportedNonComplaince],
8403
8426
  borderWidth: 1,
8404
8427
  backgroundColor: [
8405
8428
  this.COLOR_SCHEDULED,
8406
8429
  this.COLOR_NOT_COMPLIED,
8407
8430
  this.COLOR_PARTIALLY_COMPLIED,
8408
8431
  this.COLOR_COMPLIED,
8409
- this.COLOR_COMPLIED_WITH_EXCEPTION
8432
+ this.COLOR_COMPLIED_WITH_GAPS,
8433
+ this.COLOR_REPORTED_NON_COMPLIANCE
8410
8434
  ]
8411
8435
  }]
8412
8436
  };
8413
- this.csvGraphStats += 'Compliance,Scheduled,Not Complied,Partially Complied,Complied,Complied With Exception,Total\n';
8414
- this.csvGraphStats += 'Count,' + parseInt(dataScheduled) + ',' + parseInt(dataNotComplied) + ',' + parseInt(dataPartiallyComplied) + ',' + parseInt(dataComplied) + ',' + parseInt(dataCompliedWithException) + ',' + parseInt(dataTotal) + '\n';
8437
+ this.csvGraphStats += 'Compliance,Scheduled,Not Complied,Partially Complied,Complied,Complied With Gaps,Reported Non Compliance,Total\n';
8438
+ this.csvGraphStats += 'Count,' + parseInt(dataScheduled) + ',' + parseInt(dataNotComplied) + ',' + parseInt(dataPartiallyComplied) + ',' + parseInt(dataComplied) + ',' + parseInt(dataCompliedWithGaps) + ',' + parseInt(dataReportedNonComplaince) + ',' + parseInt(dataTotal) + '\n';
8415
8439
  //console.log('rendering timeliness graph', this.csvGraphStats);
8416
8440
  const itemsTimeliness = divContainer.querySelectorAll('.stat-timeliness');
8417
8441
  for (var i = 0; i < itemsTimeliness.length; i++) {
@@ -8617,6 +8641,8 @@ let SfIEvents = class SfIEvents extends LitElement {
8617
8641
  dataBar2['datasets'].push({});
8618
8642
  dataBar2['datasets'].push({});
8619
8643
  dataBar2['datasets'].push({});
8644
+ dataBar2['datasets'].push({});
8645
+ dataBar2['datasets'].push({});
8620
8646
  dataBar2['datasets'][0]['label'] = 'Scheduled';
8621
8647
  dataBar2['datasets'][0]['data'] = [];
8622
8648
  for (i = 0; i < Object.keys(complianceData).length; i++) {
@@ -8641,12 +8667,18 @@ let SfIEvents = class SfIEvents extends LitElement {
8641
8667
  dataBar2['datasets'][3]['data'].push(complianceData[Object.keys(complianceData)[i]]['complied']);
8642
8668
  }
8643
8669
  dataBar2['datasets'][3]['backgroundColor'] = this.COLOR_COMPLIED;
8644
- dataBar2['datasets'][3]['label'] = 'Complied With Exception';
8645
- dataBar2['datasets'][3]['data'] = [];
8670
+ dataBar2['datasets'][4]['label'] = 'Complied With Gaps';
8671
+ dataBar2['datasets'][4]['data'] = [];
8646
8672
  for (i = 0; i < Object.keys(complianceData).length; i++) {
8647
- dataBar2['datasets'][3]['data'].push(complianceData[Object.keys(complianceData)[i]]['complied-with-exception']);
8673
+ dataBar2['datasets'][4]['data'].push(complianceData[Object.keys(complianceData)[i]]['complied-with-gaps']);
8648
8674
  }
8649
- dataBar2['datasets'][3]['backgroundColor'] = this.COLOR_COMPLIED_WITH_EXCEPTION;
8675
+ dataBar2['datasets'][4]['backgroundColor'] = this.COLOR_COMPLIED_WITH_GAPS;
8676
+ dataBar2['datasets'][5]['label'] = 'Reported Non Compliance';
8677
+ dataBar2['datasets'][5]['data'] = [];
8678
+ for (i = 0; i < Object.keys(complianceData).length; i++) {
8679
+ dataBar2['datasets'][5]['data'].push(complianceData[Object.keys(complianceData)[i]]['reported-non-compliance']);
8680
+ }
8681
+ dataBar2['datasets'][5]['backgroundColor'] = this.COLOR_REPORTED_NON_COMPLIANCE;
8650
8682
  return dataBar2;
8651
8683
  };
8652
8684
  this.populateGraphDataPie = (pieData) => {
@@ -8716,7 +8748,7 @@ let SfIEvents = class SfIEvents extends LitElement {
8716
8748
  // 4
8717
8749
  //console.log('rendering compliance matrix', complianceData);
8718
8750
  const dataBar3 = this.populateGraphDataBarCompliance(complianceData);
8719
- //console.log('rendering compliance matrix', dataBar3);
8751
+ console.log('rendering compliance matrix', dataBar3);
8720
8752
  const ctx4 = divContainer.querySelector('#myChart4');
8721
8753
  this.showGraph(divContainer, 4);
8722
8754
  this.renderChart4(ctx4, 'bar', dataBar3, param + " vs Compliance");
@@ -9286,180 +9318,190 @@ let SfIEvents = class SfIEvents extends LitElement {
9286
9318
  if (this._SfDetailContainer.querySelector('#input-reporter-percentage') != null) {
9287
9319
  percentage = this._SfDetailContainer.querySelector('#input-reporter-percentage').value;
9288
9320
  }
9289
- if (docs.length === 0 && docsOptional.length === 0) {
9321
+ if (Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
9290
9322
  //console.log('reporter comments 3', reportercomments);
9291
9323
  buttonClick.innerHTML = "Save";
9292
- this.setError('No documents uploaded!');
9324
+ this.setError('Invalid Percentage!');
9293
9325
  setTimeout(() => {
9294
9326
  this.clearMessages();
9295
9327
  }, 3000);
9296
9328
  }
9297
9329
  else {
9298
- //console.log('reporterdoc', reporterdoc);
9299
- if (reporterdoc.length === 0) {
9330
+ if (docs.length === 0 && docsOptional.length === 0) {
9331
+ //console.log('reporter comments 3', reportercomments);
9300
9332
  buttonClick.innerHTML = "Save";
9301
- this.setError('Date of completion not selected!');
9333
+ this.setError('No documents uploaded!');
9302
9334
  setTimeout(() => {
9303
9335
  this.clearMessages();
9304
9336
  }, 3000);
9305
9337
  }
9306
9338
  else {
9307
- //console.log('makerscheckers 1', reportercomments);
9308
- if (reportercomments.trim().length === 0) {
9339
+ //console.log('reporterdoc', reporterdoc);
9340
+ if (reporterdoc.length === 0) {
9309
9341
  buttonClick.innerHTML = "Save";
9310
- this.setError('Comments cannot be blank!');
9342
+ this.setError('Date of completion not selected!');
9311
9343
  setTimeout(() => {
9312
9344
  this.clearMessages();
9313
9345
  }, 3000);
9314
9346
  }
9315
9347
  else {
9316
- var clickEvent = new MouseEvent("click", {
9317
- "view": window,
9318
- "bubbles": true,
9319
- "cancelable": false
9320
- });
9321
- this._SfDetailContainer.querySelector('#button-detail-close').dispatchEvent(clickEvent);
9322
- let flagBulk = false;
9323
- if (this.selectedItemIds.length === 0) {
9324
- await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, "notices", percentage);
9325
- console.log('this.events', this.events);
9326
- for (var p = 0; p < this.events[mmdd].length; p++) {
9327
- if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9328
- this.events[mmdd][p].documents = docs;
9329
- this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() });
9330
- this.events[mmdd][p].lastupdated = new Date().toString();
9331
- }
9332
- }
9333
- console.log('uploadReport single');
9334
- if (makercheckers.length > 0) {
9335
- await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
9348
+ //console.log('makerscheckers 1', reportercomments);
9349
+ if (reportercomments.trim().length === 0) {
9350
+ buttonClick.innerHTML = "Save";
9351
+ this.setError('Comments cannot be blank!');
9352
+ setTimeout(() => {
9353
+ this.clearMessages();
9354
+ }, 3000);
9355
+ }
9356
+ else {
9357
+ var clickEvent = new MouseEvent("click", {
9358
+ "view": window,
9359
+ "bubbles": true,
9360
+ "cancelable": false
9361
+ });
9362
+ this._SfDetailContainer.querySelector('#button-detail-close').dispatchEvent(clickEvent);
9363
+ let flagBulk = false;
9364
+ if (this.selectedItemIds.length === 0) {
9365
+ await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, "notices", percentage);
9366
+ console.log('this.events', this.events);
9336
9367
  for (var p = 0; p < this.events[mmdd].length; p++) {
9337
9368
  if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9338
- this.events[mmdd][p].approved = true;
9339
- // this.events[mmdd][p].documents = docs
9340
- this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() });
9369
+ this.events[mmdd][p].documents = docs;
9370
+ this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() });
9341
9371
  this.events[mmdd][p].lastupdated = new Date().toString();
9342
9372
  }
9343
9373
  }
9344
- console.log('upload report auto approve single');
9345
- }
9346
- if (this.recentlyReported[mmdd] == null) {
9347
- this.recentlyReported[mmdd] = [];
9348
- }
9349
- this.recentlyReported[mmdd].push(event);
9350
- }
9351
- else {
9352
- let bulkBody = [];
9353
- let bulkBodyReview = [];
9354
- for (var k = 0; k < this.selectedItemIds.length; k++) {
9355
- const selectedId = this.selectedItemIds[k];
9356
- //console.log('selectedid', selectedId);
9357
- const makercheckersL = selectedId.split('-')[5];
9358
- entityId = selectedId.split('-')[7].replace(/_/g, '-');
9359
- locationId = selectedId.split('-')[8].replace(/_/g, '-');
9360
- const eventId = selectedId.split('-')[9].replace(/_/g, '-');
9361
- mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
9362
- //console.log(entityId, locationId, eventId, mmddyyyy);
9363
- // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
9364
- if (parseInt(makercheckersL) > 0) {
9365
- bulkBodyReview.push({
9366
- "mmddyyyy": mmddyyyy,
9367
- "projectid": this.projectId,
9368
- "type": "report",
9369
- "eventid": eventId,
9370
- "comments": reportercomments,
9371
- "dateofcompletion": reporterdoc,
9372
- "percentage": percentage,
9373
- "entityid": entityId,
9374
- "locationid": locationId,
9375
- "event": null,
9376
- "docs": JSON.stringify(docs),
9377
- "approved": true,
9378
- "username": this.userName,
9379
- "reportformatvalues": reportformatvalues,
9380
- "reportformatschema": reportformatschema,
9381
- "userid": this.userProfileId,
9382
- "userrole": this.myRole,
9383
- "year": this.calendarStartYYYY,
9384
- "module": listEvent.isnotice != null ? "notices" : "events"
9385
- });
9386
- // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
9374
+ console.log('uploadReport single');
9375
+ if (makercheckers.length > 0) {
9376
+ await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
9377
+ for (var p = 0; p < this.events[mmdd].length; p++) {
9378
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9379
+ this.events[mmdd][p].approved = true;
9380
+ // this.events[mmdd][p].documents = docs
9381
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() });
9382
+ this.events[mmdd][p].lastupdated = new Date().toString();
9383
+ }
9384
+ }
9385
+ console.log('upload report auto approve single');
9387
9386
  }
9388
- else {
9389
- bulkBody.push({
9390
- "mmddyyyy": mmddyyyy,
9391
- "projectid": this.projectId,
9392
- "type": "report",
9393
- "eventid": eventId,
9394
- "comments": reportercomments,
9395
- "dateofcompletion": reporterdoc,
9396
- "percentage": percentage,
9397
- "entityid": entityId,
9398
- "locationid": locationId,
9399
- "event": null,
9400
- "docs": JSON.stringify(docs),
9401
- "username": this.userName,
9402
- "reportformatvalues": reportformatvalues,
9403
- "reportformatschema": reportformatschema,
9404
- "userid": this.userProfileId,
9405
- "userrole": this.myRole,
9406
- "year": this.calendarStartYYYY,
9407
- "module": listEvent.isnotice != null ? "notices" : "events"
9408
- });
9387
+ if (this.recentlyReported[mmdd] == null) {
9388
+ this.recentlyReported[mmdd] = [];
9409
9389
  }
9410
- // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
9411
- // await this.sleep(2000);
9412
- // this.clearMessages();
9413
- }
9414
- // await this.uploadReportsBulk(bulkBody);
9415
- // await this.fetchBulkReportingData();
9416
- if (bulkBody.length > 0) {
9417
- await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
9418
- }
9419
- if (bulkBodyReview.length > 0) {
9420
- await this.uploadReportsReviewsBulk(bulkBodyReview);
9390
+ this.recentlyReported[mmdd].push(event);
9421
9391
  }
9422
- await this.fetchBulkReportingData();
9423
- console.log('uploadReport bulk');
9424
- for (var k = 0; k < this.selectedItemIds.length; k++) {
9425
- const selectedId = this.selectedItemIds[k];
9426
- //console.log('selectedid', selectedId);
9427
- let entityId = selectedId.split('-')[7].replace(/_/g, '-');
9428
- let locationId = selectedId.split('-')[8].replace(/_/g, '-');
9429
- const eventId = selectedId.split('-')[9].replace(/_/g, '-');
9430
- mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
9431
- let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1];
9432
- for (var p = 0; p < this.events[mmdd].length; p++) {
9433
- if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9434
- this.events[mmdd][p].isbulk = true;
9435
- flagBulk = true;
9436
- if (this.recentlyReported[mmdd] == null) {
9437
- this.recentlyReported[mmdd] = [];
9392
+ else {
9393
+ let bulkBody = [];
9394
+ let bulkBodyReview = [];
9395
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
9396
+ const selectedId = this.selectedItemIds[k];
9397
+ //console.log('selectedid', selectedId);
9398
+ const makercheckersL = selectedId.split('-')[5];
9399
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
9400
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
9401
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
9402
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
9403
+ //console.log(entityId, locationId, eventId, mmddyyyy);
9404
+ // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
9405
+ if (parseInt(makercheckersL) > 0) {
9406
+ bulkBodyReview.push({
9407
+ "mmddyyyy": mmddyyyy,
9408
+ "projectid": this.projectId,
9409
+ "type": "report",
9410
+ "eventid": eventId,
9411
+ "comments": reportercomments,
9412
+ "dateofcompletion": reporterdoc,
9413
+ "percentage": percentage,
9414
+ "entityid": entityId,
9415
+ "locationid": locationId,
9416
+ "event": null,
9417
+ "docs": JSON.stringify(docs),
9418
+ "approved": true,
9419
+ "username": this.userName,
9420
+ "reportformatvalues": reportformatvalues,
9421
+ "reportformatschema": reportformatschema,
9422
+ "userid": this.userProfileId,
9423
+ "userrole": this.myRole,
9424
+ "year": this.calendarStartYYYY,
9425
+ "module": listEvent.isnotice != null ? "notices" : "events"
9426
+ });
9427
+ // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
9428
+ }
9429
+ else {
9430
+ bulkBody.push({
9431
+ "mmddyyyy": mmddyyyy,
9432
+ "projectid": this.projectId,
9433
+ "type": "report",
9434
+ "eventid": eventId,
9435
+ "comments": reportercomments,
9436
+ "dateofcompletion": reporterdoc,
9437
+ "percentage": percentage,
9438
+ "entityid": entityId,
9439
+ "locationid": locationId,
9440
+ "event": null,
9441
+ "docs": JSON.stringify(docs),
9442
+ "username": this.userName,
9443
+ "reportformatvalues": reportformatvalues,
9444
+ "reportformatschema": reportformatschema,
9445
+ "userid": this.userProfileId,
9446
+ "userrole": this.myRole,
9447
+ "year": this.calendarStartYYYY,
9448
+ "module": listEvent.isnotice != null ? "notices" : "events"
9449
+ });
9450
+ }
9451
+ // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
9452
+ // await this.sleep(2000);
9453
+ // this.clearMessages();
9454
+ }
9455
+ // await this.uploadReportsBulk(bulkBody);
9456
+ // await this.fetchBulkReportingData();
9457
+ if (bulkBody.length > 0) {
9458
+ await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
9459
+ }
9460
+ if (bulkBodyReview.length > 0) {
9461
+ await this.uploadReportsReviewsBulk(bulkBodyReview);
9462
+ }
9463
+ await this.fetchBulkReportingData();
9464
+ console.log('uploadReport bulk');
9465
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
9466
+ const selectedId = this.selectedItemIds[k];
9467
+ //console.log('selectedid', selectedId);
9468
+ let entityId = selectedId.split('-')[7].replace(/_/g, '-');
9469
+ let locationId = selectedId.split('-')[8].replace(/_/g, '-');
9470
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
9471
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
9472
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1];
9473
+ for (var p = 0; p < this.events[mmdd].length; p++) {
9474
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9475
+ this.events[mmdd][p].isbulk = true;
9476
+ flagBulk = true;
9477
+ if (this.recentlyReported[mmdd] == null) {
9478
+ this.recentlyReported[mmdd] = [];
9479
+ }
9480
+ this.recentlyReported[mmdd].push(this.events[mmdd][p]);
9438
9481
  }
9439
- this.recentlyReported[mmdd].push(this.events[mmdd][p]);
9440
9482
  }
9441
9483
  }
9442
9484
  }
9443
- }
9444
- if (this.mode == "next") {
9445
- this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus);
9446
- }
9447
- else {
9448
- // if(this.getCurrentTab() == this.TAB_CUSTOM) {
9449
- // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
9450
- // } else
9451
- if (this.getCurrentTab() == this.TAB_FIND) {
9452
- const searchString = this._SfFindContainer.querySelector('#stream-search').value;
9453
- this.processFindSelection(this._SfFindContainer, searchString);
9485
+ if (this.mode == "next") {
9486
+ this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus);
9454
9487
  }
9455
9488
  else {
9456
- if (this.selectedItemIds.length > 0) {
9457
- await this.fetchBulkReportingData();
9489
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
9490
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
9491
+ // } else
9492
+ if (this.getCurrentTab() == this.TAB_FIND) {
9493
+ const searchString = this._SfFindContainer.querySelector('#stream-search').value;
9494
+ this.processFindSelection(this._SfFindContainer, searchString);
9495
+ }
9496
+ else {
9497
+ if (this.selectedItemIds.length > 0) {
9498
+ await this.fetchBulkReportingData();
9499
+ }
9500
+ this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
9501
+ // if(currentColumnButton != null) {
9502
+ // currentColumnButton.click();
9503
+ // }
9458
9504
  }
9459
- this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
9460
- // if(currentColumnButton != null) {
9461
- // currentColumnButton.click();
9462
- // }
9463
9505
  }
9464
9506
  }
9465
9507
  }
@@ -10412,197 +10454,207 @@ let SfIEvents = class SfIEvents extends LitElement {
10412
10454
  if (this._SfDetailContainer.querySelector('#input-reporter-percentage') != null) {
10413
10455
  percentage = this._SfDetailContainer.querySelector('#input-reporter-percentage').value;
10414
10456
  }
10415
- if (docs.length === 0 && docsOptional.length === 0) {
10457
+ if (Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
10416
10458
  //console.log('reporter comments 3', reportercomments);
10417
10459
  buttonClick.innerHTML = "Save";
10418
- this.setError('No documents uploaded!');
10460
+ this.setError('Invalid Percentage!');
10419
10461
  setTimeout(() => {
10420
10462
  this.clearMessages();
10421
10463
  }, 3000);
10422
10464
  }
10423
10465
  else {
10424
- //console.log('reporterdoc', reporterdoc);
10425
- if (reporterdoc.length === 0) {
10466
+ if (docs.length === 0 && docsOptional.length === 0) {
10467
+ //console.log('reporter comments 3', reportercomments);
10426
10468
  buttonClick.innerHTML = "Save";
10427
- this.setError('Date of completion not selected!');
10469
+ this.setError('No documents uploaded!');
10428
10470
  setTimeout(() => {
10429
10471
  this.clearMessages();
10430
10472
  }, 3000);
10431
10473
  }
10432
10474
  else {
10433
- //console.log('makerscheckers 1', reportercomments);
10434
- if (reportercomments.trim().length === 0) {
10475
+ //console.log('reporterdoc', reporterdoc);
10476
+ if (reporterdoc.length === 0) {
10435
10477
  buttonClick.innerHTML = "Save";
10436
- this.setError('Comments cannot be blank!');
10478
+ this.setError('Date of completion not selected!');
10437
10479
  setTimeout(() => {
10438
10480
  this.clearMessages();
10439
10481
  }, 3000);
10440
10482
  }
10441
10483
  else {
10442
- var clickEvent = new MouseEvent("click", {
10443
- "view": window,
10444
- "bubbles": true,
10445
- "cancelable": false
10446
- });
10447
- this._SfDetailContainer.querySelector('#button-detail-close').dispatchEvent(clickEvent);
10448
- let flagBulk = false;
10449
- if (this.selectedItemIds.length === 0) {
10450
- //console.log('makerscheckers', makercheckers, reportercomments);
10451
- // console.log('reportformatvalues', reportformatvalues)
10452
- // console.log('reportformatschema',reportformatschema)
10453
- await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage);
10454
- console.log('this.events', this.events);
10455
- for (var p = 0; p < this.events[mmdd].length; p++) {
10456
- if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10457
- this.events[mmdd][p].documents = docs;
10458
- this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() });
10459
- this.events[mmdd][p].lastupdated = new Date().toString();
10460
- }
10461
- }
10462
- if (makercheckers.length > 0) {
10463
- await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
10484
+ //console.log('makerscheckers 1', reportercomments);
10485
+ if (reportercomments.trim().length === 0) {
10486
+ buttonClick.innerHTML = "Save";
10487
+ this.setError('Comments cannot be blank!');
10488
+ setTimeout(() => {
10489
+ this.clearMessages();
10490
+ }, 3000);
10491
+ }
10492
+ else {
10493
+ var clickEvent = new MouseEvent("click", {
10494
+ "view": window,
10495
+ "bubbles": true,
10496
+ "cancelable": false
10497
+ });
10498
+ this._SfDetailContainer.querySelector('#button-detail-close').dispatchEvent(clickEvent);
10499
+ let flagBulk = false;
10500
+ if (this.selectedItemIds.length === 0) {
10501
+ //console.log('makerscheckers', makercheckers, reportercomments);
10502
+ // console.log('reportformatvalues', reportformatvalues)
10503
+ // console.log('reportformatschema',reportformatschema)
10504
+ await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage);
10505
+ console.log('this.events', this.events);
10464
10506
  for (var p = 0; p < this.events[mmdd].length; p++) {
10465
10507
  if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10466
- this.events[mmdd][p].approved = true;
10467
- // this.events[mmdd][p].documents = docs
10468
- this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() });
10508
+ this.events[mmdd][p].documents = docs;
10509
+ this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() });
10469
10510
  this.events[mmdd][p].lastupdated = new Date().toString();
10470
10511
  }
10471
10512
  }
10472
- }
10473
- if (this.recentlyReported[mmdd] == null) {
10474
- this.recentlyReported[mmdd] = [];
10475
- }
10476
- this.recentlyReported[mmdd].push(event);
10477
- }
10478
- else {
10479
- let bulkBody = [];
10480
- let bulkBodyReview = [];
10481
- for (var k = 0; k < this.selectedItemIds.length; k++) {
10482
- const selectedId = this.selectedItemIds[k];
10483
- //console.log('selectedid', selectedId);
10484
- const makercheckersL = selectedId.split('-')[5];
10485
- entityId = selectedId.split('-')[7].replace(/_/g, '-');
10486
- locationId = selectedId.split('-')[8].replace(/_/g, '-');
10487
- const eventId = selectedId.split('-')[9].replace(/_/g, '-');
10488
- mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
10489
- //console.log(entityId, locationId, eventId, mmddyyyy);
10490
- // bulkBody.push({
10491
- // "mmddyyyy": mmddyyyy,
10492
- // "projectid": this.projectId,
10493
- // "type": "report",
10494
- // "eventid": eventId,
10495
- // "comments": reportercomments,
10496
- // "dateofcompletion": reporterdoc,
10497
- // "entityid": entityId,
10498
- // "locationid": locationId,
10499
- // "event": null,
10500
- // "docs": JSON.stringify(docs),
10501
- // "username": this.userName,
10502
- // "reportformatvalues": reportformatvalues,
10503
- // "reportformatschema": reportformatschema,
10504
- // "userid": this.userProfileId,
10505
- // "userrole": this.myRole,
10506
- // "year": this.calendarStartYYYY,
10507
- // "module": event.isnotice != null ? "notices" : "events"
10508
- // })
10509
- // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
10510
- if (parseInt(makercheckersL) > 0) {
10511
- bulkBodyReview.push({
10512
- "mmddyyyy": mmddyyyy,
10513
- "projectid": this.projectId,
10514
- "type": "report",
10515
- "eventid": eventId,
10516
- "comments": reportercomments,
10517
- "dateofcompletion": reporterdoc,
10518
- "percentage": percentage,
10519
- "entityid": entityId,
10520
- "locationid": locationId,
10521
- "event": null,
10522
- "docs": JSON.stringify(docs),
10523
- "approved": true,
10524
- "username": this.userName,
10525
- "reportformatvalues": reportformatvalues,
10526
- "reportformatschema": reportformatschema,
10527
- "userid": this.userProfileId,
10528
- "userrole": this.myRole,
10529
- "year": this.calendarStartYYYY,
10530
- "module": event.isnotice != null ? "notices" : "events"
10531
- });
10532
- // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
10513
+ if (makercheckers.length > 0) {
10514
+ await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
10515
+ for (var p = 0; p < this.events[mmdd].length; p++) {
10516
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10517
+ this.events[mmdd][p].approved = true;
10518
+ // this.events[mmdd][p].documents = docs
10519
+ this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() });
10520
+ this.events[mmdd][p].lastupdated = new Date().toString();
10521
+ }
10522
+ }
10533
10523
  }
10534
- else {
10535
- bulkBody.push({
10536
- "mmddyyyy": mmddyyyy,
10537
- "projectid": this.projectId,
10538
- "type": "report",
10539
- "eventid": eventId,
10540
- "comments": reportercomments,
10541
- "dateofcompletion": reporterdoc,
10542
- "percentage": percentage,
10543
- "entityid": entityId,
10544
- "locationid": locationId,
10545
- "event": null,
10546
- "docs": JSON.stringify(docs),
10547
- "username": this.userName,
10548
- "reportformatvalues": reportformatvalues,
10549
- "reportformatschema": reportformatschema,
10550
- "userid": this.userProfileId,
10551
- "userrole": this.myRole,
10552
- "year": this.calendarStartYYYY,
10553
- "module": event.isnotice != null ? "notices" : "events"
10554
- });
10524
+ if (this.recentlyReported[mmdd] == null) {
10525
+ this.recentlyReported[mmdd] = [];
10555
10526
  }
10556
- // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
10557
- // await this.sleep(2000);
10558
- // this.clearMessages();
10559
- }
10560
- if (bulkBody.length > 0) {
10561
- await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
10562
- }
10563
- // await this.fetchBulkReportingData();
10564
- if (bulkBodyReview.length > 0) {
10565
- await this.uploadReportsReviewsBulk(bulkBodyReview);
10527
+ this.recentlyReported[mmdd].push(event);
10566
10528
  }
10567
- for (var k = 0; k < this.selectedItemIds.length; k++) {
10568
- const selectedId = this.selectedItemIds[k];
10569
- //console.log('selectedid', selectedId);
10570
- entityId = selectedId.split('-')[7].replace(/_/g, '-');
10571
- locationId = selectedId.split('-')[8].replace(/_/g, '-');
10572
- const eventId = selectedId.split('-')[9].replace(/_/g, '-');
10573
- mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
10574
- let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1];
10575
- for (var p = 0; p < this.events[mmdd].length; p++) {
10576
- if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10577
- this.events[mmdd][p].isbulk = true;
10578
- flagBulk = true;
10579
- if (this.recentlyReported[mmdd] == null) {
10580
- this.recentlyReported[mmdd] = [];
10529
+ else {
10530
+ let bulkBody = [];
10531
+ let bulkBodyReview = [];
10532
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
10533
+ const selectedId = this.selectedItemIds[k];
10534
+ //console.log('selectedid', selectedId);
10535
+ const makercheckersL = selectedId.split('-')[5];
10536
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
10537
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
10538
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
10539
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
10540
+ //console.log(entityId, locationId, eventId, mmddyyyy);
10541
+ // bulkBody.push({
10542
+ // "mmddyyyy": mmddyyyy,
10543
+ // "projectid": this.projectId,
10544
+ // "type": "report",
10545
+ // "eventid": eventId,
10546
+ // "comments": reportercomments,
10547
+ // "dateofcompletion": reporterdoc,
10548
+ // "entityid": entityId,
10549
+ // "locationid": locationId,
10550
+ // "event": null,
10551
+ // "docs": JSON.stringify(docs),
10552
+ // "username": this.userName,
10553
+ // "reportformatvalues": reportformatvalues,
10554
+ // "reportformatschema": reportformatschema,
10555
+ // "userid": this.userProfileId,
10556
+ // "userrole": this.myRole,
10557
+ // "year": this.calendarStartYYYY,
10558
+ // "module": event.isnotice != null ? "notices" : "events"
10559
+ // })
10560
+ // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
10561
+ if (parseInt(makercheckersL) > 0) {
10562
+ bulkBodyReview.push({
10563
+ "mmddyyyy": mmddyyyy,
10564
+ "projectid": this.projectId,
10565
+ "type": "report",
10566
+ "eventid": eventId,
10567
+ "comments": reportercomments,
10568
+ "dateofcompletion": reporterdoc,
10569
+ "percentage": percentage,
10570
+ "entityid": entityId,
10571
+ "locationid": locationId,
10572
+ "event": null,
10573
+ "docs": JSON.stringify(docs),
10574
+ "approved": true,
10575
+ "username": this.userName,
10576
+ "reportformatvalues": reportformatvalues,
10577
+ "reportformatschema": reportformatschema,
10578
+ "userid": this.userProfileId,
10579
+ "userrole": this.myRole,
10580
+ "year": this.calendarStartYYYY,
10581
+ "module": event.isnotice != null ? "notices" : "events"
10582
+ });
10583
+ // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
10584
+ }
10585
+ else {
10586
+ bulkBody.push({
10587
+ "mmddyyyy": mmddyyyy,
10588
+ "projectid": this.projectId,
10589
+ "type": "report",
10590
+ "eventid": eventId,
10591
+ "comments": reportercomments,
10592
+ "dateofcompletion": reporterdoc,
10593
+ "percentage": percentage,
10594
+ "entityid": entityId,
10595
+ "locationid": locationId,
10596
+ "event": null,
10597
+ "docs": JSON.stringify(docs),
10598
+ "username": this.userName,
10599
+ "reportformatvalues": reportformatvalues,
10600
+ "reportformatschema": reportformatschema,
10601
+ "userid": this.userProfileId,
10602
+ "userrole": this.myRole,
10603
+ "year": this.calendarStartYYYY,
10604
+ "module": event.isnotice != null ? "notices" : "events"
10605
+ });
10606
+ }
10607
+ // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
10608
+ // await this.sleep(2000);
10609
+ // this.clearMessages();
10610
+ }
10611
+ if (bulkBody.length > 0) {
10612
+ await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
10613
+ }
10614
+ // await this.fetchBulkReportingData();
10615
+ if (bulkBodyReview.length > 0) {
10616
+ await this.uploadReportsReviewsBulk(bulkBodyReview);
10617
+ }
10618
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
10619
+ const selectedId = this.selectedItemIds[k];
10620
+ //console.log('selectedid', selectedId);
10621
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
10622
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
10623
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
10624
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
10625
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1];
10626
+ for (var p = 0; p < this.events[mmdd].length; p++) {
10627
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10628
+ this.events[mmdd][p].isbulk = true;
10629
+ flagBulk = true;
10630
+ if (this.recentlyReported[mmdd] == null) {
10631
+ this.recentlyReported[mmdd] = [];
10632
+ }
10633
+ this.recentlyReported[mmdd].push(this.events[mmdd][p]);
10581
10634
  }
10582
- this.recentlyReported[mmdd].push(this.events[mmdd][p]);
10583
10635
  }
10584
10636
  }
10585
10637
  }
10586
- }
10587
- if (this.mode == "next") {
10588
- this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus);
10589
- }
10590
- else {
10591
- // if(this.getCurrentTab() == this.TAB_CUSTOM) {
10592
- // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
10593
- // } else
10594
- if (this.getCurrentTab() == this.TAB_FIND) {
10595
- const searchString = this._SfFindContainer.querySelector('#stream-search').value;
10596
- this.processFindSelection(this._SfFindContainer, searchString);
10638
+ if (this.mode == "next") {
10639
+ this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus);
10597
10640
  }
10598
10641
  else {
10599
- if (this.selectedItemIds.length > 0) {
10600
- await this.fetchBulkReportingData();
10642
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
10643
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
10644
+ // } else
10645
+ if (this.getCurrentTab() == this.TAB_FIND) {
10646
+ const searchString = this._SfFindContainer.querySelector('#stream-search').value;
10647
+ this.processFindSelection(this._SfFindContainer, searchString);
10648
+ }
10649
+ else {
10650
+ if (this.selectedItemIds.length > 0) {
10651
+ await this.fetchBulkReportingData();
10652
+ }
10653
+ this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
10654
+ // if(currentColumnButton != null) {
10655
+ // currentColumnButton.click();
10656
+ // }
10601
10657
  }
10602
- this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
10603
- // if(currentColumnButton != null) {
10604
- // currentColumnButton.click();
10605
- // }
10606
10658
  }
10607
10659
  }
10608
10660
  }
@@ -14460,9 +14512,12 @@ let SfIEvents = class SfIEvents extends LitElement {
14460
14512
  .color-complied {
14461
14513
  color: #50cf01;
14462
14514
  }
14463
- .color-complied-with-exception {
14515
+ .color-complied-with-gaps {
14464
14516
  color: #ffe505;
14465
14517
  }
14518
+ .color-reported-non-compliance {
14519
+ color: #840B0F;
14520
+ }
14466
14521
  .color-scheduled {
14467
14522
  color: #888888;
14468
14523
  }
@@ -15705,6 +15760,9 @@ let SfIEvents = class SfIEvents extends LitElement {
15705
15760
  let graphparamname1Arr = graphparamnames1[i].innerHTML.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ').split(' • ');
15706
15761
  let filterFound = false;
15707
15762
  for (let tempFilterStr of graphparamname1Arr) {
15763
+ if (clickedValue == "reported non compliance") {
15764
+ console.log('comparing filter', tempFilterStr, this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '));
15765
+ }
15708
15766
  if (tempFilterStr == this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') || this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') == "") {
15709
15767
  filterFound = true;
15710
15768
  break;
@@ -19162,7 +19220,7 @@ let SfIEvents = class SfIEvents extends LitElement {
19162
19220
  console.log('eventsData', eventsData);
19163
19221
  console.log('role', role);
19164
19222
  // if(Object.keys(eventsData[role]).length > 0){
19165
- var notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0, compliedWithException = 0;
19223
+ var notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0, compliedWithGaps = 0, reportedNonCompliance = 0;
19166
19224
  var html = '';
19167
19225
  this.selectedItemIds = [];
19168
19226
  this.selectedStatus = "";
@@ -19202,7 +19260,8 @@ let SfIEvents = class SfIEvents extends LitElement {
19202
19260
  partiallyComplied = partiallyComplied + (complianceStatus == "partially-complied" ? 1 : 0);
19203
19261
  notComplied = notComplied + (complianceStatus == "not-complied" ? 1 : 0);
19204
19262
  complied = complied + (complianceStatus == "complied" ? 1 : 0);
19205
- compliedWithException = compliedWithException + (complianceStatus == "complied-with-exception" ? 1 : 0);
19263
+ compliedWithGaps = compliedWithGaps + (complianceStatus == "complied-with-gaps" ? 1 : 0);
19264
+ reportedNonCompliance = reportedNonCompliance + (complianceStatus == "reported-non-compliance" ? 1 : 0);
19206
19265
  eventsData[role][mmdd][j][this.FLOW_GRAPH_COMPLETENESS] = partStatus;
19207
19266
  eventsData[role][mmdd][j][this.FLOW_GRAPH_TIMELINESS] = lateStatus;
19208
19267
  eventsData[role][mmdd][j][this.FLOW_GRAPH_COMPLIANCE] = complianceStatus;
@@ -20846,9 +20905,12 @@ SfIEvents.styles = css `
20846
20905
  .color-complied {
20847
20906
  color: #50cf01;
20848
20907
  }
20849
- .color-complied-with-exception {
20908
+ .color-complied-with-gaps {
20850
20909
  color: #ffe505;
20851
20910
  }
20911
+ .color-reported-non-compliance {
20912
+ color: #840B0F;
20913
+ }
20852
20914
  .color-scheduled {
20853
20915
  color: #888888;
20854
20916
  }