sf-i-events 1.0.740 → 1.0.742
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/package.json +1 -1
- package/sf-i-events.d.ts +4 -0
- package/sf-i-events.js +131 -24
- package/src/sf-i-events.ts +145 -27
- package/src/util.ts +6 -1
- package/util.d.ts +2 -0
- package/util.js +5 -1
package/package.json
CHANGED
package/sf-i-events.d.ts
CHANGED
|
@@ -186,6 +186,7 @@ export declare class SfIEvents extends LitElement {
|
|
|
186
186
|
events: any;
|
|
187
187
|
statistics: any;
|
|
188
188
|
statisticsMeta: any;
|
|
189
|
+
statisticsFiltersData: any;
|
|
189
190
|
streamIndex: any;
|
|
190
191
|
eventsInWindow: any;
|
|
191
192
|
eventHideFields: any;
|
|
@@ -452,6 +453,9 @@ export declare class SfIEvents extends LitElement {
|
|
|
452
453
|
renderCalendarContainerDivStart: (index: number) => string;
|
|
453
454
|
renderCalendarContainerDivEnd: () => string;
|
|
454
455
|
renderCalendarEventSummary: () => string;
|
|
456
|
+
renderStatisticsFiltersTableStart: () => string;
|
|
457
|
+
renderStatisticsFiltersTableRow: () => string;
|
|
458
|
+
renderStatisticsFiltersTableEnd: () => string;
|
|
455
459
|
getCalendarRowHide: (events: any, i: number, lastDay: number, month: number, firstDate?: any, currDate?: any) => boolean;
|
|
456
460
|
renderCalendarRowDivStart: (i: number, firstDate?: any, ddmm?: string) => string;
|
|
457
461
|
renderCalendarRowDivEnd: () => string;
|
package/sf-i-events.js
CHANGED
|
@@ -339,6 +339,9 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
339
339
|
.align-center {
|
|
340
340
|
align-items: center;
|
|
341
341
|
}
|
|
342
|
+
.flex-wrap {
|
|
343
|
+
flex-wrap: wrap;
|
|
344
|
+
}
|
|
342
345
|
.mt-10 {
|
|
343
346
|
margin-top: 10px;
|
|
344
347
|
}
|
|
@@ -382,6 +385,14 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
382
385
|
.td-wide {
|
|
383
386
|
min-width: 300px;
|
|
384
387
|
}
|
|
388
|
+
.td-head {
|
|
389
|
+
font-weight: 400;
|
|
390
|
+
padding-left: 5px;
|
|
391
|
+
vertical-align: middle;
|
|
392
|
+
font-size: 80%;
|
|
393
|
+
text-transform: capitalize;
|
|
394
|
+
text-align: left;
|
|
395
|
+
}
|
|
385
396
|
td {
|
|
386
397
|
padding: 5px;
|
|
387
398
|
font-size: 70%;
|
|
@@ -393,7 +404,6 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
393
404
|
}
|
|
394
405
|
.td-odd {
|
|
395
406
|
background-color: #efefef;
|
|
396
|
-
|
|
397
407
|
}
|
|
398
408
|
.td-even {
|
|
399
409
|
background-color: #dedede;
|
|
@@ -1110,6 +1120,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
1110
1120
|
this.events = null;
|
|
1111
1121
|
this.statistics = null;
|
|
1112
1122
|
this.statisticsMeta = null;
|
|
1123
|
+
this.statisticsFiltersData = null;
|
|
1113
1124
|
this.streamIndex = null;
|
|
1114
1125
|
this.eventsInWindow = null;
|
|
1115
1126
|
this.eventHideFields = null;
|
|
@@ -2103,8 +2114,8 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2103
2114
|
//console.log('flowGraph', this.flowGraph);
|
|
2104
2115
|
var html = '';
|
|
2105
2116
|
html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
|
|
2106
|
-
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>';
|
|
2107
|
-
html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="last-update-title-container"><h6 part="last-update-title">Last Updated on ' + this.lastupdated + '</h6></div>';
|
|
2117
|
+
html += '<div class="align-center d-flex flex-wrap align-center 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>';
|
|
2118
|
+
html += '<div class="align-center d-flex flex-wrap align-center mb-10 w-100-m-0" part="last-update-title-container"><h6 part="last-update-title" class="align-center d-flex"><span class="material-symbols-outlined">update</span> Last Updated on ' + this.lastupdated + '</h6></div>';
|
|
2108
2119
|
if (showGraph) {
|
|
2109
2120
|
html += '<div part="stream-event-chart-selection" class="mb-20">';
|
|
2110
2121
|
html += '<div part="td-head" class="mb-5">Select Chart</div>';
|
|
@@ -2149,7 +2160,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2149
2160
|
var html = '';
|
|
2150
2161
|
html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
|
|
2151
2162
|
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>';
|
|
2152
|
-
html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="last-update-title-container"><h6 part="last-update-title">Last Updated on ' + this.lastupdated + '</h6></div>';
|
|
2163
|
+
html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="last-update-title-container"><h6 part="last-update-title" class="align-center d-flex"><span class="material-symbols-outlined">update</span> Last Updated on ' + this.lastupdated + '</h6></div>';
|
|
2153
2164
|
if (showGraph) {
|
|
2154
2165
|
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>';
|
|
2155
2166
|
html += '<div id="chart-settings-controls" class="mt-20"></div>';
|
|
@@ -2192,6 +2203,29 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2192
2203
|
html += '<div id="stream-event-filter" part="stream-event-total" class="d-flex flex-wrap"></div>';
|
|
2193
2204
|
return html;
|
|
2194
2205
|
};
|
|
2206
|
+
this.renderStatisticsFiltersTableStart = () => {
|
|
2207
|
+
var html = '';
|
|
2208
|
+
html += '<div class="w-100 scroll-x">';
|
|
2209
|
+
html += '<table id="statistics-table" part="statistics-table" class="statistics-table w-100"><tbody>';
|
|
2210
|
+
return html;
|
|
2211
|
+
};
|
|
2212
|
+
this.renderStatisticsFiltersTableRow = () => {
|
|
2213
|
+
var html = '';
|
|
2214
|
+
html += '<tr class="tablerow">';
|
|
2215
|
+
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center">FILTER_CRITERIA_NAME</div><div>DASHBOARD_FILTER_NAME</div></div></td>';
|
|
2216
|
+
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-icons color-not-started">schedule</span> Not Started</div><div>DASHBOARD_NOT_STARTED</div></div></td>';
|
|
2217
|
+
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-pending">pending</span> Pending Approval</div><div>DASHBOARD_PENDING_APPROVAL</div></div></td>';
|
|
2218
|
+
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-rejected">block</span> Rejected</div><div>DASHBOARD_REJECTED</div></div></td>';
|
|
2219
|
+
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-done">check_circle</span> Approved</div><div>DASHBOARD_APPROVED</div></div></td>';
|
|
2220
|
+
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center">Total</div><div>DASHBOARD_TOTAL</div></div></td>';
|
|
2221
|
+
html += '</tr>';
|
|
2222
|
+
return html;
|
|
2223
|
+
};
|
|
2224
|
+
this.renderStatisticsFiltersTableEnd = () => {
|
|
2225
|
+
var html = '';
|
|
2226
|
+
html += '</tbody></table><div>';
|
|
2227
|
+
return html;
|
|
2228
|
+
};
|
|
2195
2229
|
this.getCalendarRowHide = (events, i, lastDay, month, firstDate = null, currDate = null) => {
|
|
2196
2230
|
var hide = true;
|
|
2197
2231
|
if (events != null) {
|
|
@@ -2726,7 +2760,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2726
2760
|
return html;
|
|
2727
2761
|
};
|
|
2728
2762
|
this.renderStatistics = (_firstDay, _endDay, iInit, iLast, showGraph, index, month, period, firstDate = null, parametersTitle) => {
|
|
2729
|
-
var _a, _b, _c, _f;
|
|
2763
|
+
var _a, _b, _c, _f, _g, _h, _j, _k;
|
|
2730
2764
|
var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0;
|
|
2731
2765
|
var html = '';
|
|
2732
2766
|
// var lastDay = iLast;
|
|
@@ -2737,6 +2771,10 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2737
2771
|
html += this.renderCalendarStatisticsGraphs(showGraph, parametersTitle);
|
|
2738
2772
|
html += this.renderCalendarContainerDivStart(index);
|
|
2739
2773
|
html += this.renderCalendarEventSummary();
|
|
2774
|
+
let filtersTableHtml = "";
|
|
2775
|
+
if (Object.keys(this.statisticsFiltersData).length > 0) {
|
|
2776
|
+
filtersTableHtml += this.renderStatisticsFiltersTableStart();
|
|
2777
|
+
}
|
|
2740
2778
|
for (var i = iInit; i <= iLast; i++) {
|
|
2741
2779
|
let mmdd = "";
|
|
2742
2780
|
if (firstDate == null) {
|
|
@@ -2766,6 +2804,51 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2766
2804
|
approved += (_f = this.statistics[mmdd]["approved"]) !== null && _f !== void 0 ? _f : 0;
|
|
2767
2805
|
}
|
|
2768
2806
|
}
|
|
2807
|
+
if (Object.keys(this.statisticsFiltersData).length > 0) {
|
|
2808
|
+
let filtercriteria = Object.keys(this.statisticsFiltersData)[0];
|
|
2809
|
+
let sortedFilters = Util.alphabeticalSort(this.statisticsMeta[filtercriteria]);
|
|
2810
|
+
for (let [filterindex, filterval] of sortedFilters.entries()) {
|
|
2811
|
+
let filtername = filterval.split(';')[0];
|
|
2812
|
+
let filterid = filterval.split(';')[1];
|
|
2813
|
+
let filterTotal = 0, filterNotStarted = 0, filterPendingApproval = 0, filterRejected = 0, filterApproved = 0;
|
|
2814
|
+
for (var i = iInit; i <= iLast; i++) {
|
|
2815
|
+
let mmdd = "";
|
|
2816
|
+
if (firstDate == null) {
|
|
2817
|
+
mmdd = ("0" + (month + 1)).slice(-2) + "/" + ("0" + i).slice(-2);
|
|
2818
|
+
}
|
|
2819
|
+
else {
|
|
2820
|
+
const currDate = new Date(firstDate.getTime());
|
|
2821
|
+
currDate.setDate(firstDate.getDate() + (i - 1));
|
|
2822
|
+
mmdd = ("0" + (currDate.getMonth() + 1)).slice(-2) + "/" + ("0" + currDate.getDate()).slice(-2);
|
|
2823
|
+
}
|
|
2824
|
+
if (this.statisticsFiltersData[filtercriteria][filterid] != null) {
|
|
2825
|
+
if (this.statisticsFiltersData[filtercriteria][filterid][mmdd] != null) {
|
|
2826
|
+
filterTotal += this.statisticsFiltersData[filtercriteria][filterid][mmdd].count;
|
|
2827
|
+
filterNotStarted += (_g = this.statisticsFiltersData[filtercriteria][filterid][mmdd]['not-started']) !== null && _g !== void 0 ? _g : 0;
|
|
2828
|
+
filterPendingApproval += (_h = this.statisticsFiltersData[filtercriteria][filterid][mmdd]['pending-approval']) !== null && _h !== void 0 ? _h : 0;
|
|
2829
|
+
filterRejected += (_j = this.statisticsFiltersData[filtercriteria][filterid][mmdd]['rejected']) !== null && _j !== void 0 ? _j : 0;
|
|
2830
|
+
filterApproved += (_k = this.statisticsFiltersData[filtercriteria][filterid][mmdd]['approved']) !== null && _k !== void 0 ? _k : 0;
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
filtersTableHtml += this.renderStatisticsFiltersTableRow();
|
|
2835
|
+
if (filterindex % 2 == 0) {
|
|
2836
|
+
filtersTableHtml = filtersTableHtml.replace(/TD_BODY_CLASS/g, "td-light");
|
|
2837
|
+
}
|
|
2838
|
+
else {
|
|
2839
|
+
filtersTableHtml = filtersTableHtml.replace(/TD_BODY_CLASS/g, "td-dark");
|
|
2840
|
+
}
|
|
2841
|
+
filtersTableHtml = filtersTableHtml.replace("FILTER_CRITERIA_NAME", filtercriteria + "");
|
|
2842
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_FILTER_NAME", (filtername + "").replace(/\([^)]*\)/g, ""));
|
|
2843
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_TOTAL", filterTotal + "");
|
|
2844
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_NOT_STARTED", filterNotStarted + " (" + Util.percentageString(filterNotStarted, filterTotal) + ")");
|
|
2845
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_APPROVED", filterApproved + " (" + Util.percentageString(filterApproved, filterTotal) + ")");
|
|
2846
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_PENDING_APPROVAL", filterPendingApproval + " (" + Util.percentageString(filterPendingApproval, filterTotal) + ")");
|
|
2847
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_REJECTED", filterRejected + " (" + Util.percentageString(filterRejected, filterTotal) + ")");
|
|
2848
|
+
}
|
|
2849
|
+
filtersTableHtml += this.renderStatisticsFiltersTableEnd();
|
|
2850
|
+
}
|
|
2851
|
+
html += filtersTableHtml;
|
|
2769
2852
|
html += this.renderCalendarContainerDivEnd();
|
|
2770
2853
|
//console.log('final risk severities', this.riskSeverityData);
|
|
2771
2854
|
//this.period = firstDay?.getDate() + '/' + (firstDay!.getMonth()+1) + '/' + firstDay?.getFullYear() + " - " + endDay?.getDate() + '/' + (endDay!.getMonth()+1) + '/' + endDay?.getFullYear();
|
|
@@ -2779,6 +2862,10 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2779
2862
|
html = html.replace("DASHBOARD_REJECTED", rejected + "");
|
|
2780
2863
|
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>';
|
|
2781
2864
|
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>';
|
|
2865
|
+
if (Object.keys(this.statisticsFiltersData).length > 0) {
|
|
2866
|
+
this.htmlDataStats += '<br /><br />Report<br /><br />';
|
|
2867
|
+
this.htmlDataStats += filtersTableHtml;
|
|
2868
|
+
}
|
|
2782
2869
|
return html;
|
|
2783
2870
|
};
|
|
2784
2871
|
this.renderReporting = (event, mmddyyyy) => {
|
|
@@ -4099,6 +4186,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4099
4186
|
});
|
|
4100
4187
|
};
|
|
4101
4188
|
this.renderStatisticsFilters = (eventsContainer) => {
|
|
4189
|
+
var _a;
|
|
4102
4190
|
let selectFilterCriteria = eventsContainer.querySelector('#select-filter-criteria');
|
|
4103
4191
|
let inputLabelFilter = eventsContainer.querySelector('#input-label-filter');
|
|
4104
4192
|
let selectFilterCriteriaMobile = eventsContainer.querySelector('#select-filter-criteria-mobile');
|
|
@@ -4117,10 +4205,15 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4117
4205
|
option.value = "";
|
|
4118
4206
|
option.innerHTML = "all";
|
|
4119
4207
|
selectFilterCriteriaMobile.add(option);
|
|
4120
|
-
|
|
4208
|
+
let filterscriteria = "";
|
|
4209
|
+
if (Object.keys((_a = this.statisticsFiltersData) !== null && _a !== void 0 ? _a : {}).length > 0) {
|
|
4210
|
+
filterscriteria = Object.keys(this.statisticsFiltersData)[0];
|
|
4211
|
+
}
|
|
4121
4212
|
for (let criteria of Object.keys(this.statisticsMeta)) {
|
|
4122
4213
|
let option = new Option();
|
|
4123
4214
|
option.value = criteria;
|
|
4215
|
+
console.log('statistics filters criteria', criteria, filterscriteria, criteria == filterscriteria);
|
|
4216
|
+
option.selected = (criteria == filterscriteria);
|
|
4124
4217
|
if (criteria == "reporter" || criteria == "approver" || criteria == "functionhead") {
|
|
4125
4218
|
option.innerHTML = "user:" + criteria;
|
|
4126
4219
|
}
|
|
@@ -4130,6 +4223,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4130
4223
|
selectFilterCriteria.add(option);
|
|
4131
4224
|
option = new Option();
|
|
4132
4225
|
option.value = criteria;
|
|
4226
|
+
option.selected = (criteria == filterscriteria);
|
|
4133
4227
|
if (criteria == "reporter" || criteria == "approver" || criteria == "functionhead") {
|
|
4134
4228
|
option.innerHTML = "user:" + criteria;
|
|
4135
4229
|
}
|
|
@@ -4143,10 +4237,8 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4143
4237
|
let target = ev.target;
|
|
4144
4238
|
let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria');
|
|
4145
4239
|
let selectFilterValues = eventsContainer.querySelector('#select-filter-values');
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
this.processDateSelectionViewer(eventsContainer);
|
|
4149
|
-
}
|
|
4240
|
+
selectFilterValues.value = "";
|
|
4241
|
+
this.processDateSelectionViewer(eventsContainer);
|
|
4150
4242
|
selectFilterValues.innerHTML = "";
|
|
4151
4243
|
let option = new Option();
|
|
4152
4244
|
option.value = "";
|
|
@@ -4179,10 +4271,8 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4179
4271
|
let target = ev.target;
|
|
4180
4272
|
let inputLabelCriteriaMobile = eventsContainer.querySelector('#input-label-criteria-mobile');
|
|
4181
4273
|
let selectFilterValuesMobile = eventsContainer.querySelector('#select-filter-values-mobile');
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
this.processDateSelectionViewer(eventsContainer);
|
|
4185
|
-
}
|
|
4274
|
+
selectFilterValuesMobile.value = "";
|
|
4275
|
+
this.processDateSelectionViewer(eventsContainer);
|
|
4186
4276
|
selectFilterValuesMobile.innerHTML = "";
|
|
4187
4277
|
let option = new Option();
|
|
4188
4278
|
option.value = "";
|
|
@@ -4210,14 +4300,24 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4210
4300
|
inputLabelCriteriaMobile.style.display = 'none';
|
|
4211
4301
|
}
|
|
4212
4302
|
});
|
|
4303
|
+
selectFilterCriteriaNew.value = filterscriteria;
|
|
4304
|
+
selectFilterCriteriaMobileNew.value = filterscriteria;
|
|
4213
4305
|
let selectFilterValues = eventsContainer.querySelector('#select-filter-values');
|
|
4214
4306
|
let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria');
|
|
4215
4307
|
let selectFilterValuesMobile = eventsContainer.querySelector('#select-filter-values-mobile');
|
|
4216
4308
|
let inputLabelCriteriaMobile = eventsContainer.querySelector('#input-label-criteria-mobile');
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4309
|
+
if (filterscriteria == "") {
|
|
4310
|
+
selectFilterValues.style.display = 'none';
|
|
4311
|
+
inputLabelCriteria.style.display = 'none';
|
|
4312
|
+
selectFilterValuesMobile.style.display = 'none';
|
|
4313
|
+
inputLabelCriteriaMobile.style.display = 'none';
|
|
4314
|
+
}
|
|
4315
|
+
else {
|
|
4316
|
+
selectFilterValues.style.display = 'block';
|
|
4317
|
+
inputLabelCriteria.style.display = 'block';
|
|
4318
|
+
selectFilterValuesMobile.style.display = 'block';
|
|
4319
|
+
inputLabelCriteriaMobile.style.display = 'block';
|
|
4320
|
+
}
|
|
4221
4321
|
};
|
|
4222
4322
|
this.renderSelectAllButtons = () => {
|
|
4223
4323
|
let selectAllHtml = '<div class="d-flex justify-end w-100" style="position: fixed; bottom: 70px; left: 0px;" part="button-select-all-container">';
|
|
@@ -6307,11 +6407,11 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
6307
6407
|
html += '</div>';
|
|
6308
6408
|
html += '<div class="d-flex w-100">';
|
|
6309
6409
|
html += '<div class="calendar-left-col desktop-only flex-col justify-start align-end">';
|
|
6310
|
-
html += '<div class="title-item-date d-flex flex-col align-
|
|
6410
|
+
html += '<div class="title-item-date d-flex flex-col align-start">';
|
|
6311
6411
|
html += '<label part="input-label">Start Date</label>';
|
|
6312
6412
|
html += '<input id="stream-start-date" part="date-range-preselected" type="date" />';
|
|
6313
6413
|
html += '</div>';
|
|
6314
|
-
html += '<div class="title-item-date d-flex flex-col align-
|
|
6414
|
+
html += '<div class="title-item-date d-flex flex-col align-start">';
|
|
6315
6415
|
html += '<label part="input-label">End Date</label>';
|
|
6316
6416
|
html += '<input id="stream-end-date" part="date-range-preselected" type="date" />';
|
|
6317
6417
|
html += '</div>';
|
|
@@ -6324,11 +6424,11 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
6324
6424
|
html += '<div class="title-item-date">';
|
|
6325
6425
|
html += '<button id="button-this-year" part="button-range-preselected">This Year</button>';
|
|
6326
6426
|
html += '</div>';
|
|
6327
|
-
html += '<div class="title-item-date d-flex flex-col align-
|
|
6427
|
+
html += '<div class="title-item-date d-flex flex-col align-start">';
|
|
6328
6428
|
html += '<label part="input-label-filter-criteria" id="input-label-filter">Filter Criteria</label>';
|
|
6329
6429
|
html += '<select part="input-select-calendar-filter" id="select-filter-criteria"></select>';
|
|
6330
6430
|
html += '</div>';
|
|
6331
|
-
html += '<div class="title-item-date d-flex flex-col align-
|
|
6431
|
+
html += '<div class="title-item-date d-flex flex-col align-start">';
|
|
6332
6432
|
html += '<label part="input-label-filter-value" id="input-label-criteria"></label>';
|
|
6333
6433
|
html += '<select part="input-select-calendar-filter" id="select-filter-values"></select>';
|
|
6334
6434
|
html += '</div>';
|
|
@@ -16421,6 +16521,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
16421
16521
|
}
|
|
16422
16522
|
};
|
|
16423
16523
|
this.fetchStatistics = async (startDate = "", endDate = "", filtercriteria, filterid) => {
|
|
16524
|
+
var _a;
|
|
16424
16525
|
let path = "";
|
|
16425
16526
|
this.sdate = startDate;
|
|
16426
16527
|
this.edate = endDate;
|
|
@@ -16438,7 +16539,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
16438
16539
|
}
|
|
16439
16540
|
let url = "https://" + this.apiId + "/" + path;
|
|
16440
16541
|
//console.log('fetch calendar url', url);
|
|
16441
|
-
let urlBody = { "projectid": this.projectId, "userid": this.userProfileId, "role": this.myRole, "sdate": sDate, "edate": eDate };
|
|
16542
|
+
let urlBody = { "projectid": this.projectId, "userid": this.userProfileId, "role": this.myRole, "sdate": sDate, "edate": eDate, "filtercriteria": filtercriteria };
|
|
16442
16543
|
if (filtercriteria == 'function') {
|
|
16443
16544
|
urlBody["functionid"] = filterid;
|
|
16444
16545
|
urlBody["locationid"] = '';
|
|
@@ -16467,6 +16568,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
16467
16568
|
this.statistics = jsonRespose.data;
|
|
16468
16569
|
this.lastupdated = new Date(jsonRespose.lastupdated).toLocaleDateString('en-IN') + " - " + new Date(jsonRespose.lastupdated).toLocaleTimeString('en-IN');
|
|
16469
16570
|
console.log('statistics date', this.lastupdated);
|
|
16571
|
+
this.statisticsFiltersData = (_a = jsonRespose.filtersdata) !== null && _a !== void 0 ? _a : {};
|
|
16470
16572
|
if (jsonRespose.meta != null)
|
|
16471
16573
|
this.statisticsMeta = jsonRespose.meta;
|
|
16472
16574
|
return jsonRespose.meta;
|
|
@@ -19314,7 +19416,9 @@ SfIEvents.styles = css `
|
|
|
19314
19416
|
right: 10px
|
|
19315
19417
|
}
|
|
19316
19418
|
|
|
19317
|
-
|
|
19419
|
+
.small-icon {
|
|
19420
|
+
font-size: 98%
|
|
19421
|
+
}
|
|
19318
19422
|
`;
|
|
19319
19423
|
__decorate([
|
|
19320
19424
|
query('#decrypt-container')
|
|
@@ -19529,6 +19633,9 @@ __decorate([
|
|
|
19529
19633
|
__decorate([
|
|
19530
19634
|
property()
|
|
19531
19635
|
], SfIEvents.prototype, "statisticsMeta", void 0);
|
|
19636
|
+
__decorate([
|
|
19637
|
+
property()
|
|
19638
|
+
], SfIEvents.prototype, "statisticsFiltersData", void 0);
|
|
19532
19639
|
__decorate([
|
|
19533
19640
|
property()
|
|
19534
19641
|
], SfIEvents.prototype, "streamIndex", void 0);
|
package/src/sf-i-events.ts
CHANGED
|
@@ -343,6 +343,9 @@ export class SfIEvents extends LitElement {
|
|
|
343
343
|
.align-center {
|
|
344
344
|
align-items: center;
|
|
345
345
|
}
|
|
346
|
+
.flex-wrap {
|
|
347
|
+
flex-wrap: wrap;
|
|
348
|
+
}
|
|
346
349
|
.mt-10 {
|
|
347
350
|
margin-top: 10px;
|
|
348
351
|
}
|
|
@@ -386,6 +389,14 @@ export class SfIEvents extends LitElement {
|
|
|
386
389
|
.td-wide {
|
|
387
390
|
min-width: 300px;
|
|
388
391
|
}
|
|
392
|
+
.td-head {
|
|
393
|
+
font-weight: 400;
|
|
394
|
+
padding-left: 5px;
|
|
395
|
+
vertical-align: middle;
|
|
396
|
+
font-size: 80%;
|
|
397
|
+
text-transform: capitalize;
|
|
398
|
+
text-align: left;
|
|
399
|
+
}
|
|
389
400
|
td {
|
|
390
401
|
padding: 5px;
|
|
391
402
|
font-size: 70%;
|
|
@@ -397,7 +408,6 @@ export class SfIEvents extends LitElement {
|
|
|
397
408
|
}
|
|
398
409
|
.td-odd {
|
|
399
410
|
background-color: #efefef;
|
|
400
|
-
|
|
401
411
|
}
|
|
402
412
|
.td-even {
|
|
403
413
|
background-color: #dedede;
|
|
@@ -1346,6 +1356,9 @@ export class SfIEvents extends LitElement {
|
|
|
1346
1356
|
@property()
|
|
1347
1357
|
statisticsMeta: any = null;
|
|
1348
1358
|
|
|
1359
|
+
@property()
|
|
1360
|
+
statisticsFiltersData: any = null;
|
|
1361
|
+
|
|
1349
1362
|
@property()
|
|
1350
1363
|
streamIndex: any = null;
|
|
1351
1364
|
|
|
@@ -2639,7 +2652,9 @@ export class SfIEvents extends LitElement {
|
|
|
2639
2652
|
right: 10px
|
|
2640
2653
|
}
|
|
2641
2654
|
|
|
2642
|
-
|
|
2655
|
+
.small-icon {
|
|
2656
|
+
font-size: 98%
|
|
2657
|
+
}
|
|
2643
2658
|
`;
|
|
2644
2659
|
|
|
2645
2660
|
@query('.SfIEventsC')
|
|
@@ -4172,8 +4187,8 @@ export class SfIEvents extends LitElement {
|
|
|
4172
4187
|
var html = '';
|
|
4173
4188
|
|
|
4174
4189
|
html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
|
|
4175
|
-
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>';
|
|
4176
|
-
html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="last-update-title-container"><h6 part="last-update-title">Last Updated on ' + this.lastupdated + '</h6></div>';
|
|
4190
|
+
html += '<div class="align-center d-flex flex-wrap align-center 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>';
|
|
4191
|
+
html += '<div class="align-center d-flex flex-wrap align-center mb-10 w-100-m-0" part="last-update-title-container"><h6 part="last-update-title" class="align-center d-flex"><span class="material-symbols-outlined">update</span> Last Updated on ' + this.lastupdated + '</h6></div>';
|
|
4177
4192
|
if(showGraph) {
|
|
4178
4193
|
html += '<div part="stream-event-chart-selection" class="mb-20">';
|
|
4179
4194
|
html += '<div part="td-head" class="mb-5">Select Chart</div>';
|
|
@@ -4225,7 +4240,7 @@ export class SfIEvents extends LitElement {
|
|
|
4225
4240
|
|
|
4226
4241
|
html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
|
|
4227
4242
|
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>';
|
|
4228
|
-
html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="last-update-title-container"><h6 part="last-update-title">Last Updated on ' + this.lastupdated + '</h6></div>';
|
|
4243
|
+
html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="last-update-title-container"><h6 part="last-update-title" class="align-center d-flex"><span class="material-symbols-outlined">update</span> Last Updated on ' + this.lastupdated + '</h6></div>';
|
|
4229
4244
|
if(showGraph) {
|
|
4230
4245
|
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>';
|
|
4231
4246
|
html += '<div id="chart-settings-controls" class="mt-20"></div>'
|
|
@@ -4286,6 +4301,41 @@ export class SfIEvents extends LitElement {
|
|
|
4286
4301
|
|
|
4287
4302
|
}
|
|
4288
4303
|
|
|
4304
|
+
renderStatisticsFiltersTableStart = () => {
|
|
4305
|
+
|
|
4306
|
+
var html = '';
|
|
4307
|
+
html += '<div class="w-100 scroll-x">'
|
|
4308
|
+
html += '<table id="statistics-table" part="statistics-table" class="statistics-table w-100"><tbody>';
|
|
4309
|
+
|
|
4310
|
+
return html;
|
|
4311
|
+
|
|
4312
|
+
}
|
|
4313
|
+
|
|
4314
|
+
renderStatisticsFiltersTableRow = () => {
|
|
4315
|
+
|
|
4316
|
+
var html = '';
|
|
4317
|
+
html += '<tr class="tablerow">'
|
|
4318
|
+
html +='<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center">FILTER_CRITERIA_NAME</div><div>DASHBOARD_FILTER_NAME</div></div></td>'
|
|
4319
|
+
html +='<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-icons color-not-started">schedule</span> Not Started</div><div>DASHBOARD_NOT_STARTED</div></div></td>'
|
|
4320
|
+
html +='<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-pending">pending</span> Pending Approval</div><div>DASHBOARD_PENDING_APPROVAL</div></div></td>'
|
|
4321
|
+
html +='<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-rejected">block</span> Rejected</div><div>DASHBOARD_REJECTED</div></div></td>'
|
|
4322
|
+
html +='<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-done">check_circle</span> Approved</div><div>DASHBOARD_APPROVED</div></div></td>'
|
|
4323
|
+
html +='<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center">Total</div><div>DASHBOARD_TOTAL</div></div></td>'
|
|
4324
|
+
html += '</tr>';
|
|
4325
|
+
|
|
4326
|
+
return html;
|
|
4327
|
+
|
|
4328
|
+
}
|
|
4329
|
+
|
|
4330
|
+
renderStatisticsFiltersTableEnd = () => {
|
|
4331
|
+
|
|
4332
|
+
var html = '';
|
|
4333
|
+
html += '</tbody></table><div>';
|
|
4334
|
+
|
|
4335
|
+
return html;
|
|
4336
|
+
|
|
4337
|
+
}
|
|
4338
|
+
|
|
4289
4339
|
getCalendarRowHide = (events: any, i: number, lastDay: number, month: number, firstDate: any = null, currDate: any = null) => {
|
|
4290
4340
|
|
|
4291
4341
|
var hide = true;
|
|
@@ -4956,8 +5006,10 @@ export class SfIEvents extends LitElement {
|
|
|
4956
5006
|
html += this.renderCalendarStatisticsGraphs(showGraph, parametersTitle);
|
|
4957
5007
|
html += this.renderCalendarContainerDivStart(index)
|
|
4958
5008
|
html += this.renderCalendarEventSummary();
|
|
4959
|
-
|
|
4960
|
-
|
|
5009
|
+
let filtersTableHtml = ""
|
|
5010
|
+
if(Object.keys(this.statisticsFiltersData).length > 0){
|
|
5011
|
+
filtersTableHtml += this.renderStatisticsFiltersTableStart()
|
|
5012
|
+
}
|
|
4961
5013
|
for(var i = iInit; i <= iLast; i++) {
|
|
4962
5014
|
|
|
4963
5015
|
let mmdd : string = "";
|
|
@@ -4993,10 +5045,58 @@ export class SfIEvents extends LitElement {
|
|
|
4993
5045
|
approved += this.statistics[mmdd]["approved"] ?? 0;
|
|
4994
5046
|
|
|
4995
5047
|
}
|
|
5048
|
+
|
|
5049
|
+
|
|
4996
5050
|
}
|
|
4997
5051
|
|
|
4998
|
-
|
|
5052
|
+
if(Object.keys(this.statisticsFiltersData).length > 0){
|
|
5053
|
+
let filtercriteria = Object.keys(this.statisticsFiltersData)[0]
|
|
5054
|
+
let sortedFilters = Util.alphabeticalSort(this.statisticsMeta[filtercriteria])
|
|
5055
|
+
for(let [filterindex, filterval] of sortedFilters.entries()){
|
|
5056
|
+
let filtername = filterval.split(';')[0]
|
|
5057
|
+
let filterid = filterval.split(';')[1]
|
|
5058
|
+
let filterTotal = 0, filterNotStarted = 0, filterPendingApproval = 0, filterRejected = 0, filterApproved = 0;
|
|
5059
|
+
for(var i = iInit; i <= iLast; i++) {
|
|
5060
|
+
|
|
5061
|
+
let mmdd : string = "";
|
|
5062
|
+
|
|
5063
|
+
if(firstDate == null) {
|
|
5064
|
+
mmdd = ("0" + (month+1)).slice(-2) + "/" + ("0" + i).slice(-2);
|
|
5065
|
+
} else {
|
|
5066
|
+
const currDate = new Date(firstDate.getTime());
|
|
5067
|
+
currDate.setDate(firstDate.getDate() + (i - 1));
|
|
5068
|
+
mmdd = ("0" + (currDate.getMonth()+1)).slice(-2) + "/" + ("0" + currDate.getDate()).slice(-2);
|
|
5069
|
+
}
|
|
5070
|
+
if(this.statisticsFiltersData[filtercriteria][filterid] != null){
|
|
5071
|
+
if(this.statisticsFiltersData[filtercriteria][filterid][mmdd] != null){
|
|
5072
|
+
filterTotal += this.statisticsFiltersData[filtercriteria][filterid][mmdd].count
|
|
5073
|
+
filterNotStarted += this.statisticsFiltersData[filtercriteria][filterid][mmdd]['not-started'] ?? 0
|
|
5074
|
+
filterPendingApproval += this.statisticsFiltersData[filtercriteria][filterid][mmdd]['pending-approval'] ?? 0
|
|
5075
|
+
filterRejected += this.statisticsFiltersData[filtercriteria][filterid][mmdd]['rejected'] ?? 0
|
|
5076
|
+
filterApproved += this.statisticsFiltersData[filtercriteria][filterid][mmdd]['approved'] ?? 0
|
|
5077
|
+
}
|
|
5078
|
+
}
|
|
5079
|
+
}
|
|
5080
|
+
filtersTableHtml += this.renderStatisticsFiltersTableRow()
|
|
5081
|
+
if(filterindex % 2 == 0){
|
|
5082
|
+
filtersTableHtml = filtersTableHtml.replace(/TD_BODY_CLASS/g, "td-light");
|
|
5083
|
+
}else{
|
|
5084
|
+
filtersTableHtml = filtersTableHtml.replace(/TD_BODY_CLASS/g, "td-dark");
|
|
5085
|
+
}
|
|
5086
|
+
filtersTableHtml = filtersTableHtml.replace("FILTER_CRITERIA_NAME", filtercriteria+"");
|
|
5087
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_FILTER_NAME", (filtername+"").replace(/\([^)]*\)/g,""));
|
|
5088
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_TOTAL", filterTotal+"");
|
|
5089
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_NOT_STARTED", filterNotStarted+" (" + Util.percentageString(filterNotStarted, filterTotal) + ")");
|
|
5090
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_APPROVED", filterApproved+" (" + Util.percentageString(filterApproved, filterTotal) + ")");
|
|
5091
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_PENDING_APPROVAL", filterPendingApproval+" (" + Util.percentageString(filterPendingApproval, filterTotal) + ")");
|
|
5092
|
+
filtersTableHtml = filtersTableHtml.replace("DASHBOARD_REJECTED", filterRejected+" (" + Util.percentageString(filterRejected, filterTotal) + ")");
|
|
5093
|
+
}
|
|
5094
|
+
filtersTableHtml += this.renderStatisticsFiltersTableEnd()
|
|
5095
|
+
}
|
|
5096
|
+
|
|
4999
5097
|
|
|
5098
|
+
html += filtersTableHtml
|
|
5099
|
+
html += this.renderCalendarContainerDivEnd();
|
|
5000
5100
|
//console.log('final risk severities', this.riskSeverityData);
|
|
5001
5101
|
|
|
5002
5102
|
//this.period = firstDay?.getDate() + '/' + (firstDay!.getMonth()+1) + '/' + firstDay?.getFullYear() + " - " + endDay?.getDate() + '/' + (endDay!.getMonth()+1) + '/' + endDay?.getFullYear();
|
|
@@ -5013,6 +5113,10 @@ export class SfIEvents extends LitElement {
|
|
|
5013
5113
|
|
|
5014
5114
|
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>';
|
|
5015
5115
|
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>'
|
|
5116
|
+
if(Object.keys(this.statisticsFiltersData).length > 0){
|
|
5117
|
+
this.htmlDataStats += '<br /><br />Report<br /><br />'
|
|
5118
|
+
this.htmlDataStats += filtersTableHtml
|
|
5119
|
+
}
|
|
5016
5120
|
|
|
5017
5121
|
return html;
|
|
5018
5122
|
}
|
|
@@ -6590,10 +6694,16 @@ export class SfIEvents extends LitElement {
|
|
|
6590
6694
|
option.value = "";
|
|
6591
6695
|
option.innerHTML = "all"
|
|
6592
6696
|
selectFilterCriteriaMobile.add(option)
|
|
6593
|
-
|
|
6697
|
+
let filterscriteria = ""
|
|
6698
|
+
if(Object.keys(this.statisticsFiltersData ?? {}).length > 0){
|
|
6699
|
+
filterscriteria = Object.keys(this.statisticsFiltersData)[0]
|
|
6700
|
+
}
|
|
6701
|
+
|
|
6594
6702
|
for(let criteria of Object.keys(this.statisticsMeta)){
|
|
6595
6703
|
let option = new Option()
|
|
6596
6704
|
option.value = criteria;
|
|
6705
|
+
console.log('statistics filters criteria',criteria, filterscriteria, criteria == filterscriteria)
|
|
6706
|
+
option.selected = (criteria == filterscriteria)
|
|
6597
6707
|
if(criteria == "reporter" || criteria == "approver" || criteria == "functionhead"){
|
|
6598
6708
|
option.innerHTML = "user:" + criteria
|
|
6599
6709
|
}else{
|
|
@@ -6602,6 +6712,7 @@ export class SfIEvents extends LitElement {
|
|
|
6602
6712
|
selectFilterCriteria.add(option)
|
|
6603
6713
|
option = new Option()
|
|
6604
6714
|
option.value = criteria;
|
|
6715
|
+
option.selected = (criteria == filterscriteria)
|
|
6605
6716
|
if(criteria == "reporter" || criteria == "approver" || criteria == "functionhead"){
|
|
6606
6717
|
option.innerHTML = "user:" + criteria
|
|
6607
6718
|
}else{
|
|
@@ -6609,15 +6720,14 @@ export class SfIEvents extends LitElement {
|
|
|
6609
6720
|
}
|
|
6610
6721
|
selectFilterCriteriaMobile.add(option)
|
|
6611
6722
|
}
|
|
6723
|
+
|
|
6612
6724
|
let selectFilterCriteriaNew = Util.clearListeners(selectFilterCriteria)
|
|
6613
6725
|
selectFilterCriteriaNew.addEventListener('change',(ev: any) => {
|
|
6614
6726
|
let target = ev.target as HTMLSelectElement
|
|
6615
6727
|
let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria') as HTMLLabelElement
|
|
6616
6728
|
let selectFilterValues = eventsContainer.querySelector('#select-filter-values') as HTMLSelectElement
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
this.processDateSelectionViewer(eventsContainer)
|
|
6620
|
-
}
|
|
6729
|
+
selectFilterValues.value = ""
|
|
6730
|
+
this.processDateSelectionViewer(eventsContainer)
|
|
6621
6731
|
|
|
6622
6732
|
selectFilterValues.innerHTML = ""
|
|
6623
6733
|
let option = new Option()
|
|
@@ -6650,10 +6760,8 @@ export class SfIEvents extends LitElement {
|
|
|
6650
6760
|
let target = ev.target as HTMLSelectElement
|
|
6651
6761
|
let inputLabelCriteriaMobile = eventsContainer.querySelector('#input-label-criteria-mobile') as HTMLLabelElement
|
|
6652
6762
|
let selectFilterValuesMobile = eventsContainer.querySelector('#select-filter-values-mobile') as HTMLSelectElement
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
this.processDateSelectionViewer(eventsContainer)
|
|
6656
|
-
}
|
|
6763
|
+
selectFilterValuesMobile.value = ""
|
|
6764
|
+
this.processDateSelectionViewer(eventsContainer)
|
|
6657
6765
|
|
|
6658
6766
|
selectFilterValuesMobile.innerHTML = ""
|
|
6659
6767
|
let option = new Option()
|
|
@@ -6680,15 +6788,24 @@ export class SfIEvents extends LitElement {
|
|
|
6680
6788
|
selectFilterValuesMobile.style.display = 'none'
|
|
6681
6789
|
inputLabelCriteriaMobile.style.display = 'none'
|
|
6682
6790
|
}
|
|
6683
|
-
})
|
|
6791
|
+
});
|
|
6792
|
+
(selectFilterCriteriaNew as HTMLSelectElement).value = filterscriteria;
|
|
6793
|
+
(selectFilterCriteriaMobileNew as HTMLSelectElement).value = filterscriteria;
|
|
6684
6794
|
let selectFilterValues = eventsContainer.querySelector('#select-filter-values') as HTMLSelectElement
|
|
6685
6795
|
let inputLabelCriteria = eventsContainer.querySelector('#input-label-criteria') as HTMLLabelElement
|
|
6686
6796
|
let selectFilterValuesMobile = eventsContainer.querySelector('#select-filter-values-mobile') as HTMLSelectElement
|
|
6687
6797
|
let inputLabelCriteriaMobile = eventsContainer.querySelector('#input-label-criteria-mobile') as HTMLLabelElement
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6798
|
+
if(filterscriteria == ""){
|
|
6799
|
+
selectFilterValues.style.display = 'none'
|
|
6800
|
+
inputLabelCriteria.style.display = 'none'
|
|
6801
|
+
selectFilterValuesMobile.style.display = 'none'
|
|
6802
|
+
inputLabelCriteriaMobile.style.display = 'none'
|
|
6803
|
+
}else{
|
|
6804
|
+
selectFilterValues.style.display = 'block'
|
|
6805
|
+
inputLabelCriteria.style.display = 'block'
|
|
6806
|
+
selectFilterValuesMobile.style.display = 'block'
|
|
6807
|
+
inputLabelCriteriaMobile.style.display = 'block'
|
|
6808
|
+
}
|
|
6692
6809
|
}
|
|
6693
6810
|
renderSelectAllButtons = () => {
|
|
6694
6811
|
let selectAllHtml = '<div class="d-flex justify-end w-100" style="position: fixed; bottom: 70px; left: 0px;" part="button-select-all-container">';
|
|
@@ -9283,11 +9400,11 @@ export class SfIEvents extends LitElement {
|
|
|
9283
9400
|
html += '<div class="d-flex w-100">';
|
|
9284
9401
|
html += '<div class="calendar-left-col desktop-only flex-col justify-start align-end">';
|
|
9285
9402
|
|
|
9286
|
-
html += '<div class="title-item-date d-flex flex-col align-
|
|
9403
|
+
html += '<div class="title-item-date d-flex flex-col align-start">';
|
|
9287
9404
|
html += '<label part="input-label">Start Date</label>'
|
|
9288
9405
|
html += '<input id="stream-start-date" part="date-range-preselected" type="date" />'
|
|
9289
9406
|
html += '</div>';
|
|
9290
|
-
html += '<div class="title-item-date d-flex flex-col align-
|
|
9407
|
+
html += '<div class="title-item-date d-flex flex-col align-start">';
|
|
9291
9408
|
html += '<label part="input-label">End Date</label>'
|
|
9292
9409
|
html += '<input id="stream-end-date" part="date-range-preselected" type="date" />'
|
|
9293
9410
|
html += '</div>';
|
|
@@ -9300,11 +9417,11 @@ export class SfIEvents extends LitElement {
|
|
|
9300
9417
|
html += '<div class="title-item-date">';
|
|
9301
9418
|
html += '<button id="button-this-year" part="button-range-preselected">This Year</button>'
|
|
9302
9419
|
html += '</div>';
|
|
9303
|
-
html += '<div class="title-item-date d-flex flex-col align-
|
|
9420
|
+
html += '<div class="title-item-date d-flex flex-col align-start">';
|
|
9304
9421
|
html += '<label part="input-label-filter-criteria" id="input-label-filter">Filter Criteria</label>'
|
|
9305
9422
|
html += '<select part="input-select-calendar-filter" id="select-filter-criteria"></select>'
|
|
9306
9423
|
html += '</div>';
|
|
9307
|
-
html += '<div class="title-item-date d-flex flex-col align-
|
|
9424
|
+
html += '<div class="title-item-date d-flex flex-col align-start">';
|
|
9308
9425
|
html += '<label part="input-label-filter-value" id="input-label-criteria"></label>'
|
|
9309
9426
|
html += '<select part="input-select-calendar-filter" id="select-filter-values"></select>'
|
|
9310
9427
|
html += '</div>';
|
|
@@ -22332,7 +22449,7 @@ export class SfIEvents extends LitElement {
|
|
|
22332
22449
|
let url = "https://"+this.apiId+"/"+ path;
|
|
22333
22450
|
|
|
22334
22451
|
//console.log('fetch calendar url', url);
|
|
22335
|
-
let urlBody :any = {"projectid": this.projectId, "userid": this.userProfileId, "role": this.myRole, "sdate": sDate, "edate": eDate};
|
|
22452
|
+
let urlBody :any = {"projectid": this.projectId, "userid": this.userProfileId, "role": this.myRole, "sdate": sDate, "edate": eDate,"filtercriteria": filtercriteria};
|
|
22336
22453
|
|
|
22337
22454
|
if(filtercriteria == 'function') {
|
|
22338
22455
|
urlBody["functionid"] = filterid;
|
|
@@ -22363,6 +22480,7 @@ export class SfIEvents extends LitElement {
|
|
|
22363
22480
|
this.statistics = jsonRespose.data
|
|
22364
22481
|
this.lastupdated = new Date(jsonRespose.lastupdated).toLocaleDateString('en-IN') + " - " + new Date(jsonRespose.lastupdated).toLocaleTimeString('en-IN')
|
|
22365
22482
|
console.log('statistics date', this.lastupdated);
|
|
22483
|
+
this.statisticsFiltersData = jsonRespose.filtersdata ?? {}
|
|
22366
22484
|
if(jsonRespose.meta != null)
|
|
22367
22485
|
this.statisticsMeta = jsonRespose.meta
|
|
22368
22486
|
return jsonRespose.meta
|
package/src/util.ts
CHANGED
|
@@ -445,8 +445,13 @@ function alphabeticalSort(arr:string[]){
|
|
|
445
445
|
return arrSorted
|
|
446
446
|
}
|
|
447
447
|
|
|
448
|
+
function percentageString(val: number, valTotal: number){
|
|
449
|
+
let num = (100 * val) / valTotal
|
|
450
|
+
return (Math.round((num + Number.EPSILON) * 100) / 100) + "%"
|
|
451
|
+
}
|
|
452
|
+
|
|
448
453
|
const exportFunctions = {
|
|
449
|
-
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort
|
|
454
|
+
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString
|
|
450
455
|
};
|
|
451
456
|
|
|
452
457
|
export default exportFunctions;
|
package/util.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ declare function convertToCSV(arr: any[]): string;
|
|
|
14
14
|
declare function parseCsv(csv: string): any;
|
|
15
15
|
declare function titleCase(str: string): string;
|
|
16
16
|
declare function alphabeticalSort(arr: string[]): string[];
|
|
17
|
+
declare function percentageString(val: number, valTotal: number): string;
|
|
17
18
|
declare const exportFunctions: {
|
|
18
19
|
callApiPresignedDelete: typeof callApiPresignedDelete;
|
|
19
20
|
callApiPresignedGet: typeof callApiPresignedGet;
|
|
@@ -33,6 +34,7 @@ declare const exportFunctions: {
|
|
|
33
34
|
parseCsv: typeof parseCsv;
|
|
34
35
|
titleCase: typeof titleCase;
|
|
35
36
|
alphabeticalSort: typeof alphabeticalSort;
|
|
37
|
+
percentageString: typeof percentageString;
|
|
36
38
|
};
|
|
37
39
|
export default exportFunctions;
|
|
38
40
|
//# sourceMappingURL=util.d.ts.map
|
package/util.js
CHANGED
|
@@ -372,8 +372,12 @@ function alphabeticalSort(arr) {
|
|
|
372
372
|
});
|
|
373
373
|
return arrSorted;
|
|
374
374
|
}
|
|
375
|
+
function percentageString(val, valTotal) {
|
|
376
|
+
let num = (100 * val) / valTotal;
|
|
377
|
+
return (Math.round((num + Number.EPSILON) * 100) / 100) + "%";
|
|
378
|
+
}
|
|
375
379
|
const exportFunctions = {
|
|
376
|
-
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort
|
|
380
|
+
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString
|
|
377
381
|
};
|
|
378
382
|
export default exportFunctions;
|
|
379
383
|
//# sourceMappingURL=util.js.map
|