sf-i-events 1.0.894 → 1.0.896
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/dev/index.html +1 -1
- package/package.json +1 -1
- package/sf-i-events.d.ts +1 -0
- package/sf-i-events.js +54 -10
- package/src/sf-i-events.ts +83 -34
package/dev/index.html
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import { SfISubSelect } from 'https://esm.run/sf-i-sub-select@1.0.83/sf-i-sub-select.js';
|
|
26
26
|
import { SfIForm } from 'https://esm.run/sf-i-form@1.0.185/sf-i-form.js';
|
|
27
27
|
import { SfIElasticText } from 'https://esm.run/sf-i-elastic-text@1.0.17/sf-i-elastic-text.js';
|
|
28
|
-
import { SfIUploader } from 'https://esm.run/sf-i-uploader@1.0.
|
|
28
|
+
import { SfIUploader } from 'https://esm.run/sf-i-uploader@1.0.122/sf-i-uploader.js';
|
|
29
29
|
import { SfIMultitextarea } from 'https://esm.run/sf-i-multitextarea@1.0.23/sf-i-multitextarea.js';
|
|
30
30
|
// import { SfIReporting } from 'https://esm.run/sf-i-reporting@1.0.89/sf-i-reporting.js';
|
|
31
31
|
import { SfIReporting } from '../../sf-i-reporting/sf-i-reporting.js';
|
package/package.json
CHANGED
package/sf-i-events.d.ts
CHANGED
|
@@ -684,6 +684,7 @@ export declare class SfIEvents extends LitElement {
|
|
|
684
684
|
renderChartSettings: (container: HTMLDivElement, selectedTab: number | undefined, selectedSummary: number | undefined, ctx: any) => void;
|
|
685
685
|
renderChartSummary: () => void;
|
|
686
686
|
csvToHtmlTable: (strCsv: string) => string;
|
|
687
|
+
csvToHtmlTable1: (strCsv: string) => string;
|
|
687
688
|
getFilteredString: () => string;
|
|
688
689
|
getFilteredStringSummary: () => string;
|
|
689
690
|
formatLabel: (str: string, maxwidth: number) => any;
|
package/sf-i-events.js
CHANGED
|
@@ -3746,7 +3746,9 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
3746
3746
|
}
|
|
3747
3747
|
}
|
|
3748
3748
|
listReportingContainer.innerHTML = html;
|
|
3749
|
-
this._SfUploader[0]
|
|
3749
|
+
if (this._SfUploader[0] != null) {
|
|
3750
|
+
this._SfUploader[0].querySelector('#uploader').emailcontent = emailcontent;
|
|
3751
|
+
}
|
|
3750
3752
|
(_f = listReportingContainer.querySelector('.button-delete')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', async () => {
|
|
3751
3753
|
await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
|
|
3752
3754
|
this.setSuccess('Deleted successfully!');
|
|
@@ -8991,7 +8993,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
8991
8993
|
this.renderCompletenessCsvForGraph = (dataBar, parameter) => {
|
|
8992
8994
|
this.csvCompletenessStats = parameter + ",Not Started,In Progress,Complete,Rejected\n";
|
|
8993
8995
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
8994
|
-
this.csvCompletenessStats += dataBar['labels'][i].join(" ") + "
|
|
8996
|
+
this.csvCompletenessStats += "\"" + dataBar['labels'][i].join(" ") + "\",\"" + dataBar['datasets'][3]['data'][i] + "\",\"" + dataBar['datasets'][1]['data'][i] + "\",\"" + dataBar['datasets'][0]['data'][i] + "\",\"" + dataBar['datasets'][2]['data'][i] + (i < (dataBar['labels'].length - 1) ? "\"\n" : "");
|
|
8995
8997
|
}
|
|
8996
8998
|
console.log('rendering csv completeness', dataBar, this.csvCompletenessStats);
|
|
8997
8999
|
};
|
|
@@ -8999,14 +9001,14 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
8999
9001
|
//console.log('dataBar', dataBar);
|
|
9000
9002
|
this.csvTimelinessStats = parameter + ",In Time,Past Due Date,Late Approved,Late Executed,Late Reported\n";
|
|
9001
9003
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
9002
|
-
this.csvTimelinessStats += dataBar['labels'][i].join(" ") + "
|
|
9004
|
+
this.csvTimelinessStats += "\"" + dataBar['labels'][i].join(" ") + "\",\"" + dataBar['datasets'][0]['data'][i] + "\",\"" + dataBar['datasets'][1]['data'][i] + "\",\"" + dataBar['datasets'][3]['data'][i] + "\",\"" + dataBar['datasets'][2]['data'][i] + "\",\"" + dataBar['datasets'][4]['data'][i] + (i < (dataBar['labels'].length - 1) ? "\"\n" : "");
|
|
9003
9005
|
}
|
|
9004
9006
|
//console.log('rendering csv csvTimelinessStats', this.csvTimelinessStats);
|
|
9005
9007
|
};
|
|
9006
9008
|
this.renderComplianceCsvForGraph = (dataBar, parameter) => {
|
|
9007
|
-
this.csvComplianceStats = parameter + ",Scheduled,Not Complied,Partially Complied,Complied\n";
|
|
9009
|
+
this.csvComplianceStats = parameter + ",Scheduled,Not Complied,Partially Complied,Complied,Complied With Gaps,Reported Non Compliance\n";
|
|
9008
9010
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
9009
|
-
this.csvComplianceStats += dataBar['labels'][i].join(" ") + "
|
|
9011
|
+
this.csvComplianceStats += "\"" + dataBar['labels'][i].join(" ") + "\",\"" + dataBar['datasets'][0]['data'][i] + "\",\"" + dataBar['datasets'][1]['data'][i] + "\",\"" + dataBar['datasets'][2]['data'][i] + "\",\"" + dataBar['datasets'][3]['data'][i] + "\",\"" + dataBar['datasets'][4]['data'][i] + "\",\"" + dataBar['datasets'][5]['data'][i] + (i < (dataBar['labels'].length - 1) ? "\"\n" : "");
|
|
9010
9012
|
}
|
|
9011
9013
|
//console.log('rendering csv csvComplianceStats', this.csvComplianceStats);
|
|
9012
9014
|
};
|
|
@@ -9158,7 +9160,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9158
9160
|
}]
|
|
9159
9161
|
};
|
|
9160
9162
|
this.csvGraphStats += 'Compliance,Scheduled,Not Complied,Partially Complied,Complied,Complied With Gaps,Reported Non Compliance,Total\n';
|
|
9161
|
-
this.csvGraphStats += 'Count,' + parseInt(dataScheduled) + ',' + parseInt(dataNotComplied) + ',' + parseInt(dataPartiallyComplied) + ',' + parseInt(
|
|
9163
|
+
this.csvGraphStats += 'Count,' + parseInt(dataScheduled) + ',' + parseInt(dataNotComplied) + ',' + parseInt(dataPartiallyComplied) + ',' + parseInt(dataCompliedWithGaps) + ',' + parseInt(dataComplied) + ',' + parseInt(dataReportedNonComplaince) + ',' + parseInt(dataTotal) + '\n';
|
|
9162
9164
|
}
|
|
9163
9165
|
//console.log('rendering timeliness graph', this.csvGraphStats);
|
|
9164
9166
|
const itemsTimeliness = divContainer.querySelectorAll('.stat-timeliness');
|
|
@@ -9423,17 +9425,17 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9423
9425
|
return data;
|
|
9424
9426
|
};
|
|
9425
9427
|
this.renderPieCsv = (pieData, csv, param) => {
|
|
9426
|
-
csv += param + ',';
|
|
9428
|
+
csv += '"' + param + '",';
|
|
9427
9429
|
for (var i = 0; i < Object.keys(pieData).length; i++) {
|
|
9428
|
-
csv += (Object.keys(pieData)[i]);
|
|
9430
|
+
csv += '"' + (Object.keys(pieData)[i]) + '"';
|
|
9429
9431
|
if (i < (Object.keys(pieData).length - 1)) {
|
|
9430
9432
|
csv += ',';
|
|
9431
9433
|
}
|
|
9432
9434
|
}
|
|
9433
9435
|
csv += '\n';
|
|
9434
|
-
csv += 'Count,';
|
|
9436
|
+
csv += '"Count",';
|
|
9435
9437
|
for (var i = 0; i < Object.keys(pieData).length; i++) {
|
|
9436
|
-
csv += (pieData[Object.keys(pieData)[i]]);
|
|
9438
|
+
csv += '"' + (pieData[Object.keys(pieData)[i]]) + '"';
|
|
9437
9439
|
if (i < (Object.keys(pieData).length - 1)) {
|
|
9438
9440
|
csv += ',';
|
|
9439
9441
|
}
|
|
@@ -17948,6 +17950,48 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17948
17950
|
}
|
|
17949
17951
|
};
|
|
17950
17952
|
this.csvToHtmlTable = (strCsv) => {
|
|
17953
|
+
const htmlRows = [];
|
|
17954
|
+
const lines = strCsv.trim().split(/\r?\n/);
|
|
17955
|
+
const parseCsvLine = (line) => {
|
|
17956
|
+
const result = [];
|
|
17957
|
+
let current = '';
|
|
17958
|
+
let inQuotes = false;
|
|
17959
|
+
for (let i = 0; i < line.length; i++) {
|
|
17960
|
+
const char = line[i];
|
|
17961
|
+
const nextChar = line[i + 1];
|
|
17962
|
+
if (char === '"' && inQuotes && nextChar === '"') {
|
|
17963
|
+
current += '"'; // escaped quote
|
|
17964
|
+
i++; // skip next quote
|
|
17965
|
+
}
|
|
17966
|
+
else if (char === '"') {
|
|
17967
|
+
inQuotes = !inQuotes;
|
|
17968
|
+
}
|
|
17969
|
+
else if (char === ',' && !inQuotes) {
|
|
17970
|
+
result.push(current);
|
|
17971
|
+
current = '';
|
|
17972
|
+
}
|
|
17973
|
+
else {
|
|
17974
|
+
current += char;
|
|
17975
|
+
}
|
|
17976
|
+
}
|
|
17977
|
+
result.push(current);
|
|
17978
|
+
return result;
|
|
17979
|
+
};
|
|
17980
|
+
htmlRows.push('<br />' + parseCsvLine(lines[0])[0] + '<br /><br />');
|
|
17981
|
+
htmlRows.push('<table>');
|
|
17982
|
+
lines.forEach((line, index) => {
|
|
17983
|
+
const cells = parseCsvLine(line);
|
|
17984
|
+
const tag = index === 0 ? 'th' : 'td';
|
|
17985
|
+
htmlRows.push('<tr>');
|
|
17986
|
+
cells.forEach(cell => {
|
|
17987
|
+
htmlRows.push(`<${tag} class="${tag === 'td' ? 'text-center' : ''}">${cell}</${tag}>`);
|
|
17988
|
+
});
|
|
17989
|
+
htmlRows.push('</tr>');
|
|
17990
|
+
});
|
|
17991
|
+
htmlRows.push('</table>');
|
|
17992
|
+
return htmlRows.join('');
|
|
17993
|
+
};
|
|
17994
|
+
this.csvToHtmlTable1 = (strCsv) => {
|
|
17951
17995
|
var html = '';
|
|
17952
17996
|
//console.log('csvToHtmlTable', strCsv);
|
|
17953
17997
|
var strArr = strCsv.split("\n");
|
package/src/sf-i-events.ts
CHANGED
|
@@ -4635,16 +4635,16 @@ export class SfIEvents extends LitElement {
|
|
|
4635
4635
|
|
|
4636
4636
|
var html = '';
|
|
4637
4637
|
html += '<tr class="tablerow">'
|
|
4638
|
-
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 part="td-head' + (isLocation ? '' : '-click') +'" id="filter-' + index + '">DASHBOARD_FILTER_NAME</div>'
|
|
4638
|
+
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 part="td-head' + (isLocation ? '' : '-click') + '" id="filter-' + index + '">DASHBOARD_FILTER_NAME</div>'
|
|
4639
4639
|
if (filterUser) {
|
|
4640
4640
|
html += '<div part="td-head" class="pl-0-imp w-100 d-flex align-center">Last Access</div><div>DASHBOARD_LAST_ACTIVE</div><div part="td-head" class="pl-0-imp w-100 d-flex align-center">Last Action</div><div>DASHBOARD_LAST_ACTION</div>'
|
|
4641
4641
|
}
|
|
4642
4642
|
html += '</div></td>'
|
|
4643
|
-
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') +'" id="filter-not-started-' + index + '" 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>'
|
|
4644
|
-
html += '<td part="td-body" id="filter-pending-approval-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') +'" 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>'
|
|
4645
|
-
html += '<td part="td-body" id="filter-rejected-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') +'" 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>'
|
|
4646
|
-
html += '<td part="td-body" id="filter-approved-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') +'" 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>'
|
|
4647
|
-
html += '<td part="td-body" id="filter-total-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') +'" class="pl-0-imp w-100 d-flex align-center">Total</div><div>DASHBOARD_TOTAL</div></div></td>'
|
|
4643
|
+
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') + '" id="filter-not-started-' + index + '" 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>'
|
|
4644
|
+
html += '<td part="td-body" id="filter-pending-approval-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') + '" 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>'
|
|
4645
|
+
html += '<td part="td-body" id="filter-rejected-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') + '" 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>'
|
|
4646
|
+
html += '<td part="td-body" id="filter-approved-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') + '" 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>'
|
|
4647
|
+
html += '<td part="td-body" id="filter-total-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') + '" class="pl-0-imp w-100 d-flex align-center">Total</div><div>DASHBOARD_TOTAL</div></div></td>'
|
|
4648
4648
|
html += '</tr>';
|
|
4649
4649
|
|
|
4650
4650
|
return html;
|
|
@@ -6067,7 +6067,7 @@ export class SfIEvents extends LitElement {
|
|
|
6067
6067
|
let ddmmyyyy = mmddyyyy.split('/')[1] + '/' + mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[2];
|
|
6068
6068
|
|
|
6069
6069
|
let emailcontent = `<table border="0" cellspacing="0" style="color:#666666;border-radius:5px;border:solid 1px #efefef;width:100%; margin-top:20px"><tbody><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Compliance ID</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.id}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Country</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.countryname.replace(/ *\([^)]*\) */g, "")}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Entity</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.entityname.replace(/ *\([^)]*\) */g, "")}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Location</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.locationname.replace(/ *\([^)]*\) */g, "")}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Statute</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${(event.statute[0] ?? "")}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Subcategory</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.subcategory}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Reporter</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.reporters[0].split(';')[0]}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Approver</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.approvers[0].split(';')[0]}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Due Date</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${ddmmyyyy}</td></tr></tbody></table>`;
|
|
6070
|
-
|
|
6070
|
+
|
|
6071
6071
|
let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
|
|
6072
6072
|
for (let tempReportingContainer of listReportingContainers) {
|
|
6073
6073
|
tempReportingContainer.style.display = 'none';
|
|
@@ -6097,7 +6097,9 @@ export class SfIEvents extends LitElement {
|
|
|
6097
6097
|
}
|
|
6098
6098
|
}
|
|
6099
6099
|
listReportingContainer.innerHTML = html;
|
|
6100
|
-
(this._SfUploader[0]
|
|
6100
|
+
if (this._SfUploader[0] != null) {
|
|
6101
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.emailcontent = emailcontent;
|
|
6102
|
+
}
|
|
6101
6103
|
listReportingContainer.querySelector('.button-delete')?.addEventListener('click', async () => {
|
|
6102
6104
|
|
|
6103
6105
|
await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
|
|
@@ -8038,15 +8040,15 @@ export class SfIEvents extends LitElement {
|
|
|
8038
8040
|
this.csvDataRegisters += ('\n');
|
|
8039
8041
|
}
|
|
8040
8042
|
html += '<div class="w-100p scroll-x ' + (i != this.selectedRegisterIndex ? 'hide' : '') + ' register-body-' + i + '">';
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
+
html += '<table>';
|
|
8044
|
+
let tablecols: string[] = []
|
|
8043
8045
|
for (var j = 0; j < Object.keys(objCountry[statute]).length; j++) {
|
|
8044
8046
|
const complianceId = Object.keys(objCountry[statute])[j];
|
|
8045
8047
|
const compliance = objCountry[statute][complianceId];
|
|
8046
8048
|
const data = JSON.parse(compliance.data);
|
|
8047
8049
|
const cols = JSON.parse(compliance.cols);
|
|
8048
|
-
for(let col of cols){
|
|
8049
|
-
if(!tablecols.includes(col.toLowerCase()) && !this.EXCLUDE_COLS_FROM_REGS.includes(col.toLowerCase())){
|
|
8050
|
+
for (let col of cols) {
|
|
8051
|
+
if (!tablecols.includes(col.toLowerCase()) && !this.EXCLUDE_COLS_FROM_REGS.includes(col.toLowerCase())) {
|
|
8050
8052
|
tablecols.push(col)
|
|
8051
8053
|
}
|
|
8052
8054
|
}
|
|
@@ -8063,23 +8065,23 @@ export class SfIEvents extends LitElement {
|
|
|
8063
8065
|
// this.csvDataRegisters += ('",');
|
|
8064
8066
|
}
|
|
8065
8067
|
}
|
|
8066
|
-
if(compliance['entities'] != null && Array.isArray(compliance['entities'])){
|
|
8068
|
+
if (compliance['entities'] != null && Array.isArray(compliance['entities'])) {
|
|
8067
8069
|
let entities = '';
|
|
8068
|
-
for(let entity of compliance['entities']){
|
|
8070
|
+
for (let entity of compliance['entities']) {
|
|
8069
8071
|
entities += entity.split(';')[0].replace(/\([^)]*\)/g, "") + ','
|
|
8070
8072
|
}
|
|
8071
8073
|
entities = entities.slice(0, entities.length - 1)
|
|
8072
8074
|
html += ('<td class="td-body" part="td-body-register"><span part="td-head" style="padding-left: 0px !important">entities</span><br /><sf-i-elastic-text text="' + entities + '" minLength="80" lineSize="4"></sf-i-elastic-text></td>');
|
|
8073
|
-
|
|
8075
|
+
// this.csvDataRegisters += ('"' + (data[k] + "").replace(/"/g, '') + '",');
|
|
8074
8076
|
}
|
|
8075
|
-
if(compliance['locations'] != null && Array.isArray(compliance['locations'])){
|
|
8077
|
+
if (compliance['locations'] != null && Array.isArray(compliance['locations'])) {
|
|
8076
8078
|
let locations = '';
|
|
8077
|
-
for(let location of compliance['locations']){
|
|
8079
|
+
for (let location of compliance['locations']) {
|
|
8078
8080
|
locations += location.split(';')[0].replace(/\([^)]*\)/g, "") + ','
|
|
8079
8081
|
}
|
|
8080
8082
|
locations = locations.slice(0, locations.length - 1)
|
|
8081
8083
|
html += ('<td class="td-body" part="td-body-register"><span part="td-head" style="padding-left: 0px !important">locations</span><br /><sf-i-elastic-text text="' + locations + '" minLength="80" lineSize="4"></sf-i-elastic-text></td>');
|
|
8082
|
-
|
|
8084
|
+
// this.csvDataRegisters += ('"' + (data[k] + "").replace(/"/g, '') + '",');
|
|
8083
8085
|
}
|
|
8084
8086
|
this.csvDataRegisters = this.csvDataRegisters.replace(/,\s*$/, "");
|
|
8085
8087
|
this.csvDataRegisters += ('\n');
|
|
@@ -8089,7 +8091,7 @@ export class SfIEvents extends LitElement {
|
|
|
8089
8091
|
// html += '</div>';
|
|
8090
8092
|
}
|
|
8091
8093
|
html += '</table>';
|
|
8092
|
-
|
|
8094
|
+
html += '</div>';
|
|
8093
8095
|
|
|
8094
8096
|
// html += '</table>';
|
|
8095
8097
|
// html += '</div>';
|
|
@@ -12328,7 +12330,7 @@ export class SfIEvents extends LitElement {
|
|
|
12328
12330
|
|
|
12329
12331
|
this.csvCompletenessStats = parameter + ",Not Started,In Progress,Complete,Rejected\n";
|
|
12330
12332
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
12331
|
-
this.csvCompletenessStats += dataBar['labels'][i].join(" ") + "
|
|
12333
|
+
this.csvCompletenessStats += "\"" + dataBar['labels'][i].join(" ") + "\",\"" + dataBar['datasets'][3]['data'][i] + "\",\"" + dataBar['datasets'][1]['data'][i] + "\",\"" + dataBar['datasets'][0]['data'][i] + "\",\"" + dataBar['datasets'][2]['data'][i] + (i < (dataBar['labels'].length - 1) ? "\"\n" : "");
|
|
12332
12334
|
}
|
|
12333
12335
|
|
|
12334
12336
|
console.log('rendering csv completeness', dataBar, this.csvCompletenessStats);
|
|
@@ -12341,7 +12343,7 @@ export class SfIEvents extends LitElement {
|
|
|
12341
12343
|
|
|
12342
12344
|
this.csvTimelinessStats = parameter + ",In Time,Past Due Date,Late Approved,Late Executed,Late Reported\n";
|
|
12343
12345
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
12344
|
-
this.csvTimelinessStats += dataBar['labels'][i].join(" ") + "
|
|
12346
|
+
this.csvTimelinessStats += "\"" + dataBar['labels'][i].join(" ") + "\",\"" + dataBar['datasets'][0]['data'][i] + "\",\"" + dataBar['datasets'][1]['data'][i] + "\",\"" + dataBar['datasets'][3]['data'][i] + "\",\"" + dataBar['datasets'][2]['data'][i] + "\",\"" + dataBar['datasets'][4]['data'][i] + (i < (dataBar['labels'].length - 1) ? "\"\n" : "");
|
|
12345
12347
|
}
|
|
12346
12348
|
|
|
12347
12349
|
//console.log('rendering csv csvTimelinessStats', this.csvTimelinessStats);
|
|
@@ -12350,9 +12352,9 @@ export class SfIEvents extends LitElement {
|
|
|
12350
12352
|
|
|
12351
12353
|
renderComplianceCsvForGraph = (dataBar: any, parameter: string) => {
|
|
12352
12354
|
|
|
12353
|
-
this.csvComplianceStats = parameter + ",Scheduled,Not Complied,Partially Complied,Complied\n";
|
|
12355
|
+
this.csvComplianceStats = parameter + ",Scheduled,Not Complied,Partially Complied,Complied,Complied With Gaps,Reported Non Compliance\n";
|
|
12354
12356
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
12355
|
-
this.csvComplianceStats += dataBar['labels'][i].join(" ") + "
|
|
12357
|
+
this.csvComplianceStats += "\"" + dataBar['labels'][i].join(" ") + "\",\"" + dataBar['datasets'][0]['data'][i] + "\",\"" + dataBar['datasets'][1]['data'][i] + "\",\"" + dataBar['datasets'][2]['data'][i] + "\",\"" + dataBar['datasets'][3]['data'][i] + "\",\"" + dataBar['datasets'][4]['data'][i] + "\",\"" + dataBar['datasets'][5]['data'][i] + (i < (dataBar['labels'].length - 1) ? "\"\n" : "");
|
|
12356
12358
|
}
|
|
12357
12359
|
|
|
12358
12360
|
//console.log('rendering csv csvComplianceStats', this.csvComplianceStats);
|
|
@@ -12527,7 +12529,7 @@ export class SfIEvents extends LitElement {
|
|
|
12527
12529
|
}
|
|
12528
12530
|
|
|
12529
12531
|
this.csvGraphStats += 'Compliance,Scheduled,Not Complied,Partially Complied,Complied,Complied With Gaps,Reported Non Compliance,Total\n';
|
|
12530
|
-
this.csvGraphStats += 'Count,' + parseInt(dataScheduled) + ',' + parseInt(dataNotComplied) + ',' + parseInt(dataPartiallyComplied) + ',' + parseInt(
|
|
12532
|
+
this.csvGraphStats += 'Count,' + parseInt(dataScheduled) + ',' + parseInt(dataNotComplied) + ',' + parseInt(dataPartiallyComplied) + ',' + parseInt(dataCompliedWithGaps) + ',' + parseInt(dataComplied) + ',' + parseInt(dataReportedNonComplaince) + ',' + parseInt(dataTotal) + '\n';
|
|
12531
12533
|
}
|
|
12532
12534
|
|
|
12533
12535
|
//console.log('rendering timeliness graph', this.csvGraphStats);
|
|
@@ -12866,18 +12868,18 @@ export class SfIEvents extends LitElement {
|
|
|
12866
12868
|
|
|
12867
12869
|
renderPieCsv = (pieData: any, csv: string, param: string) => {
|
|
12868
12870
|
|
|
12869
|
-
csv += param + ','
|
|
12871
|
+
csv += '"' + param + '",'
|
|
12870
12872
|
for (var i = 0; i < Object.keys(pieData).length; i++) {
|
|
12871
|
-
csv += (Object.keys(pieData)[i])
|
|
12873
|
+
csv += '"' + (Object.keys(pieData)[i]) + '"'
|
|
12872
12874
|
if (i < (Object.keys(pieData).length - 1)) {
|
|
12873
12875
|
csv += ','
|
|
12874
12876
|
}
|
|
12875
12877
|
}
|
|
12876
12878
|
csv += '\n'
|
|
12877
12879
|
|
|
12878
|
-
csv += 'Count,'
|
|
12880
|
+
csv += '"Count",'
|
|
12879
12881
|
for (var i = 0; i < Object.keys(pieData).length; i++) {
|
|
12880
|
-
csv += (pieData[Object.keys(pieData)[i]])
|
|
12882
|
+
csv += '"' + (pieData[Object.keys(pieData)[i]]) + '"'
|
|
12881
12883
|
if (i < (Object.keys(pieData).length - 1)) {
|
|
12882
12884
|
csv += ','
|
|
12883
12885
|
}
|
|
@@ -12971,7 +12973,7 @@ export class SfIEvents extends LitElement {
|
|
|
12971
12973
|
// let username = this.userName;
|
|
12972
12974
|
let filterString = `countryid="${this.countryId}" locationid="${this.locationId}" entityid="${this.entityId}" tagid="${this.tagId}" selectedcriteria="${this.selectedCriteria}"`;
|
|
12973
12975
|
let rolestr = "viewer"
|
|
12974
|
-
|
|
12976
|
+
;
|
|
12975
12977
|
if (filter == "reporter" || filter == "approver" || filter == "functionhead") {
|
|
12976
12978
|
userid = filterid;
|
|
12977
12979
|
// username = filtervalue;
|
|
@@ -13061,7 +13063,7 @@ export class SfIEvents extends LitElement {
|
|
|
13061
13063
|
for (var i = 0; i < itemsCompliance.length; i++) {
|
|
13062
13064
|
itemsCompliance[i].style.display = 'none';
|
|
13063
13065
|
}
|
|
13064
|
-
if(filterstatus != ""){
|
|
13066
|
+
if (filterstatus != "") {
|
|
13065
13067
|
this.processGraphFilter(filterstatus, divContainer);
|
|
13066
13068
|
}
|
|
13067
13069
|
(this._SfDetailListContainer as HTMLDivElement).querySelector('#button-detail-close')?.addEventListener('click', () => {
|
|
@@ -23257,6 +23259,53 @@ export class SfIEvents extends LitElement {
|
|
|
23257
23259
|
}
|
|
23258
23260
|
|
|
23259
23261
|
csvToHtmlTable = (strCsv: string) => {
|
|
23262
|
+
const htmlRows = [];
|
|
23263
|
+
const lines = strCsv.trim().split(/\r?\n/);
|
|
23264
|
+
|
|
23265
|
+
const parseCsvLine = (line: string): string[] => {
|
|
23266
|
+
const result = [];
|
|
23267
|
+
let current = '';
|
|
23268
|
+
let inQuotes = false;
|
|
23269
|
+
|
|
23270
|
+
for (let i = 0; i < line.length; i++) {
|
|
23271
|
+
const char = line[i];
|
|
23272
|
+
const nextChar = line[i + 1];
|
|
23273
|
+
|
|
23274
|
+
if (char === '"' && inQuotes && nextChar === '"') {
|
|
23275
|
+
current += '"'; // escaped quote
|
|
23276
|
+
i++; // skip next quote
|
|
23277
|
+
} else if (char === '"') {
|
|
23278
|
+
inQuotes = !inQuotes;
|
|
23279
|
+
} else if (char === ',' && !inQuotes) {
|
|
23280
|
+
result.push(current);
|
|
23281
|
+
current = '';
|
|
23282
|
+
} else {
|
|
23283
|
+
current += char;
|
|
23284
|
+
}
|
|
23285
|
+
}
|
|
23286
|
+
result.push(current);
|
|
23287
|
+
return result;
|
|
23288
|
+
};
|
|
23289
|
+
|
|
23290
|
+
htmlRows.push('<br />' + parseCsvLine(lines[0])[0] + '<br /><br />');
|
|
23291
|
+
htmlRows.push('<table>');
|
|
23292
|
+
|
|
23293
|
+
lines.forEach((line, index) => {
|
|
23294
|
+
const cells = parseCsvLine(line);
|
|
23295
|
+
const tag = index === 0 ? 'th' : 'td';
|
|
23296
|
+
htmlRows.push('<tr>');
|
|
23297
|
+
cells.forEach(cell => {
|
|
23298
|
+
htmlRows.push(`<${tag} class="${tag === 'td' ? 'text-center' : ''}">${cell}</${tag}>`);
|
|
23299
|
+
});
|
|
23300
|
+
htmlRows.push('</tr>');
|
|
23301
|
+
});
|
|
23302
|
+
|
|
23303
|
+
htmlRows.push('</table>');
|
|
23304
|
+
return htmlRows.join('');
|
|
23305
|
+
};
|
|
23306
|
+
|
|
23307
|
+
|
|
23308
|
+
csvToHtmlTable1 = (strCsv: string) => {
|
|
23260
23309
|
|
|
23261
23310
|
var html = '';
|
|
23262
23311
|
|
|
@@ -24619,7 +24668,7 @@ export class SfIEvents extends LitElement {
|
|
|
24619
24668
|
value: clickedValue
|
|
24620
24669
|
};
|
|
24621
24670
|
(streamEventFilters as HTMLDivElement).style.display = 'block';
|
|
24622
|
-
(streamEventFilters as HTMLDivElement).innerHTML = '<div part="badge-dashboard" class="d-flex align-center justify-between mr-10 mb-10 no-shrink"><div><span>Filtered by</span> <span id="graph-total" part="badge-filter-name">' + clickedValue + '</span></div>' + (detailsListContainer == null ? '<button id="button-filter-cancel" part="button-icon"><span class="material-symbols-outlined">close</span></button>':'') + '</div>';
|
|
24671
|
+
(streamEventFilters as HTMLDivElement).innerHTML = '<div part="badge-dashboard" class="d-flex align-center justify-between mr-10 mb-10 no-shrink"><div><span>Filtered by</span> <span id="graph-total" part="badge-filter-name">' + clickedValue + '</span></div>' + (detailsListContainer == null ? '<button id="button-filter-cancel" part="button-icon"><span class="material-symbols-outlined">close</span></button>' : '') + '</div>';
|
|
24623
24672
|
(streamEventFilters as HTMLDivElement).querySelector('#button-filter-cancel')?.addEventListener('click', () => {
|
|
24624
24673
|
this.graphFilter = "";
|
|
24625
24674
|
this.clearSelectedGraphParam();
|
|
@@ -28055,14 +28104,14 @@ export class SfIEvents extends LitElement {
|
|
|
28055
28104
|
} else {
|
|
28056
28105
|
view = "entity";
|
|
28057
28106
|
}
|
|
28058
|
-
|
|
28107
|
+
|
|
28059
28108
|
path = "getallcountryevents";
|
|
28060
28109
|
|
|
28061
28110
|
let url = "https://" + this.apiId + "/" + path;
|
|
28062
28111
|
let temptagid = tagid;
|
|
28063
|
-
if(temptagid == "" && locationid != "") {
|
|
28112
|
+
if (temptagid == "" && locationid != "") {
|
|
28064
28113
|
temptagid = locationid
|
|
28065
|
-
}else if(temptagid == "" && userprofileid != this.userProfileId) {
|
|
28114
|
+
} else if (temptagid == "" && userprofileid != this.userProfileId) {
|
|
28066
28115
|
temptagid = "allevents"
|
|
28067
28116
|
}
|
|
28068
28117
|
//console.log('fetch calendar url', url);
|