sf-i-events 1.0.733 → 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.
package/sf-i-events.js CHANGED
@@ -473,6 +473,9 @@ let SfIEvents = class SfIEvents extends LitElement {
473
473
  <div>Report generated for PROJECT_NAME on REPORT_DATE</div>
474
474
  </div>
475
475
  </div>
476
+ <div class="d-flex justify-between align-center">
477
+ FILTERS_DATA
478
+ </div>
476
479
  <br />
477
480
  <div class="watermark"></div>
478
481
  <div class="report">
@@ -1105,6 +1108,8 @@ let SfIEvents = class SfIEvents extends LitElement {
1105
1108
  this.triggers = null;
1106
1109
  this.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
1107
1110
  this.events = null;
1111
+ this.statistics = null;
1112
+ this.statisticsMeta = null;
1108
1113
  this.streamIndex = null;
1109
1114
  this.eventsInWindow = null;
1110
1115
  this.eventHideFields = null;
@@ -1146,6 +1151,7 @@ let SfIEvents = class SfIEvents extends LitElement {
1146
1151
  this.htmlDataCompliances = "";
1147
1152
  this.htmlDataStats = "";
1148
1153
  this.htmlDataSummary = "";
1154
+ this.htmlStatsFilter = "";
1149
1155
  this.period = "";
1150
1156
  this.flowRcmNotification = 0;
1151
1157
  this.flowGraph = "";
@@ -2136,6 +2142,22 @@ let SfIEvents = class SfIEvents extends LitElement {
2136
2142
  html += '</div>';
2137
2143
  return html;
2138
2144
  };
2145
+ this.renderCalendarStatisticsGraphs = (showGraph, parametersTitle) => {
2146
+ //console.log('flowGraph', this.flowGraph);
2147
+ var html = '';
2148
+ html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
2149
+ 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>';
2150
+ if (showGraph) {
2151
+ 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>';
2152
+ html += '<div id="chart-settings-controls" class="mt-20"></div>';
2153
+ html += '<div id="chart-settings"></div>';
2154
+ }
2155
+ else {
2156
+ html += '<div part="box" class="box"></div>';
2157
+ }
2158
+ html += '</div>';
2159
+ return html;
2160
+ };
2139
2161
  this.renderCalendarContainerDivStart = (index) => {
2140
2162
  var html = '';
2141
2163
  html += '<div id="stream-event-' + index + '" part="stream-event-list" class="stream-event-list">';
@@ -2236,7 +2258,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2236
2258
  }
2237
2259
  }
2238
2260
  let lastUpdated = '';
2239
- console.log('lastUpdated', event.lastupdated);
2261
+ // console.log('lastUpdated', event.lastupdated);
2240
2262
  if (event.lastupdated != null && event.lastupdated.length > 0) {
2241
2263
  lastUpdated = event.lastupdated;
2242
2264
  }
@@ -2314,7 +2336,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2314
2336
  html += 'Comments';
2315
2337
  html += '</th>';
2316
2338
  }
2317
- console.log('rendering last updated', event.lastupdated);
2339
+ // console.log('rendering last updated', event.lastupdated)
2318
2340
  if (event.lastupdated != null && (event.lastupdated).length > 0) {
2319
2341
  html += '<th part="td-head">';
2320
2342
  html += 'Updated';
@@ -2495,7 +2517,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2495
2517
  let reporterStr = this.getReporterStringFromEvent(event);
2496
2518
  let approverStr = this.getApproverStringFromEvent(event);
2497
2519
  let graphParam = this.getGraphParam(event);
2498
- console.log("graphParam", graphParam.split(';')[0]);
2520
+ // console.log("graphParam", graphParam.split(';')[0]);
2499
2521
  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>';
2500
2522
  return html;
2501
2523
  };
@@ -2700,6 +2722,62 @@ let SfIEvents = class SfIEvents extends LitElement {
2700
2722
  this.htmlDataStats += '<tr><td class="w-14 text-center td-odd">' + total + '</td><td class="w-14 text-center td-odd">' + scheduled + '</td><td class="w-14 text-center td-odd">' + notComplied + '</td><td class="w-14 text-center td-odd">' + partiallyComplied + '</td><td class="w-14 text-center td-odd">' + complied + '</td><tr></table>';
2701
2723
  return html;
2702
2724
  };
2725
+ this.renderStatistics = (_firstDay, _endDay, iInit, iLast, showGraph, index, month, period, firstDate = null, parametersTitle) => {
2726
+ var _a, _b, _c, _f;
2727
+ var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0;
2728
+ var html = '';
2729
+ // var lastDay = iLast;
2730
+ // var slice = 2;
2731
+ this.clearGraphData();
2732
+ this.clearSelectedGraphParam();
2733
+ this.clearSelectedLegend();
2734
+ html += this.renderCalendarStatisticsGraphs(showGraph, parametersTitle);
2735
+ html += this.renderCalendarContainerDivStart(index);
2736
+ html += this.renderCalendarEventSummary();
2737
+ for (var i = iInit; i <= iLast; i++) {
2738
+ let mmdd = "";
2739
+ if (firstDate == null) {
2740
+ mmdd = ("0" + (month + 1)).slice(-2) + "/" + ("0" + i).slice(-2);
2741
+ }
2742
+ else {
2743
+ const currDate = new Date(firstDate.getTime());
2744
+ currDate.setDate(firstDate.getDate() + (i - 1));
2745
+ mmdd = ("0" + (currDate.getMonth() + 1)).slice(-2) + "/" + ("0" + currDate.getDate()).slice(-2);
2746
+ }
2747
+ //console.log('mmddevent', mmdd,this.events[mmdd]);
2748
+ // var hide;
2749
+ // if(firstDate == null) {
2750
+ // hide = this.getCalendarRowHide(this.events[mmdd], i, lastDay, month, firstDate, null);
2751
+ // } else {
2752
+ // const currDate = new Date(firstDate.getTime());
2753
+ // currDate.setDate(firstDate.getDate() + (i - 1));
2754
+ // hide = this.getCalendarRowHide(this.events[mmdd], i, lastDay, month, firstDate, currDate);
2755
+ // }
2756
+ if (this.statistics[mmdd] != null) {
2757
+ console.log('mmdd', mmdd, this.statistics[mmdd]['approved']);
2758
+ // html += this.renderCalendarRowDivStart(i, firstDate, mmdd.split("/")[1] + "/" + mmdd.split("/")[0]);
2759
+ total += this.statistics[mmdd].count;
2760
+ notStarted += (_a = this.statistics[mmdd]["not-started"]) !== null && _a !== void 0 ? _a : 0;
2761
+ pendingApproval += (_b = this.statistics[mmdd]["pending-approval"]) !== null && _b !== void 0 ? _b : 0;
2762
+ rejected += (_c = this.statistics[mmdd]["rejected"]) !== null && _c !== void 0 ? _c : 0;
2763
+ approved += (_f = this.statistics[mmdd]["approved"]) !== null && _f !== void 0 ? _f : 0;
2764
+ }
2765
+ }
2766
+ html += this.renderCalendarContainerDivEnd();
2767
+ //console.log('final risk severities', this.riskSeverityData);
2768
+ //this.period = firstDay?.getDate() + '/' + (firstDay!.getMonth()+1) + '/' + firstDay?.getFullYear() + " - " + endDay?.getDate() + '/' + (endDay!.getMonth()+1) + '/' + endDay?.getFullYear();
2769
+ this.period = period;
2770
+ //console.log('renderevents htmlcols', this.htmlDataCompliances);
2771
+ console.log('progress', this.period, total, notStarted, approved, this.statistics);
2772
+ html = html.replace("DASHBOARD_TOTAL", total + "");
2773
+ html = html.replace("DASHBOARD_NOT_STARTED", notStarted + "");
2774
+ html = html.replace("DASHBOARD_APPROVED", approved + "");
2775
+ html = html.replace("DASHBOARD_PENDING_APPROVAL", pendingApproval + "");
2776
+ html = html.replace("DASHBOARD_REJECTED", rejected + "");
2777
+ 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>';
2778
+ 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>';
2779
+ return html;
2780
+ };
2703
2781
  this.renderReporting = (event, mmddyyyy) => {
2704
2782
  let html = '';
2705
2783
  let completeness = this.getCompletenessStatus(event);
@@ -3985,6 +4063,112 @@ let SfIEvents = class SfIEvents extends LitElement {
3985
4063
  // this.htmlDataStats = '<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">In Progress</th><th class="w-14">Past Due Date</th><th class="w-14">Late Executed</th><th class="w-14">Late Approved</th><tr>';
3986
4064
  // 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">'+inProgress+'</td><td class="w-14 text-center td-odd">'+pastDueDate+'</td><td class="w-14 text-center td-odd">'+lateExecuted+'</td><td class="w-14 text-center td-odd">'+lateApproved+'</td><tr></table>';
3987
4065
  };
4066
+ this.renderRangeStatistics = (firstDate, count, eventsContainer) => {
4067
+ var lastDate = new Date(firstDate.getTime());
4068
+ lastDate.setDate(lastDate.getDate() + count - 1);
4069
+ const lastDay = count;
4070
+ let firstDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
4071
+ let endDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
4072
+ endDay === null || endDay === void 0 ? void 0 : endDay.setDate(endDay.getDate() + lastDay + 1);
4073
+ 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();
4074
+ //console.log('rangeperiod', period)
4075
+ var html = this.renderStatistics(firstDay, endDay, 1, lastDay, true, 0, (firstDate.getMonth()), period, firstDate, "From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'));
4076
+ eventsContainer.querySelector('.calendar-right-data').innerHTML = html;
4077
+ this.renderButtonRefresh(eventsContainer);
4078
+ // let innerhtml = eventsContainer.innerHTML;
4079
+ // innerhtml += this.renderSelectAllButtons();
4080
+ // eventsContainer.innerHTML = innerhtml
4081
+ // this.attachTimelineFilterHandlers(eventsContainer);
4082
+ // const radioExpander = eventsContainer.querySelector('#graph-radios-expander') as HTMLButtonElement;
4083
+ // radioExpander?.addEventListener('click', (e: any) => {
4084
+ // const button = (e.currentTarget as HTMLButtonElement);
4085
+ // button.style.display = 'none';
4086
+ // const arrRadios = eventsContainer.querySelectorAll('.chart-radio-item-secondary') as NodeListOf<HTMLDivElement>;
4087
+ // arrRadios.forEach(div => {
4088
+ // div.style.display = 'block';
4089
+ // });
4090
+ // });
4091
+ const buttonRefresh = eventsContainer.querySelector('#button-refresh');
4092
+ buttonRefresh.addEventListener('click', async () => {
4093
+ this.processDateSelectionViewer(eventsContainer);
4094
+ });
4095
+ };
4096
+ this.renderStatisticsFilters = (eventsContainer) => {
4097
+ let selectFilterCriteria = eventsContainer.querySelector('#select-filter-criteria');
4098
+ let inputLabelFilter = eventsContainer.querySelector('#input-label-filter');
4099
+ selectFilterCriteria.style.display = 'block';
4100
+ inputLabelFilter.style.display = 'block';
4101
+ // let selectedCriteria = ""
4102
+ selectFilterCriteria.innerHTML = "";
4103
+ let option = new Option();
4104
+ option.value = "";
4105
+ option.innerHTML = "All";
4106
+ selectFilterCriteria.add(option);
4107
+ for (let criteria of Object.keys(this.statisticsMeta)) {
4108
+ // if(i == 0){
4109
+ // selectedCriteria = criteria
4110
+ // }
4111
+ let option = new Option();
4112
+ option.value = criteria;
4113
+ option.innerHTML = Util.titleCase(criteria);
4114
+ selectFilterCriteria.add(option);
4115
+ }
4116
+ selectFilterCriteria.addEventListener('change', (ev) => {
4117
+ let target = ev.target;
4118
+ let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria');
4119
+ let selectFilterValues = eventsContainer.querySelector('#select-filter-values');
4120
+ if (target.value == "") {
4121
+ selectFilterValues.value = "";
4122
+ this.processDateSelectionViewer(eventsContainer);
4123
+ }
4124
+ selectFilterValues.innerHTML = "";
4125
+ let option = new Option();
4126
+ option.value = "";
4127
+ option.innerHTML = "All";
4128
+ selectFilterValues.add(option);
4129
+ if (this.statisticsMeta[target.value] != null) {
4130
+ selectFilterValues.style.display = 'block';
4131
+ inputLabelCriteria.style.display = 'block';
4132
+ inputLabelCriteria.innerHTML = Util.titleCase(target.value);
4133
+ for (let filter of this.statisticsMeta[target.value]) {
4134
+ let option = new Option();
4135
+ option.value = filter.split(';')[1];
4136
+ option.innerHTML = Util.titleCase(filter.split(';')[0]).replace(/\([^)]*\)/g, "");
4137
+ selectFilterValues.add(option);
4138
+ }
4139
+ selectFilterValues.addEventListener('change', () => {
4140
+ console.log('changed');
4141
+ this.processDateSelectionViewer(eventsContainer);
4142
+ });
4143
+ }
4144
+ else {
4145
+ selectFilterValues.style.display = 'none';
4146
+ inputLabelCriteria.style.display = 'none';
4147
+ }
4148
+ });
4149
+ let selectFilterValues = eventsContainer.querySelector('#select-filter-values');
4150
+ let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria');
4151
+ selectFilterValues.style.display = 'none';
4152
+ inputLabelCriteria.style.display = 'none';
4153
+ // inputLabelCriteria.innerHTML = selectedCriteria
4154
+ // selectFilterValues.innerHTML = ""
4155
+ // option = new Option()
4156
+ // option.value = "";
4157
+ // option.innerHTML = "All"
4158
+ // selectFilterValues.add(option)
4159
+ // if(this.statisticsMeta[selectedCriteria] != null){
4160
+ // for(let filter of this.statisticsMeta[selectedCriteria]){
4161
+ // let option = new Option()
4162
+ // option.value = filter.split(';')[1];
4163
+ // option.innerHTML = Util.titleCase(filter.split(';')[0]).replace(/\([^)]*\)/g,"")
4164
+ // selectFilterValues.add(option)
4165
+ // }
4166
+ // }
4167
+ // selectFilterValues.addEventListener('change',() => {
4168
+ // console.log('changed')
4169
+ // this.processDateSelectionViewer(eventsContainer);
4170
+ // })
4171
+ };
3988
4172
  this.renderSelectAllButtons = () => {
3989
4173
  let selectAllHtml = '<div class="d-flex justify-end w-100" style="position: fixed; bottom: 70px; left: 0px;" part="button-select-all-container">';
3990
4174
  selectAllHtml += '<button part="button-select-all" id="button-select-all" class="d-flex align-center mt-10 mr-10 ml-10"><span class="material-symbols-outlined">select_all</span>&nbsp;<h4>Select All</h4><span>&nbsp;(Max ' + this.selectallblock + ')</span></button>';
@@ -4321,6 +4505,96 @@ let SfIEvents = class SfIEvents extends LitElement {
4321
4505
  this.renderCompletenessGraph(eventContainer);
4322
4506
  }
4323
4507
  };
4508
+ this.processDateSelectionViewer = async (eventContainer) => {
4509
+ var startDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);
4510
+ var endDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + (parseInt(this.calendarStartYYYY) + 1));
4511
+ var valueStart = this._SfCustomContainer.querySelector('#stream-start-date').value;
4512
+ if (valueStart == "") {
4513
+ valueStart = this._SfCustomContainer.querySelector('#stream-start-date-mobile').value;
4514
+ }
4515
+ var valueEnd = this._SfCustomContainer.querySelector('#stream-end-date').value;
4516
+ if (valueEnd == "") {
4517
+ valueEnd = this._SfCustomContainer.querySelector('#stream-end-date-mobile').value;
4518
+ }
4519
+ //console.log('valuestart', valueStart);
4520
+ //console.log('valueend', valueEnd);
4521
+ let filtercriteria = this._SfCustomContainer.querySelector('#select-filter-criteria').value;
4522
+ let filtercriterianame = "";
4523
+ console.log('criteria', this._SfCustomContainer.querySelector('#select-filter-criteria').options[this._SfCustomContainer.querySelector('#select-filter-criteria').selectedIndex]);
4524
+ if (this._SfCustomContainer.querySelector('#select-filter-criteria').options[this._SfCustomContainer.querySelector('#select-filter-criteria').selectedIndex] != null) {
4525
+ filtercriterianame = this._SfCustomContainer.querySelector('#select-filter-criteria').options[this._SfCustomContainer.querySelector('#select-filter-criteria').selectedIndex].innerHTML;
4526
+ }
4527
+ if (filtercriteria == "") {
4528
+ filtercriteria = this._SfCustomContainer.querySelector('#select-filter-criteria-mobile').value;
4529
+ if (this._SfCustomContainer.querySelector('#select-filter-criteria-mobile').options[this._SfCustomContainer.querySelector('#select-filter-criteria-mobile').selectedIndex] != null) {
4530
+ filtercriterianame = this._SfCustomContainer.querySelector('#select-filter-criteria-mobile').options[this._SfCustomContainer.querySelector('#select-filter-criteria-mobile').selectedIndex].innerHTML;
4531
+ }
4532
+ }
4533
+ let filtervalue = this._SfCustomContainer.querySelector('#select-filter-values').value;
4534
+ let filtervaluename = "";
4535
+ if (this._SfCustomContainer.querySelector('#select-filter-values').options[this._SfCustomContainer.querySelector('#select-filter-values').selectedIndex] != null) {
4536
+ filtervaluename = this._SfCustomContainer.querySelector('#select-filter-values').options[this._SfCustomContainer.querySelector('#select-filter-values').selectedIndex].innerHTML;
4537
+ }
4538
+ if (filtervalue == "") {
4539
+ filtervalue = this._SfCustomContainer.querySelector('#select-filter-values-mobile').value;
4540
+ if (this._SfCustomContainer.querySelector('#select-filter-values-mobile').options[this._SfCustomContainer.querySelector('#select-filter-values-mobile').selectedIndex] != null) {
4541
+ filtervaluename = this._SfCustomContainer.querySelector('#select-filter-values-mobile').options[this._SfCustomContainer.querySelector('#select-filter-values-mobile').selectedIndex].innerHTML;
4542
+ }
4543
+ }
4544
+ if (filtercriteria == "") {
4545
+ this.htmlStatsFilter = "Filters Selected -> All";
4546
+ }
4547
+ else {
4548
+ if (filtervalue == "") {
4549
+ this.htmlStatsFilter = "Filters Selected -> " + Util.titleCase(filtercriterianame) + " -> All";
4550
+ }
4551
+ else {
4552
+ this.htmlStatsFilter = "Filters Selected -> " + Util.titleCase(filtercriterianame) + " -> " + Util.titleCase(filtervaluename);
4553
+ }
4554
+ }
4555
+ if (valueStart != "" && valueEnd != "") {
4556
+ this.initCustomRightColViewer();
4557
+ if (!this.checkStartDateEarliness(valueStart)) {
4558
+ this._SfStreamEventStatus.innerHTML = "Chosen Start Date cannot be earlier than " + startDateCalendar;
4559
+ return;
4560
+ }
4561
+ if (!this.checkEndDateLateness(valueEnd)) {
4562
+ this._SfStreamEventStatus.innerHTML = "Chosen End Date cannot be later than " + endDateCalendar;
4563
+ return;
4564
+ }
4565
+ if (new Date(valueStart).getTime() > new Date(valueEnd).getTime()) {
4566
+ this._SfStreamEventStatus.innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
4567
+ return;
4568
+ }
4569
+ if ((new Date(valueEnd).getTime() - new Date(valueStart).getTime()) / (1000 * 60 * 60 * 24) > 400) {
4570
+ this._SfStreamEventStatus.innerHTML = "Chosen time window cannot be greater than 400 days";
4571
+ return;
4572
+ }
4573
+ const tsStart = new Date(valueStart);
4574
+ const tsEnd = new Date(valueEnd);
4575
+ tsStart.setDate(tsStart.getDate() - 2);
4576
+ tsEnd.setDate(tsEnd.getDate() + 2);
4577
+ //console.log('tsstart', tsStart);
4578
+ //console.log('tsend', tsEnd);
4579
+ let meta = await this.fetchStatistics((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear(), filtercriteria, filtervalue);
4580
+ this.renderRangeStatistics(new Date(valueStart), ((new Date(valueEnd).getTime() + 24 * 60 * 60 * 1000) - new Date(valueStart).getTime()) / (1000 * 60 * 60 * 24), this._SfCustomContainer);
4581
+ if (meta != null)
4582
+ this.renderStatisticsFilters(this._SfCustomContainer);
4583
+ }
4584
+ else if (valueStart != "" && valueEnd == "") {
4585
+ this._SfStreamEventStatus.innerHTML = "Please select End Date";
4586
+ }
4587
+ else if (valueStart == "" && valueEnd != "") {
4588
+ this._SfStreamEventStatus.innerHTML = "Please select Start Date";
4589
+ }
4590
+ else if (valueStart == "" && valueEnd == "") {
4591
+ this._SfStreamEventStatus.innerHTML = "Please select Start Date and End Date";
4592
+ }
4593
+ this.attachHandlers(eventContainer, valueStart, valueEnd);
4594
+ if (eventContainer.innerHTML.indexOf('myChart') >= 0) {
4595
+ this.renderCompletenessGraph(eventContainer, -1, 2);
4596
+ }
4597
+ };
4324
4598
  this.initFindRightCol = () => {
4325
4599
  var html = "";
4326
4600
  html += '<div id="stream-event-0" part="stream-event-list" class="stream-event-list">';
@@ -4339,6 +4613,15 @@ let SfIEvents = class SfIEvents extends LitElement {
4339
4613
  html += '</div>';
4340
4614
  this._SfCustomContainer.querySelector('.calendar-right-data').innerHTML = html;
4341
4615
  };
4616
+ this.initCustomRightColViewer = () => {
4617
+ var html = "";
4618
+ html += '<div id="stream-event-0" part="stream-event-list" class="stream-event-list">';
4619
+ html += '<div part="stream-event-not-selected" class="d-flex stream-event-not-selected">';
4620
+ html += '<div><h2 id="stream-event-status">Please select Start Date, End Date and Filter Criteria</h2></div>';
4621
+ html += '</div>';
4622
+ html += '</div>';
4623
+ this._SfCustomContainer.querySelector('.calendar-right-data').innerHTML = html;
4624
+ };
4342
4625
  this.checkAndShowBulk = () => {
4343
4626
  const inputArr = this._SfMappingContainer.querySelectorAll('.input-checkbox');
4344
4627
  var checked = 0;
@@ -5942,6 +6225,189 @@ let SfIEvents = class SfIEvents extends LitElement {
5942
6225
  // })
5943
6226
  // }
5944
6227
  };
6228
+ this.renderCustomViewer = () => {
6229
+ var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m, _o, _p;
6230
+ this.clearGraphData();
6231
+ this.clearSelectedGraphParam();
6232
+ this.clearSelectedLegend();
6233
+ var html = '';
6234
+ html += '<div class="scroll-x w-100 mobile-only">';
6235
+ html += '<div class="title-item-date">';
6236
+ html += '<label part="input-label">Start Date</label><br />';
6237
+ html += '<input id="stream-start-date-mobile" part="input" type="date" />';
6238
+ html += '</div>';
6239
+ html += '<div class="title-item-date">';
6240
+ html += '<label part="input-label">End Date</label><br />';
6241
+ html += '<input id="stream-end-date-mobile" part="input" type="date" />';
6242
+ html += '</div>';
6243
+ html += '<div class="title-item-date">';
6244
+ html += '<button id="button-year-to-date-mobile" part="button-lg-short-secondary">Year To Date</button>';
6245
+ html += '</div>';
6246
+ html += '<div class="title-item-date">';
6247
+ html += '<button id="button-this-quarter-mobile" part="button-lg-short-secondary">This Quarter</button>';
6248
+ html += '</div>';
6249
+ html += '<div class="title-item-date">';
6250
+ html += '<button id="button-this-year-mobile" part="button-lg-short-secondary">This Year</button>';
6251
+ html += '</div>';
6252
+ html += '<div class="title-item-date">';
6253
+ html += '<label part="input-label-filter-criteria" id="input-label-filter-mobile">Filter Criteria</label><br />';
6254
+ html += '<select id="select-filter-criteria-mobile" class="mr-10"></select>';
6255
+ html += '</div>';
6256
+ html += '<div class="title-item-date">';
6257
+ html += '<label part="input-label-filter-value" id="input-label-criteria-mobile"></label><br />';
6258
+ html += '<select id="select-filter-values-mobile" class="mr-10"></select>';
6259
+ html += '</div>';
6260
+ html += '</div>';
6261
+ html += '<div class="d-flex w-100">';
6262
+ html += '<div class="calendar-left-col desktop-only flex-col justify-start align-end">';
6263
+ html += '<div class="title-item-date">';
6264
+ html += '<label part="input-label">Start Date</label><br />';
6265
+ html += '<input id="stream-start-date" part="input" type="date" />';
6266
+ html += '</div>';
6267
+ html += '<div class="title-item-date">';
6268
+ html += '<label part="input-label">End Date</label><br />';
6269
+ html += '<input id="stream-end-date" part="input" type="date" />';
6270
+ html += '</div>';
6271
+ html += '<div class="title-item-date">';
6272
+ html += '<button id="button-year-to-date" part="button-lg-short-secondary">Year To Date</button>';
6273
+ html += '</div>';
6274
+ html += '<div class="title-item-date">';
6275
+ html += '<button id="button-this-quarter" part="button-lg-short-secondary">This Quarter</button>';
6276
+ html += '</div>';
6277
+ html += '<div class="title-item-date">';
6278
+ html += '<button id="button-this-year" part="button-lg-short-secondary">This Year</button>';
6279
+ html += '</div>';
6280
+ html += '<div class="title-item-date d-flex flex-col align-end">';
6281
+ html += '<label part="input-label-filter-criteria" id="input-label-filter" class="mr-10">Filter Criteria</label><br />';
6282
+ html += '<select id="select-filter-criteria" class="mr-10"></select>';
6283
+ html += '</div>';
6284
+ html += '<div class="title-item-date d-flex flex-col align-end">';
6285
+ html += '<label part="input-label-filter-value" id="input-label-criteria" class="mr-10"></label><br />';
6286
+ html += '<select id="select-filter-values" class="mr-10"></select>';
6287
+ html += '</div>';
6288
+ html += '</div>';
6289
+ html += '<div class="calendar-right-data flex-grow">';
6290
+ html += '</div>';
6291
+ html += '</div>';
6292
+ console.log('html', html);
6293
+ this._SfCustomContainer.innerHTML = html;
6294
+ this.initCustomRightColViewer();
6295
+ (_a = this._SfCustomContainer.querySelector('#stream-start-date')) === null || _a === void 0 ? void 0 : _a.addEventListener('change', (_ev) => {
6296
+ //console.log('start-date', ev);
6297
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
6298
+ this.processDateSelectionViewer(this._SfCustomContainer);
6299
+ });
6300
+ (_b = this._SfCustomContainer.querySelector('#stream-end-date')) === null || _b === void 0 ? void 0 : _b.addEventListener('change', (_ev) => {
6301
+ //console.log('end-date', ev);
6302
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
6303
+ this.processDateSelectionViewer(this._SfCustomContainer);
6304
+ });
6305
+ (_c = this._SfCustomContainer.querySelector('#stream-start-date-mobile')) === null || _c === void 0 ? void 0 : _c.addEventListener('change', (_ev) => {
6306
+ //console.log('start-date', ev);
6307
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
6308
+ this.processDateSelectionViewer(this._SfCustomContainer);
6309
+ });
6310
+ (_f = this._SfCustomContainer.querySelector('#stream-end-date-mobile')) === null || _f === void 0 ? void 0 : _f.addEventListener('change', (_ev) => {
6311
+ //console.log('end-date', ev);
6312
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
6313
+ this.processDateSelectionViewer(this._SfCustomContainer);
6314
+ });
6315
+ (_g = this._SfCustomContainer.querySelector('#button-year-to-date')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', () => {
6316
+ this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6317
+ this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6318
+ this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
6319
+ this._SfCustomContainer.querySelector('#stream-end-date').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
6320
+ this.processDateSelectionViewer(this._SfCustomContainer);
6321
+ });
6322
+ (_h = this._SfCustomContainer.querySelector('#button-year-to-date-mobile')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', () => {
6323
+ this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6324
+ this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6325
+ this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
6326
+ this._SfCustomContainer.querySelector('#stream-end-date').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
6327
+ this.processDateSelectionViewer(this._SfCustomContainer);
6328
+ });
6329
+ (_j = this._SfCustomContainer.querySelector('#button-this-year-mobile')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', () => {
6330
+ this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6331
+ this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6332
+ this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6333
+ this._SfCustomContainer.querySelector('#stream-end-date').value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6334
+ this.processDateSelectionViewer(this._SfCustomContainer);
6335
+ });
6336
+ (_k = this._SfCustomContainer.querySelector('#button-this-year')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', () => {
6337
+ this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6338
+ this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6339
+ this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6340
+ this._SfCustomContainer.querySelector('#stream-end-date').value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6341
+ this.processDateSelectionViewer(this._SfCustomContainer);
6342
+ });
6343
+ (_l = this._SfCustomContainer.querySelector('#button-this-quarter-mobile')) === null || _l === void 0 ? void 0 : _l.addEventListener('click', () => {
6344
+ const mmCurrent = ((new Date().getMonth() + 1));
6345
+ let startDate = "";
6346
+ let endDate = "";
6347
+ if (mmCurrent >= 4 && mmCurrent <= 6) {
6348
+ startDate = this.calendarStartYYYY + '-' + '04' + '-' + "01";
6349
+ endDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
6350
+ }
6351
+ else if (mmCurrent >= 6 && mmCurrent <= 9) {
6352
+ startDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
6353
+ endDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
6354
+ }
6355
+ else if (mmCurrent >= 9 && mmCurrent <= 12) {
6356
+ startDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
6357
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
6358
+ }
6359
+ else {
6360
+ startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
6361
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
6362
+ }
6363
+ this._SfCustomContainer.querySelector('#stream-start-date').value = startDate;
6364
+ this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = startDate;
6365
+ this._SfCustomContainer.querySelector('#stream-end-date').value = endDate;
6366
+ this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = endDate;
6367
+ this.processDateSelectionViewer(this._SfCustomContainer);
6368
+ });
6369
+ (_m = this._SfCustomContainer.querySelector('#button-this-quarter')) === null || _m === void 0 ? void 0 : _m.addEventListener('click', () => {
6370
+ const mmCurrent = ((new Date().getMonth() + 1));
6371
+ let startDate = "";
6372
+ let endDate = "";
6373
+ if (mmCurrent >= 4 && mmCurrent <= 6) {
6374
+ startDate = this.calendarStartYYYY + '-' + '04' + '-' + "01";
6375
+ endDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
6376
+ }
6377
+ else if (mmCurrent >= 6 && mmCurrent <= 9) {
6378
+ startDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
6379
+ endDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
6380
+ }
6381
+ else if (mmCurrent >= 9 && mmCurrent <= 12) {
6382
+ startDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
6383
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
6384
+ }
6385
+ else {
6386
+ startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
6387
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
6388
+ }
6389
+ this._SfCustomContainer.querySelector('#stream-start-date').value = startDate;
6390
+ this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = startDate;
6391
+ this._SfCustomContainer.querySelector('#stream-end-date').value = endDate;
6392
+ this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = endDate;
6393
+ this.processDateSelectionViewer(this._SfCustomContainer);
6394
+ });
6395
+ let selectFileterCriteria = this._SfCustomContainer.querySelector('#select-filter-criteria');
6396
+ selectFileterCriteria.style.display = 'none';
6397
+ let selectFileterValues = this._SfCustomContainer.querySelector('#select-filter-values');
6398
+ selectFileterValues.style.display = 'none';
6399
+ let inputLabelFilter = this._SfCustomContainer.querySelector('#input-label-filter');
6400
+ inputLabelFilter.style.display = 'none';
6401
+ // for(var i = 0; i < 3; i++) {
6402
+ // (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-month-' + i)?.addEventListener('click', (ev: any)=> {
6403
+ // const target = parseInt((ev.target as HTMLDivElement).id.split('-')[2]);
6404
+ // //console.log('clicked ', target);
6405
+ // this.renderPast(target);
6406
+ // })
6407
+ // }
6408
+ (_o = this._SfCustomContainer.querySelector('#button-year-to-date')) === null || _o === void 0 ? void 0 : _o.click();
6409
+ (_p = this._SfCustomContainer.querySelector('#button-year-to-date-mobile')) === null || _p === void 0 ? void 0 : _p.click();
6410
+ };
5945
6411
  this.renderThis = (index = 1, showGraph = true) => {
5946
6412
  var _a, _b;
5947
6413
  this.clearGraphData();
@@ -6259,18 +6725,20 @@ let SfIEvents = class SfIEvents extends LitElement {
6259
6725
  document.addEventListener('scroll', () => {
6260
6726
  // console.log('scroll',window.scrollY)
6261
6727
  let buttonRefresh = eventsContainer.querySelector('#button-refresh');
6262
- if (window.scrollY > 720) {
6263
- if (buttonRefresh.style.display == "flex") {
6264
- }
6265
- else {
6266
- buttonRefresh.style.display = 'flex';
6267
- }
6268
- }
6269
- else {
6270
- if (buttonRefresh.style.display == "none") {
6728
+ if (buttonRefresh != null) {
6729
+ if (window.scrollY > 720) {
6730
+ if (buttonRefresh.style.display == "flex") {
6731
+ }
6732
+ else {
6733
+ buttonRefresh.style.display = 'flex';
6734
+ }
6271
6735
  }
6272
6736
  else {
6273
- buttonRefresh.style.display = 'none';
6737
+ if (buttonRefresh.style.display == "none") {
6738
+ }
6739
+ else {
6740
+ buttonRefresh.style.display = 'none';
6741
+ }
6274
6742
  }
6275
6743
  }
6276
6744
  });
@@ -6753,7 +7221,7 @@ let SfIEvents = class SfIEvents extends LitElement {
6753
7221
  }
6754
7222
  //console.log('rendering csv csvComplianceStats', this.csvComplianceStats);
6755
7223
  };
6756
- this.renderCompletenessGraph = (divContainer) => {
7224
+ this.renderCompletenessGraph = (divContainer, selectedTab = -1, selectedSummary = -1) => {
6757
7225
  this.clearSelectedGraphParam();
6758
7226
  // this.clearSelectedLegend();
6759
7227
  this.csvGraphStats = "";
@@ -6786,7 +7254,7 @@ let SfIEvents = class SfIEvents extends LitElement {
6786
7254
  ]
6787
7255
  }]
6788
7256
  };
6789
- this.renderChartSettings(divContainer, -1, -1, ctx);
7257
+ this.renderChartSettings(divContainer, selectedTab, selectedSummary, ctx);
6790
7258
  this.renderChart(ctx, 'doughnut', data, "Completeness");
6791
7259
  }
6792
7260
  const data = {
@@ -6817,7 +7285,7 @@ let SfIEvents = class SfIEvents extends LitElement {
6817
7285
  for (var i = 0; i < itemsCompliance.length; i++) {
6818
7286
  itemsCompliance[i].style.display = 'none';
6819
7287
  }
6820
- this.renderChartSettings(divContainer, -1, -1, ctx);
7288
+ this.renderChartSettings(divContainer, selectedTab, selectedSummary, ctx);
6821
7289
  this.renderChart(ctx, 'doughnut', data, "Completeness");
6822
7290
  };
6823
7291
  this.renderComplianceGraph = (divContainer) => {
@@ -8423,7 +8891,7 @@ let SfIEvents = class SfIEvents extends LitElement {
8423
8891
  const selectedIndex = e.currentTarget.id.split('-')[1];
8424
8892
  // taggingArray.data.mappings.mappings = [];
8425
8893
  const tempArray = [];
8426
- for (let count = 0; count < sourceArray.data.mappings.mappings.length; count++) {
8894
+ for (var count = 0; count < sourceArray.data.mappings.mappings.length; count++) {
8427
8895
  //console.log('selectedindexchecking', selectedIndex, count, this.selectedCbs.includes(selectedIndex), this.selectedCbs.includes(count));
8428
8896
  //taggingArray.data.mappings.mappings[count] = sourceArray.data.mappings.mappings[count];
8429
8897
  //taggingArray.data.mappings.mappings.push(sourceArray.data.mappings.mappings[count]);
@@ -8579,9 +9047,7 @@ let SfIEvents = class SfIEvents extends LitElement {
8579
9047
  };
8580
9048
  this.saveTagging = async (mapping, uploadFunction, refreshFunction, saveInBackground) => {
8581
9049
  async function process() {
8582
- console.log = function () {
8583
- console.log('Saving...', mapping);
8584
- };
9050
+ //console.log('Saving...', mapping);
8585
9051
  await uploadFunction(mapping);
8586
9052
  if (!saveInBackground)
8587
9053
  refreshFunction();
@@ -8916,7 +9382,7 @@ let SfIEvents = class SfIEvents extends LitElement {
8916
9382
  for (k = 0; k < taggingArray.data.mappings.mappings.length; k++) {
8917
9383
  if (taggingArray.data.mappings.mappings[k].id == sourceArray.data.mappings.mappings[i].id) {
8918
9384
  if (taggingArray.data.mappings.mappings[k].id == "62330e24-298d-4ef2-9449-c0e400e37cac") {
8919
- // console.log('found', taggingArray.data.mappings.mappings[k]);
9385
+ console.log('found', taggingArray.data.mappings.mappings[k]);
8920
9386
  //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);
8921
9387
  //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]);
8922
9388
  }
@@ -9963,10 +10429,10 @@ let SfIEvents = class SfIEvents extends LitElement {
9963
10429
  this._SfLoader.innerHTML = '<div class="lds-dual-ring"></div>';
9964
10430
  this._SfLoader.innerHTML += ('<div class="lds-text"><div class="lds-text-c"></div></div>');
9965
10431
  }
9966
- // setTimeout(() => {
9967
- // this.renderMappingTable(divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, inputFilter.value, statuteColName, extraHintsArr)
9968
- // this._SfLoader.innerHTML = '';
9969
- // }, 1000);
10432
+ setTimeout(() => {
10433
+ this.renderMappingTable(divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, inputFilter.value, statuteColName, extraHintsArr);
10434
+ this._SfLoader.innerHTML = '';
10435
+ }, 1000);
9970
10436
  }
9971
10437
  });
9972
10438
  // More button handlers
@@ -10092,9 +10558,9 @@ let SfIEvents = class SfIEvents extends LitElement {
10092
10558
  arrCheckBoxes[i].addEventListener('change', async (_e) => {
10093
10559
  //console.log(e.currentTarget, (e.currentTarget as HTMLInputElement).checked);
10094
10560
  divElement.querySelector('.button-save').disabled = false;
10095
- // if(extraFieldPosition === 1) {
10096
- // await this.saveMapping (divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true)
10097
- // }
10561
+ if (extraFieldPosition === 1) {
10562
+ await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true);
10563
+ }
10098
10564
  });
10099
10565
  }
10100
10566
  (_a = divElement.querySelector('.checkbox-all')) === null || _a === void 0 ? void 0 : _a.addEventListener('change', (e) => {
@@ -10446,7 +10912,7 @@ let SfIEvents = class SfIEvents extends LitElement {
10446
10912
  html += '<div id="approvers-list-container" class="d-flex flex-col w-100 scroll-x">';
10447
10913
  html += '</div>';
10448
10914
  this._SfOnboardingApproversContainer.innerHTML = html;
10449
- this.renderTaggingTable(this._SfOnboardingApproversListContainer, 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", "");
10915
+ this.renderTaggingTable(this._SfOnboardingApproversListContainer, mappedSerializedReporters, mappedApprovers, [], this.uploadApproversMapping, this.loadOnboardingApprovers, "approvers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["approvers"], approversJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
10450
10916
  };
10451
10917
  this.renderOnboardingFunctionHeads = (mappedFunctionHeads, mappedSerializedApprovers, functionHeadsJobs, _arrFeedbackReference) => {
10452
10918
  var html = '';
@@ -10502,7 +10968,6 @@ let SfIEvents = class SfIEvents extends LitElement {
10502
10968
  }
10503
10969
  }
10504
10970
  this._SfOnboardingFunctionsContainer.innerHTML = html;
10505
- // 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, "", "");
10506
10971
  this.renderTaggingTable(this._SfOnboardingFunctionsListContainer, mappedSerializedLocations, mappedFunctions, [], this.uploadFunctionsMapping, this.loadOnboardingFunctions, "functions", ["id", "countryname", "entityname", "locationname"], this.apiIdTags, "&Function", ["functions"], functionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
10507
10972
  };
10508
10973
  this.renderOnboardingLocations = (mappedLocations, mappedSerializedEntities, locationsJobs) => {
@@ -11612,83 +12077,121 @@ let SfIEvents = class SfIEvents extends LitElement {
11612
12077
  container.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
11613
12078
  });
11614
12079
  };
11615
- this.renderChartSettingsSettings = (container) => {
12080
+ this.renderChartSettingsSettings = (container, selectedTab = 1) => {
11616
12081
  var _a, _b, _c, _f;
11617
- var html = `
11618
-
11619
- <div class="m-10" part="settings-container">
11620
- <div class="d-flex justify-end">
11621
- <button id="chart-control-cancel" class="material-icons" part="button-icon-small">close</button>
11622
- </div>
12082
+ var html = ``;
12083
+ if (selectedTab == 1) {
12084
+ html = `
12085
+
12086
+ <div class="m-10" part="settings-container">
12087
+ <div class="d-flex justify-end">
12088
+ <button id="chart-control-cancel" class="material-icons" part="button-icon-small">close</button>
12089
+ </div>
11623
12090
 
11624
- <div class="d-flex justify-center">
11625
- <div class="p-10 mr-10 w-100">
11626
- <div part="td-head">Reports</div>
11627
- <div part="td-body" class="d-flex align-center mt-10 flex-wrap">
11628
- <div class="mr-10 d-flex align-center mb-10">
11629
- <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked name="radio-report" part="radio-download"/>
11630
- <label for="radio-csv" part="label-radio-download" class="mr-10">Summary (CSV)</label>
11631
- </div>
11632
- <div class="mr-10 d-flex align-center mb-10">
11633
- <input type="radio" id="radio-image" class="switch-image" value="Image" name="radio-report" part="radio-download"/>
11634
- <label for="radio-image" part="label-radio-download" class="mr-10">Image (PNG)</label>
12091
+ <div class="d-flex justify-center">
12092
+ <div class="p-10 mr-10 w-100">
12093
+ <div part="td-head">Reports</div>
12094
+ <div part="td-body" class="d-flex align-center mt-10 flex-wrap">
12095
+ <div class="mr-10 d-flex align-center mb-10">
12096
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked name="radio-report" part="radio-download"/>
12097
+ <label for="radio-csv" part="label-radio-download" class="mr-10">Summary (CSV)</label>
12098
+ </div>
12099
+ <div class="mr-10 d-flex align-center mb-10">
12100
+ <input type="radio" id="radio-image" class="switch-image" value="Image" name="radio-report" part="radio-download"/>
12101
+ <label for="radio-image" part="label-radio-download" class="mr-10">Image (PNG)</label>
12102
+ </div>
12103
+ <div class="mr-10 d-flex align-center mb-10">
12104
+ <input type="radio" id="radio-stats" class="switch-image" value="Stats" name="radio-report" part="radio-download"/>
12105
+ <label for="radio-stats" part="label-radio-download" class="mr-10">Stats (HTML)</label>
12106
+ </div>
12107
+ <div class="mr-10 d-flex align-center mb-10">
12108
+ <input type="radio" id="radio-list" class="switch-image" value="List" name="radio-report" part="radio-download"/>
12109
+ <label for="radio-list" part="label-radio-download" class="mr-10">List (HTML)</label>
12110
+ </div>
12111
+ <div class="mr-10 d-flex align-center mb-10">
12112
+ <input type="radio" id="radio-list-csv" class="switch-image" value="List" name="radio-report" part="radio-download"/>
12113
+ <label for="radio-list-csv" part="label-radio-download" class="mr-10">List (CSV)</label>
12114
+ </div>
12115
+ <div class="mr-10 d-flex align-center mb-10">
12116
+ <input type="radio" id="radio-consolidated" class="switch-image" value="Consolidated" name="radio-report" part="radio-download"/>
12117
+ <label for="radio-consolidated" part="label-radio-download" class="mr-10">Consolidated (HTML)</label>
12118
+ </div>
12119
+ <div class="mr-10 d-flex align-center mb-10">
12120
+ <input type="radio" id="radio-certificate" class="switch-image" value="Certificate" name="radio-report" part="radio-download"/>
12121
+ <label for="radio-certificate" part="label-radio-download" class="mr-10">Certificate (HTML)</label>
12122
+ </div>
11635
12123
  </div>
11636
- <div class="mr-10 d-flex align-center mb-10">
11637
- <input type="radio" id="radio-stats" class="switch-image" value="Stats" name="radio-report" part="radio-download"/>
11638
- <label for="radio-stats" part="label-radio-download" class="mr-10">Stats (HTML)</label>
12124
+ <div class="d-flex mt-10">
12125
+ <button id="button-download-stats" part="button" class="mt-5 ml-10">Download</button>
11639
12126
  </div>
11640
- <div class="mr-10 d-flex align-center mb-10">
11641
- <input type="radio" id="radio-list" class="switch-image" value="List" name="radio-report" part="radio-download"/>
11642
- <label for="radio-list" part="label-radio-download" class="mr-10">List (HTML)</label>
12127
+ </div>
12128
+ <!-- <div class="p-10 ml-10 mr-10">
12129
+ <div part="td-head">Compliances</div>
12130
+ <div part="td-body" class="d-flex align-center mt-5">
12131
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked part="radio-download"/>
12132
+ <label for="radio-html" part="label-radio-download">Html</label>
11643
12133
  </div>
11644
- <div class="mr-10 d-flex align-center mb-10">
11645
- <input type="radio" id="radio-list-csv" class="switch-image" value="List" name="radio-report" part="radio-download"/>
11646
- <label for="radio-list-csv" part="label-radio-download" class="mr-10">List (CSV)</label>
12134
+ <div class="d-flex">
12135
+ <button id="button-download-compliances" part="button" class="mt-5">Download</button>
11647
12136
  </div>
11648
- <div class="mr-10 d-flex align-center mb-10">
11649
- <input type="radio" id="radio-consolidated" class="switch-image" value="Consolidated" name="radio-report" part="radio-download"/>
11650
- <label for="radio-consolidated" part="label-radio-download" class="mr-10">Consolidated (HTML)</label>
12137
+ </div>
12138
+ <div class="p-10 ml-10">
12139
+ <div part="td-head">Certificate</div>
12140
+ <div part="td-body" class="d-flex align-center mt-5">
12141
+ <input type="radio" id="radio-html" class="switch-html" value="Html" checked part="radio-download"/>
12142
+ <label for="radio-html" part="label-radio-download">Html</label>
11651
12143
  </div>
11652
- <div class="mr-10 d-flex align-center mb-10">
11653
- <input type="radio" id="radio-certificate" class="switch-image" value="Certificate" name="radio-report" part="radio-download"/>
11654
- <label for="radio-certificate" part="label-radio-download" class="mr-10">Certificate (HTML)</label>
12144
+ <div class="d-flex">
12145
+ <button id="button-download-certificate" part="button" class="mt-5">Download</button>
11655
12146
  </div>
11656
- </div>
11657
- <div class="d-flex mt-10">
11658
- <button id="button-download-stats" part="button" class="mt-5 ml-10">Download</button>
11659
- </div>
12147
+ </div> -->
11660
12148
  </div>
11661
- <!-- <div class="p-10 ml-10 mr-10">
11662
- <div part="td-head">Compliances</div>
11663
- <div part="td-body" class="d-flex align-center mt-5">
11664
- <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked part="radio-download"/>
11665
- <label for="radio-html" part="label-radio-download">Html</label>
11666
- </div>
11667
- <div class="d-flex">
11668
- <button id="button-download-compliances" part="button" class="mt-5">Download</button>
11669
- </div>
12149
+ </div>
12150
+
12151
+ `;
12152
+ }
12153
+ else {
12154
+ html = `
12155
+
12156
+ <div class="m-10" part="settings-container">
12157
+ <div class="d-flex justify-end">
12158
+ <button id="chart-control-cancel" class="material-icons" part="button-icon-small">close</button>
11670
12159
  </div>
11671
- <div class="p-10 ml-10">
11672
- <div part="td-head">Certificate</div>
11673
- <div part="td-body" class="d-flex align-center mt-5">
11674
- <input type="radio" id="radio-html" class="switch-html" value="Html" checked part="radio-download"/>
11675
- <label for="radio-html" part="label-radio-download">Html</label>
11676
- </div>
11677
- <div class="d-flex">
11678
- <button id="button-download-certificate" part="button" class="mt-5">Download</button>
12160
+
12161
+ <div class="d-flex justify-center">
12162
+ <div class="p-10 mr-10 w-100">
12163
+ <div part="td-head">Reports</div>
12164
+ <div part="td-body" class="d-flex align-center mt-10 flex-wrap">
12165
+ <div class="mr-10 d-flex align-center mb-10">
12166
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked name="radio-report" part="radio-download"/>
12167
+ <label for="radio-csv" part="label-radio-download" class="mr-10">Summary (CSV)</label>
12168
+ </div>
12169
+ <div class="mr-10 d-flex align-center mb-10">
12170
+ <input type="radio" id="radio-image" class="switch-image" value="Image" name="radio-report" part="radio-download"/>
12171
+ <label for="radio-image" part="label-radio-download" class="mr-10">Image (PNG)</label>
12172
+ </div>
12173
+ <div class="mr-10 d-flex align-center mb-10">
12174
+ <input type="radio" id="radio-stats" class="switch-image" value="Stats" name="radio-report" part="radio-download"/>
12175
+ <label for="radio-stats" part="label-radio-download" class="mr-10">Stats (HTML)</label>
12176
+ </div>
12177
+ </div>
12178
+ <div class="d-flex mt-10">
12179
+ <button id="button-download-stats" part="button" class="mt-5 ml-10">Download</button>
12180
+ </div>
11679
12181
  </div>
11680
- </div> -->
12182
+ </div>
11681
12183
  </div>
11682
- </div>
11683
-
11684
- `;
12184
+
12185
+ `;
12186
+ }
11685
12187
  container.innerHTML = html;
11686
12188
  (_a = container.querySelector('#chart-control-cancel')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
11687
12189
  container.innerHTML = '';
11688
12190
  container.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
11689
12191
  });
11690
12192
  (_b = container.querySelector('#button-download-stats')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', async () => {
11691
- await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no");
12193
+ if (selectedTab === -1)
12194
+ await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no");
11692
12195
  const radioCsv = container.querySelector('#radio-csv');
11693
12196
  const radioImage = container.querySelector('#radio-image');
11694
12197
  const radioStats = container.querySelector('#radio-stats');
@@ -11734,8 +12237,20 @@ let SfIEvents = class SfIEvents extends LitElement {
11734
12237
  }
11735
12238
  if (radioStats.checked) {
11736
12239
  const ts = new Date().getTime();
12240
+ console.log('htmlstatsfilter', this.htmlStatsFilter, selectedTab);
11737
12241
  var html = this.COMPLIANCES_HTML;
11738
12242
  html = html.replace(/PROJECT_NAME/g, this.projectName);
12243
+ if (selectedTab == -1) {
12244
+ html = html.replace(/FILTERS_DATA/g, '');
12245
+ }
12246
+ else {
12247
+ let filtersHtml = `
12248
+ <div>
12249
+ ${this.htmlStatsFilter}
12250
+ </div>
12251
+ `;
12252
+ html = html.replace(/FILTERS_DATA/g, filtersHtml);
12253
+ }
11739
12254
  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);
11740
12255
  let tempHtml = "";
11741
12256
  tempHtml += this.htmlDataStats;
@@ -11753,10 +12268,11 @@ let SfIEvents = class SfIEvents extends LitElement {
11753
12268
  a.setAttribute('download', 'report_' + ts + '.html');
11754
12269
  a.click();
11755
12270
  }
11756
- if (radioList.checked) {
12271
+ if (radioList === null || radioList === void 0 ? void 0 : radioList.checked) {
11757
12272
  const ts = new Date();
11758
12273
  var html = this.COMPLIANCES_HTML;
11759
12274
  html = html.replace(/PROJECT_NAME/g, this.projectName);
12275
+ html = html.replace(/FILTERS_DATA/g, '');
11760
12276
  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);
11761
12277
  let tempHtml = "";
11762
12278
  tempHtml += this.getFilteredString();
@@ -11768,7 +12284,7 @@ let SfIEvents = class SfIEvents extends LitElement {
11768
12284
  a.setAttribute('download', 'report_' + ts + '.html');
11769
12285
  a.click();
11770
12286
  }
11771
- if (radioListCsv.checked) {
12287
+ if (radioListCsv === null || radioListCsv === void 0 ? void 0 : radioListCsv.checked) {
11772
12288
  const ts = new Date();
11773
12289
  console.log(this.csvDataCompliances);
11774
12290
  const blob = new Blob([this.csvDataCompliances], { type: 'text/csv' });
@@ -11778,10 +12294,11 @@ let SfIEvents = class SfIEvents extends LitElement {
11778
12294
  a.setAttribute('download', 'report_' + ts + '.csv');
11779
12295
  a.click();
11780
12296
  }
11781
- if (radioConsolidated.checked) {
12297
+ if (radioConsolidated === null || radioConsolidated === void 0 ? void 0 : radioConsolidated.checked) {
11782
12298
  const ts = new Date().getTime();
11783
12299
  var html = this.COMPLIANCES_HTML;
11784
12300
  html = html.replace(/PROJECT_NAME/g, this.projectName);
12301
+ html = html.replace(/FILTERS_DATA/g, '');
11785
12302
  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);
11786
12303
  let tempHtml = "";
11787
12304
  tempHtml += this.htmlDataStats;
@@ -11800,7 +12317,7 @@ let SfIEvents = class SfIEvents extends LitElement {
11800
12317
  a.setAttribute('download', 'report_' + ts + '.html');
11801
12318
  a.click();
11802
12319
  }
11803
- if (radioCertificate.checked) {
12320
+ if (radioCertificate === null || radioCertificate === void 0 ? void 0 : radioCertificate.checked) {
11804
12321
  var html = this.CERTIFICATE_HTML;
11805
12322
  html = html.replace(/PERSON_NAME/g, this.userName);
11806
12323
  html = html.replace(/PERSON_DESIGNATION/g, this.myRole);
@@ -11841,6 +12358,7 @@ let SfIEvents = class SfIEvents extends LitElement {
11841
12358
  };
11842
12359
  this.renderChartSettings = (container, selectedTab = -1, selectedSummary = -1, ctx) => {
11843
12360
  var _a, _b;
12361
+ console.log('rendering chart settings', selectedSummary);
11844
12362
  var html = '';
11845
12363
  html += '<div class="d-flex justify-end align-start">';
11846
12364
  if (selectedTab === 0) {
@@ -11858,13 +12376,13 @@ let SfIEvents = class SfIEvents extends LitElement {
11858
12376
  if (selectedSummary === 1) {
11859
12377
  html += '<button class="tab-button" id="chart-control-summary" part="calendar-tab-button-selected" class="mr-10"><span class="material-icons">summarize</span></button>';
11860
12378
  }
11861
- else {
12379
+ else if (selectedSummary !== 2) {
11862
12380
  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>';
11863
12381
  }
11864
12382
  html += '</div>';
11865
12383
  container.querySelector('#chart-settings-controls').innerHTML = html;
11866
12384
  (_a = container.querySelector('#chart-settings-controls').querySelector('#chart-control-settings')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
11867
- this.renderChartSettings(container, 1, -1, ctx);
12385
+ this.renderChartSettings(container, 1, selectedSummary, ctx);
11868
12386
  });
11869
12387
  (_b = container.querySelector('#chart-settings-controls').querySelector('#chart-control-summary')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => {
11870
12388
  console.log('summary clicked');
@@ -11881,7 +12399,7 @@ let SfIEvents = class SfIEvents extends LitElement {
11881
12399
  if (selectedTab === 1) {
11882
12400
  // const radioCompleteness = container.querySelector('#radio-completeness') as HTMLButtonElement;
11883
12401
  // radioCompleteness.click();
11884
- this.renderChartSettingsSettings(container.querySelector('#chart-settings'));
12402
+ this.renderChartSettingsSettings(container.querySelector('#chart-settings'), selectedSummary);
11885
12403
  }
11886
12404
  container.querySelector('#chart-settings').addEventListener('canceled', () => {
11887
12405
  //console.log('canceled');
@@ -11902,7 +12420,12 @@ let SfIEvents = class SfIEvents extends LitElement {
11902
12420
  // this.renderPast(this.streamIndex);
11903
12421
  // }
11904
12422
  if (this.getCurrentTab() == this.TAB_CUSTOM) {
11905
- this.processDateSelection(container);
12423
+ if (selectedSummary === 2) {
12424
+ this.processDateSelectionViewer(container);
12425
+ }
12426
+ else {
12427
+ this.processDateSelection(container);
12428
+ }
11906
12429
  }
11907
12430
  });
11908
12431
  // (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-settings-cancel')?.addEventListener('click', () => {
@@ -13501,7 +14024,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13501
14024
  this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
13502
14025
  var html = '';
13503
14026
  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>';
13504
- 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>';
14027
+ 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>';
13505
14028
  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>';
13506
14029
  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>';
13507
14030
  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>';
@@ -13594,7 +14117,12 @@ let SfIEvents = class SfIEvents extends LitElement {
13594
14117
  (_g = this._SfTabContainer.querySelector('#calendar-tab-custom')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', () => {
13595
14118
  this.enableCustom();
13596
14119
  this.renderTabs(this.TAB_CUSTOM);
13597
- this.renderCustom();
14120
+ if (this.myRole == this.TAB_VIEWER) {
14121
+ this.renderCustomViewer();
14122
+ }
14123
+ else {
14124
+ this.renderCustom();
14125
+ }
13598
14126
  });
13599
14127
  (_h = this._SfTabContainer.querySelector('#calendar-tab-find')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', () => {
13600
14128
  this.enableFind();
@@ -15838,6 +16366,60 @@ let SfIEvents = class SfIEvents extends LitElement {
15838
16366
  }
15839
16367
  }
15840
16368
  };
16369
+ this.fetchStatistics = async (startDate = "", endDate = "", filtercriteria, filterid) => {
16370
+ let path = "";
16371
+ this.sdate = startDate;
16372
+ this.edate = endDate;
16373
+ path = "getstatistics";
16374
+ let sDate = "";
16375
+ let eDate = "";
16376
+ //console.log('currenttab', this.getCurrentTab());
16377
+ if (this.getCurrentTab() == this.TAB_YEAR) {
16378
+ sDate = "03/31/" + this.calendarStartYYYY;
16379
+ eDate = "04/01/" + (parseInt(this.calendarStartYYYY) + 1);
16380
+ }
16381
+ else {
16382
+ sDate = startDate;
16383
+ eDate = endDate;
16384
+ }
16385
+ let url = "https://" + this.apiId + "/" + path;
16386
+ //console.log('fetch calendar url', url);
16387
+ let urlBody = { "projectid": this.projectId, "userid": this.userProfileId, "role": this.myRole, "sdate": sDate, "edate": eDate };
16388
+ if (filtercriteria == 'function') {
16389
+ urlBody["functionid"] = filterid;
16390
+ urlBody["locationid"] = '';
16391
+ urlBody["filteruserrole"] = '';
16392
+ urlBody["filteruserid"] = '';
16393
+ }
16394
+ else if (filtercriteria == 'location') {
16395
+ urlBody["functionid"] = '';
16396
+ urlBody["locationid"] = filterid;
16397
+ urlBody["filteruserrole"] = '';
16398
+ urlBody["filteruserid"] = '';
16399
+ }
16400
+ else {
16401
+ urlBody["functionid"] = '';
16402
+ urlBody["locationid"] = '';
16403
+ urlBody["filteruserrole"] = filtercriteria;
16404
+ urlBody["filteruserid"] = filterid;
16405
+ }
16406
+ console.log('urlbody', urlBody);
16407
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
16408
+ const xhr = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing'));
16409
+ this._SfLoader.innerHTML = '';
16410
+ if (xhr.status == 200) {
16411
+ const jsonRespose = JSON.parse(xhr.responseText);
16412
+ console.log('jsonRespose Statistics', jsonRespose);
16413
+ this.statistics = jsonRespose.data;
16414
+ if (jsonRespose.meta != null)
16415
+ this.statisticsMeta = jsonRespose.meta;
16416
+ return jsonRespose.meta;
16417
+ }
16418
+ else {
16419
+ const jsonRespose = JSON.parse(xhr.responseText);
16420
+ this.setError(jsonRespose.error);
16421
+ }
16422
+ };
15841
16423
  this.fetchBulkReportingData = async () => {
15842
16424
  let path = "getbulkreportjobs";
15843
16425
  let urlBody = { "projectid": this.projectId };
@@ -18883,6 +19465,12 @@ __decorate([
18883
19465
  __decorate([
18884
19466
  property()
18885
19467
  ], SfIEvents.prototype, "events", void 0);
19468
+ __decorate([
19469
+ property()
19470
+ ], SfIEvents.prototype, "statistics", void 0);
19471
+ __decorate([
19472
+ property()
19473
+ ], SfIEvents.prototype, "statisticsMeta", void 0);
18886
19474
  __decorate([
18887
19475
  property()
18888
19476
  ], SfIEvents.prototype, "streamIndex", void 0);
@@ -18934,6 +19522,9 @@ __decorate([
18934
19522
  __decorate([
18935
19523
  property()
18936
19524
  ], SfIEvents.prototype, "htmlDataSummary", void 0);
19525
+ __decorate([
19526
+ property()
19527
+ ], SfIEvents.prototype, "htmlStatsFilter", void 0);
18937
19528
  __decorate([
18938
19529
  property()
18939
19530
  ], SfIEvents.prototype, "period", void 0);