sf-i-events 1.0.864 → 1.0.866
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 +19 -18
- package/package.json +1 -1
- package/sf-i-events.d.ts +1 -1
- package/sf-i-events.js +278 -231
- package/src/sf-i-events.ts +299 -247
package/src/sf-i-events.ts
CHANGED
|
@@ -3661,7 +3661,7 @@ export class SfIEvents extends LitElement {
|
|
|
3661
3661
|
|
|
3662
3662
|
// console.log('about to expire', mmdd, event.duedate)
|
|
3663
3663
|
|
|
3664
|
-
let dateArr
|
|
3664
|
+
let dateArr = event.duedate.split('/')
|
|
3665
3665
|
const dd = dateArr[0];
|
|
3666
3666
|
const mm = dateArr[1];
|
|
3667
3667
|
|
|
@@ -4261,7 +4261,7 @@ export class SfIEvents extends LitElement {
|
|
|
4261
4261
|
|
|
4262
4262
|
}
|
|
4263
4263
|
|
|
4264
|
-
getComplianceStatus = (completeness: string, timeliness: string, percentage?: string, event: any = {}
|
|
4264
|
+
getComplianceStatus = (completeness: string, timeliness: string, percentage?: string, event: any = {}) => {
|
|
4265
4265
|
if (event.module == "agreement") {
|
|
4266
4266
|
if (completeness == "not-started") {
|
|
4267
4267
|
|
|
@@ -4737,7 +4737,7 @@ export class SfIEvents extends LitElement {
|
|
|
4737
4737
|
html += '<div class="stream-events-container flex-grow" part="' + bgStatus + '">';
|
|
4738
4738
|
html += '<div class="hidden-tags hide">' + JSON.stringify(event['tags']) + '</div>'
|
|
4739
4739
|
html += '<div class="hidden-title hide"><table><thead><th part="badge-filtered"><i>not filtered</i></th></thead></table></div>'
|
|
4740
|
-
html += '<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">' + '<input id="button-select-' + mmdd.replace('/', '-') + '-' + itemNumber + '-' + (((event.makercheckers != null && (event.makercheckers).length > 0)) ? '1' : '0') + '-' + (((event.docs != null && (event.docs).length > 0)) ? '1' : '0') + '-' + event.entityid.replace(/-/g, '_') + '-' + event.locationid.replace(/-/g, '_') + '-' + event.id.replace(/-/g, '_') + '-' + event.duedate.split('/')[1] + '-' + event.duedate.split('/')[0] + '-' + event.duedate.split('/')[2] + '-' + partStatus.replace(/-/g, '_') + '-' + ((event.module ?? false) ? event.module : 'compliance') + '-' + ((event.isbulk == null || event.isbulk == false) ? "" : "bulk") + '" class="button-select mr-10 ' + (((event.reportformat != null && event.reportformat.length > 0) || (event.isbulk != null && event.isbulk == true)) ? 'hide' : '') + '" type="checkbox"/>' + (event.isbulk != null && event.isbulk == true ? '<div class="lds-dual-ring1 bulk-loader mr-10"></div>' : '') + '<sf-i-elastic-text class="stream-event-title' + (event.isbulk == null || event.isbulk == false ? ' button-event-title' : '') + '" id="stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + itemNumber + '-' + ((event.module ?? false) ? event.module : 'compliance') + '" text="' + event['obligationtitle'] + '" minLength="' + (event.reporters != null ? "100" : "60") + '"></sf-i-elastic-text>' +
|
|
4740
|
+
html += '<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">' + '<input id="button-select-' + mmdd.replace('/', '-') + '-' + itemNumber + '-' + (((event.makercheckers != null && (event.makercheckers).length > 0)) ? '1' : '0') + '-' + (((event.docs != null && (event.docs).length > 0)) ? '1' : '0') + '-' + event.entityid.replace(/-/g, '_') + '-' + event.locationid.replace(/-/g, '_') + '-' + event.id.replace(/-/g, '_') + '-' + event.duedate.split('/')[1] + '-' + event.duedate.split('/')[0] + '-' + event.duedate.split('/')[2] + '-' + partStatus.replace(/-/g, '_') + '-' + ((event.module ?? false) ? event.module : 'compliance') + '-' + ((event.isbulk == null || event.isbulk == false) ? "" : "bulk") + (((event.reportformat != null && event.reportformat.length > 0) || (event.isbulk != null && event.isbulk == true) || (event.customreporting != null)) ? "reportformat" : "") + '" class="button-select mr-10 ' + (((event.reportformat != null && event.reportformat.length > 0) || (event.isbulk != null && event.isbulk == true) || (event.customreporting != null)) ? 'hide' : '') + '" type="checkbox"/>' + (event.isbulk != null && event.isbulk == true ? '<div class="lds-dual-ring1 bulk-loader mr-10"></div>' : '') + '<sf-i-elastic-text class="stream-event-title' + (event.isbulk == null || event.isbulk == false ? ' button-event-title' : '') + '" id="stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + itemNumber + '-' + ((event.module ?? false) ? event.module : 'compliance') + '" text="' + event['obligationtitle'] + '" minLength="' + (event.reporters != null ? "100" : "60") + '"></sf-i-elastic-text>' + event.reporters != null ? ('') : ('<div part="stream-event-location" class="stream-event-location ml-5">' + event.locationname.replace(/ *\([^)]*\) */g, "") + '</div><div part="stream-event-risk-' + event.risk[0].toLowerCase().replace(/ /g, '-') + '" class="stream-event-risk ml-5">' + event.risk[0] + '</div>') + (((event.reportformat != null && event.reportformat.length > 0) || (event.customreporting != null)) ? '' : ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + itemNumber + '" part="button-list-reporting" class="material-icons ml-10 button-list-reporting">edit_note</button>')) + ((event.reporters != null && lastUpdated.length > 0) ? (' <div part="event-last-updated-time" class="d-flex align-center">' + lastUpdated + '</div>') : "") + '</div>';
|
|
4741
4741
|
if (event.reporters != null && remarks.length > 0) {
|
|
4742
4742
|
html += '<div part="stream-events-event-subtitle" class="stream-events-event-subtitle">' + remarks + ', occurred on ' + occurrenceDate + '</div>';
|
|
4743
4743
|
}
|
|
@@ -5060,7 +5060,7 @@ export class SfIEvents extends LitElement {
|
|
|
5060
5060
|
|
|
5061
5061
|
let graphParam = this.getGraphParam(event);
|
|
5062
5062
|
// console.log("graphParam", graphParam.split(';')[0]);
|
|
5063
|
-
html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.reporters != null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + (event.reporters != null ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + '</div>';
|
|
5063
|
+
html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.reporters != null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + ((event.reporters != null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null))) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + '</div>';
|
|
5064
5064
|
// }
|
|
5065
5065
|
|
|
5066
5066
|
return html;
|
|
@@ -5143,7 +5143,7 @@ export class SfIEvents extends LitElement {
|
|
|
5143
5143
|
|
|
5144
5144
|
partStatus = this.getCompletenessStatus(JSON.parse(JSON.stringify(this.events[mmdd][j])));
|
|
5145
5145
|
lateStatus = this.getTimelinessStatus(mmdd, JSON.parse(JSON.stringify(this.events[mmdd][j])), partStatus);
|
|
5146
|
-
complianceStatus = this.getComplianceStatus(partStatus, lateStatus, JSON.parse(JSON.stringify(this.events[mmdd][j])).percentage, JSON.parse(JSON.stringify(this.events[mmdd][j]))
|
|
5146
|
+
complianceStatus = this.getComplianceStatus(partStatus, lateStatus, JSON.parse(JSON.stringify(this.events[mmdd][j])).percentage, JSON.parse(JSON.stringify(this.events[mmdd][j])));
|
|
5147
5147
|
console.log("agreement partStatus", partStatus, lateStatus, complianceStatus);
|
|
5148
5148
|
if (this.flowGraph == this.FLOW_GRAPH_TIMELINESS) {
|
|
5149
5149
|
bgStatus += lateStatus
|
|
@@ -5637,10 +5637,12 @@ export class SfIEvents extends LitElement {
|
|
|
5637
5637
|
html += '<div class="d-flex m-20 flex-col">';
|
|
5638
5638
|
html += '<label part="input-label">Approver Comments*</label>';
|
|
5639
5639
|
html += '<input id="input-approver-comments" type="text" part="input" value=""/><br />';
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5640
|
+
if (event.module != 'agreement') {
|
|
5641
|
+
html += '<label part="input-label">Date of Completion*</label>';
|
|
5642
|
+
html += '<input id="input-approver-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" disabled/><br />';
|
|
5643
|
+
html += '<label part="input-label">Percentage</label>';
|
|
5644
|
+
html += '<input id="input-reporter-percentage" part="input" type="number" max="100" min="0" step="1" value="' + percentage + '" disabled/><br />';
|
|
5645
|
+
}
|
|
5644
5646
|
html += '<div>'
|
|
5645
5647
|
html += '<label part="input-label">Approve?*</label><br />';
|
|
5646
5648
|
html += '<div class="mt-5">'
|
|
@@ -5696,24 +5698,28 @@ export class SfIEvents extends LitElement {
|
|
|
5696
5698
|
html += '<div class="d-flex m-20 flex-col">';
|
|
5697
5699
|
html += '<label part="input-label">Reporter Comments*</label>';
|
|
5698
5700
|
html += '<input id="input-reporter-comments" type="text" part="input" value=""/><br />';
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5701
|
+
if (event.module != 'agreement') {
|
|
5702
|
+
html += '<label part="input-label">Date of Completion*</label>';
|
|
5703
|
+
html += '<input id="input-reporter-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" max="' + (new Date().toISOString().substring(0, 10)) + '"/><br />';
|
|
5704
|
+
html += '<label part="input-label">Completion Percentage*</label>';
|
|
5705
|
+
html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1"/><br />';
|
|
5706
|
+
html += '<div part="input-reporter-percentage-message" class="input-reporter-percentage-message mb-20">For reporting full non-compliance, choose 0%. For reporting compliance with gaps, choose the appropriate % value.</div><br />'
|
|
5707
|
+
}
|
|
5704
5708
|
// if(docsOptional.length === 0) {
|
|
5705
5709
|
html += '<label part="input-label">Supporting Documents' + ((docsOptional.length > 0) ? '' : '*') + '</label>';
|
|
5706
5710
|
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5711
|
+
if (event.module != 'agreement') {
|
|
5712
|
+
html += '<slot name="uploader"></slot>';
|
|
5713
|
+
if (uploadGuidance == 1) {
|
|
5714
|
+
html += '<div id="upload-guidance-button" part="upload-guidance-button" class="d-flex button-icon-small align-center align-self-start mt-10"><span class="material-symbols-outlined">help</span> <span>Get Help</span></div>'
|
|
5715
|
+
} else if (uploadGuidance != 0) {
|
|
5716
|
+
html += '<div part="upload-guidance-content">'
|
|
5717
|
+
html += '<div part="detail-head" class="mb-5"><strong>Upload Guidance</strong></div>'
|
|
5718
|
+
html += '<sf-i-elastic-text text="' + (event['uploadguidance'] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="150"></sf-i-elastic-text>';
|
|
5719
|
+
html += '</div>'
|
|
5720
|
+
}
|
|
5721
|
+
html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>'
|
|
5715
5722
|
}
|
|
5716
|
-
html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>'
|
|
5717
5723
|
// }
|
|
5718
5724
|
html += '<br />';
|
|
5719
5725
|
if (event['reportformat'] != null && event['reportformat'].length > 0) {
|
|
@@ -5750,11 +5756,13 @@ export class SfIEvents extends LitElement {
|
|
|
5750
5756
|
html += '<div class="d-flex m-20 flex-col">';
|
|
5751
5757
|
html += '<label part="input-label">Auditor Comments</label>';
|
|
5752
5758
|
html += '<input id="input-auditor-comments" type="text" part="input" value=""/><br />';
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5759
|
+
if (event.module != 'agreement') {
|
|
5760
|
+
html += '<label part="input-label">Date of Completion</label>';
|
|
5761
|
+
html += '<input id="input-auditor-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" max="' + (new Date().toISOString().substring(0, 10)) + '" readonly/><br />';
|
|
5762
|
+
html += '<label part="input-label">Percentage</label>';
|
|
5763
|
+
html += '<input id="input-reporter-percentage" part="input" type="number" max="100" min="0" step="1" value="' + percentage + '" disabled/><br />';
|
|
5764
|
+
html += '<div part="input-reporter-percentage-message" class="input-reporter-percentage-message mb-20">For reporting full non-compliance, choose 0%. For reporting compliance with gaps, choose the appropriate % value.</div><br />'
|
|
5765
|
+
}
|
|
5758
5766
|
html += '<div>'
|
|
5759
5767
|
html += '<label part="input-label">Approve?</label><br />';
|
|
5760
5768
|
html += '<div class="mt-5">'
|
|
@@ -6625,7 +6633,14 @@ export class SfIEvents extends LitElement {
|
|
|
6625
6633
|
filterButton.innerHTML = (filterList.style.display != 'block' ? 'category' : 'close')
|
|
6626
6634
|
const filterSubmitButton = filterList.querySelector('#button-submit-features') as HTMLButtonElement
|
|
6627
6635
|
filterSubmitButton.addEventListener('click', () => {
|
|
6628
|
-
this.
|
|
6636
|
+
this.enableCustom();
|
|
6637
|
+
this.renderTabs(this.selectedTab);
|
|
6638
|
+
// this.processDateSelection(eventsContainer);
|
|
6639
|
+
if (this.myRole == this.TAB_VIEWER) {
|
|
6640
|
+
this.renderCustomViewer()
|
|
6641
|
+
} else {
|
|
6642
|
+
this.renderCustom();
|
|
6643
|
+
}
|
|
6629
6644
|
})
|
|
6630
6645
|
// const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
|
|
6631
6646
|
// selectFeatureAll.addEventListener('click',async(ev: any) => {
|
|
@@ -7408,6 +7423,7 @@ export class SfIEvents extends LitElement {
|
|
|
7408
7423
|
filterButton.innerHTML = (filterList.style.display != 'block' ? 'category' : 'close')
|
|
7409
7424
|
const filterSubmitButton = filterList.querySelector('#button-submit-features') as HTMLButtonElement
|
|
7410
7425
|
filterSubmitButton.addEventListener('click', () => {
|
|
7426
|
+
this.renderTabs(this.selectedTab)
|
|
7411
7427
|
this.processDateSelectionViewer(eventsContainer);
|
|
7412
7428
|
})
|
|
7413
7429
|
// const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
|
|
@@ -10199,8 +10215,23 @@ export class SfIEvents extends LitElement {
|
|
|
10199
10215
|
(this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-year')?.addEventListener('click', () => {
|
|
10200
10216
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
10201
10217
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
10202
|
-
|
|
10203
|
-
|
|
10218
|
+
let year = parseInt(this.calendarStartYYYY);
|
|
10219
|
+
let month = parseInt(this.calendarStartMM) - 1;
|
|
10220
|
+
|
|
10221
|
+
if (month === 0) {
|
|
10222
|
+
month = 12;
|
|
10223
|
+
year -= 1;
|
|
10224
|
+
}
|
|
10225
|
+
|
|
10226
|
+
// Pad month
|
|
10227
|
+
const monthStr = month < 10 ? '0' + month : '' + month;
|
|
10228
|
+
|
|
10229
|
+
// Determine last day of month (safe)
|
|
10230
|
+
const lastDay = new Date(year, month, 0).getDate(); // day 0 of next month gives last day of `month`
|
|
10231
|
+
const dayStr = lastDay < 10 ? '0' + lastDay : '' + lastDay;
|
|
10232
|
+
const finalDate = `${year + 1}-${monthStr}-${dayStr}`;
|
|
10233
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = finalDate;
|
|
10234
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = finalDate;
|
|
10204
10235
|
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
10205
10236
|
});
|
|
10206
10237
|
|
|
@@ -10271,7 +10302,9 @@ export class SfIEvents extends LitElement {
|
|
|
10271
10302
|
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
10272
10303
|
});
|
|
10273
10304
|
|
|
10274
|
-
|
|
10305
|
+
if (this.selectedFeatures.indexOf('agreements') >= 0) {
|
|
10306
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-year') as HTMLButtonElement).click();
|
|
10307
|
+
}
|
|
10275
10308
|
// for(var i = 0; i < 3; i++) {
|
|
10276
10309
|
// (this._SfCustomContainer as HTMLDivElement).querySelector('#stream-month-' + i)?.addEventListener('click', (ev: any)=> {
|
|
10277
10310
|
// const target = parseInt((ev.target as HTMLDivElement).id.split('-')[2]);
|
|
@@ -11192,11 +11225,26 @@ export class SfIEvents extends LitElement {
|
|
|
11192
11225
|
console.log('dateresult', dateResult, index);
|
|
11193
11226
|
console.log('selectedfeatures', this.selectedFeatures);
|
|
11194
11227
|
this.currentColumnIndex = index + "";
|
|
11195
|
-
|
|
11196
|
-
|
|
11228
|
+
|
|
11229
|
+
if (this.selectedFeatures.indexOf('agreements') >= 0) {
|
|
11230
|
+
|
|
11231
|
+
this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
|
|
11232
|
+
this.enableCustom();
|
|
11233
|
+
this.renderTabs(this.TAB_CUSTOM);
|
|
11234
|
+
console.log('stats clicked');
|
|
11235
|
+
if (this.myRole == this.TAB_VIEWER) {
|
|
11236
|
+
this.renderCustomViewer()
|
|
11237
|
+
} else {
|
|
11238
|
+
this.renderCustom();
|
|
11239
|
+
}
|
|
11240
|
+
} else {
|
|
11241
|
+
if (dateResult != null) {
|
|
11242
|
+
await this.renderWithFeatures(dateResult.startDate, dateResult.endDate, "", "no", ("0" + monthResult).slice(-2));
|
|
11243
|
+
}
|
|
11244
|
+
this.renderTabs(this.TAB_STREAM);
|
|
11245
|
+
this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
|
|
11246
|
+
this.renderStream(index, showGraph, showBackgroundButton);
|
|
11197
11247
|
}
|
|
11198
|
-
this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
|
|
11199
|
-
this.renderStream(index, showGraph, showBackgroundButton);
|
|
11200
11248
|
})
|
|
11201
11249
|
// const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
|
|
11202
11250
|
// selectFeatureAll?.addEventListener('click',async(ev: any) => {
|
|
@@ -13623,7 +13671,8 @@ export class SfIEvents extends LitElement {
|
|
|
13623
13671
|
let docs = listEvent['documents'] == null ? [] : listEvent['documents'] == null ? [] : (listEvent['documents']);
|
|
13624
13672
|
let approved = listEvent['approved'] == null ? false : listEvent['approved'] == null ? false : listEvent['approved'];
|
|
13625
13673
|
let makercheckers = listEvent['makercheckers'] == null ? [] : listEvent['makercheckers'] == null ? [] : listEvent['makercheckers'];
|
|
13626
|
-
let docsOptional = listEvent['docs'] == null ? [] : listEvent['docs'] == null ? [] : listEvent['docs'];
|
|
13674
|
+
// let docsOptional = listEvent['docs'] == null ? [] : listEvent['docs'] == null ? [] : listEvent['docs'];
|
|
13675
|
+
let html: string = '';
|
|
13627
13676
|
let documentType = listEvent['documenttype'] == null ? null : listEvent['documenttype'][0] == null ? null : listEvent['documenttype'][0].split(" ")[0];
|
|
13628
13677
|
html += `
|
|
13629
13678
|
<div part="compliance-detail-title" class="d-flex justify-between">
|
|
@@ -13833,11 +13882,10 @@ export class SfIEvents extends LitElement {
|
|
|
13833
13882
|
await this.renewAgreement(listEvent, reportformatvalues);
|
|
13834
13883
|
} else {
|
|
13835
13884
|
console.log('renew reporting', reportformatvalues)
|
|
13836
|
-
return;
|
|
13837
13885
|
}
|
|
13838
13886
|
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
13839
13887
|
if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
13840
|
-
|
|
13888
|
+
this.events[mmdd][p].approved = approved
|
|
13841
13889
|
this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
|
|
13842
13890
|
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
13843
13891
|
}
|
|
@@ -14090,13 +14138,14 @@ export class SfIEvents extends LitElement {
|
|
|
14090
14138
|
|
|
14091
14139
|
//console.log('reporter comments 1', reportercomments);
|
|
14092
14140
|
|
|
14093
|
-
const reporterdoc = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-doc') as HTMLInputElement).value.length > 0 ? (new Date(((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-doc') as HTMLInputElement).value).getTime() + "") : "";
|
|
14141
|
+
// const reporterdoc = ((((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-doc') as HTMLInputElement) != null) && ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-doc') as HTMLInputElement).value.length > 0) ? (new Date(((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-doc') as HTMLInputElement).value).getTime() + "") : "";
|
|
14142
|
+
const reporterdoc = new Date().getTime() + "";
|
|
14094
14143
|
let docs: any[] = [];
|
|
14095
14144
|
|
|
14096
14145
|
//console.log('reporter comments 2', reportercomments);
|
|
14097
14146
|
|
|
14098
14147
|
// if(docsOptional.length === 0) {
|
|
14099
|
-
docs = (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.selectedValues();
|
|
14148
|
+
// docs = (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.selectedValues();
|
|
14100
14149
|
// }
|
|
14101
14150
|
|
|
14102
14151
|
//console.log('docs', docs);
|
|
@@ -14104,6 +14153,7 @@ export class SfIEvents extends LitElement {
|
|
|
14104
14153
|
let reportformatschema: string = "";
|
|
14105
14154
|
if (listEvent.customreporting != null) {
|
|
14106
14155
|
let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
|
|
14156
|
+
console.log('reportformatvalues', JSON.stringify(reportingReporting.selectedValues()))
|
|
14107
14157
|
reportformatvalues = JSON.stringify(reportingReporting!.selectedValues()) ?? "";
|
|
14108
14158
|
reportformatschema = reportingReporting!.configjson ?? "";
|
|
14109
14159
|
}
|
|
@@ -14112,228 +14162,228 @@ export class SfIEvents extends LitElement {
|
|
|
14112
14162
|
if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement) != null) {
|
|
14113
14163
|
percentage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement).value
|
|
14114
14164
|
}
|
|
14115
|
-
if (Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
|
|
14165
|
+
// if (Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
|
|
14116
14166
|
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
|
|
14120
|
-
|
|
14121
|
-
|
|
14122
|
-
|
|
14167
|
+
// //console.log('reporter comments 3', reportercomments);
|
|
14168
|
+
// buttonClick.innerHTML = "Save"
|
|
14169
|
+
// this.setError('Invalid Percentage!');
|
|
14170
|
+
// setTimeout(() => {
|
|
14171
|
+
// this.clearMessages();
|
|
14172
|
+
// }, 3000);
|
|
14123
14173
|
|
|
14124
|
-
} else {
|
|
14125
|
-
|
|
14174
|
+
// } else {
|
|
14175
|
+
// if (docs.length === 0 && docsOptional.length === 0) {
|
|
14126
14176
|
|
|
14127
|
-
|
|
14128
|
-
|
|
14129
|
-
|
|
14130
|
-
|
|
14131
|
-
|
|
14132
|
-
|
|
14177
|
+
// //console.log('reporter comments 3', reportercomments);
|
|
14178
|
+
// buttonClick.innerHTML = "Save"
|
|
14179
|
+
// this.setError('No documents uploaded!');
|
|
14180
|
+
// setTimeout(() => {
|
|
14181
|
+
// this.clearMessages();
|
|
14182
|
+
// }, 3000);
|
|
14133
14183
|
|
|
14134
|
-
|
|
14184
|
+
// } else {
|
|
14135
14185
|
|
|
14136
|
-
|
|
14186
|
+
// //console.log('reporterdoc', reporterdoc);
|
|
14137
14187
|
|
|
14138
|
-
|
|
14139
|
-
|
|
14140
|
-
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
14188
|
+
// if (reporterdoc.length === 0) {
|
|
14189
|
+
// buttonClick.innerHTML = "Save"
|
|
14190
|
+
// this.setError('Date of completion not selected!');
|
|
14191
|
+
// setTimeout(() => {
|
|
14192
|
+
// this.clearMessages();
|
|
14193
|
+
// }, 3000);
|
|
14144
14194
|
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14195
|
+
// } else if (parseInt(reporterdoc) > new Date().getTime()) {
|
|
14196
|
+
// buttonClick.innerHTML = "Save"
|
|
14197
|
+
// this.setError('Date of completion cannot be in future!');
|
|
14198
|
+
// setTimeout(() => {
|
|
14199
|
+
// this.clearMessages();
|
|
14200
|
+
// }, 3000);
|
|
14151
14201
|
|
|
14152
|
-
|
|
14202
|
+
// } else {
|
|
14153
14203
|
|
|
14154
|
-
|
|
14204
|
+
//console.log('makerscheckers 1', reportercomments);
|
|
14155
14205
|
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14163
|
-
} else {
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
var clickEvent = new MouseEvent("click", {
|
|
14167
|
-
"view": window,
|
|
14168
|
-
"bubbles": true,
|
|
14169
|
-
"cancelable": false
|
|
14170
|
-
});
|
|
14171
|
-
|
|
14172
|
-
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
|
|
14173
|
-
let flagBulk = false;
|
|
14174
|
-
if (this.selectedItemIds.length <= 1) {
|
|
14175
|
-
|
|
14176
|
-
if (await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, listEvent.module, percentage, makercheckers)) {
|
|
14177
|
-
console.log('this.events', this.events);
|
|
14178
|
-
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
14179
|
-
if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
14180
|
-
this.events[mmdd][p].documents = docs
|
|
14181
|
-
this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() })
|
|
14182
|
-
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
14183
|
-
}
|
|
14184
|
-
}
|
|
14185
|
-
console.log('uploadReport single')
|
|
14186
|
-
if (makercheckers.length > 0) {
|
|
14187
|
-
|
|
14188
|
-
// await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
|
|
14189
|
-
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
14190
|
-
if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
14191
|
-
this.events[mmdd][p].approved = true
|
|
14192
|
-
// this.events[mmdd][p].documents = docs
|
|
14193
|
-
this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() })
|
|
14194
|
-
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
14195
|
-
}
|
|
14196
|
-
}
|
|
14197
|
-
await this.renewAgreement(listEvent, reportformatvalues);
|
|
14198
|
-
console.log('upload report auto approve single')
|
|
14199
|
-
}
|
|
14200
|
-
if (this.recentlyReported[mmdd] == null) {
|
|
14201
|
-
this.recentlyReported[mmdd] = []
|
|
14202
|
-
}
|
|
14203
|
-
this.recentlyReported[mmdd].push(listEvent)
|
|
14204
|
-
}
|
|
14205
|
-
} else {
|
|
14206
|
-
let bulkBody = []
|
|
14207
|
-
let bulkBodyReview = []
|
|
14208
|
-
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
14209
|
-
|
|
14210
|
-
const selectedId = this.selectedItemIds[k];
|
|
14211
|
-
//console.log('selectedid', selectedId);
|
|
14212
|
-
|
|
14213
|
-
const makercheckersL = selectedId.split('-')[5];
|
|
14214
|
-
entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
14215
|
-
locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
14216
|
-
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
14217
|
-
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
14218
|
-
|
|
14219
|
-
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
14220
|
-
|
|
14221
|
-
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
14222
|
-
// if(parseInt(makercheckersL) > 0) {
|
|
14223
|
-
// bulkBodyReview.push({
|
|
14224
|
-
// "mmddyyyy": mmddyyyy,
|
|
14225
|
-
// "projectid": this.projectId,
|
|
14226
|
-
// "type": "report",
|
|
14227
|
-
// "eventid": eventId,
|
|
14228
|
-
// "comments": reportercomments,
|
|
14229
|
-
// "dateofcompletion": reporterdoc,
|
|
14230
|
-
// "percentage": percentage,
|
|
14231
|
-
// "entityid": entityId,
|
|
14232
|
-
// "locationid": locationId,
|
|
14233
|
-
// "event": null,
|
|
14234
|
-
// "docs": JSON.stringify(docs),
|
|
14235
|
-
// "approved": true,
|
|
14236
|
-
// "username": this.userName,
|
|
14237
|
-
// "reportformatvalues": reportformatvalues,
|
|
14238
|
-
// "reportformatschema": reportformatschema,
|
|
14239
|
-
// "userid": this.userProfileId,
|
|
14240
|
-
// "userrole": this.myRole,
|
|
14241
|
-
// "year": this.calendarStartYYYY,
|
|
14242
|
-
// "module": listEvent.module ?? "events"
|
|
14243
|
-
// } )
|
|
14244
|
-
// // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
14206
|
+
if (reportercomments.trim().length === 0) {
|
|
14207
|
+
buttonClick.innerHTML = "Save"
|
|
14208
|
+
this.setError('Comments cannot be blank!');
|
|
14209
|
+
setTimeout(() => {
|
|
14210
|
+
this.clearMessages();
|
|
14211
|
+
}, 3000);
|
|
14245
14212
|
|
|
14246
|
-
|
|
14247
|
-
bulkBody.push({
|
|
14248
|
-
"mmddyyyy": mmddyyyy,
|
|
14249
|
-
"projectid": this.projectId,
|
|
14250
|
-
"type": "report",
|
|
14251
|
-
"eventid": eventId,
|
|
14252
|
-
"comments": reportercomments,
|
|
14253
|
-
"dateofcompletion": reporterdoc,
|
|
14254
|
-
"percentage": percentage,
|
|
14255
|
-
"entityid": entityId,
|
|
14256
|
-
"locationid": locationId,
|
|
14257
|
-
"event": null,
|
|
14258
|
-
"docs": JSON.stringify(docs),
|
|
14259
|
-
"username": this.userName,
|
|
14260
|
-
"reportformatvalues": reportformatvalues,
|
|
14261
|
-
"reportformatschema": reportformatschema,
|
|
14262
|
-
"userid": this.userProfileId,
|
|
14263
|
-
"userrole": this.myRole,
|
|
14264
|
-
"year": this.calendarStartYYYY,
|
|
14265
|
-
"module": listEvent.module ?? "events",
|
|
14266
|
-
"makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
|
|
14267
|
-
})
|
|
14268
|
-
// }
|
|
14213
|
+
} else {
|
|
14269
14214
|
|
|
14270
|
-
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
14271
|
-
// await this.sleep(2000);
|
|
14272
|
-
// this.clearMessages();
|
|
14273
14215
|
|
|
14274
|
-
|
|
14216
|
+
var clickEvent = new MouseEvent("click", {
|
|
14217
|
+
"view": window,
|
|
14218
|
+
"bubbles": true,
|
|
14219
|
+
"cancelable": false
|
|
14220
|
+
});
|
|
14275
14221
|
|
|
14276
|
-
|
|
14277
|
-
|
|
14278
|
-
|
|
14279
|
-
|
|
14222
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
|
|
14223
|
+
let flagBulk = false;
|
|
14224
|
+
if (this.selectedItemIds.length <= 1) {
|
|
14225
|
+
|
|
14226
|
+
if (await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, listEvent.module, percentage, makercheckers)) {
|
|
14227
|
+
console.log('this.events', this.events);
|
|
14228
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
14229
|
+
if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
14230
|
+
this.events[mmdd][p].documents = docs
|
|
14231
|
+
this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() })
|
|
14232
|
+
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
14233
|
+
}
|
|
14234
|
+
}
|
|
14235
|
+
console.log('uploadReport single')
|
|
14236
|
+
if (makercheckers.length > 0) {
|
|
14237
|
+
|
|
14238
|
+
// await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
|
|
14239
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
14240
|
+
if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
14241
|
+
this.events[mmdd][p].approved = true
|
|
14242
|
+
// this.events[mmdd][p].documents = docs
|
|
14243
|
+
this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() })
|
|
14244
|
+
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
14280
14245
|
}
|
|
14246
|
+
}
|
|
14247
|
+
await this.renewAgreement(listEvent, reportformatvalues);
|
|
14248
|
+
console.log('upload report auto approve single')
|
|
14249
|
+
}
|
|
14250
|
+
if (this.recentlyReported[mmdd] == null) {
|
|
14251
|
+
this.recentlyReported[mmdd] = []
|
|
14252
|
+
}
|
|
14253
|
+
this.recentlyReported[mmdd].push(listEvent)
|
|
14254
|
+
}
|
|
14255
|
+
} else {
|
|
14256
|
+
let bulkBody = []
|
|
14257
|
+
let bulkBodyReview = []
|
|
14258
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
14259
|
+
|
|
14260
|
+
const selectedId = this.selectedItemIds[k];
|
|
14261
|
+
//console.log('selectedid', selectedId);
|
|
14262
|
+
|
|
14263
|
+
const makercheckersL = selectedId.split('-')[5];
|
|
14264
|
+
entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
14265
|
+
locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
14266
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
14267
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
14268
|
+
|
|
14269
|
+
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
14270
|
+
|
|
14271
|
+
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
14272
|
+
// if(parseInt(makercheckersL) > 0) {
|
|
14273
|
+
// bulkBodyReview.push({
|
|
14274
|
+
// "mmddyyyy": mmddyyyy,
|
|
14275
|
+
// "projectid": this.projectId,
|
|
14276
|
+
// "type": "report",
|
|
14277
|
+
// "eventid": eventId,
|
|
14278
|
+
// "comments": reportercomments,
|
|
14279
|
+
// "dateofcompletion": reporterdoc,
|
|
14280
|
+
// "percentage": percentage,
|
|
14281
|
+
// "entityid": entityId,
|
|
14282
|
+
// "locationid": locationId,
|
|
14283
|
+
// "event": null,
|
|
14284
|
+
// "docs": JSON.stringify(docs),
|
|
14285
|
+
// "approved": true,
|
|
14286
|
+
// "username": this.userName,
|
|
14287
|
+
// "reportformatvalues": reportformatvalues,
|
|
14288
|
+
// "reportformatschema": reportformatschema,
|
|
14289
|
+
// "userid": this.userProfileId,
|
|
14290
|
+
// "userrole": this.myRole,
|
|
14291
|
+
// "year": this.calendarStartYYYY,
|
|
14292
|
+
// "module": listEvent.module ?? "events"
|
|
14293
|
+
// } )
|
|
14294
|
+
// // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
14295
|
+
|
|
14296
|
+
// }else{
|
|
14297
|
+
bulkBody.push({
|
|
14298
|
+
"mmddyyyy": mmddyyyy,
|
|
14299
|
+
"projectid": this.projectId,
|
|
14300
|
+
"type": "report",
|
|
14301
|
+
"eventid": eventId,
|
|
14302
|
+
"comments": reportercomments,
|
|
14303
|
+
"dateofcompletion": reporterdoc,
|
|
14304
|
+
"percentage": percentage,
|
|
14305
|
+
"entityid": entityId,
|
|
14306
|
+
"locationid": locationId,
|
|
14307
|
+
"event": null,
|
|
14308
|
+
"docs": JSON.stringify(docs),
|
|
14309
|
+
"username": this.userName,
|
|
14310
|
+
"reportformatvalues": reportformatvalues,
|
|
14311
|
+
"reportformatschema": reportformatschema,
|
|
14312
|
+
"userid": this.userProfileId,
|
|
14313
|
+
"userrole": this.myRole,
|
|
14314
|
+
"year": this.calendarStartYYYY,
|
|
14315
|
+
"module": listEvent.module ?? "events",
|
|
14316
|
+
"makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
|
|
14317
|
+
})
|
|
14318
|
+
// }
|
|
14319
|
+
|
|
14320
|
+
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
14321
|
+
// await this.sleep(2000);
|
|
14322
|
+
// this.clearMessages();
|
|
14281
14323
|
|
|
14282
|
-
|
|
14283
|
-
// await this.uploadReportsReviewsBulk(bulkBodyReview)
|
|
14284
|
-
// }
|
|
14285
|
-
await this.fetchBulkReportingData();
|
|
14286
|
-
console.log('uploadReport bulk')
|
|
14287
|
-
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
14288
|
-
|
|
14289
|
-
const selectedId = this.selectedItemIds[k];
|
|
14290
|
-
//console.log('selectedid', selectedId);
|
|
14291
|
-
let entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
14292
|
-
let locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
14293
|
-
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
14294
|
-
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
14295
|
-
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
14296
|
-
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
14297
|
-
if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
14298
|
-
|
|
14299
|
-
this.events[mmdd][p].isbulk = true
|
|
14300
|
-
flagBulk = true;
|
|
14301
|
-
if (this.recentlyReported[mmdd] == null) {
|
|
14302
|
-
this.recentlyReported[mmdd] = []
|
|
14303
|
-
}
|
|
14304
|
-
this.recentlyReported[mmdd].push(this.events[mmdd][p])
|
|
14305
|
-
}
|
|
14306
|
-
}
|
|
14307
|
-
}
|
|
14324
|
+
}
|
|
14308
14325
|
|
|
14309
|
-
|
|
14326
|
+
// await this.uploadReportsBulk(bulkBody);
|
|
14327
|
+
// await this.fetchBulkReportingData();
|
|
14328
|
+
if (bulkBody.length > 0) {
|
|
14329
|
+
await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
|
|
14330
|
+
}
|
|
14310
14331
|
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
|
|
14321
|
-
|
|
14322
|
-
|
|
14323
|
-
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14332
|
+
// if(bulkBodyReview.length > 0){
|
|
14333
|
+
// await this.uploadReportsReviewsBulk(bulkBodyReview)
|
|
14334
|
+
// }
|
|
14335
|
+
await this.fetchBulkReportingData();
|
|
14336
|
+
console.log('uploadReport bulk')
|
|
14337
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
14338
|
+
|
|
14339
|
+
const selectedId = this.selectedItemIds[k];
|
|
14340
|
+
//console.log('selectedid', selectedId);
|
|
14341
|
+
let entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
14342
|
+
let locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
14343
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
14344
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
14345
|
+
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
14346
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
14347
|
+
if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
14348
|
+
|
|
14349
|
+
this.events[mmdd][p].isbulk = true
|
|
14350
|
+
flagBulk = true;
|
|
14351
|
+
if (this.recentlyReported[mmdd] == null) {
|
|
14352
|
+
this.recentlyReported[mmdd] = []
|
|
14328
14353
|
}
|
|
14354
|
+
this.recentlyReported[mmdd].push(this.events[mmdd][p])
|
|
14329
14355
|
}
|
|
14330
|
-
|
|
14331
14356
|
}
|
|
14357
|
+
}
|
|
14332
14358
|
|
|
14359
|
+
}
|
|
14333
14360
|
|
|
14361
|
+
if (this.mode == "next") {
|
|
14362
|
+
this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
|
|
14363
|
+
} else {
|
|
14364
|
+
// if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
14365
|
+
// this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
14366
|
+
// } else
|
|
14367
|
+
if (this.getCurrentTab() == this.TAB_FIND) {
|
|
14368
|
+
const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
|
|
14369
|
+
this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
|
|
14370
|
+
} else {
|
|
14371
|
+
if (this.selectedItemIds.length > 0) {
|
|
14372
|
+
await this.fetchBulkReportingData();
|
|
14373
|
+
}
|
|
14374
|
+
this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk)
|
|
14375
|
+
// if(currentColumnButton != null) {
|
|
14376
|
+
// currentColumnButton.click();
|
|
14377
|
+
// }
|
|
14334
14378
|
}
|
|
14335
14379
|
}
|
|
14380
|
+
|
|
14336
14381
|
}
|
|
14382
|
+
|
|
14383
|
+
|
|
14384
|
+
// }
|
|
14385
|
+
// }
|
|
14386
|
+
// }
|
|
14337
14387
|
});
|
|
14338
14388
|
|
|
14339
14389
|
}
|
|
@@ -22245,7 +22295,7 @@ export class SfIEvents extends LitElement {
|
|
|
22245
22295
|
buttonListReporting[i].style.display = 'block';
|
|
22246
22296
|
}
|
|
22247
22297
|
}
|
|
22248
|
-
if (buttonSelect[i] != null && buttonSelect[i].id.indexOf('-bulk') < 0) buttonSelect[i].style.display = "flex"
|
|
22298
|
+
if (buttonSelect[i] != null && buttonSelect[i].id.indexOf('-bulk') < 0 && buttonSelect[i].id.indexOf('-reportformat') < 0) buttonSelect[i].style.display = "flex"
|
|
22249
22299
|
if (eventTitles[i] != null) (eventTitles[i]).style.display = 'flex';
|
|
22250
22300
|
divs[i].style.display = 'block'
|
|
22251
22301
|
} else {
|
|
@@ -22556,12 +22606,14 @@ export class SfIEvents extends LitElement {
|
|
|
22556
22606
|
|
|
22557
22607
|
html += '<button class="tab-button mb-10" id="calendar-tab-month" part="' + (selectedTab == this.TAB_STREAM ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Month</button>';
|
|
22558
22608
|
html += '<button class="tab-button mb-10" id="calendar-tab-custom" part="' + (selectedTab == this.TAB_CUSTOM ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">' + (this.myRole == this.TAB_VIEWER ? "Statistics" : "Range") + '</button>';
|
|
22559
|
-
|
|
22560
|
-
|
|
22561
|
-
|
|
22562
|
-
|
|
22563
|
-
|
|
22564
|
-
|
|
22609
|
+
if (this.selectedFeatures.indexOf('agreements') < 0) {
|
|
22610
|
+
html += '<button class="tab-button mb-10" id="calendar-tab-register" part="' + (selectedTab == this.TAB_REGISTERS ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Registers</button>';
|
|
22611
|
+
html += '<button class="tab-button tab-button-secondary mb-10 ' + (selectedTab == this.TAB_FIND ? '' : 'hide') + '" id="calendar-tab-find" part="' + (selectedTab == this.TAB_FIND ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Search</button>';
|
|
22612
|
+
html += '<button class="tab-button tab-button-secondary mb-10 ' + (selectedTab == this.TAB_THIS ? '' : 'hide') + '" id="calendar-tab-this" part="' + (selectedTab == this.TAB_THIS ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Current</button>';
|
|
22613
|
+
html += '<button class="tab-button tab-button-secondary mb-10 ' + (selectedTab == this.TAB_YEAR ? '' : 'hide') + '" id="calendar-tab-year" part="' + (selectedTab == this.TAB_YEAR ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Overview</button>';
|
|
22614
|
+
html += '<button class="tab-button tab-button-secondary mb-10 ' + (selectedTab == this.TAB_ADHOC ? '' : 'hide') + '" id="calendar-tab-adhoc" part="' + (selectedTab == this.TAB_ADHOC ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Adhoc</button>';
|
|
22615
|
+
html += '<button class="tab-button mb-10" id="calendar-tab-next" part="calendar-tab-button-not-selected"><span class="material-symbols-outlined">arrow_forward_ios</span></button>';
|
|
22616
|
+
}
|
|
22565
22617
|
|
|
22566
22618
|
|
|
22567
22619
|
// html += '<button class="tab-button mb-10" id="calendar-tab-upcoming" part="'+(selectedTab == this.TAB_UPCOMING ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected')+'">Upcoming</button>';
|
|
@@ -23894,7 +23946,7 @@ export class SfIEvents extends LitElement {
|
|
|
23894
23946
|
"makercheckers": makercheckers
|
|
23895
23947
|
}
|
|
23896
23948
|
|
|
23897
|
-
|
|
23949
|
+
console.log(body);
|
|
23898
23950
|
let retValue = true;
|
|
23899
23951
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
23900
23952
|
const xhr: any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;
|
|
@@ -26671,7 +26723,7 @@ export class SfIEvents extends LitElement {
|
|
|
26671
26723
|
var complianceStatus = "";
|
|
26672
26724
|
partStatus = this.getCompletenessStatus(JSON.parse(JSON.stringify(eventsData[role][mmdd][j])));
|
|
26673
26725
|
lateStatus = this.getTimelinessStatus(mmdd, JSON.parse(JSON.stringify(eventsData[role][mmdd][j])), partStatus);
|
|
26674
|
-
complianceStatus = this.getComplianceStatus(partStatus, lateStatus, JSON.parse(JSON.stringify(eventsData[role][mmdd][j])).percentage, JSON.parse(JSON.stringify(eventsData[role][mmdd][j]))
|
|
26726
|
+
complianceStatus = this.getComplianceStatus(partStatus, lateStatus, JSON.parse(JSON.stringify(eventsData[role][mmdd][j])).percentage, JSON.parse(JSON.stringify(eventsData[role][mmdd][j])));
|
|
26675
26727
|
notStarted = notStarted + (partStatus == "not-started" ? 1 : 0);
|
|
26676
26728
|
pendingApproval = pendingApproval + (partStatus == "pending-approval" ? 1 : 0);
|
|
26677
26729
|
rejected = rejected + (partStatus == "rejected" ? 1 : 0);
|
|
@@ -27288,7 +27340,7 @@ export class SfIEvents extends LitElement {
|
|
|
27288
27340
|
partStatus = this.getCompletenessStatus(JSON.parse(JSON.stringify(eventsData[mmdd][j])));
|
|
27289
27341
|
if (partStatus != "not-started") { continue; }
|
|
27290
27342
|
lateStatus = this.getTimelinessStatus(mmdd, JSON.parse(JSON.stringify(eventsData[mmdd][j])), partStatus);
|
|
27291
|
-
complianceStatus = this.getComplianceStatus(partStatus, lateStatus, JSON.parse(JSON.stringify(eventsData[mmdd][j])).percentage, JSON.parse(JSON.stringify(eventsData[mmdd][j]))
|
|
27343
|
+
complianceStatus = this.getComplianceStatus(partStatus, lateStatus, JSON.parse(JSON.stringify(eventsData[mmdd][j])).percentage, JSON.parse(JSON.stringify(eventsData[mmdd][j])));
|
|
27292
27344
|
// notStarted = notStarted + (partStatus == "not-started" ? 1 : 0);
|
|
27293
27345
|
// pendingApproval = pendingApproval + (partStatus == "pending-approval" ? 1 : 0);
|
|
27294
27346
|
// rejected = rejected + (partStatus == "rejected" ? 1 : 0);
|