sf-i-events 1.0.732 → 1.0.734

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.
@@ -477,6 +477,9 @@ export class SfIEvents extends LitElement {
477
477
  <div>Report generated for PROJECT_NAME on REPORT_DATE</div>
478
478
  </div>
479
479
  </div>
480
+ <div class="d-flex justify-between align-center">
481
+ FILTERS_DATA
482
+ </div>
480
483
  <br />
481
484
  <div class="watermark"></div>
482
485
  <div class="report">
@@ -1337,6 +1340,12 @@ export class SfIEvents extends LitElement {
1337
1340
  @property()
1338
1341
  events: any = null;
1339
1342
 
1343
+ @property()
1344
+ statistics: any = null;
1345
+
1346
+ @property()
1347
+ statisticsMeta: any = null;
1348
+
1340
1349
  @property()
1341
1350
  streamIndex: any = null;
1342
1351
 
@@ -1417,6 +1426,9 @@ export class SfIEvents extends LitElement {
1417
1426
  @property()
1418
1427
  htmlDataSummary: string = "";
1419
1428
 
1429
+ @property()
1430
+ htmlStatsFilter: string = "";
1431
+
1420
1432
  @property()
1421
1433
  period: string = "";
1422
1434
 
@@ -4201,6 +4213,26 @@ export class SfIEvents extends LitElement {
4201
4213
 
4202
4214
  return html;
4203
4215
 
4216
+ }
4217
+ renderCalendarStatisticsGraphs = (showGraph: boolean, parametersTitle: string) => {
4218
+
4219
+ //console.log('flowGraph', this.flowGraph);
4220
+
4221
+ var html = '';
4222
+
4223
+ html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
4224
+ html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="duration-title-container"><h4 part="duration-title">' + parametersTitle + '</h4><button id="button-refresh" part="button-duration-title" class="align-center d-flex justify-center"><h4 part="duration-title">' + parametersTitle + '</h4><span part="duration-title-icon" class="material-icons ml-10">refresh</span></button></div>';
4225
+ if(showGraph) {
4226
+ html += '<div class="chart-container d-flex scroll-x align-center"><div part="chart-item" class="chart-item"><canvas id="myChart"></canvas></div><div part="chart-item" class="chart-item"><canvas id="myChart4" class="gone"></canvas></div><div part="chart-item chart-item-middle" class="chart-item"><canvas id="myChart2" class="gone"></canvas></div><div part="chart-item" class="chart-item"><canvas id="myChart3" class="gone"></canvas></div></div>';
4227
+ html += '<div id="chart-settings-controls" class="mt-20"></div>'
4228
+ html += '<div id="chart-settings"></div>'
4229
+ } else {
4230
+ html += '<div part="box" class="box"></div>';
4231
+ }
4232
+ html += '</div>';
4233
+
4234
+ return html;
4235
+
4204
4236
  }
4205
4237
 
4206
4238
  renderCalendarContainerDivStart = (index: number) => {
@@ -4340,7 +4372,7 @@ export class SfIEvents extends LitElement {
4340
4372
 
4341
4373
  let lastUpdated : string = '';
4342
4374
 
4343
- console.log('lastUpdated', event.lastupdated);
4375
+ // console.log('lastUpdated', event.lastupdated);
4344
4376
  if(event.lastupdated != null && event.lastupdated.length > 0) {
4345
4377
  lastUpdated = event.lastupdated;
4346
4378
 
@@ -4438,7 +4470,7 @@ export class SfIEvents extends LitElement {
4438
4470
  html += 'Comments'
4439
4471
  html += '</th>';
4440
4472
  }
4441
- console.log('rendering last updated', event.lastupdated)
4473
+ // console.log('rendering last updated', event.lastupdated)
4442
4474
  if(event.lastupdated != null && (event.lastupdated).length > 0) {
4443
4475
  html += '<th part="td-head">';
4444
4476
  html += 'Updated'
@@ -4649,7 +4681,7 @@ export class SfIEvents extends LitElement {
4649
4681
  let approverStr = this.getApproverStringFromEvent(event);
4650
4682
 
4651
4683
  let graphParam = this.getGraphParam(event);
4652
- console.log("graphParam", graphParam.split(';')[0]);
4684
+ // console.log("graphParam", graphParam.split(';')[0]);
4653
4685
  html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + '<button id="button-list-reporting-'+mmdd.replace('/', '-')+'-' + j +'" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button></div>';
4654
4686
 
4655
4687
  return html;
@@ -4908,6 +4940,78 @@ export class SfIEvents extends LitElement {
4908
4940
 
4909
4941
  }
4910
4942
 
4943
+ renderStatistics = (_firstDay: any, _endDay: any, iInit: number, iLast: number, showGraph: boolean, index: number, month: number, period: string, firstDate: any = null, parametersTitle: string) => {
4944
+ var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0;
4945
+ var html = '';
4946
+ // var lastDay = iLast;
4947
+ // var slice = 2;
4948
+ this.clearGraphData();
4949
+ this.clearSelectedGraphParam();
4950
+ this.clearSelectedLegend();
4951
+
4952
+ html += this.renderCalendarStatisticsGraphs(showGraph, parametersTitle);
4953
+ html += this.renderCalendarContainerDivStart(index)
4954
+ html += this.renderCalendarEventSummary();
4955
+
4956
+
4957
+ for(var i = iInit; i <= iLast; i++) {
4958
+
4959
+ let mmdd : string = "";
4960
+
4961
+ if(firstDate == null) {
4962
+ mmdd = ("0" + (month+1)).slice(-2) + "/" + ("0" + i).slice(-2);
4963
+ } else {
4964
+ const currDate = new Date(firstDate.getTime());
4965
+ currDate.setDate(firstDate.getDate() + (i - 1));
4966
+ mmdd = ("0" + (currDate.getMonth()+1)).slice(-2) + "/" + ("0" + currDate.getDate()).slice(-2);
4967
+ }
4968
+
4969
+
4970
+ //console.log('mmddevent', mmdd,this.events[mmdd]);
4971
+
4972
+ // var hide;
4973
+ // if(firstDate == null) {
4974
+ // hide = this.getCalendarRowHide(this.events[mmdd], i, lastDay, month, firstDate, null);
4975
+ // } else {
4976
+ // const currDate = new Date(firstDate.getTime());
4977
+ // currDate.setDate(firstDate.getDate() + (i - 1));
4978
+ // hide = this.getCalendarRowHide(this.events[mmdd], i, lastDay, month, firstDate, currDate);
4979
+ // }
4980
+
4981
+ if(this.statistics[mmdd] != null) {
4982
+
4983
+ console.log('mmdd', mmdd, this.statistics[mmdd]['approved']);
4984
+ // html += this.renderCalendarRowDivStart(i, firstDate, mmdd.split("/")[1] + "/" + mmdd.split("/")[0]);
4985
+ total += this.statistics[mmdd].count;
4986
+ notStarted += this.statistics[mmdd]["not-started"] ?? 0;
4987
+ pendingApproval += this.statistics[mmdd]["pending-approval"] ?? 0;
4988
+ rejected += this.statistics[mmdd]["rejected"] ?? 0;
4989
+ approved += this.statistics[mmdd]["approved"] ?? 0;
4990
+
4991
+ }
4992
+ }
4993
+
4994
+ html += this.renderCalendarContainerDivEnd();
4995
+
4996
+ //console.log('final risk severities', this.riskSeverityData);
4997
+
4998
+ //this.period = firstDay?.getDate() + '/' + (firstDay!.getMonth()+1) + '/' + firstDay?.getFullYear() + " - " + endDay?.getDate() + '/' + (endDay!.getMonth()+1) + '/' + endDay?.getFullYear();
4999
+ this.period = period;
5000
+ //console.log('renderevents htmlcols', this.htmlDataCompliances);
5001
+
5002
+ console.log('progress', this.period, total, notStarted, approved, this.statistics)
5003
+
5004
+ html = html.replace("DASHBOARD_TOTAL", total+"");
5005
+ html = html.replace("DASHBOARD_NOT_STARTED", notStarted+"");
5006
+ html = html.replace("DASHBOARD_APPROVED", approved+"");
5007
+ html = html.replace("DASHBOARD_PENDING_APPROVAL", pendingApproval+"");
5008
+ html = html.replace("DASHBOARD_REJECTED", rejected+"");
5009
+
5010
+ 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>';
5011
+ 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>'
5012
+
5013
+ return html;
5014
+ }
4911
5015
  renderReporting = (event: any, mmddyyyy: any) => {
4912
5016
  let html = '';
4913
5017
  let completeness = this.getCompletenessStatus(event);
@@ -6419,6 +6523,124 @@ export class SfIEvents extends LitElement {
6419
6523
 
6420
6524
 
6421
6525
 
6526
+ }
6527
+
6528
+ renderRangeStatistics = (firstDate: Date, count: number, eventsContainer: HTMLDivElement) => {
6529
+
6530
+
6531
+ var lastDate = new Date(firstDate.getTime());
6532
+ lastDate.setDate(lastDate.getDate() + count - 1)
6533
+
6534
+ const lastDay = count;
6535
+ let firstDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
6536
+ let endDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
6537
+ endDay?.setDate(endDay.getDate() + lastDay + 1);
6538
+ var period = ("0" + (firstDate.getMonth()+1)).slice(-2) + "/" + ("0" + firstDate.getDate()).slice(-2) + '/' + firstDate.getFullYear() + ' - ' + ("0" + (lastDate.getMonth()+1)).slice(-2) + "/" + ("0" + lastDate.getDate()).slice(-2) + '/' + lastDate.getFullYear();
6539
+ //console.log('rangeperiod', period)
6540
+
6541
+ var html = this.renderStatistics(firstDay, endDay, 1, lastDay, true, 0, (firstDate.getMonth()), period, firstDate,"From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'));
6542
+
6543
+ eventsContainer.querySelector('.calendar-right-data')!.innerHTML = html;
6544
+ this.renderButtonRefresh(eventsContainer);
6545
+ // let innerhtml = eventsContainer.innerHTML;
6546
+ // innerhtml += this.renderSelectAllButtons();
6547
+ // eventsContainer.innerHTML = innerhtml
6548
+ // this.attachTimelineFilterHandlers(eventsContainer);
6549
+
6550
+ // const radioExpander = eventsContainer.querySelector('#graph-radios-expander') as HTMLButtonElement;
6551
+ // radioExpander?.addEventListener('click', (e: any) => {
6552
+
6553
+ // const button = (e.currentTarget as HTMLButtonElement);
6554
+ // button.style.display = 'none';
6555
+
6556
+ // const arrRadios = eventsContainer.querySelectorAll('.chart-radio-item-secondary') as NodeListOf<HTMLDivElement>;
6557
+ // arrRadios.forEach(div => {
6558
+ // div.style.display = 'block';
6559
+ // });
6560
+ // });
6561
+
6562
+ const buttonRefresh = eventsContainer.querySelector('#button-refresh') as HTMLButtonElement
6563
+ buttonRefresh.addEventListener('click',async ()=>{
6564
+ this.processDateSelectionViewer(eventsContainer)
6565
+ })
6566
+
6567
+ }
6568
+
6569
+ renderStatisticsFilters = (eventsContainer: HTMLDivElement) => {
6570
+ let selectFilterCriteria = eventsContainer.querySelector('#select-filter-criteria') as HTMLSelectElement
6571
+ let inputLabelFilter = eventsContainer.querySelector('#input-label-filter') as HTMLLabelElement
6572
+ selectFilterCriteria.style.display = 'block'
6573
+ inputLabelFilter.style.display = 'block'
6574
+ // let selectedCriteria = ""
6575
+ selectFilterCriteria.innerHTML = ""
6576
+ let option = new Option()
6577
+ option.value = "";
6578
+ option.innerHTML = "All"
6579
+ selectFilterCriteria.add(option)
6580
+ for(let criteria of Object.keys(this.statisticsMeta)){
6581
+ // if(i == 0){
6582
+ // selectedCriteria = criteria
6583
+ // }
6584
+ let option = new Option()
6585
+ option.value = criteria;
6586
+ option.innerHTML = Util.titleCase(criteria)
6587
+ selectFilterCriteria.add(option)
6588
+ }
6589
+ selectFilterCriteria.addEventListener('change',(ev: any) => {
6590
+ let target = ev.target as HTMLSelectElement
6591
+ let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria') as HTMLLabelElement
6592
+ let selectFilterValues = eventsContainer.querySelector('#select-filter-values') as HTMLSelectElement
6593
+ if(target.value == ""){
6594
+ selectFilterValues.value = ""
6595
+ this.processDateSelectionViewer(eventsContainer)
6596
+ }
6597
+
6598
+ selectFilterValues.innerHTML = ""
6599
+ let option = new Option()
6600
+ option.value = "";
6601
+ option.innerHTML = "All";
6602
+ selectFilterValues.add(option)
6603
+ if(this.statisticsMeta[target.value] != null){
6604
+ selectFilterValues.style.display = 'block'
6605
+ inputLabelCriteria.style.display = 'block'
6606
+ inputLabelCriteria.innerHTML = Util.titleCase(target.value)
6607
+ for(let filter of this.statisticsMeta[target.value]){
6608
+ let option = new Option()
6609
+ option.value = filter.split(';')[1];
6610
+ option.innerHTML = Util.titleCase(filter.split(';')[0]).replace(/\([^)]*\)/g,"")
6611
+ selectFilterValues.add(option)
6612
+ }
6613
+ selectFilterValues.addEventListener('change',() => {
6614
+ console.log('changed')
6615
+ this.processDateSelectionViewer(eventsContainer);
6616
+ })
6617
+ }else{
6618
+ selectFilterValues.style.display = 'none'
6619
+ inputLabelCriteria.style.display = 'none'
6620
+ }
6621
+ })
6622
+ let selectFilterValues = eventsContainer.querySelector('#select-filter-values') as HTMLSelectElement
6623
+ let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria') as HTMLLabelElement
6624
+ selectFilterValues.style.display = 'none'
6625
+ inputLabelCriteria.style.display = 'none'
6626
+ // inputLabelCriteria.innerHTML = selectedCriteria
6627
+ // selectFilterValues.innerHTML = ""
6628
+ // option = new Option()
6629
+ // option.value = "";
6630
+ // option.innerHTML = "All"
6631
+ // selectFilterValues.add(option)
6632
+ // if(this.statisticsMeta[selectedCriteria] != null){
6633
+ // for(let filter of this.statisticsMeta[selectedCriteria]){
6634
+ // let option = new Option()
6635
+ // option.value = filter.split(';')[1];
6636
+ // option.innerHTML = Util.titleCase(filter.split(';')[0]).replace(/\([^)]*\)/g,"")
6637
+ // selectFilterValues.add(option)
6638
+ // }
6639
+ // }
6640
+ // selectFilterValues.addEventListener('change',() => {
6641
+ // console.log('changed')
6642
+ // this.processDateSelectionViewer(eventsContainer);
6643
+ // })
6422
6644
  }
6423
6645
  renderSelectAllButtons = () => {
6424
6646
  let selectAllHtml = '<div class="d-flex justify-end w-100" style="position: fixed; bottom: 70px; left: 0px;" part="button-select-all-container">';
@@ -6856,6 +7078,102 @@ export class SfIEvents extends LitElement {
6856
7078
 
6857
7079
  }
6858
7080
 
7081
+ processDateSelectionViewer = async (eventContainer: HTMLDivElement) => {
7082
+
7083
+ var startDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);
7084
+ var endDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + (parseInt(this.calendarStartYYYY) + 1));
7085
+
7086
+ var valueStart = ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value;
7087
+ if(valueStart == "") {
7088
+ valueStart = ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value;
7089
+ }
7090
+ var valueEnd = ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value;
7091
+ if(valueEnd == "") {
7092
+ valueEnd = ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value;
7093
+ }
7094
+
7095
+ //console.log('valuestart', valueStart);
7096
+ //console.log('valueend', valueEnd);
7097
+ let filtercriteria = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).value
7098
+ let filtercriterianame = ""
7099
+ console.log('criteria', ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).selectedIndex]);
7100
+ if(((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).selectedIndex] != null){
7101
+ filtercriterianame = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).selectedIndex].innerHTML
7102
+ }
7103
+ if(filtercriteria == ""){
7104
+ filtercriteria = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria-mobile') as HTMLSelectElement).value
7105
+ if(((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria-mobile') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria-mobile') as HTMLSelectElement).selectedIndex] != null){
7106
+ filtercriterianame = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria-mobile') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria-mobile') as HTMLSelectElement).selectedIndex].innerHTML
7107
+ }
7108
+ }
7109
+ let filtervalue = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement).value
7110
+ let filtervaluename = ""
7111
+ if(((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement).selectedIndex] != null){
7112
+ filtervaluename = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement).selectedIndex].innerHTML
7113
+ }
7114
+ if(filtervalue == ""){
7115
+ filtervalue = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values-mobile') as HTMLSelectElement).value
7116
+ if(((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values-mobile') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values-mobile') as HTMLSelectElement).selectedIndex] != null){
7117
+ filtervaluename = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values-mobile') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values-mobile') as HTMLSelectElement).selectedIndex].innerHTML
7118
+ }
7119
+ }
7120
+ if(filtercriteria == ""){
7121
+ this.htmlStatsFilter = "Filters Selected -> All"
7122
+ }else{
7123
+ if(filtervalue == ""){
7124
+ this.htmlStatsFilter = "Filters Selected -> " + Util.titleCase(filtercriterianame) + " -> All"
7125
+ }else{
7126
+ this.htmlStatsFilter = "Filters Selected -> " + Util.titleCase(filtercriterianame) + " -> " + Util.titleCase(filtervaluename)
7127
+ }
7128
+ }
7129
+ if(valueStart != "" && valueEnd != "") {
7130
+ this.initCustomRightColViewer();
7131
+ if(!this.checkStartDateEarliness(valueStart)) {
7132
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen Start Date cannot be earlier than " + startDateCalendar;
7133
+ return;
7134
+ }
7135
+ if(!this.checkEndDateLateness(valueEnd)) {
7136
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen End Date cannot be later than " + endDateCalendar;
7137
+ return;
7138
+ }
7139
+ if(new Date(valueStart).getTime() > new Date(valueEnd).getTime()) {
7140
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
7141
+ return;
7142
+ }
7143
+ if((new Date(valueEnd).getTime() - new Date(valueStart).getTime())/(1000*60*60*24) > 400) {
7144
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen time window cannot be greater than 400 days";
7145
+ return;
7146
+ }
7147
+ const tsStart = new Date(valueStart);
7148
+ const tsEnd = new Date(valueEnd);
7149
+ tsStart.setDate(tsStart.getDate() - 2);
7150
+ tsEnd.setDate(tsEnd.getDate() + 2);
7151
+
7152
+ //console.log('tsstart', tsStart);
7153
+ //console.log('tsend', tsEnd);
7154
+
7155
+ let meta = await this.fetchStatistics((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear(), filtercriteria, filtervalue);
7156
+ this.renderRangeStatistics(new Date(valueStart), ((new Date(valueEnd).getTime()+24*60*60*1000) - new Date(valueStart).getTime())/(1000*60*60*24), (this._SfCustomContainer as HTMLDivElement));
7157
+
7158
+ if(meta != null) this.renderStatisticsFilters((this._SfCustomContainer as HTMLDivElement))
7159
+ } else if(valueStart != "" && valueEnd == "") {
7160
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Please select End Date";
7161
+ } else if(valueStart == "" && valueEnd != "") {
7162
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Please select Start Date";
7163
+ } else if(valueStart == "" && valueEnd == "") {
7164
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Please select Start Date and End Date";
7165
+ }
7166
+
7167
+ this.attachHandlers(eventContainer, valueStart, valueEnd);
7168
+
7169
+ if(eventContainer.innerHTML.indexOf('myChart') >= 0) {
7170
+
7171
+ this.renderCompletenessGraph(eventContainer, -1, 2);
7172
+
7173
+ }
7174
+
7175
+ }
7176
+
6859
7177
  initFindRightCol = () => {
6860
7178
 
6861
7179
  var html = "";
@@ -6886,6 +7204,21 @@ export class SfIEvents extends LitElement {
6886
7204
 
6887
7205
  }
6888
7206
 
7207
+ initCustomRightColViewer = () => {
7208
+
7209
+ var html = "";
7210
+
7211
+ html += '<div id="stream-event-0" part="stream-event-list" class="stream-event-list">';
7212
+ html += '<div part="stream-event-not-selected" class="d-flex stream-event-not-selected">';
7213
+ html += '<div><h2 id="stream-event-status">Please select Start Date, End Date and Filter Criteria</h2></div>';
7214
+ html += '</div>';
7215
+ html += '</div>';
7216
+
7217
+
7218
+ (this._SfCustomContainer as HTMLDivElement).querySelector('.calendar-right-data')!.innerHTML = html
7219
+
7220
+ }
7221
+
6889
7222
  checkAndShowBulk = () => {
6890
7223
 
6891
7224
  const inputArr = (this._SfMappingContainer as HTMLDivElement).querySelectorAll('.input-checkbox') as NodeListOf<HTMLInputElement>;
@@ -8865,6 +9198,226 @@ export class SfIEvents extends LitElement {
8865
9198
  // }
8866
9199
  }
8867
9200
 
9201
+ renderCustomViewer = () => {
9202
+
9203
+ this.clearGraphData();
9204
+ this.clearSelectedGraphParam();
9205
+ this.clearSelectedLegend();
9206
+
9207
+ var html = '';
9208
+
9209
+ html += '<div class="scroll-x w-100 mobile-only">';
9210
+
9211
+ html += '<div class="title-item-date">';
9212
+ html += '<label part="input-label">Start Date</label><br />'
9213
+ html += '<input id="stream-start-date-mobile" part="input" type="date" />'
9214
+ html += '</div>';
9215
+ html += '<div class="title-item-date">';
9216
+ html += '<label part="input-label">End Date</label><br />'
9217
+ html += '<input id="stream-end-date-mobile" part="input" type="date" />'
9218
+ html += '</div>';
9219
+ html += '<div class="title-item-date">';
9220
+ html += '<button id="button-year-to-date-mobile" part="button-lg-short-secondary">Year To Date</button>'
9221
+ html += '</div>';
9222
+ html += '<div class="title-item-date">';
9223
+ html += '<button id="button-this-quarter-mobile" part="button-lg-short-secondary">This Quarter</button>'
9224
+ html += '</div>';
9225
+ html += '<div class="title-item-date">';
9226
+ html += '<button id="button-this-year-mobile" part="button-lg-short-secondary">This Year</button>'
9227
+ html += '</div>';
9228
+ html += '<div class="title-item-date">';
9229
+ html += '<label part="input-label-filter-criteria" id="input-label-filter-mobile">Filter Criteria</label><br />'
9230
+ html += '<select id="select-filter-criteria-mobile" class="mr-10"></select>'
9231
+ html += '</div>';
9232
+ html += '<div class="title-item-date">';
9233
+ html += '<label part="input-label-filter-value" id="input-label-criteria-mobile"></label><br />'
9234
+ html += '<select id="select-filter-values-mobile" class="mr-10"></select>'
9235
+ html += '</div>';
9236
+
9237
+ html += '</div>';
9238
+
9239
+ html += '<div class="d-flex w-100">';
9240
+ html += '<div class="calendar-left-col desktop-only flex-col justify-start align-end">';
9241
+
9242
+ html += '<div class="title-item-date">';
9243
+ html += '<label part="input-label">Start Date</label><br />'
9244
+ html += '<input id="stream-start-date" part="input" type="date" />'
9245
+ html += '</div>';
9246
+ html += '<div class="title-item-date">';
9247
+ html += '<label part="input-label">End Date</label><br />'
9248
+ html += '<input id="stream-end-date" part="input" type="date" />'
9249
+ html += '</div>';
9250
+ html += '<div class="title-item-date">';
9251
+ html += '<button id="button-year-to-date" part="button-lg-short-secondary">Year To Date</button>'
9252
+ html += '</div>';
9253
+ html += '<div class="title-item-date">';
9254
+ html += '<button id="button-this-quarter" part="button-lg-short-secondary">This Quarter</button>'
9255
+ html += '</div>';
9256
+ html += '<div class="title-item-date">';
9257
+ html += '<button id="button-this-year" part="button-lg-short-secondary">This Year</button>'
9258
+ html += '</div>';
9259
+ html += '<div class="title-item-date d-flex flex-col align-end">';
9260
+ html += '<label part="input-label-filter-criteria" id="input-label-filter" class="mr-10">Filter Criteria</label><br />'
9261
+ html += '<select id="select-filter-criteria" class="mr-10"></select>'
9262
+ html += '</div>';
9263
+ html += '<div class="title-item-date d-flex flex-col align-end">';
9264
+ html += '<label part="input-label-filter-value" id="input-label-criteria" class="mr-10"></label><br />'
9265
+ html += '<select id="select-filter-values" class="mr-10"></select>'
9266
+ html += '</div>';
9267
+
9268
+
9269
+ html += '</div>';
9270
+
9271
+ html += '<div class="calendar-right-data flex-grow">';
9272
+
9273
+ html += '</div>';
9274
+ html += '</div>';
9275
+
9276
+ console.log('html', html);
9277
+ (this._SfCustomContainer as HTMLDivElement).innerHTML = html;
9278
+
9279
+ this.initCustomRightColViewer();
9280
+
9281
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date')?.addEventListener('change', (_ev: any) => {
9282
+ //console.log('start-date', ev);
9283
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9284
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9285
+ });
9286
+
9287
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date')?.addEventListener('change', (_ev: any) => {
9288
+ //console.log('end-date', ev);
9289
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9290
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9291
+ });
9292
+
9293
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile')?.addEventListener('change', (_ev: any) => {
9294
+ //console.log('start-date', ev);
9295
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9296
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9297
+ });
9298
+
9299
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile')?.addEventListener('change', (_ev: any) => {
9300
+ //console.log('end-date', ev);
9301
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9302
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9303
+ });
9304
+
9305
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-year-to-date')?.addEventListener('click', () => {
9306
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9307
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9308
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
9309
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
9310
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9311
+ });
9312
+
9313
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-year-to-date-mobile')?.addEventListener('click', () => {
9314
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9315
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9316
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
9317
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
9318
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9319
+ });
9320
+
9321
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-year-mobile')?.addEventListener('click', () => {
9322
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9323
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9324
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9325
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9326
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9327
+ });
9328
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-year')?.addEventListener('click', () => {
9329
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9330
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9331
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9332
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9333
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9334
+ });
9335
+
9336
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-quarter-mobile')?.addEventListener('click', () => {
9337
+
9338
+ const mmCurrent = ((new Date().getMonth() + 1));
9339
+
9340
+ let startDate : string = "";
9341
+ let endDate : string = "";
9342
+
9343
+ if(mmCurrent >=4 && mmCurrent <= 6) {
9344
+
9345
+ startDate = this.calendarStartYYYY + '-' + '04' + '-' + "01";
9346
+ endDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
9347
+
9348
+ } else if(mmCurrent >=6 && mmCurrent <= 9) {
9349
+
9350
+ startDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
9351
+ endDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
9352
+
9353
+ } else if(mmCurrent >=9 && mmCurrent <= 12) {
9354
+
9355
+ startDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
9356
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
9357
+
9358
+ } else {
9359
+ startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
9360
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
9361
+ }
9362
+
9363
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = startDate;
9364
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = startDate;
9365
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = endDate;
9366
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = endDate;
9367
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9368
+ });
9369
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-quarter')?.addEventListener('click', () => {
9370
+
9371
+ const mmCurrent = ((new Date().getMonth() + 1));
9372
+
9373
+ let startDate : string = "";
9374
+ let endDate : string = "";
9375
+
9376
+ if(mmCurrent >=4 && mmCurrent <= 6) {
9377
+
9378
+ startDate = this.calendarStartYYYY + '-' + '04' + '-' + "01";
9379
+ endDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
9380
+
9381
+ } else if(mmCurrent >=6 && mmCurrent <= 9) {
9382
+
9383
+ startDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
9384
+ endDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
9385
+
9386
+ } else if(mmCurrent >=9 && mmCurrent <= 12) {
9387
+
9388
+ startDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
9389
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
9390
+
9391
+ } else {
9392
+ startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
9393
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
9394
+ }
9395
+
9396
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = startDate;
9397
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = startDate;
9398
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = endDate;
9399
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = endDate;
9400
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9401
+ });
9402
+
9403
+ let selectFileterCriteria = (this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement
9404
+ selectFileterCriteria.style.display = 'none'
9405
+ let selectFileterValues = (this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement
9406
+ selectFileterValues.style.display = 'none'
9407
+ let inputLabelFilter = (this._SfCustomContainer as HTMLDivElement).querySelector('#input-label-filter') as HTMLLabelElement
9408
+ inputLabelFilter.style.display = 'none';
9409
+ // for(var i = 0; i < 3; i++) {
9410
+ // (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-month-' + i)?.addEventListener('click', (ev: any)=> {
9411
+ // const target = parseInt((ev.target as HTMLDivElement).id.split('-')[2]);
9412
+ // //console.log('clicked ', target);
9413
+ // this.renderPast(target);
9414
+ // })
9415
+ // }
9416
+
9417
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#button-year-to-date') as HTMLButtonElement)?.click();
9418
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#button-year-to-date-mobile') as HTMLButtonElement)?.click();
9419
+ }
9420
+
8868
9421
  renderThis = (index: number = 1, showGraph: boolean = true) => {
8869
9422
 
8870
9423
  this.clearGraphData();
@@ -9275,17 +9828,19 @@ export class SfIEvents extends LitElement {
9275
9828
  document.addEventListener('scroll',() => {
9276
9829
  // console.log('scroll',window.scrollY)
9277
9830
  let buttonRefresh = eventsContainer.querySelector('#button-refresh') as HTMLButtonElement
9278
- if(window.scrollY > 720){
9279
- if(buttonRefresh.style.display == "flex"){
9831
+ if(buttonRefresh != null){
9832
+ if(window.scrollY > 720){
9833
+ if(buttonRefresh.style.display == "flex"){
9280
9834
 
9835
+ }else{
9836
+ buttonRefresh.style.display = 'flex'
9837
+ }
9281
9838
  }else{
9282
- buttonRefresh.style.display = 'flex'
9283
- }
9284
- }else{
9285
- if(buttonRefresh.style.display == "none"){
9839
+ if(buttonRefresh.style.display == "none"){
9286
9840
 
9287
- }else{
9288
- buttonRefresh.style.display = 'none'
9841
+ }else{
9842
+ buttonRefresh.style.display = 'none'
9843
+ }
9289
9844
  }
9290
9845
  }
9291
9846
  })
@@ -9933,7 +10488,7 @@ export class SfIEvents extends LitElement {
9933
10488
 
9934
10489
  }
9935
10490
 
9936
- renderCompletenessGraph = (divContainer: HTMLDivElement) => {
10491
+ renderCompletenessGraph = (divContainer: HTMLDivElement, selectedTab: number = -1, selectedSummary: number = -1) => {
9937
10492
 
9938
10493
  this.clearSelectedGraphParam();
9939
10494
  // this.clearSelectedLegend();
@@ -9973,7 +10528,7 @@ export class SfIEvents extends LitElement {
9973
10528
  }]
9974
10529
  }
9975
10530
 
9976
- this.renderChartSettings(divContainer, -1, -1, ctx);
10531
+ this.renderChartSettings(divContainer, selectedTab, selectedSummary, ctx);
9977
10532
  this.renderChart(ctx, 'doughnut', data, "Completeness")
9978
10533
 
9979
10534
  }
@@ -10007,7 +10562,7 @@ export class SfIEvents extends LitElement {
10007
10562
  for(var i = 0; i < itemsCompliance.length; i++) {
10008
10563
  itemsCompliance[i].style.display = 'none';
10009
10564
  }
10010
- this.renderChartSettings(divContainer, -1, -1, ctx);
10565
+ this.renderChartSettings(divContainer, selectedTab, selectedSummary, ctx);
10011
10566
  this.renderChart(ctx, 'doughnut', data, "Completeness")
10012
10567
 
10013
10568
  }
@@ -12010,7 +12565,7 @@ export class SfIEvents extends LitElement {
12010
12565
 
12011
12566
  const tempArray = [];
12012
12567
 
12013
- for(let count = 0; count < sourceArray.data.mappings.mappings.length; count++) {
12568
+ for(var count = 0; count < sourceArray.data.mappings.mappings.length; count++) {
12014
12569
 
12015
12570
  //console.log('selectedindexchecking', selectedIndex, count, this.selectedCbs.includes(selectedIndex), this.selectedCbs.includes(count));
12016
12571
  //taggingArray.data.mappings.mappings[count] = sourceArray.data.mappings.mappings[count];
@@ -12212,10 +12767,7 @@ export class SfIEvents extends LitElement {
12212
12767
 
12213
12768
  async function process() {
12214
12769
 
12215
- console.log = function() {
12216
- console.log('Saving...', mapping);
12217
- }
12218
-
12770
+ //console.log('Saving...', mapping);
12219
12771
 
12220
12772
  await uploadFunction(mapping);
12221
12773
  if(!saveInBackground) refreshFunction();
@@ -12658,7 +13210,7 @@ export class SfIEvents extends LitElement {
12658
13210
  if(taggingArray.data.mappings.mappings[k].id == sourceArray.data.mappings.mappings[i].id) {
12659
13211
  if(taggingArray.data.mappings.mappings[k].id == "62330e24-298d-4ef2-9449-c0e400e37cac") {
12660
13212
 
12661
- // console.log('found', taggingArray.data.mappings.mappings[k]);
13213
+ console.log('found', taggingArray.data.mappings.mappings[k]);
12662
13214
  //console.log('before before filtermatch',sourceCols[l],JSON.parse(sourceArray.data.mappings.mappings[0].cols)[j], colCountry, (sourceArray.data.mappings.mappings[i]), (sourceArray.data.mappings.mappings[i].data), colState);
12663
13215
  //console.log('before filtermatch', colCountry, JSON.parse(sourceArray.data.mappings.mappings[i].data)[colCountry], colState, JSON.parse(sourceArray.data.mappings.mappings[i].data)[colState], JSON.parse(sourceArray.data.mappings.mappings[i].data)[colSubcategory]);
12664
13216
 
@@ -14033,10 +14585,10 @@ export class SfIEvents extends LitElement {
14033
14585
  this._SfLoader.innerHTML = '<div class="lds-dual-ring"></div>';
14034
14586
  this._SfLoader.innerHTML += ('<div class="lds-text"><div class="lds-text-c"></div></div>');
14035
14587
  }
14036
- // setTimeout(() => {
14037
- // this.renderMappingTable(divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, inputFilter.value, statuteColName, extraHintsArr)
14038
- // this._SfLoader.innerHTML = '';
14039
- // }, 1000);
14588
+ setTimeout(() => {
14589
+ this.renderMappingTable(divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, inputFilter.value, statuteColName, extraHintsArr)
14590
+ this._SfLoader.innerHTML = '';
14591
+ }, 1000);
14040
14592
 
14041
14593
  }
14042
14594
 
@@ -14211,9 +14763,9 @@ export class SfIEvents extends LitElement {
14211
14763
  arrCheckBoxes[i].addEventListener('change', async (_e: any) => {
14212
14764
  //console.log(e.currentTarget, (e.currentTarget as HTMLInputElement).checked);
14213
14765
  ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
14214
- // if(extraFieldPosition === 1) {
14215
- // await this.saveMapping (divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true)
14216
- // }
14766
+ if(extraFieldPosition === 1) {
14767
+ await this.saveMapping (divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true)
14768
+ }
14217
14769
  });
14218
14770
  }
14219
14771
 
@@ -14589,7 +15141,7 @@ export class SfIEvents extends LitElement {
14589
15141
 
14590
15142
  //console.log('rendering triggers...', (this._SfOnboardingTriggersContainer as HTMLDivElement).innerHTML);
14591
15143
 
14592
- this.renderTaggingTable((this._SfOnboardingTriggersListContainer as HTMLDivElement),mappedSerializedAlertSchedules, mappedTriggers, ["frequency", "obligation", "country", "statute"], this.uploadTriggersMapping, this.loadOnboardingTriggers, "triggers", ["id", "entityname", "locationname"], '', "", ["triggers"], triggersJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15144
+ this.renderTaggingTable((this._SfOnboardingTriggersListContainer as HTMLDivElement),mappedSerializedAlertSchedules, mappedTriggers, [], this.uploadTriggersMapping, this.loadOnboardingTriggers, "triggers", ["id", "entityname", "locationname"], '', "", ["triggers"], triggersJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
14593
15145
 
14594
15146
  }
14595
15147
 
@@ -14602,7 +15154,7 @@ export class SfIEvents extends LitElement {
14602
15154
 
14603
15155
  (this._SfOnboardingInternalControlsContainer as HTMLDivElement).innerHTML = html;
14604
15156
 
14605
- this.renderTaggingTable((this._SfOnboardingInternalControlsListContainer as HTMLDivElement),mappedSerializedTriggers, mappedInternalControls, ["frequency", "firstlineofdefence", "obligation", "country", "statute"], this.uploadInternalControlsMapping, this.loadOnboardingInternalControls, "internalcontrols", ["id", "entityname", "locationname"], '', "", ["internalcontrols"], internalcontrolsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15157
+ this.renderTaggingTable((this._SfOnboardingInternalControlsListContainer as HTMLDivElement),mappedSerializedTriggers, mappedInternalControls, [], this.uploadInternalControlsMapping, this.loadOnboardingInternalControls, "internalcontrols", ["id", "entityname", "locationname"], '', "", ["internalcontrols"], internalcontrolsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
14606
15158
 
14607
15159
  }
14608
15160
 
@@ -14615,7 +15167,7 @@ export class SfIEvents extends LitElement {
14615
15167
 
14616
15168
  (this._SfOnboardingActivationsContainer as HTMLDivElement).innerHTML = html;
14617
15169
 
14618
- this.renderTaggingTable((this._SfOnboardingActivationListContainer as HTMLDivElement),mappedSerializedExtensions, mappedActivations, [ "firstlineofdefence", "obligation", "country", "statute"], this.uploadActivationsMapping, this.loadOnboardingActivations, "activations", ["id", "entityname", "locationname"], '', "", ["activations"], activationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15170
+ this.renderTaggingTable((this._SfOnboardingActivationListContainer as HTMLDivElement),mappedSerializedExtensions, mappedActivations, [], this.uploadActivationsMapping, this.loadOnboardingActivations, "activations", ["id", "entityname", "locationname"], '', "", ["activations"], activationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
14619
15171
 
14620
15172
  }
14621
15173
 
@@ -14628,7 +15180,7 @@ export class SfIEvents extends LitElement {
14628
15180
 
14629
15181
  (this._SfOnboardingInvalidationsContainer as HTMLDivElement).innerHTML = html;
14630
15182
 
14631
- this.renderTaggingTable((this._SfOnboardingInvalidationListContainer as HTMLDivElement),mappedSerializedExtensions, mappedInvalidations, ["firstlineofdefence", "obligation", "country", "statute"], this.uploadInvalidationsMapping, this.loadOnboardingInvalidations, "invalidations", ["id", "entityname", "locationname"], '', "", ["invalidations"], invalidationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15183
+ this.renderTaggingTable((this._SfOnboardingInvalidationListContainer as HTMLDivElement),mappedSerializedExtensions, mappedInvalidations, [], this.uploadInvalidationsMapping, this.loadOnboardingInvalidations, "invalidations", ["id", "entityname", "locationname"], '', "", ["invalidations"], invalidationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
14632
15184
 
14633
15185
  }
14634
15186
 
@@ -14641,7 +15193,7 @@ export class SfIEvents extends LitElement {
14641
15193
 
14642
15194
  (this._SfOnboardingAlertSchedulesContainer as HTMLDivElement).innerHTML = html;
14643
15195
 
14644
- this.renderTaggingTable((this._SfOnboardingAlertSchedulesListContainer as HTMLDivElement),mappedSerializedExtensions, mappedAlertSchedules, [ "alertschedules", "firstlineofdefence", "obligation", "country", "statute"], this.uploadAlertSchedulesMapping, this.loadOnboardingAlertSchedules, "alertschedules", ["id", "entityname", "locationname"], '', "", ["alertschedules"], alertschedulesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15196
+ this.renderTaggingTable((this._SfOnboardingAlertSchedulesListContainer as HTMLDivElement),mappedSerializedExtensions, mappedAlertSchedules, [], this.uploadAlertSchedulesMapping, this.loadOnboardingAlertSchedules, "alertschedules", ["id", "entityname", "locationname"], '', "", ["alertschedules"], alertschedulesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
14645
15197
 
14646
15198
  }
14647
15199
 
@@ -14654,7 +15206,7 @@ export class SfIEvents extends LitElement {
14654
15206
 
14655
15207
  (this._SfOnboardingExtensionsContainer as HTMLDivElement).innerHTML = html;
14656
15208
 
14657
- this.renderTaggingTable((this._SfOnboardingExtensionsListContainer as HTMLDivElement),mappedSerializedDuedates, mappedExtensions, ["duedate","firstlineofdefence", "obligation", "country", "statute"], this.uploadExtensionsMapping, this.loadOnboardingExtensions, "extensions", ["id", "entityname", "locationname"], '', "", ["extensions"], extensionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15209
+ this.renderTaggingTable((this._SfOnboardingExtensionsListContainer as HTMLDivElement),mappedSerializedDuedates, mappedExtensions, [], this.uploadExtensionsMapping, this.loadOnboardingExtensions, "extensions", ["id", "entityname", "locationname"], '', "", ["extensions"], extensionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
14658
15210
 
14659
15211
  }
14660
15212
 
@@ -14667,7 +15219,7 @@ export class SfIEvents extends LitElement {
14667
15219
 
14668
15220
  (this._SfOnboardingDuedatesContainer as HTMLDivElement).innerHTML = html;
14669
15221
 
14670
- this.renderTaggingTable((this._SfOnboardingDuedatesListContainer as HTMLDivElement),mappedSerializedMakerCheckers, mappedDuedates, ["duedate", "firstlineofdefence", "frequency", "obligation", "country", "statute"], this.uploadDuedatesMapping, this.loadOnboardingDuedates, "duedates", ["id", "entityname", "locationname"], '', "", ["duedates"], duedatesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15222
+ this.renderTaggingTable((this._SfOnboardingDuedatesListContainer as HTMLDivElement),mappedSerializedMakerCheckers, mappedDuedates, [], this.uploadDuedatesMapping, this.loadOnboardingDuedates, "duedates", ["id", "entityname", "locationname"], '', "", ["duedates"], duedatesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
14671
15223
 
14672
15224
  }
14673
15225
 
@@ -14693,7 +15245,7 @@ export class SfIEvents extends LitElement {
14693
15245
 
14694
15246
  (this._SfOnboardingApproversContainer as HTMLDivElement).innerHTML = html;
14695
15247
 
14696
- this.renderTaggingTable((this._SfOnboardingApproversListContainer as HTMLDivElement),mappedSerializedReporters, mappedApprovers, ["obligation","firstlineofdefence","secondlineofdefence", "country", "statute", "reference"], this.uploadApproversMapping, this.loadOnboardingApprovers, "approvers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["approvers"], approversJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
15248
+ this.renderTaggingTable((this._SfOnboardingApproversListContainer as HTMLDivElement),mappedSerializedReporters, mappedApprovers, [], this.uploadApproversMapping, this.loadOnboardingApprovers, "approvers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["approvers"], approversJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
14697
15249
 
14698
15250
  }
14699
15251
 
@@ -14706,7 +15258,7 @@ export class SfIEvents extends LitElement {
14706
15258
 
14707
15259
  (this._SfOnboardingFunctionHeadsContainer as HTMLDivElement).innerHTML = html;
14708
15260
 
14709
- this.renderTaggingTable((this._SfOnboardingFunctionHeadsListContainer as HTMLDivElement),mappedSerializedApprovers, mappedFunctionHeads, ["obligation", "firstlineofdefence","thirdlineofdefence", "country", "statute", "reference"], this.uploadFunctionHeadsMapping, this.loadOnboardingFunctionHeads, "functionheads", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["functionheads"], functionHeadsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
15261
+ this.renderTaggingTable((this._SfOnboardingFunctionHeadsListContainer as HTMLDivElement),mappedSerializedApprovers, mappedFunctionHeads, [], this.uploadFunctionHeadsMapping, this.loadOnboardingFunctionHeads, "functionheads", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["functionheads"], functionHeadsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
14710
15262
 
14711
15263
  }
14712
15264
 
@@ -14719,7 +15271,7 @@ export class SfIEvents extends LitElement {
14719
15271
 
14720
15272
  (this._SfOnboardingMakerCheckersContainer as HTMLDivElement).innerHTML = html;
14721
15273
 
14722
- this.renderTaggingTable((this._SfOnboardingMakerCheckersListContainer as HTMLDivElement),mappedSerializedDocs, mappedMakerCheckers, ["firstlineofdefence", "obligation", "obligationtype", "country", "statute"], this.uploadMakerCheckersMapping, this.loadOnboardingMakerCheckers, "makercheckers", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["makercheckers"], makerCheckerJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15274
+ this.renderTaggingTable((this._SfOnboardingMakerCheckersListContainer as HTMLDivElement),mappedSerializedDocs, mappedMakerCheckers, [], this.uploadMakerCheckersMapping, this.loadOnboardingMakerCheckers, "makercheckers", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["makercheckers"], makerCheckerJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
14723
15275
 
14724
15276
  }
14725
15277
 
@@ -14732,7 +15284,7 @@ export class SfIEvents extends LitElement {
14732
15284
 
14733
15285
  (this._SfOnboardingDocsContainer as HTMLDivElement).innerHTML = html;
14734
15286
 
14735
- this.renderTaggingTable((this._SfOnboardingDocsListContainer as HTMLDivElement),mappedSerializedViewers, mappedDocs, ["firstlineofdefence", "obligation", "obligationtype", "country", "statute"], this.uploadDocsMapping, this.loadOnboardingDocs, "docs", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["docs"], docsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15287
+ this.renderTaggingTable((this._SfOnboardingDocsListContainer as HTMLDivElement),mappedSerializedViewers, mappedDocs, [], this.uploadDocsMapping, this.loadOnboardingDocs, "docs", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["docs"], docsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
14736
15288
 
14737
15289
  }
14738
15290
 
@@ -14747,7 +15299,7 @@ export class SfIEvents extends LitElement {
14747
15299
 
14748
15300
  (this._SfOnboardingAuditorsContainer as HTMLDivElement).innerHTML = html;
14749
15301
 
14750
- this.renderTaggingTable((this._SfOnboardingAuditorsListContainer as HTMLDivElement),mappedSerializedFunctionheads, mappedAuditors, ["obligation","firstlineofdefence", "country", "statute", "reference"], this.uploadAuditorsMapping, this.loadOnboardingAuditors, "auditors", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["auditors"], auditorsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
15302
+ this.renderTaggingTable((this._SfOnboardingAuditorsListContainer as HTMLDivElement),mappedSerializedFunctionheads, mappedAuditors, [], this.uploadAuditorsMapping, this.loadOnboardingAuditors, "auditors", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["auditors"], auditorsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
14751
15303
 
14752
15304
  }
14753
15305
 
@@ -14762,7 +15314,7 @@ export class SfIEvents extends LitElement {
14762
15314
 
14763
15315
  (this._SfOnboardingViewersContainer as HTMLDivElement).innerHTML = html;
14764
15316
 
14765
- this.renderTaggingTable((this._SfOnboardingViewersListContainer as HTMLDivElement),mappedSerializedAuditors, mappedViewers, ["obligation","firstlineofdefence", "country", "statute", "reference"], this.uploadViewersMapping, this.loadOnboardingViewers, "viewers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["viewers"], viewersJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
15317
+ this.renderTaggingTable((this._SfOnboardingViewersListContainer as HTMLDivElement),mappedSerializedAuditors, mappedViewers, [], this.uploadViewersMapping, this.loadOnboardingViewers, "viewers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["viewers"], viewersJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
14766
15318
 
14767
15319
  }
14768
15320
 
@@ -14796,7 +15348,6 @@ export class SfIEvents extends LitElement {
14796
15348
 
14797
15349
  (this._SfOnboardingFunctionsContainer as HTMLDivElement).innerHTML = html;
14798
15350
 
14799
- // this.renderTaggingTable((this._SfOnboardingFunctionsListContainer as HTMLDivElement),mappedSerializedLocations, mappedFunctions, ["obligation","firstlineofdefence", "country", "statute", "reference"], this.uploadFunctionsMapping, this.loadOnboardingFunctions, "functions", ["id", "countryname", "entityname", "locationname"], this.apiIdTags, "&Function", ["functions"], functionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
14800
15351
  this.renderTaggingTable((this._SfOnboardingFunctionsListContainer as HTMLDivElement),mappedSerializedLocations, mappedFunctions, [], this.uploadFunctionsMapping, this.loadOnboardingFunctions, "functions", ["id", "countryname", "entityname", "locationname"], this.apiIdTags, "&Function", ["functions"], functionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
14801
15352
 
14802
15353
  }
@@ -16269,76 +16820,112 @@ export class SfIEvents extends LitElement {
16269
16820
 
16270
16821
  }
16271
16822
 
16272
- renderChartSettingsSettings = (container: HTMLDivElement) => {
16823
+ renderChartSettingsSettings = (container: HTMLDivElement, selectedTab: number = 1) => {
16273
16824
 
16274
- var html = `
16275
-
16276
- <div class="m-10" part="settings-container">
16277
- <div class="d-flex justify-end">
16278
- <button id="chart-control-cancel" class="material-icons" part="button-icon-small">close</button>
16279
- </div>
16825
+ var html = ``
16826
+ if(selectedTab == 1){
16827
+ html = `
16828
+
16829
+ <div class="m-10" part="settings-container">
16830
+ <div class="d-flex justify-end">
16831
+ <button id="chart-control-cancel" class="material-icons" part="button-icon-small">close</button>
16832
+ </div>
16280
16833
 
16281
- <div class="d-flex justify-center">
16282
- <div class="p-10 mr-10 w-100">
16283
- <div part="td-head">Reports</div>
16284
- <div part="td-body" class="d-flex align-center mt-10 flex-wrap">
16285
- <div class="mr-10 d-flex align-center mb-10">
16286
- <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked name="radio-report" part="radio-download"/>
16287
- <label for="radio-csv" part="label-radio-download" class="mr-10">Summary (CSV)</label>
16288
- </div>
16289
- <div class="mr-10 d-flex align-center mb-10">
16290
- <input type="radio" id="radio-image" class="switch-image" value="Image" name="radio-report" part="radio-download"/>
16291
- <label for="radio-image" part="label-radio-download" class="mr-10">Image (PNG)</label>
16834
+ <div class="d-flex justify-center">
16835
+ <div class="p-10 mr-10 w-100">
16836
+ <div part="td-head">Reports</div>
16837
+ <div part="td-body" class="d-flex align-center mt-10 flex-wrap">
16838
+ <div class="mr-10 d-flex align-center mb-10">
16839
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked name="radio-report" part="radio-download"/>
16840
+ <label for="radio-csv" part="label-radio-download" class="mr-10">Summary (CSV)</label>
16841
+ </div>
16842
+ <div class="mr-10 d-flex align-center mb-10">
16843
+ <input type="radio" id="radio-image" class="switch-image" value="Image" name="radio-report" part="radio-download"/>
16844
+ <label for="radio-image" part="label-radio-download" class="mr-10">Image (PNG)</label>
16845
+ </div>
16846
+ <div class="mr-10 d-flex align-center mb-10">
16847
+ <input type="radio" id="radio-stats" class="switch-image" value="Stats" name="radio-report" part="radio-download"/>
16848
+ <label for="radio-stats" part="label-radio-download" class="mr-10">Stats (HTML)</label>
16849
+ </div>
16850
+ <div class="mr-10 d-flex align-center mb-10">
16851
+ <input type="radio" id="radio-list" class="switch-image" value="List" name="radio-report" part="radio-download"/>
16852
+ <label for="radio-list" part="label-radio-download" class="mr-10">List (HTML)</label>
16853
+ </div>
16854
+ <div class="mr-10 d-flex align-center mb-10">
16855
+ <input type="radio" id="radio-list-csv" class="switch-image" value="List" name="radio-report" part="radio-download"/>
16856
+ <label for="radio-list-csv" part="label-radio-download" class="mr-10">List (CSV)</label>
16857
+ </div>
16858
+ <div class="mr-10 d-flex align-center mb-10">
16859
+ <input type="radio" id="radio-consolidated" class="switch-image" value="Consolidated" name="radio-report" part="radio-download"/>
16860
+ <label for="radio-consolidated" part="label-radio-download" class="mr-10">Consolidated (HTML)</label>
16861
+ </div>
16862
+ <div class="mr-10 d-flex align-center mb-10">
16863
+ <input type="radio" id="radio-certificate" class="switch-image" value="Certificate" name="radio-report" part="radio-download"/>
16864
+ <label for="radio-certificate" part="label-radio-download" class="mr-10">Certificate (HTML)</label>
16865
+ </div>
16292
16866
  </div>
16293
- <div class="mr-10 d-flex align-center mb-10">
16294
- <input type="radio" id="radio-stats" class="switch-image" value="Stats" name="radio-report" part="radio-download"/>
16295
- <label for="radio-stats" part="label-radio-download" class="mr-10">Stats (HTML)</label>
16867
+ <div class="d-flex mt-10">
16868
+ <button id="button-download-stats" part="button" class="mt-5 ml-10">Download</button>
16296
16869
  </div>
16297
- <div class="mr-10 d-flex align-center mb-10">
16298
- <input type="radio" id="radio-list" class="switch-image" value="List" name="radio-report" part="radio-download"/>
16299
- <label for="radio-list" part="label-radio-download" class="mr-10">List (HTML)</label>
16870
+ </div>
16871
+ <!-- <div class="p-10 ml-10 mr-10">
16872
+ <div part="td-head">Compliances</div>
16873
+ <div part="td-body" class="d-flex align-center mt-5">
16874
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked part="radio-download"/>
16875
+ <label for="radio-html" part="label-radio-download">Html</label>
16300
16876
  </div>
16301
- <div class="mr-10 d-flex align-center mb-10">
16302
- <input type="radio" id="radio-list-csv" class="switch-image" value="List" name="radio-report" part="radio-download"/>
16303
- <label for="radio-list-csv" part="label-radio-download" class="mr-10">List (CSV)</label>
16877
+ <div class="d-flex">
16878
+ <button id="button-download-compliances" part="button" class="mt-5">Download</button>
16304
16879
  </div>
16305
- <div class="mr-10 d-flex align-center mb-10">
16306
- <input type="radio" id="radio-consolidated" class="switch-image" value="Consolidated" name="radio-report" part="radio-download"/>
16307
- <label for="radio-consolidated" part="label-radio-download" class="mr-10">Consolidated (HTML)</label>
16880
+ </div>
16881
+ <div class="p-10 ml-10">
16882
+ <div part="td-head">Certificate</div>
16883
+ <div part="td-body" class="d-flex align-center mt-5">
16884
+ <input type="radio" id="radio-html" class="switch-html" value="Html" checked part="radio-download"/>
16885
+ <label for="radio-html" part="label-radio-download">Html</label>
16308
16886
  </div>
16309
- <div class="mr-10 d-flex align-center mb-10">
16310
- <input type="radio" id="radio-certificate" class="switch-image" value="Certificate" name="radio-report" part="radio-download"/>
16311
- <label for="radio-certificate" part="label-radio-download" class="mr-10">Certificate (HTML)</label>
16887
+ <div class="d-flex">
16888
+ <button id="button-download-certificate" part="button" class="mt-5">Download</button>
16312
16889
  </div>
16313
- </div>
16314
- <div class="d-flex mt-10">
16315
- <button id="button-download-stats" part="button" class="mt-5 ml-10">Download</button>
16316
- </div>
16890
+ </div> -->
16317
16891
  </div>
16318
- <!-- <div class="p-10 ml-10 mr-10">
16319
- <div part="td-head">Compliances</div>
16320
- <div part="td-body" class="d-flex align-center mt-5">
16321
- <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked part="radio-download"/>
16322
- <label for="radio-html" part="label-radio-download">Html</label>
16323
- </div>
16324
- <div class="d-flex">
16325
- <button id="button-download-compliances" part="button" class="mt-5">Download</button>
16326
- </div>
16892
+ </div>
16893
+
16894
+ `;
16895
+ }else{
16896
+ html = `
16897
+
16898
+ <div class="m-10" part="settings-container">
16899
+ <div class="d-flex justify-end">
16900
+ <button id="chart-control-cancel" class="material-icons" part="button-icon-small">close</button>
16327
16901
  </div>
16328
- <div class="p-10 ml-10">
16329
- <div part="td-head">Certificate</div>
16330
- <div part="td-body" class="d-flex align-center mt-5">
16331
- <input type="radio" id="radio-html" class="switch-html" value="Html" checked part="radio-download"/>
16332
- <label for="radio-html" part="label-radio-download">Html</label>
16333
- </div>
16334
- <div class="d-flex">
16335
- <button id="button-download-certificate" part="button" class="mt-5">Download</button>
16902
+
16903
+ <div class="d-flex justify-center">
16904
+ <div class="p-10 mr-10 w-100">
16905
+ <div part="td-head">Reports</div>
16906
+ <div part="td-body" class="d-flex align-center mt-10 flex-wrap">
16907
+ <div class="mr-10 d-flex align-center mb-10">
16908
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked name="radio-report" part="radio-download"/>
16909
+ <label for="radio-csv" part="label-radio-download" class="mr-10">Summary (CSV)</label>
16910
+ </div>
16911
+ <div class="mr-10 d-flex align-center mb-10">
16912
+ <input type="radio" id="radio-image" class="switch-image" value="Image" name="radio-report" part="radio-download"/>
16913
+ <label for="radio-image" part="label-radio-download" class="mr-10">Image (PNG)</label>
16914
+ </div>
16915
+ <div class="mr-10 d-flex align-center mb-10">
16916
+ <input type="radio" id="radio-stats" class="switch-image" value="Stats" name="radio-report" part="radio-download"/>
16917
+ <label for="radio-stats" part="label-radio-download" class="mr-10">Stats (HTML)</label>
16918
+ </div>
16919
+ </div>
16920
+ <div class="d-flex mt-10">
16921
+ <button id="button-download-stats" part="button" class="mt-5 ml-10">Download</button>
16922
+ </div>
16336
16923
  </div>
16337
- </div> -->
16924
+ </div>
16338
16925
  </div>
16339
- </div>
16340
-
16341
- `;
16926
+
16927
+ `;
16928
+ }
16342
16929
 
16343
16930
  container.innerHTML = html;
16344
16931
 
@@ -16350,6 +16937,7 @@ export class SfIEvents extends LitElement {
16350
16937
  });
16351
16938
 
16352
16939
  container.querySelector('#button-download-stats')?.addEventListener('click', async () => {
16940
+ if(selectedTab === -1)
16353
16941
  await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate,"", "no");
16354
16942
  const radioCsv = (container.querySelector('#radio-csv') as HTMLInputElement);
16355
16943
  const radioImage = (container.querySelector('#radio-image') as HTMLInputElement);
@@ -16404,9 +16992,19 @@ export class SfIEvents extends LitElement {
16404
16992
 
16405
16993
  if(radioStats.checked) {
16406
16994
  const ts = new Date().getTime();
16407
-
16995
+ console.log('htmlstatsfilter', this.htmlStatsFilter, selectedTab);
16408
16996
  var html = this.COMPLIANCES_HTML;
16409
16997
  html = html.replace(/PROJECT_NAME/g, this.projectName);
16998
+ if(selectedTab == -1){
16999
+ html = html.replace(/FILTERS_DATA/g, '');
17000
+ }else{
17001
+ let filtersHtml = `
17002
+ <div>
17003
+ ${this.htmlStatsFilter}
17004
+ </div>
17005
+ `
17006
+ html = html.replace(/FILTERS_DATA/g, filtersHtml);
17007
+ }
16410
17008
  html = html.replace(/REPORT_DATE/g, new Date().getDate() + "/" + (new Date().getMonth()+1) + "/" + new Date().getFullYear() + " " + new Date().getHours() + ":" + new Date().getMinutes() + ' for the period ' + this.period);
16411
17009
 
16412
17010
  let tempHtml: string = "";
@@ -16427,11 +17025,12 @@ export class SfIEvents extends LitElement {
16427
17025
  a.click()
16428
17026
  }
16429
17027
 
16430
- if(radioList.checked) {
17028
+ if(radioList?.checked) {
16431
17029
  const ts = new Date();
16432
17030
 
16433
17031
  var html = this.COMPLIANCES_HTML;
16434
17032
  html = html.replace(/PROJECT_NAME/g, this.projectName);
17033
+ html = html.replace(/FILTERS_DATA/g, '');
16435
17034
  html = html.replace(/REPORT_DATE/g, new Date().getDate() + "/" + (new Date().getMonth()+1) + "/" + new Date().getFullYear() + " " + new Date().getHours() + ":" + new Date().getMinutes() + ' for the period ' + this.period);
16436
17035
 
16437
17036
  let tempHtml: string = "";
@@ -16446,7 +17045,7 @@ export class SfIEvents extends LitElement {
16446
17045
  a.click()
16447
17046
  }
16448
17047
 
16449
- if(radioListCsv.checked) {
17048
+ if(radioListCsv?.checked) {
16450
17049
  const ts = new Date();
16451
17050
  console.log(this.csvDataCompliances);
16452
17051
  const blob = new Blob([this.csvDataCompliances], { type: 'text/csv' });
@@ -16457,12 +17056,13 @@ export class SfIEvents extends LitElement {
16457
17056
  a.click()
16458
17057
  }
16459
17058
 
16460
- if(radioConsolidated.checked) {
17059
+ if(radioConsolidated?.checked) {
16461
17060
 
16462
17061
  const ts = new Date().getTime();
16463
17062
 
16464
17063
  var html = this.COMPLIANCES_HTML;
16465
17064
  html = html.replace(/PROJECT_NAME/g, this.projectName);
17065
+ html = html.replace(/FILTERS_DATA/g, '');
16466
17066
  html = html.replace(/REPORT_DATE/g, new Date().getDate() + "/" + (new Date().getMonth()+1) + "/" + new Date().getFullYear() + " " + new Date().getHours() + ":" + new Date().getMinutes() + ' for the period ' + this.period);
16467
17067
 
16468
17068
  let tempHtml: string = "";
@@ -16485,7 +17085,7 @@ export class SfIEvents extends LitElement {
16485
17085
 
16486
17086
  }
16487
17087
 
16488
- if(radioCertificate.checked) {
17088
+ if(radioCertificate?.checked) {
16489
17089
 
16490
17090
  var html = this.CERTIFICATE_HTML;
16491
17091
  html = html.replace(/PERSON_NAME/g, this.userName);
@@ -16538,7 +17138,7 @@ export class SfIEvents extends LitElement {
16538
17138
  }
16539
17139
 
16540
17140
  renderChartSettings = (container: HTMLDivElement, selectedTab: number = -1, selectedSummary: number = -1, ctx: any) => {
16541
-
17141
+ console.log('rendering chart settings', selectedSummary);
16542
17142
  var html = '';
16543
17143
 
16544
17144
  html += '<div class="d-flex justify-end align-start">';
@@ -16554,7 +17154,7 @@ export class SfIEvents extends LitElement {
16554
17154
  }
16555
17155
  if (selectedSummary === 1) {
16556
17156
  html += '<button class="tab-button" id="chart-control-summary" part="calendar-tab-button-selected" class="mr-10"><span class="material-icons">summarize</span></button>';
16557
- } else {
17157
+ } else if(selectedSummary !== 2) {
16558
17158
  html += '<button class="tab-button" id="chart-control-summary" part="calendar-tab-button-not-selected" class="mr-10"><span class="material-icons">summarize</span></button>';
16559
17159
  }
16560
17160
  html += '</div>';
@@ -16563,7 +17163,7 @@ export class SfIEvents extends LitElement {
16563
17163
 
16564
17164
  (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-settings')?.addEventListener('click', () => {
16565
17165
 
16566
- this.renderChartSettings(container, 1, -1, ctx);
17166
+ this.renderChartSettings(container, 1, selectedSummary, ctx);
16567
17167
 
16568
17168
  });
16569
17169
  (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-summary')?.addEventListener('click', () => {
@@ -16585,10 +17185,10 @@ export class SfIEvents extends LitElement {
16585
17185
  this.renderChartSettingsFilters((container.querySelector('#chart-settings') as HTMLDivElement), ctx);
16586
17186
  }
16587
17187
 
16588
- if(selectedTab === 1) {
17188
+ if(selectedTab === 1 ) {
16589
17189
  // const radioCompleteness = container.querySelector('#radio-completeness') as HTMLButtonElement;
16590
17190
  // radioCompleteness.click();
16591
- this.renderChartSettingsSettings((container.querySelector('#chart-settings') as HTMLDivElement));
17191
+ this.renderChartSettingsSettings((container.querySelector('#chart-settings') as HTMLDivElement), selectedSummary);
16592
17192
  }
16593
17193
 
16594
17194
  (container.querySelector('#chart-settings') as HTMLDivElement).addEventListener('canceled', () => {
@@ -16610,7 +17210,11 @@ export class SfIEvents extends LitElement {
16610
17210
  // this.renderPast(this.streamIndex);
16611
17211
  // }
16612
17212
  if(this.getCurrentTab() == this.TAB_CUSTOM) {
16613
- this.processDateSelection(container);
17213
+ if(selectedSummary === 2){
17214
+ this.processDateSelectionViewer(container)
17215
+ }else{
17216
+ this.processDateSelection(container);
17217
+ }
16614
17218
  }
16615
17219
  })
16616
17220
 
@@ -18500,7 +19104,7 @@ export class SfIEvents extends LitElement {
18500
19104
  var html = '';
18501
19105
 
18502
19106
  html += '<button class="tab-button mb-10" id="calendar-tab-month" part="'+(selectedTab == this.TAB_STREAM ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected')+'">Month</button>';
18503
- html += '<button class="tab-button mb-10" id="calendar-tab-custom" part="'+(selectedTab == this.TAB_CUSTOM ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected')+'">Range</button>';
19107
+ html += '<button class="tab-button mb-10" id="calendar-tab-custom" part="'+(selectedTab == this.TAB_CUSTOM ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected')+'">' + (this.myRole == this.TAB_VIEWER ? "Statistics" : "Range")+ '</button>';
18504
19108
  html += '<button class="tab-button mb-10" id="calendar-tab-register" part="'+(selectedTab == this.TAB_REGISTERS ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected')+'">Registers</button>';
18505
19109
  html += '<button class="tab-button tab-button-secondary mb-10 '+(selectedTab == this.TAB_FIND ? '' : 'hide')+'" id="calendar-tab-find" part="'+(selectedTab == this.TAB_FIND ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected')+'">Search</button>';
18506
19110
  html += '<button class="tab-button tab-button-secondary mb-10 '+(selectedTab == this.TAB_THIS ? '' : 'hide')+'" id="calendar-tab-this" part="'+(selectedTab == this.TAB_THIS ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected')+'">Current</button>';
@@ -18611,7 +19215,11 @@ export class SfIEvents extends LitElement {
18611
19215
  (this._SfTabContainer as HTMLDivElement).querySelector('#calendar-tab-custom')?.addEventListener('click', () => {
18612
19216
  this.enableCustom();
18613
19217
  this.renderTabs(this.TAB_CUSTOM);
18614
- this.renderCustom();
19218
+ if(this.myRole == this.TAB_VIEWER){
19219
+ this.renderCustomViewer()
19220
+ }else{
19221
+ this.renderCustom();
19222
+ }
18615
19223
  });
18616
19224
 
18617
19225
  (this._SfTabContainer as HTMLDivElement).querySelector('#calendar-tab-find')?.addEventListener('click', () => {
@@ -21647,6 +22255,72 @@ export class SfIEvents extends LitElement {
21647
22255
 
21648
22256
  }
21649
22257
 
22258
+ fetchStatistics = async(startDate: string = "", endDate: string = "", filtercriteria: string, filterid: string) => {
22259
+
22260
+ let path = "";
22261
+ this.sdate = startDate;
22262
+ this.edate = endDate;
22263
+
22264
+
22265
+ path = "getstatistics";
22266
+
22267
+ let sDate = "";
22268
+ let eDate = "";
22269
+
22270
+ //console.log('currenttab', this.getCurrentTab());
22271
+
22272
+ if(this.getCurrentTab() == this.TAB_YEAR) {
22273
+ sDate = "03/31/" + this.calendarStartYYYY;
22274
+ eDate = "04/01/" + (parseInt(this.calendarStartYYYY) + 1);
22275
+ } else {
22276
+ sDate = startDate;
22277
+ eDate = endDate;
22278
+ }
22279
+
22280
+
22281
+ let url = "https://"+this.apiId+"/"+ path;
22282
+
22283
+ //console.log('fetch calendar url', url);
22284
+ let urlBody :any = {"projectid": this.projectId, "userid": this.userProfileId, "role": this.myRole, "sdate": sDate, "edate": eDate};
22285
+
22286
+ if(filtercriteria == 'function') {
22287
+ urlBody["functionid"] = filterid;
22288
+ urlBody["locationid"] = '';
22289
+ urlBody["filteruserrole"] = '';
22290
+ urlBody["filteruserid"] = '';
22291
+ }else if(filtercriteria == 'location'){
22292
+ urlBody["functionid"] = '';
22293
+ urlBody["locationid"] = filterid;
22294
+ urlBody["filteruserrole"] = '';
22295
+ urlBody["filteruserid"] = '';
22296
+ }else{
22297
+ urlBody["functionid"] = '';
22298
+ urlBody["locationid"] = '';
22299
+ urlBody["filteruserrole"] = filtercriteria;
22300
+ urlBody["filteruserid"] = filterid;
22301
+ }
22302
+
22303
+ console.log('urlbody', urlBody);
22304
+
22305
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
22306
+ const xhr : any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
22307
+ this._SfLoader.innerHTML = '';
22308
+ if(xhr.status == 200) {
22309
+
22310
+ const jsonRespose = JSON.parse(xhr.responseText);
22311
+ console.log('jsonRespose Statistics', jsonRespose);
22312
+ this.statistics = jsonRespose.data
22313
+ if(jsonRespose.meta != null)
22314
+ this.statisticsMeta = jsonRespose.meta
22315
+ return jsonRespose.meta
22316
+
22317
+ } else {
22318
+ const jsonRespose = JSON.parse(xhr.responseText);
22319
+ this.setError(jsonRespose.error);
22320
+ }
22321
+
22322
+ }
22323
+
21650
22324
  fetchBulkReportingData = async() => {
21651
22325
  let path = "getbulkreportjobs"
21652
22326
  let urlBody :any = {"projectid": this.projectId}