sf-i-events 1.0.895 → 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 +51 -9
- package/src/sf-i-events.ts +81 -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
|
@@ -8993,7 +8993,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
8993
8993
|
this.renderCompletenessCsvForGraph = (dataBar, parameter) => {
|
|
8994
8994
|
this.csvCompletenessStats = parameter + ",Not Started,In Progress,Complete,Rejected\n";
|
|
8995
8995
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
8996
|
-
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" : "");
|
|
8997
8997
|
}
|
|
8998
8998
|
console.log('rendering csv completeness', dataBar, this.csvCompletenessStats);
|
|
8999
8999
|
};
|
|
@@ -9001,14 +9001,14 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9001
9001
|
//console.log('dataBar', dataBar);
|
|
9002
9002
|
this.csvTimelinessStats = parameter + ",In Time,Past Due Date,Late Approved,Late Executed,Late Reported\n";
|
|
9003
9003
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
9004
|
-
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" : "");
|
|
9005
9005
|
}
|
|
9006
9006
|
//console.log('rendering csv csvTimelinessStats', this.csvTimelinessStats);
|
|
9007
9007
|
};
|
|
9008
9008
|
this.renderComplianceCsvForGraph = (dataBar, parameter) => {
|
|
9009
|
-
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";
|
|
9010
9010
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
9011
|
-
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" : "");
|
|
9012
9012
|
}
|
|
9013
9013
|
//console.log('rendering csv csvComplianceStats', this.csvComplianceStats);
|
|
9014
9014
|
};
|
|
@@ -9160,7 +9160,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9160
9160
|
}]
|
|
9161
9161
|
};
|
|
9162
9162
|
this.csvGraphStats += 'Compliance,Scheduled,Not Complied,Partially Complied,Complied,Complied With Gaps,Reported Non Compliance,Total\n';
|
|
9163
|
-
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';
|
|
9164
9164
|
}
|
|
9165
9165
|
//console.log('rendering timeliness graph', this.csvGraphStats);
|
|
9166
9166
|
const itemsTimeliness = divContainer.querySelectorAll('.stat-timeliness');
|
|
@@ -9425,17 +9425,17 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9425
9425
|
return data;
|
|
9426
9426
|
};
|
|
9427
9427
|
this.renderPieCsv = (pieData, csv, param) => {
|
|
9428
|
-
csv += param + ',';
|
|
9428
|
+
csv += '"' + param + '",';
|
|
9429
9429
|
for (var i = 0; i < Object.keys(pieData).length; i++) {
|
|
9430
|
-
csv += (Object.keys(pieData)[i]);
|
|
9430
|
+
csv += '"' + (Object.keys(pieData)[i]) + '"';
|
|
9431
9431
|
if (i < (Object.keys(pieData).length - 1)) {
|
|
9432
9432
|
csv += ',';
|
|
9433
9433
|
}
|
|
9434
9434
|
}
|
|
9435
9435
|
csv += '\n';
|
|
9436
|
-
csv += 'Count,';
|
|
9436
|
+
csv += '"Count",';
|
|
9437
9437
|
for (var i = 0; i < Object.keys(pieData).length; i++) {
|
|
9438
|
-
csv += (pieData[Object.keys(pieData)[i]]);
|
|
9438
|
+
csv += '"' + (pieData[Object.keys(pieData)[i]]) + '"';
|
|
9439
9439
|
if (i < (Object.keys(pieData).length - 1)) {
|
|
9440
9440
|
csv += ',';
|
|
9441
9441
|
}
|
|
@@ -17950,6 +17950,48 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17950
17950
|
}
|
|
17951
17951
|
};
|
|
17952
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) => {
|
|
17953
17995
|
var html = '';
|
|
17954
17996
|
//console.log('csvToHtmlTable', strCsv);
|
|
17955
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,7 @@ export class SfIEvents extends LitElement {
|
|
|
6097
6097
|
}
|
|
6098
6098
|
}
|
|
6099
6099
|
listReportingContainer.innerHTML = html;
|
|
6100
|
-
if(this._SfUploader[0] != null) {
|
|
6100
|
+
if (this._SfUploader[0] != null) {
|
|
6101
6101
|
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.emailcontent = emailcontent;
|
|
6102
6102
|
}
|
|
6103
6103
|
listReportingContainer.querySelector('.button-delete')?.addEventListener('click', async () => {
|
|
@@ -8040,15 +8040,15 @@ export class SfIEvents extends LitElement {
|
|
|
8040
8040
|
this.csvDataRegisters += ('\n');
|
|
8041
8041
|
}
|
|
8042
8042
|
html += '<div class="w-100p scroll-x ' + (i != this.selectedRegisterIndex ? 'hide' : '') + ' register-body-' + i + '">';
|
|
8043
|
-
|
|
8044
|
-
|
|
8043
|
+
html += '<table>';
|
|
8044
|
+
let tablecols: string[] = []
|
|
8045
8045
|
for (var j = 0; j < Object.keys(objCountry[statute]).length; j++) {
|
|
8046
8046
|
const complianceId = Object.keys(objCountry[statute])[j];
|
|
8047
8047
|
const compliance = objCountry[statute][complianceId];
|
|
8048
8048
|
const data = JSON.parse(compliance.data);
|
|
8049
8049
|
const cols = JSON.parse(compliance.cols);
|
|
8050
|
-
for(let col of cols){
|
|
8051
|
-
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())) {
|
|
8052
8052
|
tablecols.push(col)
|
|
8053
8053
|
}
|
|
8054
8054
|
}
|
|
@@ -8065,23 +8065,23 @@ export class SfIEvents extends LitElement {
|
|
|
8065
8065
|
// this.csvDataRegisters += ('",');
|
|
8066
8066
|
}
|
|
8067
8067
|
}
|
|
8068
|
-
if(compliance['entities'] != null && Array.isArray(compliance['entities'])){
|
|
8068
|
+
if (compliance['entities'] != null && Array.isArray(compliance['entities'])) {
|
|
8069
8069
|
let entities = '';
|
|
8070
|
-
for(let entity of compliance['entities']){
|
|
8070
|
+
for (let entity of compliance['entities']) {
|
|
8071
8071
|
entities += entity.split(';')[0].replace(/\([^)]*\)/g, "") + ','
|
|
8072
8072
|
}
|
|
8073
8073
|
entities = entities.slice(0, entities.length - 1)
|
|
8074
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>');
|
|
8075
|
-
|
|
8075
|
+
// this.csvDataRegisters += ('"' + (data[k] + "").replace(/"/g, '') + '",');
|
|
8076
8076
|
}
|
|
8077
|
-
if(compliance['locations'] != null && Array.isArray(compliance['locations'])){
|
|
8077
|
+
if (compliance['locations'] != null && Array.isArray(compliance['locations'])) {
|
|
8078
8078
|
let locations = '';
|
|
8079
|
-
for(let location of compliance['locations']){
|
|
8079
|
+
for (let location of compliance['locations']) {
|
|
8080
8080
|
locations += location.split(';')[0].replace(/\([^)]*\)/g, "") + ','
|
|
8081
8081
|
}
|
|
8082
8082
|
locations = locations.slice(0, locations.length - 1)
|
|
8083
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>');
|
|
8084
|
-
|
|
8084
|
+
// this.csvDataRegisters += ('"' + (data[k] + "").replace(/"/g, '') + '",');
|
|
8085
8085
|
}
|
|
8086
8086
|
this.csvDataRegisters = this.csvDataRegisters.replace(/,\s*$/, "");
|
|
8087
8087
|
this.csvDataRegisters += ('\n');
|
|
@@ -8091,7 +8091,7 @@ export class SfIEvents extends LitElement {
|
|
|
8091
8091
|
// html += '</div>';
|
|
8092
8092
|
}
|
|
8093
8093
|
html += '</table>';
|
|
8094
|
-
|
|
8094
|
+
html += '</div>';
|
|
8095
8095
|
|
|
8096
8096
|
// html += '</table>';
|
|
8097
8097
|
// html += '</div>';
|
|
@@ -12330,7 +12330,7 @@ export class SfIEvents extends LitElement {
|
|
|
12330
12330
|
|
|
12331
12331
|
this.csvCompletenessStats = parameter + ",Not Started,In Progress,Complete,Rejected\n";
|
|
12332
12332
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
12333
|
-
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" : "");
|
|
12334
12334
|
}
|
|
12335
12335
|
|
|
12336
12336
|
console.log('rendering csv completeness', dataBar, this.csvCompletenessStats);
|
|
@@ -12343,7 +12343,7 @@ export class SfIEvents extends LitElement {
|
|
|
12343
12343
|
|
|
12344
12344
|
this.csvTimelinessStats = parameter + ",In Time,Past Due Date,Late Approved,Late Executed,Late Reported\n";
|
|
12345
12345
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
12346
|
-
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" : "");
|
|
12347
12347
|
}
|
|
12348
12348
|
|
|
12349
12349
|
//console.log('rendering csv csvTimelinessStats', this.csvTimelinessStats);
|
|
@@ -12352,9 +12352,9 @@ export class SfIEvents extends LitElement {
|
|
|
12352
12352
|
|
|
12353
12353
|
renderComplianceCsvForGraph = (dataBar: any, parameter: string) => {
|
|
12354
12354
|
|
|
12355
|
-
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";
|
|
12356
12356
|
for (var i = 0; i < dataBar['labels'].length; i++) {
|
|
12357
|
-
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" : "");
|
|
12358
12358
|
}
|
|
12359
12359
|
|
|
12360
12360
|
//console.log('rendering csv csvComplianceStats', this.csvComplianceStats);
|
|
@@ -12529,7 +12529,7 @@ export class SfIEvents extends LitElement {
|
|
|
12529
12529
|
}
|
|
12530
12530
|
|
|
12531
12531
|
this.csvGraphStats += 'Compliance,Scheduled,Not Complied,Partially Complied,Complied,Complied With Gaps,Reported Non Compliance,Total\n';
|
|
12532
|
-
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';
|
|
12533
12533
|
}
|
|
12534
12534
|
|
|
12535
12535
|
//console.log('rendering timeliness graph', this.csvGraphStats);
|
|
@@ -12868,18 +12868,18 @@ export class SfIEvents extends LitElement {
|
|
|
12868
12868
|
|
|
12869
12869
|
renderPieCsv = (pieData: any, csv: string, param: string) => {
|
|
12870
12870
|
|
|
12871
|
-
csv += param + ','
|
|
12871
|
+
csv += '"' + param + '",'
|
|
12872
12872
|
for (var i = 0; i < Object.keys(pieData).length; i++) {
|
|
12873
|
-
csv += (Object.keys(pieData)[i])
|
|
12873
|
+
csv += '"' + (Object.keys(pieData)[i]) + '"'
|
|
12874
12874
|
if (i < (Object.keys(pieData).length - 1)) {
|
|
12875
12875
|
csv += ','
|
|
12876
12876
|
}
|
|
12877
12877
|
}
|
|
12878
12878
|
csv += '\n'
|
|
12879
12879
|
|
|
12880
|
-
csv += 'Count,'
|
|
12880
|
+
csv += '"Count",'
|
|
12881
12881
|
for (var i = 0; i < Object.keys(pieData).length; i++) {
|
|
12882
|
-
csv += (pieData[Object.keys(pieData)[i]])
|
|
12882
|
+
csv += '"' + (pieData[Object.keys(pieData)[i]]) + '"'
|
|
12883
12883
|
if (i < (Object.keys(pieData).length - 1)) {
|
|
12884
12884
|
csv += ','
|
|
12885
12885
|
}
|
|
@@ -12973,7 +12973,7 @@ export class SfIEvents extends LitElement {
|
|
|
12973
12973
|
// let username = this.userName;
|
|
12974
12974
|
let filterString = `countryid="${this.countryId}" locationid="${this.locationId}" entityid="${this.entityId}" tagid="${this.tagId}" selectedcriteria="${this.selectedCriteria}"`;
|
|
12975
12975
|
let rolestr = "viewer"
|
|
12976
|
-
|
|
12976
|
+
;
|
|
12977
12977
|
if (filter == "reporter" || filter == "approver" || filter == "functionhead") {
|
|
12978
12978
|
userid = filterid;
|
|
12979
12979
|
// username = filtervalue;
|
|
@@ -13063,7 +13063,7 @@ export class SfIEvents extends LitElement {
|
|
|
13063
13063
|
for (var i = 0; i < itemsCompliance.length; i++) {
|
|
13064
13064
|
itemsCompliance[i].style.display = 'none';
|
|
13065
13065
|
}
|
|
13066
|
-
if(filterstatus != ""){
|
|
13066
|
+
if (filterstatus != "") {
|
|
13067
13067
|
this.processGraphFilter(filterstatus, divContainer);
|
|
13068
13068
|
}
|
|
13069
13069
|
(this._SfDetailListContainer as HTMLDivElement).querySelector('#button-detail-close')?.addEventListener('click', () => {
|
|
@@ -23259,6 +23259,53 @@ export class SfIEvents extends LitElement {
|
|
|
23259
23259
|
}
|
|
23260
23260
|
|
|
23261
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) => {
|
|
23262
23309
|
|
|
23263
23310
|
var html = '';
|
|
23264
23311
|
|
|
@@ -24621,7 +24668,7 @@ export class SfIEvents extends LitElement {
|
|
|
24621
24668
|
value: clickedValue
|
|
24622
24669
|
};
|
|
24623
24670
|
(streamEventFilters as HTMLDivElement).style.display = 'block';
|
|
24624
|
-
(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>';
|
|
24625
24672
|
(streamEventFilters as HTMLDivElement).querySelector('#button-filter-cancel')?.addEventListener('click', () => {
|
|
24626
24673
|
this.graphFilter = "";
|
|
24627
24674
|
this.clearSelectedGraphParam();
|
|
@@ -28057,14 +28104,14 @@ export class SfIEvents extends LitElement {
|
|
|
28057
28104
|
} else {
|
|
28058
28105
|
view = "entity";
|
|
28059
28106
|
}
|
|
28060
|
-
|
|
28107
|
+
|
|
28061
28108
|
path = "getallcountryevents";
|
|
28062
28109
|
|
|
28063
28110
|
let url = "https://" + this.apiId + "/" + path;
|
|
28064
28111
|
let temptagid = tagid;
|
|
28065
|
-
if(temptagid == "" && locationid != "") {
|
|
28112
|
+
if (temptagid == "" && locationid != "") {
|
|
28066
28113
|
temptagid = locationid
|
|
28067
|
-
}else if(temptagid == "" && userprofileid != this.userProfileId) {
|
|
28114
|
+
} else if (temptagid == "" && userprofileid != this.userProfileId) {
|
|
28068
28115
|
temptagid = "allevents"
|
|
28069
28116
|
}
|
|
28070
28117
|
//console.log('fetch calendar url', url);
|