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.
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,98 @@ 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
+ selectFilterCriteria.innerHTML = "";
4102
+ let option = new Option();
4103
+ option.value = "";
4104
+ option.innerHTML = "all";
4105
+ selectFilterCriteria.add(option);
4106
+ for (let criteria of Object.keys(this.statisticsMeta)) {
4107
+ let option = new Option();
4108
+ option.value = criteria;
4109
+ if (criteria == "reporter" || criteria == "approver" || criteria == "functionhead") {
4110
+ option.innerHTML = "user:" + criteria;
4111
+ }
4112
+ else {
4113
+ option.innerHTML = criteria;
4114
+ }
4115
+ selectFilterCriteria.add(option);
4116
+ }
4117
+ let selectFilterCriteriaNew = Util.clearListeners(selectFilterCriteria);
4118
+ selectFilterCriteriaNew.addEventListener('change', (ev) => {
4119
+ let target = ev.target;
4120
+ let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria');
4121
+ let selectFilterValues = eventsContainer.querySelector('#select-filter-values');
4122
+ if (target.value == "") {
4123
+ selectFilterValues.value = "";
4124
+ this.processDateSelectionViewer(eventsContainer);
4125
+ }
4126
+ selectFilterValues.innerHTML = "";
4127
+ let option = new Option();
4128
+ option.value = "";
4129
+ option.innerHTML = "All";
4130
+ selectFilterValues.add(option);
4131
+ if (this.statisticsMeta[target.value] != null) {
4132
+ let sortedFilters = Util.alphabeticalSort(this.statisticsMeta[target.value]);
4133
+ selectFilterValues.style.display = 'block';
4134
+ inputLabelCriteria.style.display = 'block';
4135
+ inputLabelCriteria.innerHTML = target.value;
4136
+ for (let filter of sortedFilters) {
4137
+ let option = new Option();
4138
+ option.value = filter.split(';')[1];
4139
+ option.innerHTML = filter.split(';')[0].replace(/\([^)]*\)/g, "");
4140
+ selectFilterValues.add(option);
4141
+ }
4142
+ let selectFilterValuesNew = Util.clearListeners(selectFilterValues);
4143
+ selectFilterValuesNew.addEventListener('change', () => {
4144
+ console.log('changed');
4145
+ this.processDateSelectionViewer(eventsContainer);
4146
+ });
4147
+ }
4148
+ else {
4149
+ selectFilterValues.style.display = 'none';
4150
+ inputLabelCriteria.style.display = 'none';
4151
+ }
4152
+ });
4153
+ let selectFilterValues = eventsContainer.querySelector('#select-filter-values');
4154
+ let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria');
4155
+ selectFilterValues.style.display = 'none';
4156
+ inputLabelCriteria.style.display = 'none';
4157
+ };
3988
4158
  this.renderSelectAllButtons = () => {
3989
4159
  let selectAllHtml = '<div class="d-flex justify-end w-100" style="position: fixed; bottom: 70px; left: 0px;" part="button-select-all-container">';
3990
4160
  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 +4491,96 @@ let SfIEvents = class SfIEvents extends LitElement {
4321
4491
  this.renderCompletenessGraph(eventContainer);
4322
4492
  }
4323
4493
  };
4494
+ this.processDateSelectionViewer = async (eventContainer) => {
4495
+ var startDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);
4496
+ var endDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + (parseInt(this.calendarStartYYYY) + 1));
4497
+ var valueStart = this._SfCustomContainer.querySelector('#stream-start-date').value;
4498
+ if (valueStart == "") {
4499
+ valueStart = this._SfCustomContainer.querySelector('#stream-start-date-mobile').value;
4500
+ }
4501
+ var valueEnd = this._SfCustomContainer.querySelector('#stream-end-date').value;
4502
+ if (valueEnd == "") {
4503
+ valueEnd = this._SfCustomContainer.querySelector('#stream-end-date-mobile').value;
4504
+ }
4505
+ //console.log('valuestart', valueStart);
4506
+ //console.log('valueend', valueEnd);
4507
+ let filtercriteria = this._SfCustomContainer.querySelector('#select-filter-criteria').value;
4508
+ let filtercriterianame = "";
4509
+ console.log('criteria', this._SfCustomContainer.querySelector('#select-filter-criteria').options[this._SfCustomContainer.querySelector('#select-filter-criteria').selectedIndex]);
4510
+ if (this._SfCustomContainer.querySelector('#select-filter-criteria').options[this._SfCustomContainer.querySelector('#select-filter-criteria').selectedIndex] != null) {
4511
+ filtercriterianame = this._SfCustomContainer.querySelector('#select-filter-criteria').options[this._SfCustomContainer.querySelector('#select-filter-criteria').selectedIndex].innerHTML;
4512
+ }
4513
+ if (filtercriteria == "") {
4514
+ filtercriteria = this._SfCustomContainer.querySelector('#select-filter-criteria-mobile').value;
4515
+ if (this._SfCustomContainer.querySelector('#select-filter-criteria-mobile').options[this._SfCustomContainer.querySelector('#select-filter-criteria-mobile').selectedIndex] != null) {
4516
+ filtercriterianame = this._SfCustomContainer.querySelector('#select-filter-criteria-mobile').options[this._SfCustomContainer.querySelector('#select-filter-criteria-mobile').selectedIndex].innerHTML;
4517
+ }
4518
+ }
4519
+ let filtervalue = this._SfCustomContainer.querySelector('#select-filter-values').value;
4520
+ let filtervaluename = "";
4521
+ if (this._SfCustomContainer.querySelector('#select-filter-values').options[this._SfCustomContainer.querySelector('#select-filter-values').selectedIndex] != null) {
4522
+ filtervaluename = this._SfCustomContainer.querySelector('#select-filter-values').options[this._SfCustomContainer.querySelector('#select-filter-values').selectedIndex].innerHTML;
4523
+ }
4524
+ if (filtervalue == "") {
4525
+ filtervalue = this._SfCustomContainer.querySelector('#select-filter-values-mobile').value;
4526
+ if (this._SfCustomContainer.querySelector('#select-filter-values-mobile').options[this._SfCustomContainer.querySelector('#select-filter-values-mobile').selectedIndex] != null) {
4527
+ filtervaluename = this._SfCustomContainer.querySelector('#select-filter-values-mobile').options[this._SfCustomContainer.querySelector('#select-filter-values-mobile').selectedIndex].innerHTML;
4528
+ }
4529
+ }
4530
+ if (filtercriteria == "") {
4531
+ this.htmlStatsFilter = "Filters Selected -> All";
4532
+ }
4533
+ else {
4534
+ if (filtervalue == "") {
4535
+ this.htmlStatsFilter = "Filters Selected -> " + Util.titleCase(filtercriterianame) + " -> All";
4536
+ }
4537
+ else {
4538
+ this.htmlStatsFilter = "Filters Selected -> " + Util.titleCase(filtercriterianame) + " -> " + Util.titleCase(filtervaluename);
4539
+ }
4540
+ }
4541
+ if (valueStart != "" && valueEnd != "") {
4542
+ this.initCustomRightColViewer();
4543
+ if (!this.checkStartDateEarliness(valueStart)) {
4544
+ this._SfStreamEventStatus.innerHTML = "Chosen Start Date cannot be earlier than " + startDateCalendar;
4545
+ return;
4546
+ }
4547
+ if (!this.checkEndDateLateness(valueEnd)) {
4548
+ this._SfStreamEventStatus.innerHTML = "Chosen End Date cannot be later than " + endDateCalendar;
4549
+ return;
4550
+ }
4551
+ if (new Date(valueStart).getTime() > new Date(valueEnd).getTime()) {
4552
+ this._SfStreamEventStatus.innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
4553
+ return;
4554
+ }
4555
+ if ((new Date(valueEnd).getTime() - new Date(valueStart).getTime()) / (1000 * 60 * 60 * 24) > 400) {
4556
+ this._SfStreamEventStatus.innerHTML = "Chosen time window cannot be greater than 400 days";
4557
+ return;
4558
+ }
4559
+ const tsStart = new Date(valueStart);
4560
+ const tsEnd = new Date(valueEnd);
4561
+ tsStart.setDate(tsStart.getDate() - 2);
4562
+ tsEnd.setDate(tsEnd.getDate() + 2);
4563
+ //console.log('tsstart', tsStart);
4564
+ //console.log('tsend', tsEnd);
4565
+ let meta = await this.fetchStatistics((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear(), filtercriteria, filtervalue);
4566
+ this.renderRangeStatistics(new Date(valueStart), ((new Date(valueEnd).getTime() + 24 * 60 * 60 * 1000) - new Date(valueStart).getTime()) / (1000 * 60 * 60 * 24), this._SfCustomContainer);
4567
+ if (meta != null)
4568
+ this.renderStatisticsFilters(this._SfCustomContainer);
4569
+ }
4570
+ else if (valueStart != "" && valueEnd == "") {
4571
+ this._SfStreamEventStatus.innerHTML = "Please select End Date";
4572
+ }
4573
+ else if (valueStart == "" && valueEnd != "") {
4574
+ this._SfStreamEventStatus.innerHTML = "Please select Start Date";
4575
+ }
4576
+ else if (valueStart == "" && valueEnd == "") {
4577
+ this._SfStreamEventStatus.innerHTML = "Please select Start Date and End Date";
4578
+ }
4579
+ this.attachHandlers(eventContainer, valueStart, valueEnd);
4580
+ if (eventContainer.innerHTML.indexOf('myChart') >= 0) {
4581
+ this.renderCompletenessGraph(eventContainer, -1, 2);
4582
+ }
4583
+ };
4324
4584
  this.initFindRightCol = () => {
4325
4585
  var html = "";
4326
4586
  html += '<div id="stream-event-0" part="stream-event-list" class="stream-event-list">';
@@ -4339,6 +4599,15 @@ let SfIEvents = class SfIEvents extends LitElement {
4339
4599
  html += '</div>';
4340
4600
  this._SfCustomContainer.querySelector('.calendar-right-data').innerHTML = html;
4341
4601
  };
4602
+ this.initCustomRightColViewer = () => {
4603
+ var html = "";
4604
+ html += '<div id="stream-event-0" part="stream-event-list" class="stream-event-list">';
4605
+ html += '<div part="stream-event-not-selected" class="d-flex stream-event-not-selected">';
4606
+ html += '<div><h2 id="stream-event-status">Please select Start Date, End Date and Filter Criteria</h2></div>';
4607
+ html += '</div>';
4608
+ html += '</div>';
4609
+ this._SfCustomContainer.querySelector('.calendar-right-data').innerHTML = html;
4610
+ };
4342
4611
  this.checkAndShowBulk = () => {
4343
4612
  const inputArr = this._SfMappingContainer.querySelectorAll('.input-checkbox');
4344
4613
  var checked = 0;
@@ -5942,6 +6211,188 @@ let SfIEvents = class SfIEvents extends LitElement {
5942
6211
  // })
5943
6212
  // }
5944
6213
  };
6214
+ this.renderCustomViewer = () => {
6215
+ var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m;
6216
+ this.clearGraphData();
6217
+ this.clearSelectedGraphParam();
6218
+ this.clearSelectedLegend();
6219
+ var html = '';
6220
+ html += '<div class="scroll-x w-100 mobile-only">';
6221
+ html += '<div class="title-item-date">';
6222
+ html += '<label part="input-label">Start Date</label><br />';
6223
+ html += '<input id="stream-start-date-mobile" part="input" type="date" />';
6224
+ html += '</div>';
6225
+ html += '<div class="title-item-date">';
6226
+ html += '<label part="input-label">End Date</label><br />';
6227
+ html += '<input id="stream-end-date-mobile" part="input" type="date" />';
6228
+ html += '</div>';
6229
+ html += '<div class="title-item-date">';
6230
+ html += '<button id="button-year-to-date-mobile" part="button-lg-short-secondary">Year To Date</button>';
6231
+ html += '</div>';
6232
+ html += '<div class="title-item-date">';
6233
+ html += '<button id="button-this-quarter-mobile" part="button-lg-short-secondary">This Quarter</button>';
6234
+ html += '</div>';
6235
+ html += '<div class="title-item-date">';
6236
+ html += '<button id="button-this-year-mobile" part="button-lg-short-secondary">This Year</button>';
6237
+ html += '</div>';
6238
+ html += '<div class="title-item-date">';
6239
+ html += '<label part="input-label-filter-criteria" id="input-label-filter-mobile">Filter Criteria</label><br />';
6240
+ html += '<select id="select-filter-criteria-mobile" class="mr-10"></select>';
6241
+ html += '</div>';
6242
+ html += '<div class="title-item-date">';
6243
+ html += '<label part="input-label-filter-value" id="input-label-criteria-mobile"></label><br />';
6244
+ html += '<select id="select-filter-values-mobile" class="mr-10"></select>';
6245
+ html += '</div>';
6246
+ html += '</div>';
6247
+ html += '<div class="d-flex w-100">';
6248
+ html += '<div class="calendar-left-col desktop-only flex-col justify-start align-end">';
6249
+ html += '<div class="title-item-date d-flex flex-col align-end">';
6250
+ html += '<label part="input-label">Start Date</label>';
6251
+ html += '<input id="stream-start-date" part="input" type="date" />';
6252
+ html += '</div>';
6253
+ html += '<div class="title-item-date d-flex flex-col align-end">';
6254
+ html += '<label part="input-label">End Date</label>';
6255
+ html += '<input id="stream-end-date" part="input" type="date" />';
6256
+ html += '</div>';
6257
+ html += '<div class="title-item-date">';
6258
+ html += '<button id="button-year-to-date" part="button-lg-short-secondary">Year To Date</button>';
6259
+ html += '</div>';
6260
+ html += '<div class="title-item-date">';
6261
+ html += '<button id="button-this-quarter" part="button-lg-short-secondary">This Quarter</button>';
6262
+ html += '</div>';
6263
+ html += '<div class="title-item-date">';
6264
+ html += '<button id="button-this-year" part="button-lg-short-secondary">This Year</button>';
6265
+ html += '</div>';
6266
+ html += '<div class="title-item-date d-flex flex-col align-end">';
6267
+ html += '<label part="input-label-filter-criteria" id="input-label-filter" class="mr-10">Filter Criteria</label>';
6268
+ html += '<select id="select-filter-criteria" class="mr-10"></select>';
6269
+ html += '</div>';
6270
+ html += '<div class="title-item-date d-flex flex-col align-end">';
6271
+ html += '<label part="input-label-filter-value" id="input-label-criteria" class="mr-10"></label>';
6272
+ html += '<select id="select-filter-values" class="mr-10"></select>';
6273
+ html += '</div>';
6274
+ html += '</div>';
6275
+ html += '<div class="calendar-right-data flex-grow">';
6276
+ html += '</div>';
6277
+ html += '</div>';
6278
+ console.log('html', html);
6279
+ this._SfCustomContainer.innerHTML = html;
6280
+ this.initCustomRightColViewer();
6281
+ (_a = this._SfCustomContainer.querySelector('#stream-start-date')) === null || _a === void 0 ? void 0 : _a.addEventListener('change', (_ev) => {
6282
+ //console.log('start-date', ev);
6283
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
6284
+ this.processDateSelectionViewer(this._SfCustomContainer);
6285
+ });
6286
+ (_b = this._SfCustomContainer.querySelector('#stream-end-date')) === null || _b === void 0 ? void 0 : _b.addEventListener('change', (_ev) => {
6287
+ //console.log('end-date', ev);
6288
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
6289
+ this.processDateSelectionViewer(this._SfCustomContainer);
6290
+ });
6291
+ (_c = this._SfCustomContainer.querySelector('#stream-start-date-mobile')) === null || _c === void 0 ? void 0 : _c.addEventListener('change', (_ev) => {
6292
+ //console.log('start-date', ev);
6293
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
6294
+ this.processDateSelectionViewer(this._SfCustomContainer);
6295
+ });
6296
+ (_f = this._SfCustomContainer.querySelector('#stream-end-date-mobile')) === null || _f === void 0 ? void 0 : _f.addEventListener('change', (_ev) => {
6297
+ //console.log('end-date', ev);
6298
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
6299
+ this.processDateSelectionViewer(this._SfCustomContainer);
6300
+ });
6301
+ (_g = this._SfCustomContainer.querySelector('#button-year-to-date')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', () => {
6302
+ this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6303
+ this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6304
+ this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
6305
+ this._SfCustomContainer.querySelector('#stream-end-date').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
6306
+ this.processDateSelectionViewer(this._SfCustomContainer);
6307
+ });
6308
+ (_h = this._SfCustomContainer.querySelector('#button-year-to-date-mobile')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', () => {
6309
+ this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6310
+ this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6311
+ this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
6312
+ this._SfCustomContainer.querySelector('#stream-end-date').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
6313
+ this.processDateSelectionViewer(this._SfCustomContainer);
6314
+ });
6315
+ (_j = this._SfCustomContainer.querySelector('#button-this-year-mobile')) === null || _j === void 0 ? void 0 : _j.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 = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6319
+ this._SfCustomContainer.querySelector('#stream-end-date').value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6320
+ this.processDateSelectionViewer(this._SfCustomContainer);
6321
+ });
6322
+ (_k = this._SfCustomContainer.querySelector('#button-this-year')) === null || _k === void 0 ? void 0 : _k.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 = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6326
+ this._SfCustomContainer.querySelector('#stream-end-date').value = (parseInt(this.calendarStartYYYY) + 1) + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
6327
+ this.processDateSelectionViewer(this._SfCustomContainer);
6328
+ });
6329
+ (_l = this._SfCustomContainer.querySelector('#button-this-quarter-mobile')) === null || _l === void 0 ? void 0 : _l.addEventListener('click', () => {
6330
+ const mmCurrent = ((new Date().getMonth() + 1));
6331
+ let startDate = "";
6332
+ let endDate = "";
6333
+ if (mmCurrent >= 4 && mmCurrent <= 6) {
6334
+ startDate = this.calendarStartYYYY + '-' + '04' + '-' + "01";
6335
+ endDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
6336
+ }
6337
+ else if (mmCurrent >= 6 && mmCurrent <= 9) {
6338
+ startDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
6339
+ endDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
6340
+ }
6341
+ else if (mmCurrent >= 9 && mmCurrent <= 12) {
6342
+ startDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
6343
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
6344
+ }
6345
+ else {
6346
+ startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
6347
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
6348
+ }
6349
+ this._SfCustomContainer.querySelector('#stream-start-date').value = startDate;
6350
+ this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = startDate;
6351
+ this._SfCustomContainer.querySelector('#stream-end-date').value = endDate;
6352
+ this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = endDate;
6353
+ this.processDateSelectionViewer(this._SfCustomContainer);
6354
+ });
6355
+ (_m = this._SfCustomContainer.querySelector('#button-this-quarter')) === null || _m === void 0 ? void 0 : _m.addEventListener('click', () => {
6356
+ const mmCurrent = ((new Date().getMonth() + 1));
6357
+ let startDate = "";
6358
+ let endDate = "";
6359
+ if (mmCurrent >= 4 && mmCurrent <= 6) {
6360
+ startDate = this.calendarStartYYYY + '-' + '04' + '-' + "01";
6361
+ endDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
6362
+ }
6363
+ else if (mmCurrent >= 6 && mmCurrent <= 9) {
6364
+ startDate = this.calendarStartYYYY + '-' + '07' + '-' + "01";
6365
+ endDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
6366
+ }
6367
+ else if (mmCurrent >= 9 && mmCurrent <= 12) {
6368
+ startDate = this.calendarStartYYYY + '-' + '10' + '-' + "01";
6369
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
6370
+ }
6371
+ else {
6372
+ startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
6373
+ endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
6374
+ }
6375
+ this._SfCustomContainer.querySelector('#stream-start-date').value = startDate;
6376
+ this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = startDate;
6377
+ this._SfCustomContainer.querySelector('#stream-end-date').value = endDate;
6378
+ this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = endDate;
6379
+ this.processDateSelectionViewer(this._SfCustomContainer);
6380
+ });
6381
+ let selectFilterCriteria = this._SfCustomContainer.querySelector('#select-filter-criteria');
6382
+ selectFilterCriteria.style.display = 'none';
6383
+ let selectFilterValues = this._SfCustomContainer.querySelector('#select-filter-values');
6384
+ selectFilterValues.style.display = 'none';
6385
+ let inputLabelFilter = this._SfCustomContainer.querySelector('#input-label-filter');
6386
+ inputLabelFilter.style.display = 'none';
6387
+ // for(var i = 0; i < 3; i++) {
6388
+ // (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-month-' + i)?.addEventListener('click', (ev: any)=> {
6389
+ // const target = parseInt((ev.target as HTMLDivElement).id.split('-')[2]);
6390
+ // //console.log('clicked ', target);
6391
+ // this.renderPast(target);
6392
+ // })
6393
+ // }
6394
+ this._SfCustomContainer.querySelector('#button-year-to-date').click();
6395
+ };
5945
6396
  this.renderThis = (index = 1, showGraph = true) => {
5946
6397
  var _a, _b;
5947
6398
  this.clearGraphData();
@@ -6259,18 +6710,20 @@ let SfIEvents = class SfIEvents extends LitElement {
6259
6710
  document.addEventListener('scroll', () => {
6260
6711
  // console.log('scroll',window.scrollY)
6261
6712
  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") {
6713
+ if (buttonRefresh != null) {
6714
+ if (window.scrollY > 720) {
6715
+ if (buttonRefresh.style.display == "flex") {
6716
+ }
6717
+ else {
6718
+ buttonRefresh.style.display = 'flex';
6719
+ }
6271
6720
  }
6272
6721
  else {
6273
- buttonRefresh.style.display = 'none';
6722
+ if (buttonRefresh.style.display == "none") {
6723
+ }
6724
+ else {
6725
+ buttonRefresh.style.display = 'none';
6726
+ }
6274
6727
  }
6275
6728
  }
6276
6729
  });
@@ -6753,7 +7206,7 @@ let SfIEvents = class SfIEvents extends LitElement {
6753
7206
  }
6754
7207
  //console.log('rendering csv csvComplianceStats', this.csvComplianceStats);
6755
7208
  };
6756
- this.renderCompletenessGraph = (divContainer) => {
7209
+ this.renderCompletenessGraph = (divContainer, selectedTab = -1, selectedSummary = -1) => {
6757
7210
  this.clearSelectedGraphParam();
6758
7211
  // this.clearSelectedLegend();
6759
7212
  this.csvGraphStats = "";
@@ -6786,7 +7239,7 @@ let SfIEvents = class SfIEvents extends LitElement {
6786
7239
  ]
6787
7240
  }]
6788
7241
  };
6789
- this.renderChartSettings(divContainer, -1, -1, ctx);
7242
+ this.renderChartSettings(divContainer, selectedTab, selectedSummary, ctx);
6790
7243
  this.renderChart(ctx, 'doughnut', data, "Completeness");
6791
7244
  }
6792
7245
  const data = {
@@ -6817,7 +7270,7 @@ let SfIEvents = class SfIEvents extends LitElement {
6817
7270
  for (var i = 0; i < itemsCompliance.length; i++) {
6818
7271
  itemsCompliance[i].style.display = 'none';
6819
7272
  }
6820
- this.renderChartSettings(divContainer, -1, -1, ctx);
7273
+ this.renderChartSettings(divContainer, selectedTab, selectedSummary, ctx);
6821
7274
  this.renderChart(ctx, 'doughnut', data, "Completeness");
6822
7275
  };
6823
7276
  this.renderComplianceGraph = (divContainer) => {
@@ -8423,7 +8876,7 @@ let SfIEvents = class SfIEvents extends LitElement {
8423
8876
  const selectedIndex = e.currentTarget.id.split('-')[1];
8424
8877
  // taggingArray.data.mappings.mappings = [];
8425
8878
  const tempArray = [];
8426
- for (let count = 0; count < sourceArray.data.mappings.mappings.length; count++) {
8879
+ for (var count = 0; count < sourceArray.data.mappings.mappings.length; count++) {
8427
8880
  //console.log('selectedindexchecking', selectedIndex, count, this.selectedCbs.includes(selectedIndex), this.selectedCbs.includes(count));
8428
8881
  //taggingArray.data.mappings.mappings[count] = sourceArray.data.mappings.mappings[count];
8429
8882
  //taggingArray.data.mappings.mappings.push(sourceArray.data.mappings.mappings[count]);
@@ -8579,9 +9032,7 @@ let SfIEvents = class SfIEvents extends LitElement {
8579
9032
  };
8580
9033
  this.saveTagging = async (mapping, uploadFunction, refreshFunction, saveInBackground) => {
8581
9034
  async function process() {
8582
- console.log = function () {
8583
- console.log('Saving...', mapping);
8584
- };
9035
+ //console.log('Saving...', mapping);
8585
9036
  await uploadFunction(mapping);
8586
9037
  if (!saveInBackground)
8587
9038
  refreshFunction();
@@ -8916,7 +9367,7 @@ let SfIEvents = class SfIEvents extends LitElement {
8916
9367
  for (k = 0; k < taggingArray.data.mappings.mappings.length; k++) {
8917
9368
  if (taggingArray.data.mappings.mappings[k].id == sourceArray.data.mappings.mappings[i].id) {
8918
9369
  if (taggingArray.data.mappings.mappings[k].id == "62330e24-298d-4ef2-9449-c0e400e37cac") {
8919
- // console.log('found', taggingArray.data.mappings.mappings[k]);
9370
+ console.log('found', taggingArray.data.mappings.mappings[k]);
8920
9371
  //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
9372
  //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
9373
  }
@@ -9963,10 +10414,10 @@ let SfIEvents = class SfIEvents extends LitElement {
9963
10414
  this._SfLoader.innerHTML = '<div class="lds-dual-ring"></div>';
9964
10415
  this._SfLoader.innerHTML += ('<div class="lds-text"><div class="lds-text-c"></div></div>');
9965
10416
  }
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);
10417
+ setTimeout(() => {
10418
+ this.renderMappingTable(divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, inputFilter.value, statuteColName, extraHintsArr);
10419
+ this._SfLoader.innerHTML = '';
10420
+ }, 1000);
9970
10421
  }
9971
10422
  });
9972
10423
  // More button handlers
@@ -10092,9 +10543,9 @@ let SfIEvents = class SfIEvents extends LitElement {
10092
10543
  arrCheckBoxes[i].addEventListener('change', async (_e) => {
10093
10544
  //console.log(e.currentTarget, (e.currentTarget as HTMLInputElement).checked);
10094
10545
  divElement.querySelector('.button-save').disabled = false;
10095
- // if(extraFieldPosition === 1) {
10096
- // await this.saveMapping (divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true)
10097
- // }
10546
+ if (extraFieldPosition === 1) {
10547
+ await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true);
10548
+ }
10098
10549
  });
10099
10550
  }
10100
10551
  (_a = divElement.querySelector('.checkbox-all')) === null || _a === void 0 ? void 0 : _a.addEventListener('change', (e) => {
@@ -10446,7 +10897,7 @@ let SfIEvents = class SfIEvents extends LitElement {
10446
10897
  html += '<div id="approvers-list-container" class="d-flex flex-col w-100 scroll-x">';
10447
10898
  html += '</div>';
10448
10899
  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", "");
10900
+ 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
10901
  };
10451
10902
  this.renderOnboardingFunctionHeads = (mappedFunctionHeads, mappedSerializedApprovers, functionHeadsJobs, _arrFeedbackReference) => {
10452
10903
  var html = '';
@@ -10502,7 +10953,6 @@ let SfIEvents = class SfIEvents extends LitElement {
10502
10953
  }
10503
10954
  }
10504
10955
  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
10956
  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
10957
  };
10508
10958
  this.renderOnboardingLocations = (mappedLocations, mappedSerializedEntities, locationsJobs) => {
@@ -11612,83 +12062,121 @@ let SfIEvents = class SfIEvents extends LitElement {
11612
12062
  container.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
11613
12063
  });
11614
12064
  };
11615
- this.renderChartSettingsSettings = (container) => {
12065
+ this.renderChartSettingsSettings = (container, selectedTab = 1) => {
11616
12066
  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>
12067
+ var html = ``;
12068
+ if (selectedTab == 1) {
12069
+ html = `
12070
+
12071
+ <div class="m-10" part="settings-container">
12072
+ <div class="d-flex justify-end">
12073
+ <button id="chart-control-cancel" class="material-icons" part="button-icon-small">close</button>
12074
+ </div>
11623
12075
 
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>
12076
+ <div class="d-flex justify-center">
12077
+ <div class="p-10 mr-10 w-100">
12078
+ <div part="td-head">Reports</div>
12079
+ <div part="td-body" class="d-flex align-center mt-10 flex-wrap">
12080
+ <div class="mr-10 d-flex align-center mb-10">
12081
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked name="radio-report" part="radio-download"/>
12082
+ <label for="radio-csv" part="label-radio-download" class="mr-10">Summary (CSV)</label>
12083
+ </div>
12084
+ <div class="mr-10 d-flex align-center mb-10">
12085
+ <input type="radio" id="radio-image" class="switch-image" value="Image" name="radio-report" part="radio-download"/>
12086
+ <label for="radio-image" part="label-radio-download" class="mr-10">Image (PNG)</label>
12087
+ </div>
12088
+ <div class="mr-10 d-flex align-center mb-10">
12089
+ <input type="radio" id="radio-stats" class="switch-image" value="Stats" name="radio-report" part="radio-download"/>
12090
+ <label for="radio-stats" part="label-radio-download" class="mr-10">Stats (HTML)</label>
12091
+ </div>
12092
+ <div class="mr-10 d-flex align-center mb-10">
12093
+ <input type="radio" id="radio-list" class="switch-image" value="List" name="radio-report" part="radio-download"/>
12094
+ <label for="radio-list" part="label-radio-download" class="mr-10">List (HTML)</label>
12095
+ </div>
12096
+ <div class="mr-10 d-flex align-center mb-10">
12097
+ <input type="radio" id="radio-list-csv" class="switch-image" value="List" name="radio-report" part="radio-download"/>
12098
+ <label for="radio-list-csv" part="label-radio-download" class="mr-10">List (CSV)</label>
12099
+ </div>
12100
+ <div class="mr-10 d-flex align-center mb-10">
12101
+ <input type="radio" id="radio-consolidated" class="switch-image" value="Consolidated" name="radio-report" part="radio-download"/>
12102
+ <label for="radio-consolidated" part="label-radio-download" class="mr-10">Consolidated (HTML)</label>
12103
+ </div>
12104
+ <div class="mr-10 d-flex align-center mb-10">
12105
+ <input type="radio" id="radio-certificate" class="switch-image" value="Certificate" name="radio-report" part="radio-download"/>
12106
+ <label for="radio-certificate" part="label-radio-download" class="mr-10">Certificate (HTML)</label>
12107
+ </div>
11635
12108
  </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>
12109
+ <div class="d-flex mt-10">
12110
+ <button id="button-download-stats" part="button" class="mt-5 ml-10">Download</button>
11639
12111
  </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>
12112
+ </div>
12113
+ <!-- <div class="p-10 ml-10 mr-10">
12114
+ <div part="td-head">Compliances</div>
12115
+ <div part="td-body" class="d-flex align-center mt-5">
12116
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked part="radio-download"/>
12117
+ <label for="radio-html" part="label-radio-download">Html</label>
11643
12118
  </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>
12119
+ <div class="d-flex">
12120
+ <button id="button-download-compliances" part="button" class="mt-5">Download</button>
11647
12121
  </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>
12122
+ </div>
12123
+ <div class="p-10 ml-10">
12124
+ <div part="td-head">Certificate</div>
12125
+ <div part="td-body" class="d-flex align-center mt-5">
12126
+ <input type="radio" id="radio-html" class="switch-html" value="Html" checked part="radio-download"/>
12127
+ <label for="radio-html" part="label-radio-download">Html</label>
11651
12128
  </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>
12129
+ <div class="d-flex">
12130
+ <button id="button-download-certificate" part="button" class="mt-5">Download</button>
11655
12131
  </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>
12132
+ </div> -->
11660
12133
  </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>
12134
+ </div>
12135
+
12136
+ `;
12137
+ }
12138
+ else {
12139
+ html = `
12140
+
12141
+ <div class="m-10" part="settings-container">
12142
+ <div class="d-flex justify-end">
12143
+ <button id="chart-control-cancel" class="material-icons" part="button-icon-small">close</button>
11670
12144
  </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>
12145
+
12146
+ <div class="d-flex justify-center">
12147
+ <div class="p-10 mr-10 w-100">
12148
+ <div part="td-head">Reports</div>
12149
+ <div part="td-body" class="d-flex align-center mt-10 flex-wrap">
12150
+ <div class="mr-10 d-flex align-center mb-10">
12151
+ <input type="radio" id="radio-csv" class="switch-csv" value="Excel" checked name="radio-report" part="radio-download"/>
12152
+ <label for="radio-csv" part="label-radio-download" class="mr-10">Summary (CSV)</label>
12153
+ </div>
12154
+ <div class="mr-10 d-flex align-center mb-10">
12155
+ <input type="radio" id="radio-image" class="switch-image" value="Image" name="radio-report" part="radio-download"/>
12156
+ <label for="radio-image" part="label-radio-download" class="mr-10">Image (PNG)</label>
12157
+ </div>
12158
+ <div class="mr-10 d-flex align-center mb-10">
12159
+ <input type="radio" id="radio-stats" class="switch-image" value="Stats" name="radio-report" part="radio-download"/>
12160
+ <label for="radio-stats" part="label-radio-download" class="mr-10">Stats (HTML)</label>
12161
+ </div>
12162
+ </div>
12163
+ <div class="d-flex mt-10">
12164
+ <button id="button-download-stats" part="button" class="mt-5 ml-10">Download</button>
12165
+ </div>
11679
12166
  </div>
11680
- </div> -->
12167
+ </div>
11681
12168
  </div>
11682
- </div>
11683
-
11684
- `;
12169
+
12170
+ `;
12171
+ }
11685
12172
  container.innerHTML = html;
11686
12173
  (_a = container.querySelector('#chart-control-cancel')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
11687
12174
  container.innerHTML = '';
11688
12175
  container.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
11689
12176
  });
11690
12177
  (_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");
12178
+ if (selectedTab === -1)
12179
+ await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no");
11692
12180
  const radioCsv = container.querySelector('#radio-csv');
11693
12181
  const radioImage = container.querySelector('#radio-image');
11694
12182
  const radioStats = container.querySelector('#radio-stats');
@@ -11734,8 +12222,20 @@ let SfIEvents = class SfIEvents extends LitElement {
11734
12222
  }
11735
12223
  if (radioStats.checked) {
11736
12224
  const ts = new Date().getTime();
12225
+ console.log('htmlstatsfilter', this.htmlStatsFilter, selectedTab);
11737
12226
  var html = this.COMPLIANCES_HTML;
11738
12227
  html = html.replace(/PROJECT_NAME/g, this.projectName);
12228
+ if (selectedTab == -1) {
12229
+ html = html.replace(/FILTERS_DATA/g, '');
12230
+ }
12231
+ else {
12232
+ let filtersHtml = `
12233
+ <div>
12234
+ ${this.htmlStatsFilter}
12235
+ </div>
12236
+ `;
12237
+ html = html.replace(/FILTERS_DATA/g, filtersHtml);
12238
+ }
11739
12239
  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
12240
  let tempHtml = "";
11741
12241
  tempHtml += this.htmlDataStats;
@@ -11753,10 +12253,11 @@ let SfIEvents = class SfIEvents extends LitElement {
11753
12253
  a.setAttribute('download', 'report_' + ts + '.html');
11754
12254
  a.click();
11755
12255
  }
11756
- if (radioList.checked) {
12256
+ if (radioList === null || radioList === void 0 ? void 0 : radioList.checked) {
11757
12257
  const ts = new Date();
11758
12258
  var html = this.COMPLIANCES_HTML;
11759
12259
  html = html.replace(/PROJECT_NAME/g, this.projectName);
12260
+ html = html.replace(/FILTERS_DATA/g, '');
11760
12261
  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
12262
  let tempHtml = "";
11762
12263
  tempHtml += this.getFilteredString();
@@ -11768,7 +12269,7 @@ let SfIEvents = class SfIEvents extends LitElement {
11768
12269
  a.setAttribute('download', 'report_' + ts + '.html');
11769
12270
  a.click();
11770
12271
  }
11771
- if (radioListCsv.checked) {
12272
+ if (radioListCsv === null || radioListCsv === void 0 ? void 0 : radioListCsv.checked) {
11772
12273
  const ts = new Date();
11773
12274
  console.log(this.csvDataCompliances);
11774
12275
  const blob = new Blob([this.csvDataCompliances], { type: 'text/csv' });
@@ -11778,10 +12279,11 @@ let SfIEvents = class SfIEvents extends LitElement {
11778
12279
  a.setAttribute('download', 'report_' + ts + '.csv');
11779
12280
  a.click();
11780
12281
  }
11781
- if (radioConsolidated.checked) {
12282
+ if (radioConsolidated === null || radioConsolidated === void 0 ? void 0 : radioConsolidated.checked) {
11782
12283
  const ts = new Date().getTime();
11783
12284
  var html = this.COMPLIANCES_HTML;
11784
12285
  html = html.replace(/PROJECT_NAME/g, this.projectName);
12286
+ html = html.replace(/FILTERS_DATA/g, '');
11785
12287
  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
12288
  let tempHtml = "";
11787
12289
  tempHtml += this.htmlDataStats;
@@ -11800,7 +12302,7 @@ let SfIEvents = class SfIEvents extends LitElement {
11800
12302
  a.setAttribute('download', 'report_' + ts + '.html');
11801
12303
  a.click();
11802
12304
  }
11803
- if (radioCertificate.checked) {
12305
+ if (radioCertificate === null || radioCertificate === void 0 ? void 0 : radioCertificate.checked) {
11804
12306
  var html = this.CERTIFICATE_HTML;
11805
12307
  html = html.replace(/PERSON_NAME/g, this.userName);
11806
12308
  html = html.replace(/PERSON_DESIGNATION/g, this.myRole);
@@ -11841,6 +12343,7 @@ let SfIEvents = class SfIEvents extends LitElement {
11841
12343
  };
11842
12344
  this.renderChartSettings = (container, selectedTab = -1, selectedSummary = -1, ctx) => {
11843
12345
  var _a, _b;
12346
+ console.log('rendering chart settings', selectedSummary);
11844
12347
  var html = '';
11845
12348
  html += '<div class="d-flex justify-end align-start">';
11846
12349
  if (selectedTab === 0) {
@@ -11858,13 +12361,13 @@ let SfIEvents = class SfIEvents extends LitElement {
11858
12361
  if (selectedSummary === 1) {
11859
12362
  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
12363
  }
11861
- else {
12364
+ else if (selectedSummary !== 2) {
11862
12365
  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
12366
  }
11864
12367
  html += '</div>';
11865
12368
  container.querySelector('#chart-settings-controls').innerHTML = html;
11866
12369
  (_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);
12370
+ this.renderChartSettings(container, 1, selectedSummary, ctx);
11868
12371
  });
11869
12372
  (_b = container.querySelector('#chart-settings-controls').querySelector('#chart-control-summary')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => {
11870
12373
  console.log('summary clicked');
@@ -11881,7 +12384,7 @@ let SfIEvents = class SfIEvents extends LitElement {
11881
12384
  if (selectedTab === 1) {
11882
12385
  // const radioCompleteness = container.querySelector('#radio-completeness') as HTMLButtonElement;
11883
12386
  // radioCompleteness.click();
11884
- this.renderChartSettingsSettings(container.querySelector('#chart-settings'));
12387
+ this.renderChartSettingsSettings(container.querySelector('#chart-settings'), selectedSummary);
11885
12388
  }
11886
12389
  container.querySelector('#chart-settings').addEventListener('canceled', () => {
11887
12390
  //console.log('canceled');
@@ -11902,7 +12405,12 @@ let SfIEvents = class SfIEvents extends LitElement {
11902
12405
  // this.renderPast(this.streamIndex);
11903
12406
  // }
11904
12407
  if (this.getCurrentTab() == this.TAB_CUSTOM) {
11905
- this.processDateSelection(container);
12408
+ if (selectedSummary === 2) {
12409
+ this.processDateSelectionViewer(container);
12410
+ }
12411
+ else {
12412
+ this.processDateSelection(container);
12413
+ }
11906
12414
  }
11907
12415
  });
11908
12416
  // (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-settings-cancel')?.addEventListener('click', () => {
@@ -12386,7 +12894,9 @@ let SfIEvents = class SfIEvents extends LitElement {
12386
12894
  }
12387
12895
  }
12388
12896
  }
12389
- this.chart4Base64 = this.chart4.toBase64Image();
12897
+ if (this.chart4 != null) {
12898
+ this.chart4Base64 = this.chart4.toBase64Image();
12899
+ }
12390
12900
  }
12391
12901
  },
12392
12902
  scales: {
@@ -12562,7 +13072,9 @@ let SfIEvents = class SfIEvents extends LitElement {
12562
13072
  }
12563
13073
  }
12564
13074
  }
12565
- this.chart3Base64 = this.chart3.toBase64Image();
13075
+ if (this.chart3 != null) {
13076
+ this.chart3Base64 = this.chart3.toBase64Image();
13077
+ }
12566
13078
  }
12567
13079
  },
12568
13080
  scales: {
@@ -12728,7 +13240,9 @@ let SfIEvents = class SfIEvents extends LitElement {
12728
13240
  }
12729
13241
  }
12730
13242
  }
12731
- this.chart2Base64 = this.chart2.toBase64Image();
13243
+ if (this.chart2 != null) {
13244
+ this.chart2Base64 = this.chart2.toBase64Image();
13245
+ }
12732
13246
  }
12733
13247
  },
12734
13248
  scales: {
@@ -12935,8 +13449,9 @@ let SfIEvents = class SfIEvents extends LitElement {
12935
13449
  }
12936
13450
  }
12937
13451
  }
12938
- this.chartBase64 = this.chart.toBase64Image();
12939
- console.log('this.chart onAnimationComplete', this.chart, this.chart.toBase64Image());
13452
+ if (this.chart != null) {
13453
+ this.chartBase64 = this.chart.toBase64Image();
13454
+ }
12940
13455
  }
12941
13456
  },
12942
13457
  scales: {
@@ -13501,7 +14016,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13501
14016
  this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
13502
14017
  var html = '';
13503
14018
  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>';
14019
+ 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
14020
  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
14021
  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
14022
  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 +14109,13 @@ let SfIEvents = class SfIEvents extends LitElement {
13594
14109
  (_g = this._SfTabContainer.querySelector('#calendar-tab-custom')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', () => {
13595
14110
  this.enableCustom();
13596
14111
  this.renderTabs(this.TAB_CUSTOM);
13597
- this.renderCustom();
14112
+ console.log('stats clicked');
14113
+ if (this.myRole == this.TAB_VIEWER) {
14114
+ this.renderCustomViewer();
14115
+ }
14116
+ else {
14117
+ this.renderCustom();
14118
+ }
13598
14119
  });
13599
14120
  (_h = this._SfTabContainer.querySelector('#calendar-tab-find')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', () => {
13600
14121
  this.enableFind();
@@ -15838,6 +16359,60 @@ let SfIEvents = class SfIEvents extends LitElement {
15838
16359
  }
15839
16360
  }
15840
16361
  };
16362
+ this.fetchStatistics = async (startDate = "", endDate = "", filtercriteria, filterid) => {
16363
+ let path = "";
16364
+ this.sdate = startDate;
16365
+ this.edate = endDate;
16366
+ path = "getstatistics";
16367
+ let sDate = "";
16368
+ let eDate = "";
16369
+ //console.log('currenttab', this.getCurrentTab());
16370
+ if (this.getCurrentTab() == this.TAB_YEAR) {
16371
+ sDate = "03/31/" + this.calendarStartYYYY;
16372
+ eDate = "04/01/" + (parseInt(this.calendarStartYYYY) + 1);
16373
+ }
16374
+ else {
16375
+ sDate = startDate;
16376
+ eDate = endDate;
16377
+ }
16378
+ let url = "https://" + this.apiId + "/" + path;
16379
+ //console.log('fetch calendar url', url);
16380
+ let urlBody = { "projectid": this.projectId, "userid": this.userProfileId, "role": this.myRole, "sdate": sDate, "edate": eDate };
16381
+ if (filtercriteria == 'function') {
16382
+ urlBody["functionid"] = filterid;
16383
+ urlBody["locationid"] = '';
16384
+ urlBody["filteruserrole"] = '';
16385
+ urlBody["filteruserid"] = '';
16386
+ }
16387
+ else if (filtercriteria == 'location') {
16388
+ urlBody["functionid"] = '';
16389
+ urlBody["locationid"] = filterid;
16390
+ urlBody["filteruserrole"] = '';
16391
+ urlBody["filteruserid"] = '';
16392
+ }
16393
+ else {
16394
+ urlBody["functionid"] = '';
16395
+ urlBody["locationid"] = '';
16396
+ urlBody["filteruserrole"] = filtercriteria;
16397
+ urlBody["filteruserid"] = filterid;
16398
+ }
16399
+ console.log('urlbody', urlBody);
16400
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
16401
+ const xhr = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing'));
16402
+ this._SfLoader.innerHTML = '';
16403
+ if (xhr.status == 200) {
16404
+ const jsonRespose = JSON.parse(xhr.responseText);
16405
+ console.log('jsonRespose Statistics', jsonRespose);
16406
+ this.statistics = jsonRespose.data;
16407
+ if (jsonRespose.meta != null)
16408
+ this.statisticsMeta = jsonRespose.meta;
16409
+ return jsonRespose.meta;
16410
+ }
16411
+ else {
16412
+ const jsonRespose = JSON.parse(xhr.responseText);
16413
+ this.setError(jsonRespose.error);
16414
+ }
16415
+ };
15841
16416
  this.fetchBulkReportingData = async () => {
15842
16417
  let path = "getbulkreportjobs";
15843
16418
  let urlBody = { "projectid": this.projectId };
@@ -18883,6 +19458,12 @@ __decorate([
18883
19458
  __decorate([
18884
19459
  property()
18885
19460
  ], SfIEvents.prototype, "events", void 0);
19461
+ __decorate([
19462
+ property()
19463
+ ], SfIEvents.prototype, "statistics", void 0);
19464
+ __decorate([
19465
+ property()
19466
+ ], SfIEvents.prototype, "statisticsMeta", void 0);
18886
19467
  __decorate([
18887
19468
  property()
18888
19469
  ], SfIEvents.prototype, "streamIndex", void 0);
@@ -18934,6 +19515,9 @@ __decorate([
18934
19515
  __decorate([
18935
19516
  property()
18936
19517
  ], SfIEvents.prototype, "htmlDataSummary", void 0);
19518
+ __decorate([
19519
+ property()
19520
+ ], SfIEvents.prototype, "htmlStatsFilter", void 0);
18937
19521
  __decorate([
18938
19522
  property()
18939
19523
  ], SfIEvents.prototype, "period", void 0);