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.
@@ -116,7 +116,8 @@ export class SfIEvents extends LitElement {
116
116
  COLOR_NOT_COMPLIED = "#C80036";
117
117
  COLOR_PARTIALLY_COMPLIED = "#F79256";
118
118
  COLOR_COMPLIED = "#50cf01";
119
- COLOR_COMPLIED_WITH_EXCEPTION = "#ffe505";
119
+ COLOR_COMPLIED_WITH_GAPS = "#ffe505";
120
+ COLOR_REPORTED_NON_COMPLIANCE = "#840B0F";
120
121
  STATUS_NOT_STARTED = "not-started";
121
122
  STATUS_PENDING_APPROVAL = "pending-approval";
122
123
  STATUS_REJECTED = "rejected";
@@ -432,9 +433,12 @@ export class SfIEvents extends LitElement {
432
433
  .color-complied {
433
434
  color: #50cf01;
434
435
  }
435
- .color-complied-with-exception {
436
+ .color-complied-with-gaps {
436
437
  color: #ffe505;
437
438
  }
439
+ .color-reported-non-compliance {
440
+ color: #840B0F;
441
+ }
438
442
  .color-scheduled {
439
443
  color: #888888;
440
444
  }
@@ -641,9 +645,12 @@ export class SfIEvents extends LitElement {
641
645
  .color-complied {
642
646
  color: #50cf01;
643
647
  }
644
- .color-complied-with-exception {
648
+ .color-complied-with-gaps {
645
649
  color: #ffe505;
646
650
  }
651
+ .color-reported-non-compliance {
652
+ color: #840B0F;
653
+ }
647
654
  .color-scheduled {
648
655
  color: #888888;
649
656
  }
@@ -2128,9 +2135,12 @@ export class SfIEvents extends LitElement {
2128
2135
  .color-complied {
2129
2136
  color: #50cf01;
2130
2137
  }
2131
- .color-complied-with-exception {
2138
+ .color-complied-with-gaps {
2132
2139
  color: #ffe505;
2133
2140
  }
2141
+ .color-reported-non-compliance {
2142
+ color: #840B0F;
2143
+ }
2134
2144
  .color-scheduled {
2135
2145
  color: #888888;
2136
2146
  }
@@ -3906,8 +3916,11 @@ export class SfIEvents extends LitElement {
3906
3916
  if(arrComplianceData[name]["complied"] == null) {
3907
3917
  arrComplianceData[name]["complied"] = 0;
3908
3918
  }
3909
- if(arrComplianceData[name]["complied-with-exception"] == null) {
3910
- arrComplianceData[name]["complied-with-exception"] = 0;
3919
+ if(arrComplianceData[name]["complied-with-gaps"] == null) {
3920
+ arrComplianceData[name]["complied-with-gaps"] = 0;
3921
+ }
3922
+ if(arrComplianceData[name]["reported-non-compliance"] == null) {
3923
+ arrComplianceData[name]["reported-non-compliance"] = 0;
3911
3924
  }
3912
3925
 
3913
3926
  arrComplianceData[name][complianceStatus]++;
@@ -4234,8 +4247,11 @@ export class SfIEvents extends LitElement {
4234
4247
  } else {
4235
4248
 
4236
4249
  if(timeliness == "in-time" || timeliness == "late-reported" || timeliness == "late-approved") {
4237
- if(percentage != null && parseInt(percentage) < 100){
4238
- return "complied-with-exception"
4250
+ if(percentage != null && parseInt(percentage) == 0){
4251
+ console.log('reported non compliance')
4252
+ return "reported-non-compliance"
4253
+ }else if(percentage != null && parseInt(percentage) < 100){
4254
+ return "complied-with-gaps"
4239
4255
  }else{
4240
4256
  return "complied";
4241
4257
  }
@@ -4423,7 +4439,8 @@ export class SfIEvents extends LitElement {
4423
4439
  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>';
4424
4440
  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>';
4425
4441
  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>';
4426
- 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>';
4442
+ 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>';
4443
+ 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>';
4427
4444
  html += '</div>';
4428
4445
 
4429
4446
  html += '<div id="stream-event-filter" part="stream-event-total" class="d-flex flex-wrap"></div>';
@@ -4451,7 +4468,8 @@ export class SfIEvents extends LitElement {
4451
4468
  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>';
4452
4469
  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>';
4453
4470
  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>';
4454
- 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>';
4471
+ 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>';
4472
+ 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>';
4455
4473
  html += '</div>';
4456
4474
 
4457
4475
  html += '<div id="stream-event-filter" part="stream-event-total" class="d-flex flex-wrap"></div>';
@@ -4845,7 +4863,8 @@ export class SfIEvents extends LitElement {
4845
4863
  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>' : '');
4846
4864
  html += (complianceStatus == "partially-complied" ? '<span class="material-symbols-outlined color-partially-complied color-partially-complied-item color-partially-complied-item-'+i+'">rule</span>' : '');
4847
4865
  html += (complianceStatus == "complied" ? '<span class="material-symbols-outlined color-complied color-complied-item color-complied-item-'+i+'">sweep</span>' : '');
4848
- 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>' : '');
4866
+ 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>' : '');
4867
+ 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>' : '');
4849
4868
 
4850
4869
  html += (partStatus == "not-started" ? '<span class="material-symbols-outlined color-not-started color-not-started-item color-not-started-item-'+i+'">schedule</span>' : '');
4851
4870
  html += (partStatus == "pending-approval" ? '<span class="material-symbols-outlined color-pending color-pending-item color-pending-item-'+i+'">pending</span>' : '');
@@ -4919,7 +4938,7 @@ export class SfIEvents extends LitElement {
4919
4938
  }
4920
4939
 
4921
4940
  renderEvents = (_firstDay: any, _endDay: any, iInit: number, iLast: number, showGraph: boolean, index: number, month: number, period: string, firstDate: any = null, parametersTitle: string, showBackgroundButton: boolean) => {
4922
- 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;
4941
+ 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;
4923
4942
  var html = '';
4924
4943
  this.selectedItemIds = [];
4925
4944
  this.selectedItems = [];
@@ -5017,7 +5036,8 @@ export class SfIEvents extends LitElement {
5017
5036
  partiallyComplied = partiallyComplied + (complianceStatus == "partially-complied" ? 1 : 0);
5018
5037
  notComplied = notComplied + (complianceStatus == "not-complied" ? 1 : 0);
5019
5038
  complied = complied + (complianceStatus == "complied" ? 1 : 0);
5020
- compliedWithException = compliedWithException + (complianceStatus == "complied-with-exception" ? 1 : 0);
5039
+ compliedWithGaps = compliedWithGaps + (complianceStatus == "complied-with-gaps" ? 1 : 0);
5040
+ reportedNonCompliance = reportedNonCompliance + (complianceStatus == "reported-non-compliance" ? 1 : 0);
5021
5041
 
5022
5042
  this.events[mmdd][j][this.FLOW_GRAPH_COMPLETENESS] = partStatus;
5023
5043
  this.events[mmdd][j][this.FLOW_GRAPH_TIMELINESS] = lateStatus;
@@ -5158,10 +5178,11 @@ export class SfIEvents extends LitElement {
5158
5178
  html = html.replace("DASHBOARD_NOT_COMPLIED", notComplied+"");
5159
5179
  html = html.replace("DASHBOARD_PARTIALLY_COMPLIED", partiallyComplied+"");
5160
5180
  html = html.replace("DASHBOARD_COMPLIED", complied+"");
5161
- html = html.replace("DASHBOARD_COMPLIED_WITH_EXCEPTION", compliedWithException+"");
5181
+ html = html.replace("DASHBOARD_COMPLIED_WITH_GAPS", compliedWithGaps+"");
5182
+ html = html.replace("DASHBOARD_REPORTED_NON_COMPLIANCE", reportedNonCompliance+"");
5162
5183
 
5163
- 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';
5164
- this.csvDataStats += this.period + "," + total + "," + notStarted + "," + approved + "," + pendingApproval + "," + rejected + "," + pastDueDate + "," + lateReported + "," + lateExecuted + "," + lateApproved + "," + scheduled + "," + notComplied + "," + partiallyComplied + "," + complied;
5184
+ 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';
5185
+ this.csvDataStats += this.period + "," + total + "," + notStarted + "," + approved + "," + pendingApproval + "," + rejected + "," + pastDueDate + "," + lateReported + "," + lateExecuted + "," + lateApproved + "," + scheduled + "," + notComplied + "," + partiallyComplied + "," + complied+ "," + compliedWithGaps+ "," + reportedNonCompliance;
5165
5186
 
5166
5187
  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>';
5167
5188
  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>'
@@ -5169,8 +5190,8 @@ export class SfIEvents extends LitElement {
5169
5190
  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>';
5170
5191
  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>'
5171
5192
 
5172
- 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>';
5173
- 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>'
5193
+ 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>';
5194
+ 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>'
5174
5195
 
5175
5196
  return html;
5176
5197
 
@@ -5515,6 +5536,7 @@ export class SfIEvents extends LitElement {
5515
5536
  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 />';
5516
5537
  html += '<label part="input-label">Completion Percentage*</label>';
5517
5538
  html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1"/><br />';
5539
+ 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 />'
5518
5540
  // if(docsOptional.length === 0) {
5519
5541
  html += '<label part="input-label">Supporting Documents' + ((docsOptional.length > 0) ? '' : '*') + '</label>';
5520
5542
 
@@ -5562,6 +5584,7 @@ export class SfIEvents extends LitElement {
5562
5584
  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 />';
5563
5585
  html += '<label part="input-label">Percentage</label>';
5564
5586
  html += '<input id="input-reporter-percentage" part="input" type="number" max="100" min="0" step="1" value="' + percentage + '" disabled/><br />';
5587
+ 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 />'
5565
5588
  html += '<div>'
5566
5589
  html += '<label part="input-label">Approve?</label><br />';
5567
5590
  html += '<div class="mt-5">'
@@ -5975,11 +5998,12 @@ export class SfIEvents extends LitElement {
5975
5998
  if((listReportingContainer.querySelector('#input-reporter-percentage') as HTMLInputElement) != null){
5976
5999
  percentage = (listReportingContainer.querySelector('#input-reporter-percentage') as HTMLInputElement).value
5977
6000
  }
5978
- if(docs.length == 0 && event.docsOptional != null && event.docsOptional.length === 0) {
6001
+ console.log('percentage', percentage, (listReportingContainer.querySelector('#input-reporter-percentage') as HTMLInputElement).value);
6002
+ if(Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
5979
6003
 
5980
6004
  //console.log('reporter comments 3', reportercomments);
5981
6005
  buttonClick.innerHTML = "Save"
5982
- this.setError('No documents uploaded!');
6006
+ this.setError('Invalid Percentage!');
5983
6007
  setTimeout(() => {
5984
6008
  this.clearMessages();
5985
6009
  }, 3000);
@@ -11740,7 +11764,8 @@ export class SfIEvents extends LitElement {
11740
11764
  var dataScheduled = (divContainer.querySelector('#graph-scheduled') as HTMLSpanElement).innerHTML;
11741
11765
  var dataPartiallyComplied = (divContainer.querySelector('#graph-partially-complied') as HTMLSpanElement).innerHTML;
11742
11766
  var dataComplied = (divContainer.querySelector('#graph-complied') as HTMLSpanElement).innerHTML;
11743
- var dataCompliedWithException = (divContainer.querySelector('#graph-complied-with-exception') as HTMLSpanElement).innerHTML;
11767
+ var dataCompliedWithGaps = (divContainer.querySelector('#graph-complied-with-gaps') as HTMLSpanElement).innerHTML;
11768
+ var dataReportedNonComplaince = (divContainer.querySelector('#graph-reported-non-compliance') as HTMLSpanElement).innerHTML;
11744
11769
 
11745
11770
  const ctx = divContainer.querySelector('#myChart') as ChartItem;
11746
11771
  this.showGraph(divContainer, 1);
@@ -11749,23 +11774,24 @@ export class SfIEvents extends LitElement {
11749
11774
  this.clearGraph(divContainer, 4);
11750
11775
 
11751
11776
  const data = {
11752
- labels: ['Scheduled', 'Not Complied', 'Partially Complied', 'Complied', 'Complied With Exception'],
11777
+ labels: ['Scheduled', 'Not Complied', 'Partially Complied', 'Complied', 'Complied With Gaps','Reported Non Compliance'],
11753
11778
  datasets: [{
11754
11779
  label: 'Compliances',
11755
- data: [dataScheduled, dataNotComplied, dataPartiallyComplied, dataComplied, dataCompliedWithException],
11780
+ data: [dataScheduled, dataNotComplied, dataPartiallyComplied, dataComplied, dataCompliedWithGaps, dataReportedNonComplaince],
11756
11781
  borderWidth: 1,
11757
11782
  backgroundColor: [
11758
11783
  this.COLOR_SCHEDULED,
11759
11784
  this.COLOR_NOT_COMPLIED,
11760
11785
  this.COLOR_PARTIALLY_COMPLIED,
11761
11786
  this.COLOR_COMPLIED,
11762
- this.COLOR_COMPLIED_WITH_EXCEPTION
11787
+ this.COLOR_COMPLIED_WITH_GAPS,
11788
+ this.COLOR_REPORTED_NON_COMPLIANCE
11763
11789
  ]
11764
11790
  }]
11765
11791
  }
11766
11792
 
11767
- this.csvGraphStats += 'Compliance,Scheduled,Not Complied,Partially Complied,Complied,Complied With Exception,Total\n';
11768
- this.csvGraphStats += 'Count,'+parseInt(dataScheduled)+','+parseInt(dataNotComplied)+','+parseInt(dataPartiallyComplied)+','+parseInt(dataComplied)+','+parseInt(dataCompliedWithException)+','+parseInt(dataTotal)+'\n';
11793
+ this.csvGraphStats += 'Compliance,Scheduled,Not Complied,Partially Complied,Complied,Complied With Gaps,Reported Non Compliance,Total\n';
11794
+ this.csvGraphStats += 'Count,'+parseInt(dataScheduled)+','+parseInt(dataNotComplied)+','+parseInt(dataPartiallyComplied)+','+parseInt(dataComplied)+','+parseInt(dataCompliedWithGaps)+','+parseInt(dataReportedNonComplaince)+','+parseInt(dataTotal)+'\n';
11769
11795
 
11770
11796
  //console.log('rendering timeliness graph', this.csvGraphStats);
11771
11797
 
@@ -12032,6 +12058,8 @@ export class SfIEvents extends LitElement {
12032
12058
  dataBar2['datasets'].push({});
12033
12059
  dataBar2['datasets'].push({});
12034
12060
  dataBar2['datasets'].push({});
12061
+ dataBar2['datasets'].push({});
12062
+ dataBar2['datasets'].push({});
12035
12063
 
12036
12064
  dataBar2['datasets'][0]['label'] = 'Scheduled';
12037
12065
  dataBar2['datasets'][0]['data'] = [];
@@ -12061,12 +12089,19 @@ export class SfIEvents extends LitElement {
12061
12089
  }
12062
12090
  dataBar2['datasets'][3]['backgroundColor'] = this.COLOR_COMPLIED;
12063
12091
 
12064
- dataBar2['datasets'][3]['label'] = 'Complied With Exception';
12065
- dataBar2['datasets'][3]['data'] = [];
12092
+ dataBar2['datasets'][4]['label'] = 'Complied With Gaps';
12093
+ dataBar2['datasets'][4]['data'] = [];
12066
12094
  for(i = 0; i < Object.keys(complianceData).length; i++) {
12067
- dataBar2['datasets'][3]['data'].push(complianceData[Object.keys(complianceData)[i]]['complied-with-exception']);
12095
+ dataBar2['datasets'][4]['data'].push(complianceData[Object.keys(complianceData)[i]]['complied-with-gaps']);
12068
12096
  }
12069
- dataBar2['datasets'][3]['backgroundColor'] = this.COLOR_COMPLIED_WITH_EXCEPTION;
12097
+ dataBar2['datasets'][4]['backgroundColor'] = this.COLOR_COMPLIED_WITH_GAPS;
12098
+
12099
+ dataBar2['datasets'][5]['label'] = 'Reported Non Compliance';
12100
+ dataBar2['datasets'][5]['data'] = [];
12101
+ for(i = 0; i < Object.keys(complianceData).length; i++) {
12102
+ dataBar2['datasets'][5]['data'].push(complianceData[Object.keys(complianceData)[i]]['reported-non-compliance']);
12103
+ }
12104
+ dataBar2['datasets'][5]['backgroundColor'] = this.COLOR_REPORTED_NON_COMPLIANCE;
12070
12105
 
12071
12106
  return dataBar2;
12072
12107
 
@@ -12160,7 +12195,7 @@ export class SfIEvents extends LitElement {
12160
12195
 
12161
12196
  const dataBar3:any = this.populateGraphDataBarCompliance(complianceData);
12162
12197
 
12163
- //console.log('rendering compliance matrix', dataBar3);
12198
+ console.log('rendering compliance matrix', dataBar3);
12164
12199
 
12165
12200
  const ctx4 = divContainer.querySelector('#myChart4') as ChartItem;
12166
12201
  this.showGraph(divContainer, 4);
@@ -12854,210 +12889,219 @@ export class SfIEvents extends LitElement {
12854
12889
  if(((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement) != null){
12855
12890
  percentage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement).value
12856
12891
  }
12857
-
12858
- if(docs.length === 0 && docsOptional.length === 0) {
12892
+ if(Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
12859
12893
 
12860
12894
  //console.log('reporter comments 3', reportercomments);
12861
12895
  buttonClick.innerHTML = "Save"
12862
- this.setError('No documents uploaded!');
12896
+ this.setError('Invalid Percentage!');
12863
12897
  setTimeout(() => {
12864
12898
  this.clearMessages();
12865
12899
  }, 3000);
12866
12900
 
12867
12901
  } else {
12902
+ if(docs.length === 0 && docsOptional.length === 0) {
12868
12903
 
12869
- //console.log('reporterdoc', reporterdoc);
12870
-
12871
- if(reporterdoc.length === 0) {
12904
+ //console.log('reporter comments 3', reportercomments);
12872
12905
  buttonClick.innerHTML = "Save"
12873
- this.setError('Date of completion not selected!');
12906
+ this.setError('No documents uploaded!');
12874
12907
  setTimeout(() => {
12875
12908
  this.clearMessages();
12876
12909
  }, 3000);
12877
12910
 
12878
12911
  } else {
12879
12912
 
12880
- //console.log('makerscheckers 1', reportercomments);
12913
+ //console.log('reporterdoc', reporterdoc);
12881
12914
 
12882
- if(reportercomments.trim().length === 0) {
12915
+ if(reporterdoc.length === 0) {
12883
12916
  buttonClick.innerHTML = "Save"
12884
- this.setError('Comments cannot be blank!');
12917
+ this.setError('Date of completion not selected!');
12885
12918
  setTimeout(() => {
12886
12919
  this.clearMessages();
12887
12920
  }, 3000);
12888
12921
 
12889
12922
  } else {
12890
12923
 
12924
+ //console.log('makerscheckers 1', reportercomments);
12891
12925
 
12892
- var clickEvent = new MouseEvent("click", {
12893
- "view": window,
12894
- "bubbles": true,
12895
- "cancelable": false
12896
- });
12926
+ if(reportercomments.trim().length === 0) {
12927
+ buttonClick.innerHTML = "Save"
12928
+ this.setError('Comments cannot be blank!');
12929
+ setTimeout(() => {
12930
+ this.clearMessages();
12931
+ }, 3000);
12897
12932
 
12898
- ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
12899
- let flagBulk = false;
12900
- if(this.selectedItemIds.length === 0) {
12933
+ } else {
12901
12934
 
12902
- await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, "notices", percentage)
12903
- console.log('this.events', this.events);
12904
- for( var p = 0 ; p < this.events[mmdd].length; p ++){
12905
- if(this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
12906
- this.events[mmdd][p].documents = docs
12907
- this.events[mmdd][p].comments.push({'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString()})
12908
- this.events[mmdd][p].lastupdated = new Date().toString()
12909
- }
12910
- }
12911
- console.log('uploadReport single')
12912
- if(makercheckers.length > 0) {
12913
12935
 
12914
- await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
12936
+ var clickEvent = new MouseEvent("click", {
12937
+ "view": window,
12938
+ "bubbles": true,
12939
+ "cancelable": false
12940
+ });
12941
+
12942
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
12943
+ let flagBulk = false;
12944
+ if(this.selectedItemIds.length === 0) {
12945
+
12946
+ await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, "notices", percentage)
12947
+ console.log('this.events', this.events);
12915
12948
  for( var p = 0 ; p < this.events[mmdd].length; p ++){
12916
12949
  if(this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
12917
- this.events[mmdd][p].approved = true
12918
- // this.events[mmdd][p].documents = docs
12919
- this.events[mmdd][p].comments.push({'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString()})
12950
+ this.events[mmdd][p].documents = docs
12951
+ this.events[mmdd][p].comments.push({'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString()})
12920
12952
  this.events[mmdd][p].lastupdated = new Date().toString()
12921
12953
  }
12922
12954
  }
12923
- console.log('upload report auto approve single')
12924
- }
12925
- if(this.recentlyReported[mmdd] == null){
12926
- this.recentlyReported[mmdd] = []
12927
- }
12928
- this.recentlyReported[mmdd].push(event)
12955
+ console.log('uploadReport single')
12956
+ if(makercheckers.length > 0) {
12929
12957
 
12930
- } else {
12931
- let bulkBody = []
12932
- let bulkBodyReview = []
12933
- for(var k = 0; k < this.selectedItemIds.length; k++) {
12934
-
12935
- const selectedId = this.selectedItemIds[k];
12936
- //console.log('selectedid', selectedId);
12958
+ await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
12959
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
12960
+ if(this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
12961
+ this.events[mmdd][p].approved = true
12962
+ // this.events[mmdd][p].documents = docs
12963
+ this.events[mmdd][p].comments.push({'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString()})
12964
+ this.events[mmdd][p].lastupdated = new Date().toString()
12965
+ }
12966
+ }
12967
+ console.log('upload report auto approve single')
12968
+ }
12969
+ if(this.recentlyReported[mmdd] == null){
12970
+ this.recentlyReported[mmdd] = []
12971
+ }
12972
+ this.recentlyReported[mmdd].push(event)
12937
12973
 
12938
- const makercheckersL = selectedId.split('-')[5];
12939
- entityId = selectedId.split('-')[7].replace(/_/g, '-');
12940
- locationId = selectedId.split('-')[8].replace(/_/g, '-');
12941
- const eventId = selectedId.split('-')[9].replace(/_/g, '-');
12942
- mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
12974
+ } else {
12975
+ let bulkBody = []
12976
+ let bulkBodyReview = []
12977
+ for(var k = 0; k < this.selectedItemIds.length; k++) {
12978
+
12979
+ const selectedId = this.selectedItemIds[k];
12980
+ //console.log('selectedid', selectedId);
12943
12981
 
12944
- //console.log(entityId, locationId, eventId, mmddyyyy);
12945
-
12946
- // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
12947
- if(parseInt(makercheckersL) > 0) {
12948
- bulkBodyReview.push({
12949
- "mmddyyyy": mmddyyyy,
12950
- "projectid": this.projectId,
12951
- "type": "report",
12952
- "eventid": eventId,
12953
- "comments": reportercomments,
12954
- "dateofcompletion": reporterdoc,
12955
- "percentage": percentage,
12956
- "entityid": entityId,
12957
- "locationid": locationId,
12958
- "event": null,
12959
- "docs": JSON.stringify(docs),
12960
- "approved": true,
12961
- "username": this.userName,
12962
- "reportformatvalues": reportformatvalues,
12963
- "reportformatschema": reportformatschema,
12964
- "userid": this.userProfileId,
12965
- "userrole": this.myRole,
12966
- "year": this.calendarStartYYYY,
12967
- "module": listEvent.isnotice != null ? "notices" : "events"
12968
- } )
12969
- // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
12970
-
12971
- }else{
12972
- bulkBody.push({
12973
- "mmddyyyy": mmddyyyy,
12974
- "projectid": this.projectId,
12975
- "type": "report",
12976
- "eventid": eventId,
12977
- "comments": reportercomments,
12978
- "dateofcompletion": reporterdoc,
12979
- "percentage": percentage,
12980
- "entityid": entityId,
12981
- "locationid": locationId,
12982
- "event": null,
12983
- "docs": JSON.stringify(docs),
12984
- "username": this.userName,
12985
- "reportformatvalues": reportformatvalues,
12986
- "reportformatschema": reportformatschema,
12987
- "userid": this.userProfileId,
12988
- "userrole": this.myRole,
12989
- "year": this.calendarStartYYYY,
12990
- "module": listEvent.isnotice != null ? "notices" : "events"
12991
- })
12992
- }
12982
+ const makercheckersL = selectedId.split('-')[5];
12983
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
12984
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
12985
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
12986
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
12987
+
12988
+ //console.log(entityId, locationId, eventId, mmddyyyy);
12989
+
12990
+ // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
12991
+ if(parseInt(makercheckersL) > 0) {
12992
+ bulkBodyReview.push({
12993
+ "mmddyyyy": mmddyyyy,
12994
+ "projectid": this.projectId,
12995
+ "type": "report",
12996
+ "eventid": eventId,
12997
+ "comments": reportercomments,
12998
+ "dateofcompletion": reporterdoc,
12999
+ "percentage": percentage,
13000
+ "entityid": entityId,
13001
+ "locationid": locationId,
13002
+ "event": null,
13003
+ "docs": JSON.stringify(docs),
13004
+ "approved": true,
13005
+ "username": this.userName,
13006
+ "reportformatvalues": reportformatvalues,
13007
+ "reportformatschema": reportformatschema,
13008
+ "userid": this.userProfileId,
13009
+ "userrole": this.myRole,
13010
+ "year": this.calendarStartYYYY,
13011
+ "module": listEvent.isnotice != null ? "notices" : "events"
13012
+ } )
13013
+ // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
13014
+
13015
+ }else{
13016
+ bulkBody.push({
13017
+ "mmddyyyy": mmddyyyy,
13018
+ "projectid": this.projectId,
13019
+ "type": "report",
13020
+ "eventid": eventId,
13021
+ "comments": reportercomments,
13022
+ "dateofcompletion": reporterdoc,
13023
+ "percentage": percentage,
13024
+ "entityid": entityId,
13025
+ "locationid": locationId,
13026
+ "event": null,
13027
+ "docs": JSON.stringify(docs),
13028
+ "username": this.userName,
13029
+ "reportformatvalues": reportformatvalues,
13030
+ "reportformatschema": reportformatschema,
13031
+ "userid": this.userProfileId,
13032
+ "userrole": this.myRole,
13033
+ "year": this.calendarStartYYYY,
13034
+ "module": listEvent.isnotice != null ? "notices" : "events"
13035
+ })
13036
+ }
12993
13037
 
12994
- // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
12995
- // await this.sleep(2000);
12996
- // this.clearMessages();
13038
+ // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
13039
+ // await this.sleep(2000);
13040
+ // this.clearMessages();
12997
13041
 
12998
- }
13042
+ }
12999
13043
 
13000
- // await this.uploadReportsBulk(bulkBody);
13001
- // await this.fetchBulkReportingData();
13002
- if(bulkBody.length > 0){
13003
- await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
13004
- }
13005
-
13006
- if(bulkBodyReview.length > 0){
13007
- await this.uploadReportsReviewsBulk(bulkBodyReview)
13008
- }
13009
- await this.fetchBulkReportingData();
13010
- console.log('uploadReport bulk')
13011
- for(var k = 0; k < this.selectedItemIds.length; k++) {
13012
-
13013
- const selectedId = this.selectedItemIds[k];
13014
- //console.log('selectedid', selectedId);
13015
- let entityId = selectedId.split('-')[7].replace(/_/g, '-');
13016
- let locationId = selectedId.split('-')[8].replace(/_/g, '-');
13017
- const eventId = selectedId.split('-')[9].replace(/_/g, '-');
13018
- mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
13019
- let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
13020
- for( var p = 0 ; p < this.events[mmdd].length; p ++){
13021
- if(this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
13022
-
13023
- this.events[mmdd][p].isbulk = true
13024
- flagBulk = true;
13025
- if(this.recentlyReported[mmdd] == null){
13026
- this.recentlyReported[mmdd] = []
13044
+ // await this.uploadReportsBulk(bulkBody);
13045
+ // await this.fetchBulkReportingData();
13046
+ if(bulkBody.length > 0){
13047
+ await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
13048
+ }
13049
+
13050
+ if(bulkBodyReview.length > 0){
13051
+ await this.uploadReportsReviewsBulk(bulkBodyReview)
13052
+ }
13053
+ await this.fetchBulkReportingData();
13054
+ console.log('uploadReport bulk')
13055
+ for(var k = 0; k < this.selectedItemIds.length; k++) {
13056
+
13057
+ const selectedId = this.selectedItemIds[k];
13058
+ //console.log('selectedid', selectedId);
13059
+ let entityId = selectedId.split('-')[7].replace(/_/g, '-');
13060
+ let locationId = selectedId.split('-')[8].replace(/_/g, '-');
13061
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
13062
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
13063
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
13064
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
13065
+ if(this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
13066
+
13067
+ this.events[mmdd][p].isbulk = true
13068
+ flagBulk = true;
13069
+ if(this.recentlyReported[mmdd] == null){
13070
+ this.recentlyReported[mmdd] = []
13071
+ }
13072
+ this.recentlyReported[mmdd].push(this.events[mmdd][p])
13027
13073
  }
13028
- this.recentlyReported[mmdd].push(this.events[mmdd][p])
13029
13074
  }
13030
13075
  }
13031
- }
13032
13076
 
13033
- }
13077
+ }
13034
13078
 
13035
- if(this.mode == "next"){
13036
- this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
13037
- }else{
13038
- // if(this.getCurrentTab() == this.TAB_CUSTOM) {
13039
- // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
13040
- // } else
13041
- if(this.getCurrentTab() == this.TAB_FIND) {
13042
- const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
13043
- this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
13044
- } else {
13045
- if(this.selectedItemIds.length > 0) {
13046
- await this.fetchBulkReportingData();
13079
+ if(this.mode == "next"){
13080
+ this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
13081
+ }else{
13082
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
13083
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
13084
+ // } else
13085
+ if(this.getCurrentTab() == this.TAB_FIND) {
13086
+ const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
13087
+ this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
13088
+ } else {
13089
+ if(this.selectedItemIds.length > 0) {
13090
+ await this.fetchBulkReportingData();
13091
+ }
13092
+ this.renderAppropriateStream(this.sdate,this.edate,true, flagBulk)
13093
+ // if(currentColumnButton != null) {
13094
+ // currentColumnButton.click();
13095
+ // }
13047
13096
  }
13048
- this.renderAppropriateStream(this.sdate,this.edate,true, flagBulk)
13049
- // if(currentColumnButton != null) {
13050
- // currentColumnButton.click();
13051
- // }
13052
13097
  }
13098
+
13053
13099
  }
13100
+
13054
13101
 
13055
13102
  }
13056
-
13057
-
13058
13103
  }
13059
13104
  }
13060
-
13061
13105
  });
13062
13106
 
13063
13107
  }
@@ -14162,224 +14206,234 @@ export class SfIEvents extends LitElement {
14162
14206
  if(((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement) != null){
14163
14207
  percentage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement).value
14164
14208
  }
14165
- if(docs.length === 0 && docsOptional.length === 0) {
14209
+ if(Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
14166
14210
 
14167
14211
  //console.log('reporter comments 3', reportercomments);
14168
14212
  buttonClick.innerHTML = "Save"
14169
- this.setError('No documents uploaded!');
14213
+ this.setError('Invalid Percentage!');
14170
14214
  setTimeout(() => {
14171
14215
  this.clearMessages();
14172
14216
  }, 3000);
14173
14217
 
14174
14218
  } else {
14219
+ if(docs.length === 0 && docsOptional.length === 0) {
14175
14220
 
14176
- //console.log('reporterdoc', reporterdoc);
14177
-
14178
- if(reporterdoc.length === 0) {
14221
+ //console.log('reporter comments 3', reportercomments);
14179
14222
  buttonClick.innerHTML = "Save"
14180
- this.setError('Date of completion not selected!');
14223
+ this.setError('No documents uploaded!');
14181
14224
  setTimeout(() => {
14182
14225
  this.clearMessages();
14183
14226
  }, 3000);
14184
14227
 
14185
14228
  } else {
14186
14229
 
14187
- //console.log('makerscheckers 1', reportercomments);
14230
+ //console.log('reporterdoc', reporterdoc);
14188
14231
 
14189
- if(reportercomments.trim().length === 0) {
14232
+ if(reporterdoc.length === 0) {
14190
14233
  buttonClick.innerHTML = "Save"
14191
- this.setError('Comments cannot be blank!');
14234
+ this.setError('Date of completion not selected!');
14192
14235
  setTimeout(() => {
14193
14236
  this.clearMessages();
14194
14237
  }, 3000);
14195
14238
 
14196
14239
  } else {
14197
14240
 
14241
+ //console.log('makerscheckers 1', reportercomments);
14198
14242
 
14199
- var clickEvent = new MouseEvent("click", {
14200
- "view": window,
14201
- "bubbles": true,
14202
- "cancelable": false
14203
- });
14204
-
14205
- ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
14206
- let flagBulk = false;
14207
- if(this.selectedItemIds.length === 0) {
14208
-
14209
- //console.log('makerscheckers', makercheckers, reportercomments);
14210
- // console.log('reportformatvalues', reportformatvalues)
14211
- // console.log('reportformatschema',reportformatschema)
14212
- await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage)
14213
- console.log('this.events', this.events);
14214
- for( var p = 0 ; p < this.events[mmdd].length; p ++){
14215
- if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
14216
- this.events[mmdd][p].documents = docs
14217
- this.events[mmdd][p].comments.push({'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString()})
14218
- this.events[mmdd][p].lastupdated = new Date().toString()
14219
- }
14220
- }
14221
- if(makercheckers.length > 0) {
14243
+ if(reportercomments.trim().length === 0) {
14244
+ buttonClick.innerHTML = "Save"
14245
+ this.setError('Comments cannot be blank!');
14246
+ setTimeout(() => {
14247
+ this.clearMessages();
14248
+ }, 3000);
14249
+
14250
+ } else {
14222
14251
 
14223
- await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
14252
+
14253
+ var clickEvent = new MouseEvent("click", {
14254
+ "view": window,
14255
+ "bubbles": true,
14256
+ "cancelable": false
14257
+ });
14258
+
14259
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
14260
+ let flagBulk = false;
14261
+ if(this.selectedItemIds.length === 0) {
14262
+
14263
+ //console.log('makerscheckers', makercheckers, reportercomments);
14264
+ // console.log('reportformatvalues', reportformatvalues)
14265
+ // console.log('reportformatschema',reportformatschema)
14266
+ await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage)
14267
+ console.log('this.events', this.events);
14224
14268
  for( var p = 0 ; p < this.events[mmdd].length; p ++){
14225
14269
  if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
14226
- this.events[mmdd][p].approved = true
14227
- // this.events[mmdd][p].documents = docs
14228
- this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString()})
14270
+ this.events[mmdd][p].documents = docs
14271
+ this.events[mmdd][p].comments.push({'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString()})
14229
14272
  this.events[mmdd][p].lastupdated = new Date().toString()
14230
14273
  }
14231
14274
  }
14232
- }
14233
- if(this.recentlyReported[mmdd] == null){
14234
- this.recentlyReported[mmdd] = []
14235
- }
14236
- this.recentlyReported[mmdd].push(event)
14275
+ if(makercheckers.length > 0) {
14237
14276
 
14238
- } else {
14239
- let bulkBody = []
14240
- let bulkBodyReview = []
14241
- for(var k = 0; k < this.selectedItemIds.length; k++) {
14242
-
14243
- const selectedId = this.selectedItemIds[k];
14244
- //console.log('selectedid', selectedId);
14245
-
14246
- const makercheckersL = selectedId.split('-')[5];
14247
- entityId = selectedId.split('-')[7].replace(/_/g, '-');
14248
- locationId = selectedId.split('-')[8].replace(/_/g, '-');
14249
- const eventId = selectedId.split('-')[9].replace(/_/g, '-');
14250
- mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
14251
-
14252
- //console.log(entityId, locationId, eventId, mmddyyyy);
14253
- // bulkBody.push({
14254
- // "mmddyyyy": mmddyyyy,
14255
- // "projectid": this.projectId,
14256
- // "type": "report",
14257
- // "eventid": eventId,
14258
- // "comments": reportercomments,
14259
- // "dateofcompletion": reporterdoc,
14260
- // "entityid": entityId,
14261
- // "locationid": locationId,
14262
- // "event": null,
14263
- // "docs": JSON.stringify(docs),
14264
- // "username": this.userName,
14265
- // "reportformatvalues": reportformatvalues,
14266
- // "reportformatschema": reportformatschema,
14267
- // "userid": this.userProfileId,
14268
- // "userrole": this.myRole,
14269
- // "year": this.calendarStartYYYY,
14270
- // "module": event.isnotice != null ? "notices" : "events"
14271
- // })
14272
- // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
14273
- if(parseInt(makercheckersL) > 0) {
14274
- bulkBodyReview.push({
14275
- "mmddyyyy": mmddyyyy,
14276
- "projectid": this.projectId,
14277
- "type": "report",
14278
- "eventid": eventId,
14279
- "comments": reportercomments,
14280
- "dateofcompletion": reporterdoc,
14281
- "percentage": percentage,
14282
- "entityid": entityId,
14283
- "locationid": locationId,
14284
- "event": null,
14285
- "docs": JSON.stringify(docs),
14286
- "approved": true,
14287
- "username": this.userName,
14288
- "reportformatvalues": reportformatvalues,
14289
- "reportformatschema": reportformatschema,
14290
- "userid": this.userProfileId,
14291
- "userrole": this.myRole,
14292
- "year": this.calendarStartYYYY,
14293
- "module": event.isnotice != null ? "notices" : "events"
14294
- } )
14295
- // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
14296
-
14297
- }else{
14298
- bulkBody.push({
14299
- "mmddyyyy": mmddyyyy,
14300
- "projectid": this.projectId,
14301
- "type": "report",
14302
- "eventid": eventId,
14303
- "comments": reportercomments,
14304
- "dateofcompletion": reporterdoc,
14305
- "percentage": percentage,
14306
- "entityid": entityId,
14307
- "locationid": locationId,
14308
- "event": null,
14309
- "docs": JSON.stringify(docs),
14310
- "username": this.userName,
14311
- "reportformatvalues": reportformatvalues,
14312
- "reportformatschema": reportformatschema,
14313
- "userid": this.userProfileId,
14314
- "userrole": this.myRole,
14315
- "year": this.calendarStartYYYY,
14316
- "module": event.isnotice != null ? "notices" : "events"
14317
- })
14277
+ await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
14278
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
14279
+ if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
14280
+ this.events[mmdd][p].approved = true
14281
+ // this.events[mmdd][p].documents = docs
14282
+ this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString()})
14283
+ this.events[mmdd][p].lastupdated = new Date().toString()
14284
+ }
14285
+ }
14286
+ }
14287
+ if(this.recentlyReported[mmdd] == null){
14288
+ this.recentlyReported[mmdd] = []
14318
14289
  }
14290
+ this.recentlyReported[mmdd].push(event)
14319
14291
 
14320
- // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
14321
- // await this.sleep(2000);
14322
- // this.clearMessages();
14292
+ } else {
14293
+ let bulkBody = []
14294
+ let bulkBodyReview = []
14295
+ for(var k = 0; k < this.selectedItemIds.length; k++) {
14296
+
14297
+ const selectedId = this.selectedItemIds[k];
14298
+ //console.log('selectedid', selectedId);
14323
14299
 
14324
- }
14300
+ const makercheckersL = selectedId.split('-')[5];
14301
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
14302
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
14303
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
14304
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
14325
14305
 
14326
- if(bulkBody.length > 0){
14327
- await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
14328
- }
14329
- // await this.fetchBulkReportingData();
14330
- if(bulkBodyReview.length > 0){
14331
- await this.uploadReportsReviewsBulk(bulkBodyReview)
14332
- }
14333
- for(var k = 0; k < this.selectedItemIds.length; k++) {
14334
-
14335
- const selectedId = this.selectedItemIds[k];
14336
- //console.log('selectedid', selectedId);
14337
- entityId = selectedId.split('-')[7].replace(/_/g, '-');
14338
- locationId = selectedId.split('-')[8].replace(/_/g, '-');
14339
- const eventId = selectedId.split('-')[9].replace(/_/g, '-');
14340
- mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
14341
- let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
14342
- for( var p = 0 ; p < this.events[mmdd].length; p ++){
14343
- if(this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
14344
-
14345
- this.events[mmdd][p].isbulk = true
14346
- flagBulk = true;
14347
- if(this.recentlyReported[mmdd] == null){
14348
- this.recentlyReported[mmdd] = []
14306
+ //console.log(entityId, locationId, eventId, mmddyyyy);
14307
+ // bulkBody.push({
14308
+ // "mmddyyyy": mmddyyyy,
14309
+ // "projectid": this.projectId,
14310
+ // "type": "report",
14311
+ // "eventid": eventId,
14312
+ // "comments": reportercomments,
14313
+ // "dateofcompletion": reporterdoc,
14314
+ // "entityid": entityId,
14315
+ // "locationid": locationId,
14316
+ // "event": null,
14317
+ // "docs": JSON.stringify(docs),
14318
+ // "username": this.userName,
14319
+ // "reportformatvalues": reportformatvalues,
14320
+ // "reportformatschema": reportformatschema,
14321
+ // "userid": this.userProfileId,
14322
+ // "userrole": this.myRole,
14323
+ // "year": this.calendarStartYYYY,
14324
+ // "module": event.isnotice != null ? "notices" : "events"
14325
+ // })
14326
+ // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
14327
+ if(parseInt(makercheckersL) > 0) {
14328
+ bulkBodyReview.push({
14329
+ "mmddyyyy": mmddyyyy,
14330
+ "projectid": this.projectId,
14331
+ "type": "report",
14332
+ "eventid": eventId,
14333
+ "comments": reportercomments,
14334
+ "dateofcompletion": reporterdoc,
14335
+ "percentage": percentage,
14336
+ "entityid": entityId,
14337
+ "locationid": locationId,
14338
+ "event": null,
14339
+ "docs": JSON.stringify(docs),
14340
+ "approved": true,
14341
+ "username": this.userName,
14342
+ "reportformatvalues": reportformatvalues,
14343
+ "reportformatschema": reportformatschema,
14344
+ "userid": this.userProfileId,
14345
+ "userrole": this.myRole,
14346
+ "year": this.calendarStartYYYY,
14347
+ "module": event.isnotice != null ? "notices" : "events"
14348
+ } )
14349
+ // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
14350
+
14351
+ }else{
14352
+ bulkBody.push({
14353
+ "mmddyyyy": mmddyyyy,
14354
+ "projectid": this.projectId,
14355
+ "type": "report",
14356
+ "eventid": eventId,
14357
+ "comments": reportercomments,
14358
+ "dateofcompletion": reporterdoc,
14359
+ "percentage": percentage,
14360
+ "entityid": entityId,
14361
+ "locationid": locationId,
14362
+ "event": null,
14363
+ "docs": JSON.stringify(docs),
14364
+ "username": this.userName,
14365
+ "reportformatvalues": reportformatvalues,
14366
+ "reportformatschema": reportformatschema,
14367
+ "userid": this.userProfileId,
14368
+ "userrole": this.myRole,
14369
+ "year": this.calendarStartYYYY,
14370
+ "module": event.isnotice != null ? "notices" : "events"
14371
+ })
14372
+ }
14373
+
14374
+ // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
14375
+ // await this.sleep(2000);
14376
+ // this.clearMessages();
14377
+
14378
+ }
14379
+
14380
+ if(bulkBody.length > 0){
14381
+ await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
14382
+ }
14383
+ // await this.fetchBulkReportingData();
14384
+ if(bulkBodyReview.length > 0){
14385
+ await this.uploadReportsReviewsBulk(bulkBodyReview)
14386
+ }
14387
+ for(var k = 0; k < this.selectedItemIds.length; k++) {
14388
+
14389
+ const selectedId = this.selectedItemIds[k];
14390
+ //console.log('selectedid', selectedId);
14391
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
14392
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
14393
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
14394
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
14395
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
14396
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
14397
+ if(this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
14398
+
14399
+ this.events[mmdd][p].isbulk = true
14400
+ flagBulk = true;
14401
+ if(this.recentlyReported[mmdd] == null){
14402
+ this.recentlyReported[mmdd] = []
14403
+ }
14404
+ this.recentlyReported[mmdd].push(this.events[mmdd][p])
14349
14405
  }
14350
- this.recentlyReported[mmdd].push(this.events[mmdd][p])
14351
14406
  }
14352
14407
  }
14353
- }
14354
14408
 
14355
- }
14409
+ }
14356
14410
 
14357
- if(this.mode == "next"){
14358
- this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
14359
- }else{
14360
- // if(this.getCurrentTab() == this.TAB_CUSTOM) {
14361
- // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
14362
- // } else
14363
- if(this.getCurrentTab() == this.TAB_FIND) {
14364
- const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
14365
- this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
14366
- } else {
14367
- if(this.selectedItemIds.length > 0) {
14368
- await this.fetchBulkReportingData();
14411
+ if(this.mode == "next"){
14412
+ this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
14413
+ }else{
14414
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
14415
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
14416
+ // } else
14417
+ if(this.getCurrentTab() == this.TAB_FIND) {
14418
+ const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
14419
+ this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
14420
+ } else {
14421
+ if(this.selectedItemIds.length > 0) {
14422
+ await this.fetchBulkReportingData();
14423
+ }
14424
+ this.renderAppropriateStream(this.sdate,this.edate,true, flagBulk)
14425
+ // if(currentColumnButton != null) {
14426
+ // currentColumnButton.click();
14427
+ // }
14369
14428
  }
14370
- this.renderAppropriateStream(this.sdate,this.edate,true, flagBulk)
14371
- // if(currentColumnButton != null) {
14372
- // currentColumnButton.click();
14373
- // }
14374
14429
  }
14430
+
14375
14431
  }
14432
+
14376
14433
 
14377
14434
  }
14378
-
14379
-
14380
14435
  }
14381
14436
  }
14382
-
14383
14437
  });
14384
14438
 
14385
14439
  }
@@ -19428,9 +19482,12 @@ export class SfIEvents extends LitElement {
19428
19482
  .color-complied {
19429
19483
  color: #50cf01;
19430
19484
  }
19431
- .color-complied-with-exception {
19485
+ .color-complied-with-gaps {
19432
19486
  color: #ffe505;
19433
19487
  }
19488
+ .color-reported-non-compliance {
19489
+ color: #840B0F;
19490
+ }
19434
19491
  .color-scheduled {
19435
19492
  color: #888888;
19436
19493
  }
@@ -20875,7 +20932,7 @@ export class SfIEvents extends LitElement {
20875
20932
  }, 10000);
20876
20933
  }
20877
20934
 
20878
-
20935
+
20879
20936
  for(var i = 0; i < divs.length; i++) {
20880
20937
 
20881
20938
  // console.log('processGraphFilter', graphparamnames1[i], (graphparamnames1[i] as HTMLDivElement).innerHTML.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '), this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '));
@@ -20885,6 +20942,9 @@ export class SfIEvents extends LitElement {
20885
20942
  let graphparamname1Arr = (graphparamnames1[i] as HTMLDivElement).innerHTML.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ').split(' • ');
20886
20943
  let filterFound = false;
20887
20944
  for(let tempFilterStr of graphparamname1Arr){
20945
+ if(clickedValue == "reported non compliance"){
20946
+ console.log('comparing filter', tempFilterStr, this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '))
20947
+ }
20888
20948
  if(tempFilterStr == this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') || this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') == ""){
20889
20949
  filterFound = true;
20890
20950
  break;
@@ -25369,7 +25429,7 @@ export class SfIEvents extends LitElement {
25369
25429
  console.log('eventsData', eventsData)
25370
25430
  console.log('role', role)
25371
25431
  // if(Object.keys(eventsData[role]).length > 0){
25372
- 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;
25432
+ 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;
25373
25433
  var html = '';
25374
25434
  this.selectedItemIds = [];
25375
25435
  this.selectedStatus = "";
@@ -25416,7 +25476,8 @@ export class SfIEvents extends LitElement {
25416
25476
  partiallyComplied = partiallyComplied + (complianceStatus == "partially-complied" ? 1 : 0);
25417
25477
  notComplied = notComplied + (complianceStatus == "not-complied" ? 1 : 0);
25418
25478
  complied = complied + (complianceStatus == "complied" ? 1 : 0);
25419
- compliedWithException = compliedWithException + (complianceStatus == "complied-with-exception" ? 1 : 0);
25479
+ compliedWithGaps = compliedWithGaps + (complianceStatus == "complied-with-gaps" ? 1 : 0);
25480
+ reportedNonCompliance = reportedNonCompliance + (complianceStatus == "reported-non-compliance" ? 1 : 0);
25420
25481
 
25421
25482
  eventsData[role][mmdd][j][this.FLOW_GRAPH_COMPLETENESS] = partStatus;
25422
25483
  eventsData[role][mmdd][j][this.FLOW_GRAPH_TIMELINESS] = lateStatus;