sf-i-events 1.0.816 → 1.0.818
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 +5 -5
- package/package.json +1 -1
- package/sf-i-events.d.ts +1 -1
- package/sf-i-events.js +263 -351
- package/src/sf-i-events.ts +239 -293
package/src/sf-i-events.ts
CHANGED
|
@@ -6052,7 +6052,7 @@ export class SfIEvents extends LitElement {
|
|
|
6052
6052
|
let flagBulk = false;
|
|
6053
6053
|
if(this.selectedItemIds.length == 0){
|
|
6054
6054
|
|
|
6055
|
-
await this.uploadReport(event.entityid, event.locationid, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage)
|
|
6055
|
+
await this.uploadReport(event.entityid, event.locationid, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage, event.makercheckers)
|
|
6056
6056
|
|
|
6057
6057
|
console.log('this.events', this.events);
|
|
6058
6058
|
if(this.mode != "next"){
|
|
@@ -6066,7 +6066,7 @@ export class SfIEvents extends LitElement {
|
|
|
6066
6066
|
|
|
6067
6067
|
if(event.makercheckers.length > 0) {
|
|
6068
6068
|
|
|
6069
|
-
await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
|
|
6069
|
+
// await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
|
|
6070
6070
|
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
6071
6071
|
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid){
|
|
6072
6072
|
this.events[mmdd][p].approved = true
|
|
@@ -6099,31 +6099,31 @@ export class SfIEvents extends LitElement {
|
|
|
6099
6099
|
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
6100
6100
|
|
|
6101
6101
|
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
6102
|
-
if(parseInt(makercheckersL) > 0) {
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
}else{
|
|
6102
|
+
// if(parseInt(makercheckersL) > 0) {
|
|
6103
|
+
// bulkBodyReview.push({
|
|
6104
|
+
// "mmddyyyy": mmddyyyy,
|
|
6105
|
+
// "projectid": this.projectId,
|
|
6106
|
+
// "type": "report",
|
|
6107
|
+
// "eventid": eventId,
|
|
6108
|
+
// "comments": reportercomments,
|
|
6109
|
+
// "dateofcompletion": reporterdoc,
|
|
6110
|
+
// "percentage": percentage,
|
|
6111
|
+
// "entityid": entityId,
|
|
6112
|
+
// "locationid": locationId,
|
|
6113
|
+
// "event": null,
|
|
6114
|
+
// "docs": JSON.stringify(docs),
|
|
6115
|
+
// "approved": true,
|
|
6116
|
+
// "username": this.userName,
|
|
6117
|
+
// "reportformatvalues": reportformatvalues,
|
|
6118
|
+
// "reportformatschema": reportformatschema,
|
|
6119
|
+
// "userid": this.userProfileId,
|
|
6120
|
+
// "userrole": this.myRole,
|
|
6121
|
+
// "year": this.calendarStartYYYY,
|
|
6122
|
+
// "module": event.isnotice != null ? "notices" : "events"
|
|
6123
|
+
// } )
|
|
6124
|
+
// // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
6125
|
+
|
|
6126
|
+
// }else{
|
|
6127
6127
|
bulkBody.push({
|
|
6128
6128
|
"mmddyyyy": mmddyyyy,
|
|
6129
6129
|
"projectid": this.projectId,
|
|
@@ -6142,9 +6142,10 @@ export class SfIEvents extends LitElement {
|
|
|
6142
6142
|
"userid": this.userProfileId,
|
|
6143
6143
|
"userrole": this.myRole,
|
|
6144
6144
|
"year": this.calendarStartYYYY,
|
|
6145
|
-
"module": event.isnotice != null ? "notices" : "events"
|
|
6145
|
+
"module": event.isnotice != null ? "notices" : "events",
|
|
6146
|
+
"makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
|
|
6146
6147
|
})
|
|
6147
|
-
}
|
|
6148
|
+
// }
|
|
6148
6149
|
|
|
6149
6150
|
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
6150
6151
|
// await this.sleep(2000);
|
|
@@ -6158,9 +6159,9 @@ export class SfIEvents extends LitElement {
|
|
|
6158
6159
|
await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
|
|
6159
6160
|
}
|
|
6160
6161
|
|
|
6161
|
-
if(bulkBodyReview.length > 0){
|
|
6162
|
-
|
|
6163
|
-
}
|
|
6162
|
+
// if(bulkBodyReview.length > 0){
|
|
6163
|
+
// await this.uploadReportsReviewsBulk(bulkBodyReview)
|
|
6164
|
+
// }
|
|
6164
6165
|
for(var k = 0; k < this.selectedItemIds.length; k++) {
|
|
6165
6166
|
|
|
6166
6167
|
const selectedId = this.selectedItemIds[k];
|
|
@@ -12953,7 +12954,7 @@ export class SfIEvents extends LitElement {
|
|
|
12953
12954
|
let flagBulk = false;
|
|
12954
12955
|
if(this.selectedItemIds.length === 0) {
|
|
12955
12956
|
|
|
12956
|
-
await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, "notices", percentage)
|
|
12957
|
+
await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, "notices", percentage, makercheckers)
|
|
12957
12958
|
console.log('this.events', this.events);
|
|
12958
12959
|
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
12959
12960
|
if(this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
|
|
@@ -12965,7 +12966,7 @@ export class SfIEvents extends LitElement {
|
|
|
12965
12966
|
console.log('uploadReport single')
|
|
12966
12967
|
if(makercheckers.length > 0) {
|
|
12967
12968
|
|
|
12968
|
-
await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
|
|
12969
|
+
// await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
|
|
12969
12970
|
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
12970
12971
|
if(this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
|
|
12971
12972
|
this.events[mmdd][p].approved = true
|
|
@@ -12998,31 +12999,31 @@ export class SfIEvents extends LitElement {
|
|
|
12998
12999
|
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
12999
13000
|
|
|
13000
13001
|
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
13001
|
-
if(parseInt(makercheckersL) > 0) {
|
|
13002
|
-
|
|
13003
|
-
|
|
13004
|
-
|
|
13005
|
-
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
}else{
|
|
13002
|
+
// if(parseInt(makercheckersL) > 0) {
|
|
13003
|
+
// bulkBodyReview.push({
|
|
13004
|
+
// "mmddyyyy": mmddyyyy,
|
|
13005
|
+
// "projectid": this.projectId,
|
|
13006
|
+
// "type": "report",
|
|
13007
|
+
// "eventid": eventId,
|
|
13008
|
+
// "comments": reportercomments,
|
|
13009
|
+
// "dateofcompletion": reporterdoc,
|
|
13010
|
+
// "percentage": percentage,
|
|
13011
|
+
// "entityid": entityId,
|
|
13012
|
+
// "locationid": locationId,
|
|
13013
|
+
// "event": null,
|
|
13014
|
+
// "docs": JSON.stringify(docs),
|
|
13015
|
+
// "approved": true,
|
|
13016
|
+
// "username": this.userName,
|
|
13017
|
+
// "reportformatvalues": reportformatvalues,
|
|
13018
|
+
// "reportformatschema": reportformatschema,
|
|
13019
|
+
// "userid": this.userProfileId,
|
|
13020
|
+
// "userrole": this.myRole,
|
|
13021
|
+
// "year": this.calendarStartYYYY,
|
|
13022
|
+
// "module": listEvent.isnotice != null ? "notices" : "events"
|
|
13023
|
+
// } )
|
|
13024
|
+
// // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
13025
|
+
|
|
13026
|
+
// }else{
|
|
13026
13027
|
bulkBody.push({
|
|
13027
13028
|
"mmddyyyy": mmddyyyy,
|
|
13028
13029
|
"projectid": this.projectId,
|
|
@@ -13041,9 +13042,10 @@ export class SfIEvents extends LitElement {
|
|
|
13041
13042
|
"userid": this.userProfileId,
|
|
13042
13043
|
"userrole": this.myRole,
|
|
13043
13044
|
"year": this.calendarStartYYYY,
|
|
13044
|
-
"module": listEvent.isnotice != null ? "notices" : "events"
|
|
13045
|
+
"module": listEvent.isnotice != null ? "notices" : "events",
|
|
13046
|
+
"makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
|
|
13045
13047
|
})
|
|
13046
|
-
}
|
|
13048
|
+
// }
|
|
13047
13049
|
|
|
13048
13050
|
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
13049
13051
|
// await this.sleep(2000);
|
|
@@ -13057,9 +13059,9 @@ export class SfIEvents extends LitElement {
|
|
|
13057
13059
|
await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
|
|
13058
13060
|
}
|
|
13059
13061
|
|
|
13060
|
-
if(bulkBodyReview.length > 0){
|
|
13061
|
-
|
|
13062
|
-
}
|
|
13062
|
+
// if(bulkBodyReview.length > 0){
|
|
13063
|
+
// await this.uploadReportsReviewsBulk(bulkBodyReview)
|
|
13064
|
+
// }
|
|
13063
13065
|
await this.fetchBulkReportingData();
|
|
13064
13066
|
console.log('uploadReport bulk')
|
|
13065
13067
|
for(var k = 0; k < this.selectedItemIds.length; k++) {
|
|
@@ -13532,204 +13534,34 @@ export class SfIEvents extends LitElement {
|
|
|
13532
13534
|
html += '</div>';
|
|
13533
13535
|
html += '</div>';
|
|
13534
13536
|
|
|
13535
|
-
html += '
|
|
13536
|
-
|
|
13537
|
-
|
|
13538
|
-
|
|
13539
|
-
|
|
13540
|
-
|
|
13541
|
-
|
|
13542
|
-
// if(!this.getEventHideFields().includes(Object.keys(event)[k])) {
|
|
13543
|
-
// html += '<div class="m-20">';
|
|
13544
|
-
// html += '<div part="detail-head"><strong>'+Object.keys(event)[k]+'</strong></div>'
|
|
13545
|
-
// //console.log(Object.keys(event)[k], event[Object.keys(event)[k]]);
|
|
13546
|
-
// if((event[Object.keys(event)[k]] + "").indexOf("[") >= 0) {
|
|
13547
|
-
// html += this.getEventTexts(Object.keys(event)[k], JSON.parse(event[Object.keys(event)[k]]), event);
|
|
13548
|
-
// } else {
|
|
13549
|
-
// html += '<sf-i-elastic-text text="'+(event[Object.keys(event)[k]] + "").replace(/"/g, "")+'" minLength="20"></sf-i-elastic-text>';
|
|
13550
|
-
// }
|
|
13551
|
-
// html += '</div>';
|
|
13552
|
-
// }
|
|
13553
|
-
|
|
13554
|
-
// }
|
|
13555
|
-
// }
|
|
13556
|
-
|
|
13557
|
-
if(this.mode == "consumer" || this.mode == "next") {
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
//console.log('docs received', event['documents']);
|
|
13561
|
-
//console.log('docs received', comments);
|
|
13562
|
-
//console.log('docs received', approved);
|
|
13563
|
-
|
|
13564
|
-
/* if(this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) {
|
|
13565
|
-
|
|
13566
|
-
if(comments.length > 0) {
|
|
13567
|
-
|
|
13568
|
-
html += '<div class="d-flex justify-between m-20">';
|
|
13569
|
-
html += '<h3 part="results-title" class="m-0"><br />Approve Compliance</h3>';
|
|
13570
|
-
html += '</div>';
|
|
13571
|
-
html += '<div class="m-20" part="report-container">';
|
|
13572
|
-
html += '<div class="d-flex justify-between align-center">'
|
|
13573
|
-
html += '<button class="invisible" part="button">Save</button>'
|
|
13574
|
-
html += '<button id="button-uploader-submit-approve" class="button-submit" part="button">Save</button>'
|
|
13575
|
-
html += '</div>'
|
|
13576
|
-
|
|
13577
|
-
if(this.myRole != this.TAB_FUNCTION_HEAD && docs.length > 0) {
|
|
13578
|
-
html += '<div class="m-20">';
|
|
13579
|
-
html += '<label part="input-label">Supporting Documents</label>';
|
|
13580
|
-
html += '<slot name="uploader"></slot>';
|
|
13581
|
-
html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>'
|
|
13582
|
-
html += '</div>';
|
|
13583
|
-
}
|
|
13584
|
-
|
|
13585
|
-
html += '<div class="d-flex m-20 flex-col">';
|
|
13586
|
-
html += '<label part="input-label">Approver Comments*</label>';
|
|
13587
|
-
html += '<input id="input-approver-comments" type="text" part="input" value=""/><br />';
|
|
13588
|
-
html += '<label part="input-label">Date of Completion*</label>';
|
|
13589
|
-
html += '<input id="input-approver-doc" part="input" type="date" value="'+(dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0,10))+'" disabled/><br />';
|
|
13590
|
-
html += '<div>'
|
|
13591
|
-
html += '<label part="input-label">Approve?*</label><br />';
|
|
13592
|
-
html += '<div class="mt-5">'
|
|
13593
|
-
html += '<input id="input-approve-yes" name="radio-approved" type="radio"/> Yes';
|
|
13594
|
-
html += '<input id="input-approve-no" name="radio-approved" type="radio" checked/> No';
|
|
13595
|
-
html += '</div>'
|
|
13596
|
-
html += '</div>';
|
|
13597
|
-
html += '</div>';
|
|
13598
|
-
html += '</div>';
|
|
13599
|
-
|
|
13600
|
-
}
|
|
13601
|
-
|
|
13602
|
-
}
|
|
13537
|
+
html += '<div class="accordian-section section-feedback pl-20 pr-20" part="accordian-section">';
|
|
13538
|
+
html += '<div class="d-flex justify-between accordian-head head-feedback" part="accordian-head">';
|
|
13539
|
+
html += '<h3>Feedback</h3>'
|
|
13540
|
+
html += '<h3 class="head-indicator-feedback">+</h3>'
|
|
13541
|
+
html += '</div>';
|
|
13542
|
+
html += '<div class="d-flex flex-wrap accordian-body body-feedback hide" part="accordian-body">';
|
|
13603
13543
|
|
|
13604
|
-
|
|
13605
|
-
|
|
13606
|
-
|
|
13607
|
-
html += '<h3 part="results-title" class="m-0"><br />Report Compliance</h3>';
|
|
13608
|
-
html += '</div>';
|
|
13609
|
-
|
|
13610
|
-
var showSubmissionSection = true;
|
|
13611
|
-
var showGoogleFormLink = false;
|
|
13612
|
-
|
|
13613
|
-
if(event['form'].length > 5) {
|
|
13614
|
-
|
|
13615
|
-
if(event['form'].indexOf('docs.google.com/forms') >= 0) {
|
|
13616
|
-
showSubmissionSection = false;
|
|
13617
|
-
if(!approved) {
|
|
13618
|
-
showGoogleFormLink = true;
|
|
13619
|
-
|
|
13620
|
-
}
|
|
13621
|
-
}
|
|
13622
|
-
|
|
13623
|
-
}
|
|
13624
|
-
|
|
13625
|
-
if(showGoogleFormLink) {
|
|
13626
|
-
html += ('<div part="detail-summary-form" class="mt-20 pl-20 pr-20"><button part="button" onclick="window.open(\'' + event['form'] + (this.projectId + '_' + entityId + '_' + locationId + '_' + event['id'] + '_' + mmddyyyy) + '\',\'_blank\')">Submit Via Link</button></div>');
|
|
13627
|
-
}
|
|
13628
|
-
|
|
13629
|
-
if(showSubmissionSection) {
|
|
13630
|
-
|
|
13631
|
-
html += '<div class="m-20" part="report-container">';
|
|
13632
|
-
html += '<div class="d-flex justify-between align-center">'
|
|
13633
|
-
html += '<button class="invisible" part="button">Save</button>'
|
|
13634
|
-
html += '<button id="button-uploader-submit-report" class="button-submit" part="button">Save</button>'
|
|
13635
|
-
html += '</div>'
|
|
13636
|
-
|
|
13637
|
-
html += '<div class="d-flex m-20 flex-col">';
|
|
13638
|
-
html += '<label part="input-label">Reporter Comments*</label>';
|
|
13639
|
-
html += '<input id="input-reporter-comments" type="text" part="input" value=""/><br />';
|
|
13640
|
-
html += '<label part="input-label">Date of Completion*</label>';
|
|
13641
|
-
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 />';
|
|
13642
|
-
// if(docsOptional.length === 0) {
|
|
13643
|
-
html += '<label part="input-label">Supporting Documents' + ((docsOptional.length > 0) ? '' : '*') + '</label>';
|
|
13644
|
-
|
|
13645
|
-
if(event['uploadguidance'] != null && event['uploadguidance'].length > 0) {
|
|
13646
|
-
html += ('<div part="uploader-analysis-message">'+event['uploadguidance']+'</div>');
|
|
13647
|
-
}
|
|
13648
|
-
|
|
13649
|
-
html += '<slot name="uploader"></slot>';
|
|
13650
|
-
html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>'
|
|
13651
|
-
// }
|
|
13652
|
-
html += '<br />';
|
|
13653
|
-
if(event['reportformat'] != null && event['reportformat'].length > 0){
|
|
13654
|
-
html += '<div id="report-format-container"><div class="box"></div></div>'
|
|
13655
|
-
}
|
|
13656
|
-
html += '<br />';
|
|
13657
|
-
if(makercheckers.length > 0) {
|
|
13658
|
-
html += '<div part="td-head" class="td-head d-flex justify-center align-center"><span class="material-symbols-outlined">check_small</span><div> Auto-approve Enabled</div></div>';
|
|
13659
|
-
|
|
13660
|
-
if(completeness == "pending-approval" && this.enableDeleteLatestReport) {
|
|
13661
|
-
html += '<div part="td-head" class="td-head d-flex justify-center align-center"><button class="mt-5" part="button" id="button-auto-approve">Auto Approve</button></div>';
|
|
13662
|
-
}
|
|
13663
|
-
}
|
|
13664
|
-
html += '</div>';
|
|
13665
|
-
html += '</div>';
|
|
13666
|
-
|
|
13667
|
-
}
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
}
|
|
13673
|
-
|
|
13674
|
-
if(this.myRole == this.TAB_AUDITOR) {
|
|
13675
|
-
|
|
13676
|
-
html += '<div class="d-flex justify-between m-20">';
|
|
13677
|
-
html += '<h3 part="results-title" class="m-0"><br />Audit Compliance</h3>';
|
|
13678
|
-
html += '</div>';
|
|
13679
|
-
html += '<div class="m-20" part="report-container">';
|
|
13680
|
-
html += '<div class="d-flex justify-between align-center">'
|
|
13681
|
-
html += '<button class="invisible" part="button">Save</button>'
|
|
13682
|
-
html += '<button id="button-uploader-submit-audit" class="button-submit" part="button">Save</button>'
|
|
13544
|
+
html += '<div class="d-flex justify-end w-100 flex-wrap">'
|
|
13545
|
+
html += '<div class="d-flex w-100 mb-10">'
|
|
13546
|
+
html += '<div part="feedback-message">Do you wish to send us feedback about this compliance? Any doubts? Need guidance or more clarity? Drop us a feedback and we will revert soon.</div>'
|
|
13683
13547
|
html += '</div>'
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
|
|
13688
|
-
html += '<
|
|
13689
|
-
html += '<
|
|
13690
|
-
html += '<
|
|
13691
|
-
|
|
13692
|
-
|
|
13693
|
-
html += '<input id="input-approve-yes" name="radio-approved" type="radio" checked/> Yes';
|
|
13694
|
-
html += '<input id="input-approve-no" name="radio-approved" type="radio"/> No';
|
|
13695
|
-
html += '</div>'
|
|
13696
|
-
html += '</div>';
|
|
13697
|
-
html += '<br />';
|
|
13698
|
-
if(docs.length > 0) {
|
|
13699
|
-
html += '<label part="input-label">Supporting Documents</label>';
|
|
13700
|
-
html += '<slot name="uploader"></slot>';
|
|
13701
|
-
html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>'
|
|
13702
|
-
}
|
|
13703
|
-
html += '</div>';
|
|
13704
|
-
html += '</div>';
|
|
13705
|
-
|
|
13706
|
-
}
|
|
13548
|
+
html += '<div class="d-flex justify-end w-100 mb-10">'
|
|
13549
|
+
html += '<textarea part="input" id="feedback-message" class="w-100 mt-10 mb-10 hide" placeholder="Type your feedback message here..."></textarea>'
|
|
13550
|
+
html += '</div>'
|
|
13551
|
+
html += '<div class="d-flex w-100">'
|
|
13552
|
+
html += ('<button part="button-lg-short" id="button-feedback" class="d-flex justify-center align-center"><span class="material-symbols-outlined">comment</span><span> Send Feedback</span></button>');
|
|
13553
|
+
html += ('<button part="button-lg-short-secondary" id="button-feedback-cancel" class="hide d-flex justify-center align-center mr-10"><span class="material-symbols-outlined">close</span><span> Cancel</span></button>');
|
|
13554
|
+
html += ('<button part="button-lg-short" id="button-feedback-confirm" class="hide d-flex justify-center align-center"><span class="material-symbols-outlined">commentcheck</span><span> Submit Feedback</span></button>');
|
|
13555
|
+
html += '</div>'
|
|
13556
|
+
html += '</div>'
|
|
13707
13557
|
|
|
13708
|
-
|
|
13558
|
+
html += '</div>';
|
|
13559
|
+
html += '</div>';
|
|
13709
13560
|
|
|
13710
|
-
|
|
13711
|
-
html += '<h3 part="results-title" class="m-0"><br />View Compliance</h3>';
|
|
13712
|
-
html += '</div>';
|
|
13713
|
-
html += '<div class="m-20" part="report-container">';
|
|
13561
|
+
html += '</div>';
|
|
13714
13562
|
|
|
13715
|
-
|
|
13716
|
-
html += '<div>'
|
|
13717
|
-
html += '<label part="input-label">Approve?</label><br />';
|
|
13718
|
-
html += '<div class="mt-5">'
|
|
13719
|
-
html += '<input id="input-approve-yes" name="radio-approved" type="radio" checked/> Yes';
|
|
13720
|
-
html += '<input id="input-approve-no" name="radio-approved" type="radio"/> No';
|
|
13721
|
-
html += '</div>'
|
|
13722
|
-
html += '</div>';
|
|
13723
|
-
html += '<br />';
|
|
13724
|
-
if(docs.length === 0) {
|
|
13725
|
-
html += '<label part="input-label">Supporting Documents</label>';
|
|
13726
|
-
html += '<slot name="uploader"></slot>';
|
|
13727
|
-
html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>'
|
|
13728
|
-
}
|
|
13729
|
-
html += '</div>';
|
|
13730
|
-
html += '</div>';
|
|
13563
|
+
if(this.mode == "consumer" || this.mode == "next") {
|
|
13731
13564
|
|
|
13732
|
-
} */
|
|
13733
13565
|
html += '<div part="reporting-view-container">'
|
|
13734
13566
|
html += this.renderReporting(event, mmddyyyy);
|
|
13735
13567
|
html += "</div>"
|
|
@@ -13949,6 +13781,118 @@ export class SfIEvents extends LitElement {
|
|
|
13949
13781
|
}
|
|
13950
13782
|
});
|
|
13951
13783
|
|
|
13784
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('.head-feedback')?.addEventListener('click', () => {
|
|
13785
|
+
if(((this._SfDetailContainer as HTMLDivElement).querySelector('.body-feedback') as HTMLDivElement).style.display == 'flex') {
|
|
13786
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('.body-feedback') as HTMLDivElement).style.display = 'none';
|
|
13787
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('.head-indicator-feedback') as HTMLDivElement).innerHTML = '+';
|
|
13788
|
+
} else {
|
|
13789
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('.body-feedback') as HTMLDivElement).style.display = 'flex';
|
|
13790
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('.head-indicator-feedback') as HTMLDivElement).innerHTML = '-';
|
|
13791
|
+
}
|
|
13792
|
+
});
|
|
13793
|
+
|
|
13794
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close')?.addEventListener('click', () => {
|
|
13795
|
+
|
|
13796
|
+
(this._SfDetailContainer as HTMLDivElement).innerHTML = '';
|
|
13797
|
+
(this._SfDetailContainer as HTMLDivElement).style.display = 'none';
|
|
13798
|
+
|
|
13799
|
+
});
|
|
13800
|
+
|
|
13801
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-feedback')?.addEventListener('click', () => {
|
|
13802
|
+
|
|
13803
|
+
const feedbackMessage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#feedback-message') as HTMLTextAreaElement);
|
|
13804
|
+
const buttonFeedback = ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-feedback') as HTMLButtonElement);
|
|
13805
|
+
const buttonCancel = ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-feedback-cancel') as HTMLButtonElement);
|
|
13806
|
+
const buttonConfirm = ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-feedback-confirm') as HTMLButtonElement);
|
|
13807
|
+
|
|
13808
|
+
console.log(buttonConfirm.classList);
|
|
13809
|
+
|
|
13810
|
+
if(feedbackMessage.classList.contains('hide')) {
|
|
13811
|
+
feedbackMessage.classList.remove('hide');
|
|
13812
|
+
}
|
|
13813
|
+
|
|
13814
|
+
if(buttonConfirm.classList.contains('hide')) {
|
|
13815
|
+
buttonConfirm.classList.remove('hide');
|
|
13816
|
+
}
|
|
13817
|
+
|
|
13818
|
+
if(buttonCancel.classList.contains('hide')) {
|
|
13819
|
+
buttonCancel.classList.remove('hide');
|
|
13820
|
+
}
|
|
13821
|
+
|
|
13822
|
+
if(!buttonFeedback.classList.contains('hide')) {
|
|
13823
|
+
buttonFeedback.classList.add('hide');
|
|
13824
|
+
}
|
|
13825
|
+
|
|
13826
|
+
// const body = {
|
|
13827
|
+
// projectid: this.projectId,
|
|
13828
|
+
// complianceid: compliance.id
|
|
13829
|
+
// }
|
|
13830
|
+
// console.log(body);
|
|
13831
|
+
|
|
13832
|
+
});
|
|
13833
|
+
|
|
13834
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-feedback-cancel')?.addEventListener('click', () => {
|
|
13835
|
+
|
|
13836
|
+
const feedbackMessage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#feedback-message') as HTMLTextAreaElement);
|
|
13837
|
+
const buttonFeedback = ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-feedback') as HTMLButtonElement);
|
|
13838
|
+
const buttonCancel = ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-feedback-cancel') as HTMLButtonElement);
|
|
13839
|
+
const buttonConfirm = ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-feedback-confirm') as HTMLButtonElement);
|
|
13840
|
+
|
|
13841
|
+
console.log(buttonConfirm.classList);
|
|
13842
|
+
|
|
13843
|
+
if(!feedbackMessage.classList.contains('hide')) {
|
|
13844
|
+
feedbackMessage.classList.add('hide');
|
|
13845
|
+
}
|
|
13846
|
+
|
|
13847
|
+
if(!buttonConfirm.classList.contains('hide')) {
|
|
13848
|
+
buttonConfirm.classList.add('hide');
|
|
13849
|
+
}
|
|
13850
|
+
|
|
13851
|
+
if(!buttonCancel.classList.contains('hide')) {
|
|
13852
|
+
buttonCancel.classList.add('hide');
|
|
13853
|
+
}
|
|
13854
|
+
|
|
13855
|
+
if(buttonFeedback.classList.contains('hide')) {
|
|
13856
|
+
buttonFeedback.classList.remove('hide');
|
|
13857
|
+
}
|
|
13858
|
+
|
|
13859
|
+
});
|
|
13860
|
+
|
|
13861
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-feedback-confirm')?.addEventListener('click', async () => {
|
|
13862
|
+
|
|
13863
|
+
const feedbackMessage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#feedback-message') as HTMLTextAreaElement);
|
|
13864
|
+
const buttonCancel = ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-feedback-cancel') as HTMLButtonElement);
|
|
13865
|
+
const buttonClose = ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement);
|
|
13866
|
+
console.log('sending feedback', event);
|
|
13867
|
+
if(feedbackMessage.value.length === 0) {
|
|
13868
|
+
feedbackMessage.setAttribute('style', 'border:solid 2px ' + this.COLOR_REJECTED + ' !important');
|
|
13869
|
+
} else {
|
|
13870
|
+
feedbackMessage.setAttribute('style', 'border:');
|
|
13871
|
+
this.uploadTriggerMyEvent(
|
|
13872
|
+
event.id + ";" + event.shortid,
|
|
13873
|
+
feedbackMessage.value,
|
|
13874
|
+
event.countries.join(",").replace(/ *\([^)]*\) */g, ""),
|
|
13875
|
+
event.entities.join(',').replace(/ *\([^)]*\) */g, ""),
|
|
13876
|
+
event.locations.join(',').replace(/ *\([^)]*\) */g, ""),
|
|
13877
|
+
event.statute[0],
|
|
13878
|
+
event.subcategory[0]);
|
|
13879
|
+
buttonCancel.click();
|
|
13880
|
+
buttonClose.click();
|
|
13881
|
+
}
|
|
13882
|
+
|
|
13883
|
+
});
|
|
13884
|
+
|
|
13885
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('#feedback-message')?.addEventListener('keyup', (e: any) => {
|
|
13886
|
+
|
|
13887
|
+
if(e.code == "Enter") {
|
|
13888
|
+
|
|
13889
|
+
const buttonConfirm = ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-feedback-confirm') as HTMLButtonElement);
|
|
13890
|
+
buttonConfirm.click();
|
|
13891
|
+
|
|
13892
|
+
}
|
|
13893
|
+
|
|
13894
|
+
})
|
|
13895
|
+
|
|
13952
13896
|
if(this.mode == "consumer" || this.mode == "next") {
|
|
13953
13897
|
|
|
13954
13898
|
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-approve')?.addEventListener('click', async (ev:any) => {
|
|
@@ -14288,7 +14232,7 @@ export class SfIEvents extends LitElement {
|
|
|
14288
14232
|
//console.log('makerscheckers', makercheckers, reportercomments);
|
|
14289
14233
|
// console.log('reportformatvalues', reportformatvalues)
|
|
14290
14234
|
// console.log('reportformatschema',reportformatschema)
|
|
14291
|
-
await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage)
|
|
14235
|
+
await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage, makercheckers)
|
|
14292
14236
|
console.log('this.events', this.events);
|
|
14293
14237
|
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
14294
14238
|
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
|
|
@@ -14299,12 +14243,12 @@ export class SfIEvents extends LitElement {
|
|
|
14299
14243
|
}
|
|
14300
14244
|
if(makercheckers.length > 0) {
|
|
14301
14245
|
|
|
14302
|
-
await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
|
|
14246
|
+
// await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
|
|
14303
14247
|
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
14304
14248
|
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
|
|
14305
14249
|
this.events[mmdd][p].approved = true
|
|
14306
14250
|
// this.events[mmdd][p].documents = docs
|
|
14307
|
-
this.events[mmdd][p].comments.push({'author': '
|
|
14251
|
+
this.events[mmdd][p].comments.push({'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString()})
|
|
14308
14252
|
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
14309
14253
|
}
|
|
14310
14254
|
}
|
|
@@ -14349,31 +14293,31 @@ export class SfIEvents extends LitElement {
|
|
|
14349
14293
|
// "module": event.isnotice != null ? "notices" : "events"
|
|
14350
14294
|
// })
|
|
14351
14295
|
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
14352
|
-
if(parseInt(makercheckersL) > 0) {
|
|
14353
|
-
|
|
14354
|
-
|
|
14355
|
-
|
|
14356
|
-
|
|
14357
|
-
|
|
14358
|
-
|
|
14359
|
-
|
|
14360
|
-
|
|
14361
|
-
|
|
14362
|
-
|
|
14363
|
-
|
|
14364
|
-
|
|
14365
|
-
|
|
14366
|
-
|
|
14367
|
-
|
|
14368
|
-
|
|
14369
|
-
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
|
|
14373
|
-
|
|
14374
|
-
|
|
14375
|
-
|
|
14376
|
-
}else{
|
|
14296
|
+
// if(parseInt(makercheckersL) > 0) {
|
|
14297
|
+
// bulkBodyReview.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
|
+
// "approved": true,
|
|
14310
|
+
// "username": this.userName,
|
|
14311
|
+
// "reportformatvalues": reportformatvalues,
|
|
14312
|
+
// "reportformatschema": reportformatschema,
|
|
14313
|
+
// "userid": this.userProfileId,
|
|
14314
|
+
// "userrole": this.myRole,
|
|
14315
|
+
// "year": this.calendarStartYYYY,
|
|
14316
|
+
// "module": event.isnotice != null ? "notices" : "events"
|
|
14317
|
+
// } )
|
|
14318
|
+
// // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
14319
|
+
|
|
14320
|
+
// }else{
|
|
14377
14321
|
bulkBody.push({
|
|
14378
14322
|
"mmddyyyy": mmddyyyy,
|
|
14379
14323
|
"projectid": this.projectId,
|
|
@@ -14392,9 +14336,10 @@ export class SfIEvents extends LitElement {
|
|
|
14392
14336
|
"userid": this.userProfileId,
|
|
14393
14337
|
"userrole": this.myRole,
|
|
14394
14338
|
"year": this.calendarStartYYYY,
|
|
14395
|
-
"module": event.isnotice != null ? "notices" : "events"
|
|
14339
|
+
"module": event.isnotice != null ? "notices" : "events",
|
|
14340
|
+
"makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
|
|
14396
14341
|
})
|
|
14397
|
-
}
|
|
14342
|
+
// }
|
|
14398
14343
|
|
|
14399
14344
|
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
14400
14345
|
// await this.sleep(2000);
|
|
@@ -14406,9 +14351,9 @@ export class SfIEvents extends LitElement {
|
|
|
14406
14351
|
await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
|
|
14407
14352
|
}
|
|
14408
14353
|
// await this.fetchBulkReportingData();
|
|
14409
|
-
if(bulkBodyReview.length > 0){
|
|
14410
|
-
|
|
14411
|
-
}
|
|
14354
|
+
// if(bulkBodyReview.length > 0){
|
|
14355
|
+
// await this.uploadReportsReviewsBulk(bulkBodyReview)
|
|
14356
|
+
// }
|
|
14412
14357
|
for(var k = 0; k < this.selectedItemIds.length; k++) {
|
|
14413
14358
|
|
|
14414
14359
|
const selectedId = this.selectedItemIds[k];
|
|
@@ -22583,8 +22528,8 @@ export class SfIEvents extends LitElement {
|
|
|
22583
22528
|
}
|
|
22584
22529
|
}
|
|
22585
22530
|
|
|
22586
|
-
uploadReport = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, doc: string, docs: any, event: any, reportformatvalues: string = "", reportformatschema: string = "", module: string = "events", percentage: string = "100") => {
|
|
22587
|
-
let url = "https://"+this.apiId+"/
|
|
22531
|
+
uploadReport = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, doc: string, docs: any, event: any, reportformatvalues: string = "", reportformatschema: string = "", module: string = "events", percentage: string = "100", makercheckers: any) => {
|
|
22532
|
+
let url = "https://"+this.apiId+"/uploadreport1";
|
|
22588
22533
|
|
|
22589
22534
|
let body = {
|
|
22590
22535
|
"mmddyyyy": mmddyyyy,
|
|
@@ -22604,7 +22549,8 @@ export class SfIEvents extends LitElement {
|
|
|
22604
22549
|
"userid": this.userProfileId,
|
|
22605
22550
|
"userrole": this.myRole,
|
|
22606
22551
|
"year": this.calendarStartYYYY,
|
|
22607
|
-
"module": module
|
|
22552
|
+
"module": module,
|
|
22553
|
+
"makercheckers": makercheckers
|
|
22608
22554
|
}
|
|
22609
22555
|
|
|
22610
22556
|
//console.log(body);
|
|
@@ -22638,7 +22584,7 @@ export class SfIEvents extends LitElement {
|
|
|
22638
22584
|
}
|
|
22639
22585
|
|
|
22640
22586
|
uploadReportsBulk = async (bulkBody: any, showSuccess: boolean = true) => {
|
|
22641
|
-
let url = "https://"+this.apiId+"/
|
|
22587
|
+
let url = "https://"+this.apiId+"/uploadreportsbulk1"
|
|
22642
22588
|
|
|
22643
22589
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
22644
22590
|
const xhr : any = (await this.prepareXhr(bulkBody, url, this._SfLoader, authorization)) as any;
|