sf-i-events 1.0.733 → 1.0.735

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,109 @@ 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
+ selectFilterCriteria.innerHTML = ""
6575
+ let option = new Option()
6576
+ option.value = "";
6577
+ option.innerHTML = "all"
6578
+ selectFilterCriteria.add(option)
6579
+ for(let criteria of Object.keys(this.statisticsMeta)){
6580
+ let option = new Option()
6581
+ option.value = criteria;
6582
+ if(criteria == "reporter" || criteria == "approver" || criteria == "functionhead"){
6583
+ option.innerHTML = "user:" + criteria
6584
+ }else{
6585
+ option.innerHTML = criteria
6586
+ }
6587
+ selectFilterCriteria.add(option)
6588
+ }
6589
+ let selectFilterCriteriaNew = Util.clearListeners(selectFilterCriteria)
6590
+ selectFilterCriteriaNew.addEventListener('change',(ev: any) => {
6591
+ let target = ev.target as HTMLSelectElement
6592
+ let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria') as HTMLLabelElement
6593
+ let selectFilterValues = eventsContainer.querySelector('#select-filter-values') as HTMLSelectElement
6594
+ if(target.value == ""){
6595
+ selectFilterValues.value = ""
6596
+ this.processDateSelectionViewer(eventsContainer)
6597
+ }
6598
+
6599
+ selectFilterValues.innerHTML = ""
6600
+ let option = new Option()
6601
+ option.value = "";
6602
+ option.innerHTML = "All";
6603
+ selectFilterValues.add(option)
6604
+ if(this.statisticsMeta[target.value] != null){
6605
+ let sortedFilters = Util.alphabeticalSort(this.statisticsMeta[target.value])
6606
+ selectFilterValues.style.display = 'block'
6607
+ inputLabelCriteria.style.display = 'block'
6608
+ inputLabelCriteria.innerHTML = target.value
6609
+ for(let filter of sortedFilters){
6610
+ let option = new Option()
6611
+ option.value = filter.split(';')[1];
6612
+ option.innerHTML = filter.split(';')[0].replace(/\([^)]*\)/g,"")
6613
+ selectFilterValues.add(option)
6614
+ }
6615
+ let selectFilterValuesNew = Util.clearListeners(selectFilterValues)
6616
+ selectFilterValuesNew.addEventListener('change',() => {
6617
+ console.log('changed')
6618
+ this.processDateSelectionViewer(eventsContainer);
6619
+ })
6620
+ }else{
6621
+ selectFilterValues.style.display = 'none'
6622
+ inputLabelCriteria.style.display = 'none'
6623
+ }
6624
+ })
6625
+ let selectFilterValues = eventsContainer.querySelector('#select-filter-values') as HTMLSelectElement
6626
+ let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria') as HTMLLabelElement
6627
+ selectFilterValues.style.display = 'none'
6628
+ inputLabelCriteria.style.display = 'none'
6422
6629
  }
6423
6630
  renderSelectAllButtons = () => {
6424
6631
  let selectAllHtml = '<div class="d-flex justify-end w-100" style="position: fixed; bottom: 70px; left: 0px;" part="button-select-all-container">';
@@ -6856,6 +7063,102 @@ export class SfIEvents extends LitElement {
6856
7063
 
6857
7064
  }
6858
7065
 
7066
+ processDateSelectionViewer = async (eventContainer: HTMLDivElement) => {
7067
+
7068
+ var startDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);
7069
+ var endDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + (parseInt(this.calendarStartYYYY) + 1));
7070
+
7071
+ var valueStart = ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value;
7072
+ if(valueStart == "") {
7073
+ valueStart = ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value;
7074
+ }
7075
+ var valueEnd = ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value;
7076
+ if(valueEnd == "") {
7077
+ valueEnd = ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value;
7078
+ }
7079
+
7080
+ //console.log('valuestart', valueStart);
7081
+ //console.log('valueend', valueEnd);
7082
+ let filtercriteria = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).value
7083
+ let filtercriterianame = ""
7084
+ 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]);
7085
+ if(((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).selectedIndex] != null){
7086
+ filtercriterianame = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).selectedIndex].innerHTML
7087
+ }
7088
+ if(filtercriteria == ""){
7089
+ filtercriteria = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria-mobile') as HTMLSelectElement).value
7090
+ 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){
7091
+ 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
7092
+ }
7093
+ }
7094
+ let filtervalue = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement).value
7095
+ let filtervaluename = ""
7096
+ if(((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement).selectedIndex] != null){
7097
+ filtervaluename = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement).options[((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement).selectedIndex].innerHTML
7098
+ }
7099
+ if(filtervalue == ""){
7100
+ filtervalue = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values-mobile') as HTMLSelectElement).value
7101
+ 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){
7102
+ 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
7103
+ }
7104
+ }
7105
+ if(filtercriteria == ""){
7106
+ this.htmlStatsFilter = "Filters Selected -> All"
7107
+ }else{
7108
+ if(filtervalue == ""){
7109
+ this.htmlStatsFilter = "Filters Selected -> " + Util.titleCase(filtercriterianame) + " -> All"
7110
+ }else{
7111
+ this.htmlStatsFilter = "Filters Selected -> " + Util.titleCase(filtercriterianame) + " -> " + Util.titleCase(filtervaluename)
7112
+ }
7113
+ }
7114
+ if(valueStart != "" && valueEnd != "") {
7115
+ this.initCustomRightColViewer();
7116
+ if(!this.checkStartDateEarliness(valueStart)) {
7117
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen Start Date cannot be earlier than " + startDateCalendar;
7118
+ return;
7119
+ }
7120
+ if(!this.checkEndDateLateness(valueEnd)) {
7121
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen End Date cannot be later than " + endDateCalendar;
7122
+ return;
7123
+ }
7124
+ if(new Date(valueStart).getTime() > new Date(valueEnd).getTime()) {
7125
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
7126
+ return;
7127
+ }
7128
+ if((new Date(valueEnd).getTime() - new Date(valueStart).getTime())/(1000*60*60*24) > 400) {
7129
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen time window cannot be greater than 400 days";
7130
+ return;
7131
+ }
7132
+ const tsStart = new Date(valueStart);
7133
+ const tsEnd = new Date(valueEnd);
7134
+ tsStart.setDate(tsStart.getDate() - 2);
7135
+ tsEnd.setDate(tsEnd.getDate() + 2);
7136
+
7137
+ //console.log('tsstart', tsStart);
7138
+ //console.log('tsend', tsEnd);
7139
+
7140
+ let meta = await this.fetchStatistics((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear(), filtercriteria, filtervalue);
7141
+ 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));
7142
+
7143
+ if(meta != null) this.renderStatisticsFilters((this._SfCustomContainer as HTMLDivElement))
7144
+ } else if(valueStart != "" && valueEnd == "") {
7145
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Please select End Date";
7146
+ } else if(valueStart == "" && valueEnd != "") {
7147
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Please select Start Date";
7148
+ } else if(valueStart == "" && valueEnd == "") {
7149
+ (this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Please select Start Date and End Date";
7150
+ }
7151
+
7152
+ this.attachHandlers(eventContainer, valueStart, valueEnd);
7153
+
7154
+ if(eventContainer.innerHTML.indexOf('myChart') >= 0) {
7155
+
7156
+ this.renderCompletenessGraph(eventContainer, -1, 2);
7157
+
7158
+ }
7159
+
7160
+ }
7161
+
6859
7162
  initFindRightCol = () => {
6860
7163
 
6861
7164
  var html = "";
@@ -6886,6 +7189,21 @@ export class SfIEvents extends LitElement {
6886
7189
 
6887
7190
  }
6888
7191
 
7192
+ initCustomRightColViewer = () => {
7193
+
7194
+ var html = "";
7195
+
7196
+ html += '<div id="stream-event-0" part="stream-event-list" class="stream-event-list">';
7197
+ html += '<div part="stream-event-not-selected" class="d-flex stream-event-not-selected">';
7198
+ html += '<div><h2 id="stream-event-status">Please select Start Date, End Date and Filter Criteria</h2></div>';
7199
+ html += '</div>';
7200
+ html += '</div>';
7201
+
7202
+
7203
+ (this._SfCustomContainer as HTMLDivElement).querySelector('.calendar-right-data')!.innerHTML = html
7204
+
7205
+ }
7206
+
6889
7207
  checkAndShowBulk = () => {
6890
7208
 
6891
7209
  const inputArr = (this._SfMappingContainer as HTMLDivElement).querySelectorAll('.input-checkbox') as NodeListOf<HTMLInputElement>;
@@ -8865,6 +9183,225 @@ export class SfIEvents extends LitElement {
8865
9183
  // }
8866
9184
  }
8867
9185
 
9186
+ renderCustomViewer = () => {
9187
+
9188
+ this.clearGraphData();
9189
+ this.clearSelectedGraphParam();
9190
+ this.clearSelectedLegend();
9191
+
9192
+ var html = '';
9193
+
9194
+ html += '<div class="scroll-x w-100 mobile-only">';
9195
+
9196
+ html += '<div class="title-item-date">';
9197
+ html += '<label part="input-label">Start Date</label><br />'
9198
+ html += '<input id="stream-start-date-mobile" part="input" type="date" />'
9199
+ html += '</div>';
9200
+ html += '<div class="title-item-date">';
9201
+ html += '<label part="input-label">End Date</label><br />'
9202
+ html += '<input id="stream-end-date-mobile" part="input" type="date" />'
9203
+ html += '</div>';
9204
+ html += '<div class="title-item-date">';
9205
+ html += '<button id="button-year-to-date-mobile" part="button-lg-short-secondary">Year To Date</button>'
9206
+ html += '</div>';
9207
+ html += '<div class="title-item-date">';
9208
+ html += '<button id="button-this-quarter-mobile" part="button-lg-short-secondary">This Quarter</button>'
9209
+ html += '</div>';
9210
+ html += '<div class="title-item-date">';
9211
+ html += '<button id="button-this-year-mobile" part="button-lg-short-secondary">This Year</button>'
9212
+ html += '</div>';
9213
+ html += '<div class="title-item-date">';
9214
+ html += '<label part="input-label-filter-criteria" id="input-label-filter-mobile">Filter Criteria</label><br />'
9215
+ html += '<select id="select-filter-criteria-mobile" class="mr-10"></select>'
9216
+ html += '</div>';
9217
+ html += '<div class="title-item-date">';
9218
+ html += '<label part="input-label-filter-value" id="input-label-criteria-mobile"></label><br />'
9219
+ html += '<select id="select-filter-values-mobile" class="mr-10"></select>'
9220
+ html += '</div>';
9221
+
9222
+ html += '</div>';
9223
+
9224
+ html += '<div class="d-flex w-100">';
9225
+ html += '<div class="calendar-left-col desktop-only flex-col justify-start align-end">';
9226
+
9227
+ html += '<div class="title-item-date d-flex flex-col align-end">';
9228
+ html += '<label part="input-label">Start Date</label>'
9229
+ html += '<input id="stream-start-date" part="input" type="date" />'
9230
+ html += '</div>';
9231
+ html += '<div class="title-item-date d-flex flex-col align-end">';
9232
+ html += '<label part="input-label">End Date</label>'
9233
+ html += '<input id="stream-end-date" part="input" type="date" />'
9234
+ html += '</div>';
9235
+ html += '<div class="title-item-date">';
9236
+ html += '<button id="button-year-to-date" part="button-lg-short-secondary">Year To Date</button>'
9237
+ html += '</div>';
9238
+ html += '<div class="title-item-date">';
9239
+ html += '<button id="button-this-quarter" part="button-lg-short-secondary">This Quarter</button>'
9240
+ html += '</div>';
9241
+ html += '<div class="title-item-date">';
9242
+ html += '<button id="button-this-year" part="button-lg-short-secondary">This Year</button>'
9243
+ html += '</div>';
9244
+ html += '<div class="title-item-date d-flex flex-col align-end">';
9245
+ html += '<label part="input-label-filter-criteria" id="input-label-filter" class="mr-10">Filter Criteria</label>'
9246
+ html += '<select id="select-filter-criteria" class="mr-10"></select>'
9247
+ html += '</div>';
9248
+ html += '<div class="title-item-date d-flex flex-col align-end">';
9249
+ html += '<label part="input-label-filter-value" id="input-label-criteria" class="mr-10"></label>'
9250
+ html += '<select id="select-filter-values" class="mr-10"></select>'
9251
+ html += '</div>';
9252
+
9253
+
9254
+ html += '</div>';
9255
+
9256
+ html += '<div class="calendar-right-data flex-grow">';
9257
+
9258
+ html += '</div>';
9259
+ html += '</div>';
9260
+
9261
+ console.log('html', html);
9262
+ (this._SfCustomContainer as HTMLDivElement).innerHTML = html;
9263
+
9264
+ this.initCustomRightColViewer();
9265
+
9266
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date')?.addEventListener('change', (_ev: any) => {
9267
+ //console.log('start-date', ev);
9268
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9269
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9270
+ });
9271
+
9272
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date')?.addEventListener('change', (_ev: any) => {
9273
+ //console.log('end-date', ev);
9274
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9275
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9276
+ });
9277
+
9278
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile')?.addEventListener('change', (_ev: any) => {
9279
+ //console.log('start-date', ev);
9280
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9281
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9282
+ });
9283
+
9284
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile')?.addEventListener('change', (_ev: any) => {
9285
+ //console.log('end-date', ev);
9286
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9287
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9288
+ });
9289
+
9290
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-year-to-date')?.addEventListener('click', () => {
9291
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9292
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9293
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
9294
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
9295
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9296
+ });
9297
+
9298
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-year-to-date-mobile')?.addEventListener('click', () => {
9299
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9300
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9301
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
9302
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
9303
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9304
+ });
9305
+
9306
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-year-mobile')?.addEventListener('click', () => {
9307
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9308
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9309
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9310
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9311
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9312
+ });
9313
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-year')?.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 = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9317
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
9318
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9319
+ });
9320
+
9321
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-quarter-mobile')?.addEventListener('click', () => {
9322
+
9323
+ const mmCurrent = ((new Date().getMonth() + 1));
9324
+
9325
+ let startDate : string = "";
9326
+ let endDate : string = "";
9327
+
9328
+ if(mmCurrent >=4 && mmCurrent <= 6) {
9329
+
9330
+ startDate = this.calendarStartYYYY + '-' + '04' + '-' + "01";
9331
+ endDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
9332
+
9333
+ } else if(mmCurrent >=6 && mmCurrent <= 9) {
9334
+
9335
+ startDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
9336
+ endDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
9337
+
9338
+ } else if(mmCurrent >=9 && mmCurrent <= 12) {
9339
+
9340
+ startDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
9341
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
9342
+
9343
+ } else {
9344
+ startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
9345
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
9346
+ }
9347
+
9348
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = startDate;
9349
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = startDate;
9350
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = endDate;
9351
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = endDate;
9352
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9353
+ });
9354
+ (this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-quarter')?.addEventListener('click', () => {
9355
+
9356
+ const mmCurrent = ((new Date().getMonth() + 1));
9357
+
9358
+ let startDate : string = "";
9359
+ let endDate : string = "";
9360
+
9361
+ if(mmCurrent >=4 && mmCurrent <= 6) {
9362
+
9363
+ startDate = this.calendarStartYYYY + '-' + '04' + '-' + "01";
9364
+ endDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
9365
+
9366
+ } else if(mmCurrent >=6 && mmCurrent <= 9) {
9367
+
9368
+ startDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
9369
+ endDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
9370
+
9371
+ } else if(mmCurrent >=9 && mmCurrent <= 12) {
9372
+
9373
+ startDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
9374
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
9375
+
9376
+ } else {
9377
+ startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
9378
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
9379
+ }
9380
+
9381
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = startDate;
9382
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = startDate;
9383
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = endDate;
9384
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = endDate;
9385
+ this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
9386
+ });
9387
+
9388
+ let selectFilterCriteria = (this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement
9389
+ selectFilterCriteria.style.display = 'none'
9390
+ let selectFilterValues = (this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-values') as HTMLSelectElement
9391
+ selectFilterValues.style.display = 'none'
9392
+ let inputLabelFilter = (this._SfCustomContainer as HTMLDivElement).querySelector('#input-label-filter') as HTMLLabelElement
9393
+ inputLabelFilter.style.display = 'none';
9394
+ // for(var i = 0; i < 3; i++) {
9395
+ // (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-month-' + i)?.addEventListener('click', (ev: any)=> {
9396
+ // const target = parseInt((ev.target as HTMLDivElement).id.split('-')[2]);
9397
+ // //console.log('clicked ', target);
9398
+ // this.renderPast(target);
9399
+ // })
9400
+ // }
9401
+
9402
+ ((this._SfCustomContainer as HTMLDivElement).querySelector('#button-year-to-date') as HTMLButtonElement).click();
9403
+ }
9404
+
8868
9405
  renderThis = (index: number = 1, showGraph: boolean = true) => {
8869
9406
 
8870
9407
  this.clearGraphData();
@@ -9275,17 +9812,19 @@ export class SfIEvents extends LitElement {
9275
9812
  document.addEventListener('scroll',() => {
9276
9813
  // console.log('scroll',window.scrollY)
9277
9814
  let buttonRefresh = eventsContainer.querySelector('#button-refresh') as HTMLButtonElement
9278
- if(window.scrollY > 720){
9279
- if(buttonRefresh.style.display == "flex"){
9815
+ if(buttonRefresh != null){
9816
+ if(window.scrollY > 720){
9817
+ if(buttonRefresh.style.display == "flex"){
9280
9818
 
9819
+ }else{
9820
+ buttonRefresh.style.display = 'flex'
9821
+ }
9281
9822
  }else{
9282
- buttonRefresh.style.display = 'flex'
9283
- }
9284
- }else{
9285
- if(buttonRefresh.style.display == "none"){
9823
+ if(buttonRefresh.style.display == "none"){
9286
9824
 
9287
- }else{
9288
- buttonRefresh.style.display = 'none'
9825
+ }else{
9826
+ buttonRefresh.style.display = 'none'
9827
+ }
9289
9828
  }
9290
9829
  }
9291
9830
  })
@@ -9933,7 +10472,7 @@ export class SfIEvents extends LitElement {
9933
10472
 
9934
10473
  }
9935
10474
 
9936
- renderCompletenessGraph = (divContainer: HTMLDivElement) => {
10475
+ renderCompletenessGraph = (divContainer: HTMLDivElement, selectedTab: number = -1, selectedSummary: number = -1) => {
9937
10476
 
9938
10477
  this.clearSelectedGraphParam();
9939
10478
  // this.clearSelectedLegend();
@@ -9973,7 +10512,7 @@ export class SfIEvents extends LitElement {
9973
10512
  }]
9974
10513
  }
9975
10514
 
9976
- this.renderChartSettings(divContainer, -1, -1, ctx);
10515
+ this.renderChartSettings(divContainer, selectedTab, selectedSummary, ctx);
9977
10516
  this.renderChart(ctx, 'doughnut', data, "Completeness")
9978
10517
 
9979
10518
  }
@@ -10007,7 +10546,7 @@ export class SfIEvents extends LitElement {
10007
10546
  for(var i = 0; i < itemsCompliance.length; i++) {
10008
10547
  itemsCompliance[i].style.display = 'none';
10009
10548
  }
10010
- this.renderChartSettings(divContainer, -1, -1, ctx);
10549
+ this.renderChartSettings(divContainer, selectedTab, selectedSummary, ctx);
10011
10550
  this.renderChart(ctx, 'doughnut', data, "Completeness")
10012
10551
 
10013
10552
  }
@@ -12010,7 +12549,7 @@ export class SfIEvents extends LitElement {
12010
12549
 
12011
12550
  const tempArray = [];
12012
12551
 
12013
- for(let count = 0; count < sourceArray.data.mappings.mappings.length; count++) {
12552
+ for(var count = 0; count < sourceArray.data.mappings.mappings.length; count++) {
12014
12553
 
12015
12554
  //console.log('selectedindexchecking', selectedIndex, count, this.selectedCbs.includes(selectedIndex), this.selectedCbs.includes(count));
12016
12555
  //taggingArray.data.mappings.mappings[count] = sourceArray.data.mappings.mappings[count];
@@ -12212,10 +12751,7 @@ export class SfIEvents extends LitElement {
12212
12751
 
12213
12752
  async function process() {
12214
12753
 
12215
- console.log = function() {
12216
- console.log('Saving...', mapping);
12217
- }
12218
-
12754
+ //console.log('Saving...', mapping);
12219
12755
 
12220
12756
  await uploadFunction(mapping);
12221
12757
  if(!saveInBackground) refreshFunction();
@@ -12658,7 +13194,7 @@ export class SfIEvents extends LitElement {
12658
13194
  if(taggingArray.data.mappings.mappings[k].id == sourceArray.data.mappings.mappings[i].id) {
12659
13195
  if(taggingArray.data.mappings.mappings[k].id == "62330e24-298d-4ef2-9449-c0e400e37cac") {
12660
13196
 
12661
- // console.log('found', taggingArray.data.mappings.mappings[k]);
13197
+ console.log('found', taggingArray.data.mappings.mappings[k]);
12662
13198
  //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
13199
  //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
13200
 
@@ -14033,10 +14569,10 @@ export class SfIEvents extends LitElement {
14033
14569
  this._SfLoader.innerHTML = '<div class="lds-dual-ring"></div>';
14034
14570
  this._SfLoader.innerHTML += ('<div class="lds-text"><div class="lds-text-c"></div></div>');
14035
14571
  }
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);
14572
+ setTimeout(() => {
14573
+ this.renderMappingTable(divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, inputFilter.value, statuteColName, extraHintsArr)
14574
+ this._SfLoader.innerHTML = '';
14575
+ }, 1000);
14040
14576
 
14041
14577
  }
14042
14578
 
@@ -14211,9 +14747,9 @@ export class SfIEvents extends LitElement {
14211
14747
  arrCheckBoxes[i].addEventListener('change', async (_e: any) => {
14212
14748
  //console.log(e.currentTarget, (e.currentTarget as HTMLInputElement).checked);
14213
14749
  ((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
- // }
14750
+ if(extraFieldPosition === 1) {
14751
+ await this.saveMapping (divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true)
14752
+ }
14217
14753
  });
14218
14754
  }
14219
14755
 
@@ -14615,7 +15151,7 @@ export class SfIEvents extends LitElement {
14615
15151
 
14616
15152
  (this._SfOnboardingActivationsContainer as HTMLDivElement).innerHTML = html;
14617
15153
 
14618
- this.renderTaggingTable((this._SfOnboardingActivationListContainer as HTMLDivElement),mappedSerializedExtensions, mappedActivations, [ ], this.uploadActivationsMapping, this.loadOnboardingActivations, "activations", ["id", "entityname", "locationname"], '', "", ["activations"], activationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15154
+ 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
15155
 
14620
15156
  }
14621
15157
 
@@ -14641,7 +15177,7 @@ export class SfIEvents extends LitElement {
14641
15177
 
14642
15178
  (this._SfOnboardingAlertSchedulesContainer as HTMLDivElement).innerHTML = html;
14643
15179
 
14644
- this.renderTaggingTable((this._SfOnboardingAlertSchedulesListContainer as HTMLDivElement),mappedSerializedExtensions, mappedAlertSchedules, [ ], this.uploadAlertSchedulesMapping, this.loadOnboardingAlertSchedules, "alertschedules", ["id", "entityname", "locationname"], '', "", ["alertschedules"], alertschedulesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15180
+ 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
15181
 
14646
15182
  }
14647
15183
 
@@ -14693,7 +15229,7 @@ export class SfIEvents extends LitElement {
14693
15229
 
14694
15230
  (this._SfOnboardingApproversContainer as HTMLDivElement).innerHTML = html;
14695
15231
 
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", "");
15232
+ 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
15233
 
14698
15234
  }
14699
15235
 
@@ -14796,7 +15332,6 @@ export class SfIEvents extends LitElement {
14796
15332
 
14797
15333
  (this._SfOnboardingFunctionsContainer as HTMLDivElement).innerHTML = html;
14798
15334
 
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
15335
  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
15336
 
14802
15337
  }
@@ -16269,76 +16804,112 @@ export class SfIEvents extends LitElement {
16269
16804
 
16270
16805
  }
16271
16806
 
16272
- renderChartSettingsSettings = (container: HTMLDivElement) => {
16807
+ renderChartSettingsSettings = (container: HTMLDivElement, selectedTab: number = 1) => {
16273
16808
 
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>
16809
+ var html = ``
16810
+ if(selectedTab == 1){
16811
+ html = `
16812
+
16813
+ <div class="m-10" part="settings-container">
16814
+ <div class="d-flex justify-end">
16815
+ <button id="chart-control-cancel" class="material-icons" part="button-icon-small">close</button>
16816
+ </div>
16280
16817
 
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>
16818
+ <div class="d-flex justify-center">
16819
+ <div class="p-10 mr-10 w-100">
16820
+ <div part="td-head">Reports</div>
16821
+ <div part="td-body" class="d-flex align-center mt-10 flex-wrap">
16822
+ <div class="mr-10 d-flex align-center mb-10">
16823
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked name="radio-report" part="radio-download"/>
16824
+ <label for="radio-csv" part="label-radio-download" class="mr-10">Summary (CSV)</label>
16825
+ </div>
16826
+ <div class="mr-10 d-flex align-center mb-10">
16827
+ <input type="radio" id="radio-image" class="switch-image" value="Image" name="radio-report" part="radio-download"/>
16828
+ <label for="radio-image" part="label-radio-download" class="mr-10">Image (PNG)</label>
16829
+ </div>
16830
+ <div class="mr-10 d-flex align-center mb-10">
16831
+ <input type="radio" id="radio-stats" class="switch-image" value="Stats" name="radio-report" part="radio-download"/>
16832
+ <label for="radio-stats" part="label-radio-download" class="mr-10">Stats (HTML)</label>
16833
+ </div>
16834
+ <div class="mr-10 d-flex align-center mb-10">
16835
+ <input type="radio" id="radio-list" class="switch-image" value="List" name="radio-report" part="radio-download"/>
16836
+ <label for="radio-list" part="label-radio-download" class="mr-10">List (HTML)</label>
16837
+ </div>
16838
+ <div class="mr-10 d-flex align-center mb-10">
16839
+ <input type="radio" id="radio-list-csv" class="switch-image" value="List" name="radio-report" part="radio-download"/>
16840
+ <label for="radio-list-csv" part="label-radio-download" class="mr-10">List (CSV)</label>
16841
+ </div>
16842
+ <div class="mr-10 d-flex align-center mb-10">
16843
+ <input type="radio" id="radio-consolidated" class="switch-image" value="Consolidated" name="radio-report" part="radio-download"/>
16844
+ <label for="radio-consolidated" part="label-radio-download" class="mr-10">Consolidated (HTML)</label>
16845
+ </div>
16846
+ <div class="mr-10 d-flex align-center mb-10">
16847
+ <input type="radio" id="radio-certificate" class="switch-image" value="Certificate" name="radio-report" part="radio-download"/>
16848
+ <label for="radio-certificate" part="label-radio-download" class="mr-10">Certificate (HTML)</label>
16849
+ </div>
16292
16850
  </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>
16851
+ <div class="d-flex mt-10">
16852
+ <button id="button-download-stats" part="button" class="mt-5 ml-10">Download</button>
16296
16853
  </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>
16854
+ </div>
16855
+ <!-- <div class="p-10 ml-10 mr-10">
16856
+ <div part="td-head">Compliances</div>
16857
+ <div part="td-body" class="d-flex align-center mt-5">
16858
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked part="radio-download"/>
16859
+ <label for="radio-html" part="label-radio-download">Html</label>
16300
16860
  </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>
16861
+ <div class="d-flex">
16862
+ <button id="button-download-compliances" part="button" class="mt-5">Download</button>
16304
16863
  </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>
16864
+ </div>
16865
+ <div class="p-10 ml-10">
16866
+ <div part="td-head">Certificate</div>
16867
+ <div part="td-body" class="d-flex align-center mt-5">
16868
+ <input type="radio" id="radio-html" class="switch-html" value="Html" checked part="radio-download"/>
16869
+ <label for="radio-html" part="label-radio-download">Html</label>
16308
16870
  </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>
16871
+ <div class="d-flex">
16872
+ <button id="button-download-certificate" part="button" class="mt-5">Download</button>
16312
16873
  </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>
16874
+ </div> -->
16317
16875
  </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>
16876
+ </div>
16877
+
16878
+ `;
16879
+ }else{
16880
+ html = `
16881
+
16882
+ <div class="m-10" part="settings-container">
16883
+ <div class="d-flex justify-end">
16884
+ <button id="chart-control-cancel" class="material-icons" part="button-icon-small">close</button>
16327
16885
  </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>
16886
+
16887
+ <div class="d-flex justify-center">
16888
+ <div class="p-10 mr-10 w-100">
16889
+ <div part="td-head">Reports</div>
16890
+ <div part="td-body" class="d-flex align-center mt-10 flex-wrap">
16891
+ <div class="mr-10 d-flex align-center mb-10">
16892
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked name="radio-report" part="radio-download"/>
16893
+ <label for="radio-csv" part="label-radio-download" class="mr-10">Summary (CSV)</label>
16894
+ </div>
16895
+ <div class="mr-10 d-flex align-center mb-10">
16896
+ <input type="radio" id="radio-image" class="switch-image" value="Image" name="radio-report" part="radio-download"/>
16897
+ <label for="radio-image" part="label-radio-download" class="mr-10">Image (PNG)</label>
16898
+ </div>
16899
+ <div class="mr-10 d-flex align-center mb-10">
16900
+ <input type="radio" id="radio-stats" class="switch-image" value="Stats" name="radio-report" part="radio-download"/>
16901
+ <label for="radio-stats" part="label-radio-download" class="mr-10">Stats (HTML)</label>
16902
+ </div>
16903
+ </div>
16904
+ <div class="d-flex mt-10">
16905
+ <button id="button-download-stats" part="button" class="mt-5 ml-10">Download</button>
16906
+ </div>
16336
16907
  </div>
16337
- </div> -->
16908
+ </div>
16338
16909
  </div>
16339
- </div>
16340
-
16341
- `;
16910
+
16911
+ `;
16912
+ }
16342
16913
 
16343
16914
  container.innerHTML = html;
16344
16915
 
@@ -16350,6 +16921,7 @@ export class SfIEvents extends LitElement {
16350
16921
  });
16351
16922
 
16352
16923
  container.querySelector('#button-download-stats')?.addEventListener('click', async () => {
16924
+ if(selectedTab === -1)
16353
16925
  await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate,"", "no");
16354
16926
  const radioCsv = (container.querySelector('#radio-csv') as HTMLInputElement);
16355
16927
  const radioImage = (container.querySelector('#radio-image') as HTMLInputElement);
@@ -16404,9 +16976,19 @@ export class SfIEvents extends LitElement {
16404
16976
 
16405
16977
  if(radioStats.checked) {
16406
16978
  const ts = new Date().getTime();
16407
-
16979
+ console.log('htmlstatsfilter', this.htmlStatsFilter, selectedTab);
16408
16980
  var html = this.COMPLIANCES_HTML;
16409
16981
  html = html.replace(/PROJECT_NAME/g, this.projectName);
16982
+ if(selectedTab == -1){
16983
+ html = html.replace(/FILTERS_DATA/g, '');
16984
+ }else{
16985
+ let filtersHtml = `
16986
+ <div>
16987
+ ${this.htmlStatsFilter}
16988
+ </div>
16989
+ `
16990
+ html = html.replace(/FILTERS_DATA/g, filtersHtml);
16991
+ }
16410
16992
  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
16993
 
16412
16994
  let tempHtml: string = "";
@@ -16427,11 +17009,12 @@ export class SfIEvents extends LitElement {
16427
17009
  a.click()
16428
17010
  }
16429
17011
 
16430
- if(radioList.checked) {
17012
+ if(radioList?.checked) {
16431
17013
  const ts = new Date();
16432
17014
 
16433
17015
  var html = this.COMPLIANCES_HTML;
16434
17016
  html = html.replace(/PROJECT_NAME/g, this.projectName);
17017
+ html = html.replace(/FILTERS_DATA/g, '');
16435
17018
  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
17019
 
16437
17020
  let tempHtml: string = "";
@@ -16446,7 +17029,7 @@ export class SfIEvents extends LitElement {
16446
17029
  a.click()
16447
17030
  }
16448
17031
 
16449
- if(radioListCsv.checked) {
17032
+ if(radioListCsv?.checked) {
16450
17033
  const ts = new Date();
16451
17034
  console.log(this.csvDataCompliances);
16452
17035
  const blob = new Blob([this.csvDataCompliances], { type: 'text/csv' });
@@ -16457,12 +17040,13 @@ export class SfIEvents extends LitElement {
16457
17040
  a.click()
16458
17041
  }
16459
17042
 
16460
- if(radioConsolidated.checked) {
17043
+ if(radioConsolidated?.checked) {
16461
17044
 
16462
17045
  const ts = new Date().getTime();
16463
17046
 
16464
17047
  var html = this.COMPLIANCES_HTML;
16465
17048
  html = html.replace(/PROJECT_NAME/g, this.projectName);
17049
+ html = html.replace(/FILTERS_DATA/g, '');
16466
17050
  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
17051
 
16468
17052
  let tempHtml: string = "";
@@ -16485,7 +17069,7 @@ export class SfIEvents extends LitElement {
16485
17069
 
16486
17070
  }
16487
17071
 
16488
- if(radioCertificate.checked) {
17072
+ if(radioCertificate?.checked) {
16489
17073
 
16490
17074
  var html = this.CERTIFICATE_HTML;
16491
17075
  html = html.replace(/PERSON_NAME/g, this.userName);
@@ -16538,7 +17122,7 @@ export class SfIEvents extends LitElement {
16538
17122
  }
16539
17123
 
16540
17124
  renderChartSettings = (container: HTMLDivElement, selectedTab: number = -1, selectedSummary: number = -1, ctx: any) => {
16541
-
17125
+ console.log('rendering chart settings', selectedSummary);
16542
17126
  var html = '';
16543
17127
 
16544
17128
  html += '<div class="d-flex justify-end align-start">';
@@ -16554,7 +17138,7 @@ export class SfIEvents extends LitElement {
16554
17138
  }
16555
17139
  if (selectedSummary === 1) {
16556
17140
  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 {
17141
+ } else if(selectedSummary !== 2) {
16558
17142
  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
17143
  }
16560
17144
  html += '</div>';
@@ -16563,7 +17147,7 @@ export class SfIEvents extends LitElement {
16563
17147
 
16564
17148
  (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-settings')?.addEventListener('click', () => {
16565
17149
 
16566
- this.renderChartSettings(container, 1, -1, ctx);
17150
+ this.renderChartSettings(container, 1, selectedSummary, ctx);
16567
17151
 
16568
17152
  });
16569
17153
  (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-summary')?.addEventListener('click', () => {
@@ -16585,10 +17169,10 @@ export class SfIEvents extends LitElement {
16585
17169
  this.renderChartSettingsFilters((container.querySelector('#chart-settings') as HTMLDivElement), ctx);
16586
17170
  }
16587
17171
 
16588
- if(selectedTab === 1) {
17172
+ if(selectedTab === 1 ) {
16589
17173
  // const radioCompleteness = container.querySelector('#radio-completeness') as HTMLButtonElement;
16590
17174
  // radioCompleteness.click();
16591
- this.renderChartSettingsSettings((container.querySelector('#chart-settings') as HTMLDivElement));
17175
+ this.renderChartSettingsSettings((container.querySelector('#chart-settings') as HTMLDivElement), selectedSummary);
16592
17176
  }
16593
17177
 
16594
17178
  (container.querySelector('#chart-settings') as HTMLDivElement).addEventListener('canceled', () => {
@@ -16610,7 +17194,11 @@ export class SfIEvents extends LitElement {
16610
17194
  // this.renderPast(this.streamIndex);
16611
17195
  // }
16612
17196
  if(this.getCurrentTab() == this.TAB_CUSTOM) {
16613
- this.processDateSelection(container);
17197
+ if(selectedSummary === 2){
17198
+ this.processDateSelectionViewer(container)
17199
+ }else{
17200
+ this.processDateSelection(container);
17201
+ }
16614
17202
  }
16615
17203
  })
16616
17204
 
@@ -17202,7 +17790,9 @@ export class SfIEvents extends LitElement {
17202
17790
 
17203
17791
 
17204
17792
  }
17205
- this.chart4Base64 = (this.chart4 as Chart).toBase64Image()
17793
+ if(this.chart4 != null){
17794
+ this.chart4Base64 = (this.chart4 as Chart).toBase64Image()
17795
+ }
17206
17796
  }
17207
17797
  },
17208
17798
  scales: {
@@ -17404,7 +17994,9 @@ export class SfIEvents extends LitElement {
17404
17994
 
17405
17995
 
17406
17996
  }
17407
- this.chart3Base64 = (this.chart3 as Chart).toBase64Image();
17997
+ if(this.chart3 != null){
17998
+ this.chart3Base64 = (this.chart3 as Chart).toBase64Image();
17999
+ }
17408
18000
  }
17409
18001
  },
17410
18002
  scales: {
@@ -17594,7 +18186,9 @@ export class SfIEvents extends LitElement {
17594
18186
  }
17595
18187
 
17596
18188
  }
17597
- this.chart2Base64 = (this.chart2 as Chart).toBase64Image();
18189
+ if(this.chart2 != null){
18190
+ this.chart2Base64 = (this.chart2 as Chart).toBase64Image();
18191
+ }
17598
18192
  }
17599
18193
  },
17600
18194
  scales: {
@@ -17830,8 +18424,9 @@ export class SfIEvents extends LitElement {
17830
18424
  }
17831
18425
 
17832
18426
  }
17833
- this.chartBase64 = (this.chart as Chart).toBase64Image();
17834
- console.log('this.chart onAnimationComplete', this.chart, (this.chart as Chart).toBase64Image())
18427
+ if(this.chart != null){
18428
+ this.chartBase64 = (this.chart as Chart).toBase64Image();
18429
+ }
17835
18430
  }
17836
18431
  },
17837
18432
  scales: {
@@ -18500,7 +19095,7 @@ export class SfIEvents extends LitElement {
18500
19095
  var html = '';
18501
19096
 
18502
19097
  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>';
19098
+ 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
19099
  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
19100
  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
19101
  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 +19206,12 @@ export class SfIEvents extends LitElement {
18611
19206
  (this._SfTabContainer as HTMLDivElement).querySelector('#calendar-tab-custom')?.addEventListener('click', () => {
18612
19207
  this.enableCustom();
18613
19208
  this.renderTabs(this.TAB_CUSTOM);
18614
- this.renderCustom();
19209
+ console.log('stats clicked');
19210
+ if(this.myRole == this.TAB_VIEWER){
19211
+ this.renderCustomViewer()
19212
+ }else{
19213
+ this.renderCustom();
19214
+ }
18615
19215
  });
18616
19216
 
18617
19217
  (this._SfTabContainer as HTMLDivElement).querySelector('#calendar-tab-find')?.addEventListener('click', () => {
@@ -21647,6 +22247,72 @@ export class SfIEvents extends LitElement {
21647
22247
 
21648
22248
  }
21649
22249
 
22250
+ fetchStatistics = async(startDate: string = "", endDate: string = "", filtercriteria: string, filterid: string) => {
22251
+
22252
+ let path = "";
22253
+ this.sdate = startDate;
22254
+ this.edate = endDate;
22255
+
22256
+
22257
+ path = "getstatistics";
22258
+
22259
+ let sDate = "";
22260
+ let eDate = "";
22261
+
22262
+ //console.log('currenttab', this.getCurrentTab());
22263
+
22264
+ if(this.getCurrentTab() == this.TAB_YEAR) {
22265
+ sDate = "03/31/" + this.calendarStartYYYY;
22266
+ eDate = "04/01/" + (parseInt(this.calendarStartYYYY) + 1);
22267
+ } else {
22268
+ sDate = startDate;
22269
+ eDate = endDate;
22270
+ }
22271
+
22272
+
22273
+ let url = "https://"+this.apiId+"/"+ path;
22274
+
22275
+ //console.log('fetch calendar url', url);
22276
+ let urlBody :any = {"projectid": this.projectId, "userid": this.userProfileId, "role": this.myRole, "sdate": sDate, "edate": eDate};
22277
+
22278
+ if(filtercriteria == 'function') {
22279
+ urlBody["functionid"] = filterid;
22280
+ urlBody["locationid"] = '';
22281
+ urlBody["filteruserrole"] = '';
22282
+ urlBody["filteruserid"] = '';
22283
+ }else if(filtercriteria == 'location'){
22284
+ urlBody["functionid"] = '';
22285
+ urlBody["locationid"] = filterid;
22286
+ urlBody["filteruserrole"] = '';
22287
+ urlBody["filteruserid"] = '';
22288
+ }else{
22289
+ urlBody["functionid"] = '';
22290
+ urlBody["locationid"] = '';
22291
+ urlBody["filteruserrole"] = filtercriteria;
22292
+ urlBody["filteruserid"] = filterid;
22293
+ }
22294
+
22295
+ console.log('urlbody', urlBody);
22296
+
22297
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
22298
+ const xhr : any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
22299
+ this._SfLoader.innerHTML = '';
22300
+ if(xhr.status == 200) {
22301
+
22302
+ const jsonRespose = JSON.parse(xhr.responseText);
22303
+ console.log('jsonRespose Statistics', jsonRespose);
22304
+ this.statistics = jsonRespose.data
22305
+ if(jsonRespose.meta != null)
22306
+ this.statisticsMeta = jsonRespose.meta
22307
+ return jsonRespose.meta
22308
+
22309
+ } else {
22310
+ const jsonRespose = JSON.parse(xhr.responseText);
22311
+ this.setError(jsonRespose.error);
22312
+ }
22313
+
22314
+ }
22315
+
21650
22316
  fetchBulkReportingData = async() => {
21651
22317
  let path = "getbulkreportjobs"
21652
22318
  let urlBody :any = {"projectid": this.projectId}