sf-i-events 1.0.712 → 1.0.714
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/sf-i-events.d.ts +6 -4
- package/sf-i-events.js +695 -144
- package/src/sf-i-events.ts +621 -27
package/src/sf-i-events.ts
CHANGED
|
@@ -4639,7 +4639,7 @@ export class SfIEvents extends LitElement {
|
|
|
4639
4639
|
return graphParam;
|
|
4640
4640
|
}
|
|
4641
4641
|
|
|
4642
|
-
renderCalendarAnnotations = (event: any) => {
|
|
4642
|
+
renderCalendarAnnotations = (event: any, mmdd: string, i: number, j:number) => {
|
|
4643
4643
|
|
|
4644
4644
|
var html = '';
|
|
4645
4645
|
|
|
@@ -4650,7 +4650,7 @@ export class SfIEvents extends LitElement {
|
|
|
4650
4650
|
|
|
4651
4651
|
let graphParam = this.getGraphParam(event);
|
|
4652
4652
|
console.log("graphParam", graphParam.split(';')[0]);
|
|
4653
|
-
html += '<div class="d-flex"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + '</div>';
|
|
4653
|
+
html += '<div class="d-flex align-center"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + '<button id="button-list-reporting-'+mmdd.replace('/', '-')+'-'+ i + '-' + j +'" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">summarize</button></div>';
|
|
4654
4654
|
|
|
4655
4655
|
return html;
|
|
4656
4656
|
|
|
@@ -4842,7 +4842,8 @@ export class SfIEvents extends LitElement {
|
|
|
4842
4842
|
html += this.renderCalendarRowDivItemDivStart(mmdd, this.events[mmdd][j], j, partStatus);
|
|
4843
4843
|
html += this.renderCalendarRowDivItemDivTableHead(this.events[mmdd][j], partStatus);
|
|
4844
4844
|
html += this.renderCalendarRowDivItemDivTableBody(this.events[mmdd][j], partStatus, lateStatus, complianceStatus, mmdd, i, j);
|
|
4845
|
-
html += this.renderCalendarAnnotations(this.events[mmdd][j]);
|
|
4845
|
+
html += this.renderCalendarAnnotations(this.events[mmdd][j], mmdd, i, j);
|
|
4846
|
+
html += '<div class="list-reporting-container d-flex flex-col hide" id="list-reporting-container-' + i + '-' + j + '"></div>'
|
|
4846
4847
|
html += this.renderCalendarRowDivItemDivEnd();
|
|
4847
4848
|
|
|
4848
4849
|
}
|
|
@@ -4907,6 +4908,531 @@ export class SfIEvents extends LitElement {
|
|
|
4907
4908
|
|
|
4908
4909
|
}
|
|
4909
4910
|
|
|
4911
|
+
renderReporting = (event: any, mmddyyyy: any) => {
|
|
4912
|
+
let html = '';
|
|
4913
|
+
let completeness = this.getCompletenessStatus(event);
|
|
4914
|
+
let docs = event['documents'] == null ? [] : event['documents'] == null ? [] : (event['documents']);
|
|
4915
|
+
let approved = event['approved'] == null ? false : event['approved'] == null ? false : event['approved'];
|
|
4916
|
+
let dateOfCompletion = event['dateofcompletion'] == null ? '' : event['dateofcompletion'] == null ? '' : event['dateofcompletion'];
|
|
4917
|
+
let makercheckers = event['makercheckers'] == null ? [] : event['makercheckers'] == null ? [] : event['makercheckers'];
|
|
4918
|
+
let docsOptional = event['docs'] == null ? [] : event['docs'] == null ? [] : event['docs'];
|
|
4919
|
+
if(this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) {
|
|
4920
|
+
if(event.comments.length > 0) {
|
|
4921
|
+
|
|
4922
|
+
html += '<div class="d-flex justify-between m-20">';
|
|
4923
|
+
html += '<h3 part="results-title" class="m-0"><br />Approve Compliance</h3>';
|
|
4924
|
+
html += '</div>';
|
|
4925
|
+
html += '<div class="m-20" part="report-container">';
|
|
4926
|
+
html += '<div class="d-flex justify-between align-center">'
|
|
4927
|
+
html += '<button class="invisible" part="button">Save</button>'
|
|
4928
|
+
html += '<button id="button-uploader-submit-approve" class="button-submit" part="button">Save</button>'
|
|
4929
|
+
html += '</div>'
|
|
4930
|
+
|
|
4931
|
+
if(this.myRole != this.TAB_FUNCTION_HEAD && event.docs.length > 0) {
|
|
4932
|
+
html += '<div class="m-20">';
|
|
4933
|
+
html += '<label part="input-label">Supporting Documents</label>';
|
|
4934
|
+
html += '<slot name="uploader"></slot>';
|
|
4935
|
+
html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>'
|
|
4936
|
+
html += '</div>';
|
|
4937
|
+
}
|
|
4938
|
+
|
|
4939
|
+
html += '<div class="d-flex m-20 flex-col">';
|
|
4940
|
+
html += '<label part="input-label">Approver Comments*</label>';
|
|
4941
|
+
html += '<input id="input-approver-comments" type="text" part="input" value=""/><br />';
|
|
4942
|
+
html += '<label part="input-label">Date of Completion*</label>';
|
|
4943
|
+
html += '<input id="input-approver-doc" part="input" type="date" value="'+(dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0,10))+'" disabled/><br />';
|
|
4944
|
+
html += '<div>'
|
|
4945
|
+
html += '<label part="input-label">Approve?*</label><br />';
|
|
4946
|
+
html += '<div class="mt-5">'
|
|
4947
|
+
html += '<input id="input-approve-yes" name="radio-approved" type="radio"/> Yes';
|
|
4948
|
+
html += '<input id="input-approve-no" name="radio-approved" type="radio" checked/> No';
|
|
4949
|
+
html += '</div>'
|
|
4950
|
+
html += '</div>';
|
|
4951
|
+
html += '</div>';
|
|
4952
|
+
html += '</div>';
|
|
4953
|
+
|
|
4954
|
+
}
|
|
4955
|
+
|
|
4956
|
+
}
|
|
4957
|
+
|
|
4958
|
+
if(this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) {
|
|
4959
|
+
|
|
4960
|
+
html += '<div class="d-flex justify-between m-20">';
|
|
4961
|
+
html += '<h3 part="results-title" class="m-0"><br />Report Compliance</h3>';
|
|
4962
|
+
html += '</div>';
|
|
4963
|
+
|
|
4964
|
+
var showSubmissionSection = true;
|
|
4965
|
+
var showGoogleFormLink = false;
|
|
4966
|
+
|
|
4967
|
+
if(event['form'] != null && event['form'].length > 5) {
|
|
4968
|
+
|
|
4969
|
+
if(event['form'].indexOf('docs.google.com/forms') >= 0) {
|
|
4970
|
+
showSubmissionSection = false;
|
|
4971
|
+
if(!approved) {
|
|
4972
|
+
showGoogleFormLink = true;
|
|
4973
|
+
|
|
4974
|
+
}
|
|
4975
|
+
}
|
|
4976
|
+
|
|
4977
|
+
}
|
|
4978
|
+
|
|
4979
|
+
if(showGoogleFormLink) {
|
|
4980
|
+
html += ('<div part="detail-summary-form" class="mt-20 pl-20 pr-20"><button part="button" onclick="window.open(\'' + event['form'] + (this.projectId + '_' + event.entityid + '_' + event.locationid + '_' + event['id'] + '_' + mmddyyyy) + '\',\'_blank\')">Submit Via Link</button></div>');
|
|
4981
|
+
}
|
|
4982
|
+
|
|
4983
|
+
if(showSubmissionSection) {
|
|
4984
|
+
|
|
4985
|
+
html += '<div class="m-20" part="report-container">';
|
|
4986
|
+
html += '<div class="d-flex justify-between align-center">'
|
|
4987
|
+
html += '<button class="invisible" part="button">Save</button>'
|
|
4988
|
+
html += '<button id="button-uploader-submit-report" class="button-submit" part="button">Save</button>'
|
|
4989
|
+
html += '</div>'
|
|
4990
|
+
|
|
4991
|
+
html += '<div class="d-flex m-20 flex-col">';
|
|
4992
|
+
html += '<label part="input-label">Reporter Comments*</label>';
|
|
4993
|
+
html += '<input id="input-reporter-comments" type="text" part="input" value=""/><br />';
|
|
4994
|
+
html += '<label part="input-label">Date of Completion*</label>';
|
|
4995
|
+
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 />';
|
|
4996
|
+
// if(docsOptional.length === 0) {
|
|
4997
|
+
html += '<label part="input-label">Supporting Documents' + ((docsOptional.length > 0) ? '' : '*') + '</label>';
|
|
4998
|
+
|
|
4999
|
+
if(event['uploadguidance'] != null && event['uploadguidance'].length > 0) {
|
|
5000
|
+
html += ('<div part="uploader-analysis-message">'+event['uploadguidance']+'</div>');
|
|
5001
|
+
}
|
|
5002
|
+
|
|
5003
|
+
html += '<slot name="uploader"></slot>';
|
|
5004
|
+
html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>'
|
|
5005
|
+
// }
|
|
5006
|
+
html += '<br />';
|
|
5007
|
+
if(event['reportformat'] != null && event['reportformat'].length > 0){
|
|
5008
|
+
html += '<div id="report-format-container"><div class="box"></div></div>'
|
|
5009
|
+
}
|
|
5010
|
+
html += '<br />';
|
|
5011
|
+
if(makercheckers.length > 0) {
|
|
5012
|
+
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>';
|
|
5013
|
+
|
|
5014
|
+
if(completeness == "pending-approval" && this.enableDeleteLatestReport) {
|
|
5015
|
+
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>';
|
|
5016
|
+
}
|
|
5017
|
+
}
|
|
5018
|
+
html += '</div>';
|
|
5019
|
+
html += '</div>';
|
|
5020
|
+
|
|
5021
|
+
}
|
|
5022
|
+
|
|
5023
|
+
}
|
|
5024
|
+
|
|
5025
|
+
if(this.myRole == this.TAB_AUDITOR) {
|
|
5026
|
+
|
|
5027
|
+
html += '<div class="d-flex justify-between m-20">';
|
|
5028
|
+
html += '<h3 part="results-title" class="m-0"><br />Audit Compliance</h3>';
|
|
5029
|
+
html += '</div>';
|
|
5030
|
+
html += '<div class="m-20" part="report-container">';
|
|
5031
|
+
html += '<div class="d-flex justify-between align-center">'
|
|
5032
|
+
html += '<button class="invisible" part="button">Save</button>'
|
|
5033
|
+
html += '<button id="button-uploader-submit-audit" class="button-submit" part="button">Save</button>'
|
|
5034
|
+
html += '</div>'
|
|
5035
|
+
|
|
5036
|
+
html += '<div class="d-flex m-20 flex-col">';
|
|
5037
|
+
html += '<label part="input-label">Auditor Comments</label>';
|
|
5038
|
+
html += '<input id="input-auditor-comments" type="text" part="input" value=""/><br />';
|
|
5039
|
+
html += '<label part="input-label">Date of Completion</label>';
|
|
5040
|
+
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 />';
|
|
5041
|
+
html += '<div>'
|
|
5042
|
+
html += '<label part="input-label">Approve?</label><br />';
|
|
5043
|
+
html += '<div class="mt-5">'
|
|
5044
|
+
html += '<input id="input-approve-yes" name="radio-approved" type="radio" checked/> Yes';
|
|
5045
|
+
html += '<input id="input-approve-no" name="radio-approved" type="radio"/> No';
|
|
5046
|
+
html += '</div>'
|
|
5047
|
+
html += '</div>';
|
|
5048
|
+
html += '<br />';
|
|
5049
|
+
if(docs.length > 0) {
|
|
5050
|
+
html += '<label part="input-label">Supporting Documents</label>';
|
|
5051
|
+
html += '<slot name="uploader"></slot>';
|
|
5052
|
+
html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>'
|
|
5053
|
+
}
|
|
5054
|
+
html += '</div>';
|
|
5055
|
+
html += '</div>';
|
|
5056
|
+
|
|
5057
|
+
}
|
|
5058
|
+
|
|
5059
|
+
if(this.myRole == this.TAB_VIEWER) {
|
|
5060
|
+
|
|
5061
|
+
html += '<div class="d-flex justify-between m-20">';
|
|
5062
|
+
html += '<h3 part="results-title" class="m-0"><br />View Compliance</h3>';
|
|
5063
|
+
html += '</div>';
|
|
5064
|
+
html += '<div class="m-20" part="report-container">';
|
|
5065
|
+
|
|
5066
|
+
html += '<div class="d-flex m-20 flex-col">';
|
|
5067
|
+
html += '<div>'
|
|
5068
|
+
html += '<label part="input-label">Approve?</label><br />';
|
|
5069
|
+
html += '<div class="mt-5">'
|
|
5070
|
+
html += '<input id="input-approve-yes" name="radio-approved" type="radio" checked/> Yes';
|
|
5071
|
+
html += '<input id="input-approve-no" name="radio-approved" type="radio"/> No';
|
|
5072
|
+
html += '</div>'
|
|
5073
|
+
html += '</div>';
|
|
5074
|
+
html += '<br />';
|
|
5075
|
+
if(docs.length === 0) {
|
|
5076
|
+
html += '<label part="input-label">Supporting Documents</label>';
|
|
5077
|
+
html += '<slot name="uploader"></slot>';
|
|
5078
|
+
html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>'
|
|
5079
|
+
}
|
|
5080
|
+
html += '</div>';
|
|
5081
|
+
html += '</div>';
|
|
5082
|
+
}
|
|
5083
|
+
return html;
|
|
5084
|
+
}
|
|
5085
|
+
renderListReporting = (listReportingContainer: HTMLDivElement, event: any, mmddyyyy: any, eventsContainer: HTMLDivElement) => {
|
|
5086
|
+
let html = ''
|
|
5087
|
+
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
5088
|
+
|
|
5089
|
+
let reportformatName: string = '';
|
|
5090
|
+
if(event['reportformat'] != null){
|
|
5091
|
+
reportformatName = (event['reportformat'][0] ?? "").trim().replace('&','&');
|
|
5092
|
+
}
|
|
5093
|
+
let docs = event['documents'] == null ? [] : event['documents'] == null ? [] : (event['documents']);
|
|
5094
|
+
html = this.renderReporting(event, mmddyyyy);
|
|
5095
|
+
console.log('reporting html', html);
|
|
5096
|
+
let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
|
|
5097
|
+
for(let tempReportingContainer of listReportingContainers){
|
|
5098
|
+
tempReportingContainer.style.display = 'none';
|
|
5099
|
+
tempReportingContainer.innerHTML = '';
|
|
5100
|
+
}
|
|
5101
|
+
listReportingContainer.style.display = 'flex';
|
|
5102
|
+
listReportingContainer.innerHTML = html;
|
|
5103
|
+
listReportingContainer.querySelector('.button-delete')?.addEventListener('click', async () => {
|
|
5104
|
+
|
|
5105
|
+
await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
|
|
5106
|
+
this.setSuccess('Deleted successfully!')
|
|
5107
|
+
setTimeout(() => {
|
|
5108
|
+
this.clearMessages()
|
|
5109
|
+
}, 3000);
|
|
5110
|
+
//console.log('deleted', resultDelete);
|
|
5111
|
+
if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
5112
|
+
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
5113
|
+
} else {
|
|
5114
|
+
// if(currentColumnButton != null) {
|
|
5115
|
+
// currentColumnButton.click();
|
|
5116
|
+
// }
|
|
5117
|
+
}
|
|
5118
|
+
|
|
5119
|
+
});
|
|
5120
|
+
listReportingContainer.querySelector('#button-auto-approve')?.addEventListener('click', async () => {
|
|
5121
|
+
await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true);
|
|
5122
|
+
this.setSuccess('Auto-Approved successfully!')
|
|
5123
|
+
setTimeout(() => {
|
|
5124
|
+
this.clearMessages()
|
|
5125
|
+
}, 3000);
|
|
5126
|
+
if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
5127
|
+
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
5128
|
+
} else {
|
|
5129
|
+
// if(currentColumnButton != null) {
|
|
5130
|
+
// currentColumnButton.click();
|
|
5131
|
+
// }
|
|
5132
|
+
}
|
|
5133
|
+
|
|
5134
|
+
});
|
|
5135
|
+
if(this.mode == "consumer" || this.mode == "next") {
|
|
5136
|
+
|
|
5137
|
+
listReportingContainer.querySelector('#button-uploader-submit-approve')?.addEventListener('click', async () => {
|
|
5138
|
+
|
|
5139
|
+
const comments = (listReportingContainer.querySelector('#input-approver-comments') as HTMLInputElement).value;
|
|
5140
|
+
const approved = (listReportingContainer.querySelector('#input-approve-yes') as HTMLInputElement).checked;
|
|
5141
|
+
await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved)
|
|
5142
|
+
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
5143
|
+
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid){
|
|
5144
|
+
|
|
5145
|
+
this.events[mmdd][p].comments.push({'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toISOString()})
|
|
5146
|
+
this.events[mmdd][p].lastupdated = new Date().toISOString()
|
|
5147
|
+
}
|
|
5148
|
+
}
|
|
5149
|
+
|
|
5150
|
+
if(this.mode == "next"){
|
|
5151
|
+
// this.fetchNext(this.nextPage)
|
|
5152
|
+
this.renderRoleTabsNext(this.nextPage)
|
|
5153
|
+
}else{
|
|
5154
|
+
if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
5155
|
+
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
5156
|
+
} else if(this.getCurrentTab() == this.TAB_FIND) {
|
|
5157
|
+
const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
|
|
5158
|
+
this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
|
|
5159
|
+
} else {
|
|
5160
|
+
if(this.selectedItemIds.length > 0) {
|
|
5161
|
+
await this.fetchBulkReportingData();
|
|
5162
|
+
}
|
|
5163
|
+
this.renderAppropriateStream(this.sdate,this.edate, true);
|
|
5164
|
+
}
|
|
5165
|
+
}
|
|
5166
|
+
|
|
5167
|
+
});
|
|
5168
|
+
|
|
5169
|
+
listReportingContainer.querySelector('#button-uploader-submit-audit')?.addEventListener('click', async () => {
|
|
5170
|
+
|
|
5171
|
+
const comments = (listReportingContainer.querySelector('#input-auditor-comments') as HTMLInputElement).value;
|
|
5172
|
+
const approved = (listReportingContainer.querySelector('#input-approve-yes') as HTMLInputElement).checked;
|
|
5173
|
+
|
|
5174
|
+
if(comments.trim().length === 0) {
|
|
5175
|
+
|
|
5176
|
+
this.setError('Comments cannot be blank!');
|
|
5177
|
+
setTimeout(() => {
|
|
5178
|
+
this.clearMessages();
|
|
5179
|
+
}, 3000);
|
|
5180
|
+
|
|
5181
|
+
} else {
|
|
5182
|
+
await this.uploadAudit(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved)
|
|
5183
|
+
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
5184
|
+
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid){
|
|
5185
|
+
this.events[mmdd][p].approved = approved
|
|
5186
|
+
this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toISOString()})
|
|
5187
|
+
this.events[mmdd][p].lastupdated = new Date().toISOString()
|
|
5188
|
+
}
|
|
5189
|
+
}
|
|
5190
|
+
if(this.mode == "next"){
|
|
5191
|
+
this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
|
|
5192
|
+
}else{
|
|
5193
|
+
if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
5194
|
+
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
5195
|
+
} else if(this.getCurrentTab() == this.TAB_FIND) {
|
|
5196
|
+
const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
|
|
5197
|
+
this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
|
|
5198
|
+
} else {
|
|
5199
|
+
if(this.selectedItemIds.length > 0) {
|
|
5200
|
+
await this.fetchBulkReportingData();
|
|
5201
|
+
}
|
|
5202
|
+
this.renderAppropriateStream(this.sdate,this.edate,true);
|
|
5203
|
+
// if(currentColumnButton != null) {
|
|
5204
|
+
// currentColumnButton.click();
|
|
5205
|
+
// }
|
|
5206
|
+
}
|
|
5207
|
+
}
|
|
5208
|
+
|
|
5209
|
+
}
|
|
5210
|
+
|
|
5211
|
+
|
|
5212
|
+
|
|
5213
|
+
});
|
|
5214
|
+
|
|
5215
|
+
if(this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) {
|
|
5216
|
+
|
|
5217
|
+
if(event.approved) {
|
|
5218
|
+
|
|
5219
|
+
if((listReportingContainer.querySelector('#button-uploader-submit-report') as HTMLElement) != null) {
|
|
5220
|
+
(listReportingContainer.querySelector('#button-uploader-submit-report') as HTMLElement).style.visibility = 'hidden';
|
|
5221
|
+
}
|
|
5222
|
+
|
|
5223
|
+
|
|
5224
|
+
} else {
|
|
5225
|
+
|
|
5226
|
+
if((listReportingContainer.querySelector('#button-uploader-submit-report') as HTMLElement) != null) {
|
|
5227
|
+
|
|
5228
|
+
|
|
5229
|
+
(listReportingContainer.querySelector('#button-uploader-submit-report') as HTMLElement).style.visibility = 'visible';
|
|
5230
|
+
|
|
5231
|
+
listReportingContainer.querySelector('#button-uploader-submit-report')?.addEventListener('click', async () => {
|
|
5232
|
+
|
|
5233
|
+
const reportercomments = (listReportingContainer.querySelector('#input-reporter-comments') as HTMLInputElement).value;
|
|
5234
|
+
|
|
5235
|
+
//console.log('reporter comments 1', reportercomments);
|
|
5236
|
+
|
|
5237
|
+
const reporterdoc = (listReportingContainer.querySelector('#input-reporter-doc') as HTMLInputElement).value.length > 0 ? (new Date((listReportingContainer.querySelector('#input-reporter-doc') as HTMLInputElement).value).getTime() + "") : "";
|
|
5238
|
+
let docs:any[] = [];
|
|
5239
|
+
|
|
5240
|
+
//console.log('reporter comments 2', reportercomments);
|
|
5241
|
+
|
|
5242
|
+
// if(docsOptional.length === 0) {
|
|
5243
|
+
docs = (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.selectedValues();
|
|
5244
|
+
// }
|
|
5245
|
+
|
|
5246
|
+
//console.log('docs', docs);
|
|
5247
|
+
let reportformatvalues:string = "";
|
|
5248
|
+
let reportformatschema:string = "";
|
|
5249
|
+
if(this._SfReporting[0] != null){
|
|
5250
|
+
reportformatvalues = JSON.stringify((this._SfReporting[0].querySelector('#reporting-format') as SfIReporting)!.selectedValues()) ?? "";
|
|
5251
|
+
reportformatschema = (this._SfReporting[0].querySelector('#reporting-format') as SfIReporting)!.configjson ?? "";
|
|
5252
|
+
}
|
|
5253
|
+
|
|
5254
|
+
|
|
5255
|
+
if(docs.length === 0 && event.docsOptional.length === 0) {
|
|
5256
|
+
|
|
5257
|
+
//console.log('reporter comments 3', reportercomments);
|
|
5258
|
+
|
|
5259
|
+
this.setError('No documents uploaded!');
|
|
5260
|
+
setTimeout(() => {
|
|
5261
|
+
this.clearMessages();
|
|
5262
|
+
}, 3000);
|
|
5263
|
+
|
|
5264
|
+
} else {
|
|
5265
|
+
|
|
5266
|
+
//console.log('reporterdoc', reporterdoc);
|
|
5267
|
+
|
|
5268
|
+
if(reporterdoc.length === 0) {
|
|
5269
|
+
|
|
5270
|
+
this.setError('Date of completion not selected!');
|
|
5271
|
+
setTimeout(() => {
|
|
5272
|
+
this.clearMessages();
|
|
5273
|
+
}, 3000);
|
|
5274
|
+
|
|
5275
|
+
} else {
|
|
5276
|
+
|
|
5277
|
+
//console.log('makerscheckers 1', reportercomments);
|
|
5278
|
+
|
|
5279
|
+
if(reportercomments.trim().length === 0) {
|
|
5280
|
+
|
|
5281
|
+
this.setError('Comments cannot be blank!');
|
|
5282
|
+
setTimeout(() => {
|
|
5283
|
+
this.clearMessages();
|
|
5284
|
+
}, 3000);
|
|
5285
|
+
|
|
5286
|
+
} else {
|
|
5287
|
+
|
|
5288
|
+
await this.uploadReport(event.entityid, event.locationid, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema)
|
|
5289
|
+
console.log('this.events', this.events);
|
|
5290
|
+
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
5291
|
+
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid){
|
|
5292
|
+
this.events[mmdd][p].documents = docs
|
|
5293
|
+
this.events[mmdd][p].comments.push({'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toISOString()})
|
|
5294
|
+
this.events[mmdd][p].lastupdated = new Date().toISOString()
|
|
5295
|
+
}
|
|
5296
|
+
}
|
|
5297
|
+
if(event.makercheckers.length > 0) {
|
|
5298
|
+
|
|
5299
|
+
await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true);
|
|
5300
|
+
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
5301
|
+
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid){
|
|
5302
|
+
this.events[mmdd][p].approved = true
|
|
5303
|
+
// this.events[mmdd][p].documents = docs
|
|
5304
|
+
this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toISOString()})
|
|
5305
|
+
this.events[mmdd][p].lastupdated = new Date().toISOString()
|
|
5306
|
+
}
|
|
5307
|
+
}
|
|
5308
|
+
}
|
|
5309
|
+
|
|
5310
|
+
if(this.mode == "next"){
|
|
5311
|
+
this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
|
|
5312
|
+
}else{
|
|
5313
|
+
if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
5314
|
+
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
5315
|
+
} else if(this.getCurrentTab() == this.TAB_FIND) {
|
|
5316
|
+
const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
|
|
5317
|
+
this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
|
|
5318
|
+
} else {
|
|
5319
|
+
if(this.selectedItemIds.length > 0) {
|
|
5320
|
+
await this.fetchBulkReportingData();
|
|
5321
|
+
}
|
|
5322
|
+
this.renderAppropriateStream(this.sdate,this.edate,true)
|
|
5323
|
+
// if(currentColumnButton != null) {
|
|
5324
|
+
// currentColumnButton.click();
|
|
5325
|
+
// }
|
|
5326
|
+
}
|
|
5327
|
+
}
|
|
5328
|
+
|
|
5329
|
+
}
|
|
5330
|
+
}
|
|
5331
|
+
}
|
|
5332
|
+
|
|
5333
|
+
});
|
|
5334
|
+
|
|
5335
|
+
}
|
|
5336
|
+
|
|
5337
|
+
}
|
|
5338
|
+
|
|
5339
|
+
}
|
|
5340
|
+
|
|
5341
|
+
if(this._SfUploader[0] != null) {
|
|
5342
|
+
if((listReportingContainer.querySelector('.uploader-analysis-message') as HTMLDivElement) != null){
|
|
5343
|
+
(listReportingContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "none"
|
|
5344
|
+
}
|
|
5345
|
+
this._SfUploader[0].querySelector('#uploader').addEventListener('analysisInProgress', (_ev: any) => {
|
|
5346
|
+
console.log('uploader analysisInProgress', _ev);
|
|
5347
|
+
(listReportingContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "block"
|
|
5348
|
+
});
|
|
5349
|
+
this._SfUploader[0].querySelector('#uploader').addEventListener('analysisCompleted', (_ev: any) => {
|
|
5350
|
+
console.log('uploader analysisInProgress', _ev);
|
|
5351
|
+
(listReportingContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "none"
|
|
5352
|
+
});
|
|
5353
|
+
|
|
5354
|
+
|
|
5355
|
+
//console.log('documentType checking', documentType);
|
|
5356
|
+
|
|
5357
|
+
if(event.documentType != null) {
|
|
5358
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.docType = event.documentType;
|
|
5359
|
+
}
|
|
5360
|
+
|
|
5361
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.prepopulatedInputArr = JSON.stringify([]);
|
|
5362
|
+
console.log('uploader', (this._SfUploader[0].querySelector('#uploader') as SfIUploader));
|
|
5363
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
|
|
5364
|
+
|
|
5365
|
+
if(docs.length > 0) {
|
|
5366
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.prepopulatedInputArr = JSON.stringify(docs);
|
|
5367
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
|
|
5368
|
+
}
|
|
5369
|
+
|
|
5370
|
+
if(this.myRole == this.TAB_APPROVER || event.approved) {
|
|
5371
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.readOnly = true;
|
|
5372
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
|
|
5373
|
+
} else {
|
|
5374
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.readOnly = false;
|
|
5375
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
|
|
5376
|
+
}
|
|
5377
|
+
|
|
5378
|
+
const dataPassthrough = {
|
|
5379
|
+
projectId: this.projectId,
|
|
5380
|
+
countryId: this.countryId,
|
|
5381
|
+
entityId: event.entityid,
|
|
5382
|
+
locationId: event.locationid,
|
|
5383
|
+
mmddyyyy: mmddyyyy,
|
|
5384
|
+
complianceId: event['id'],
|
|
5385
|
+
path: "uploadextract"
|
|
5386
|
+
};
|
|
5387
|
+
|
|
5388
|
+
const callbackUrlHost = "8icpy39ru0.execute-api.us-east-1.amazonaws.com";
|
|
5389
|
+
const callbackUrlPath = "test/uploadextract";
|
|
5390
|
+
|
|
5391
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.projectId = this.projectId;
|
|
5392
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.dataPassthrough = JSON.stringify(dataPassthrough);
|
|
5393
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.callbackUrlHost = callbackUrlHost;
|
|
5394
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.callbackUrlPath = callbackUrlPath;
|
|
5395
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
|
|
5396
|
+
|
|
5397
|
+
}
|
|
5398
|
+
|
|
5399
|
+
|
|
5400
|
+
|
|
5401
|
+
//console.log('approved 1', event["approved"], this.myRole, this.TAB_APPROVER);
|
|
5402
|
+
if(this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_VIEWER || this.myRole == this.TAB_AUDITOR || this.myRole == this.TAB_FUNCTION_HEAD) {
|
|
5403
|
+
//console.log('approved 1', event["approved"], this.myRole, this.TAB_APPROVER);
|
|
5404
|
+
if(event["approved"] != null) {
|
|
5405
|
+
if(event["approved"] === true) {
|
|
5406
|
+
//console.log('approved 2', event["approved"], this.myRole, this.TAB_APPROVER);
|
|
5407
|
+
if((listReportingContainer.querySelector('#input-approve-yes') as HTMLInputElement) != null) {
|
|
5408
|
+
(listReportingContainer.querySelector('#input-approve-yes') as HTMLInputElement).checked = true;
|
|
5409
|
+
}
|
|
5410
|
+
if((listReportingContainer.querySelector('#input-approve-no') as HTMLInputElement) != null) {
|
|
5411
|
+
(listReportingContainer.querySelector('#input-approve-no') as HTMLInputElement).checked = false;
|
|
5412
|
+
}
|
|
5413
|
+
} else {
|
|
5414
|
+
if((listReportingContainer.querySelector('#input-approve-yes') as HTMLInputElement) != null) {
|
|
5415
|
+
(listReportingContainer.querySelector('#input-approve-yes') as HTMLInputElement)!.checked = false;
|
|
5416
|
+
}
|
|
5417
|
+
if((listReportingContainer.querySelector('#input-approve-no') as HTMLInputElement) != null) {
|
|
5418
|
+
(listReportingContainer.querySelector('#input-approve-no') as HTMLInputElement)!.checked = true;
|
|
5419
|
+
}
|
|
5420
|
+
}
|
|
5421
|
+
} else {
|
|
5422
|
+
if(listReportingContainer.querySelector('#input-approve-yes') as HTMLInputElement != null) {
|
|
5423
|
+
(listReportingContainer.querySelector('#input-approve-yes') as HTMLInputElement).checked = false;
|
|
5424
|
+
}
|
|
5425
|
+
if((listReportingContainer.querySelector('#input-approve-no') as HTMLInputElement) != null) {
|
|
5426
|
+
(listReportingContainer.querySelector('#input-approve-no') as HTMLInputElement).checked = true;
|
|
5427
|
+
}
|
|
5428
|
+
}
|
|
5429
|
+
}
|
|
5430
|
+
}
|
|
5431
|
+
if(event['reportformat'] != null && event['reportformat'].length > 0){
|
|
5432
|
+
this.fetchReportFormat(listReportingContainer, reportformatName, event['reportformatschema'] ?? "", event['reportformatvalues'] ?? "");
|
|
5433
|
+
}
|
|
5434
|
+
}
|
|
5435
|
+
|
|
4910
5436
|
renderStreamEvents = (index: number, month: number, year: number, showGraph: boolean = true) => {
|
|
4911
5437
|
|
|
4912
5438
|
//console.log('flowgraph renderStreamEvents', this.flowGraph);
|
|
@@ -4997,6 +5523,25 @@ export class SfIEvents extends LitElement {
|
|
|
4997
5523
|
buttonRefresh.addEventListener('click',async ()=>{
|
|
4998
5524
|
this.processDateSelection(eventsContainer)
|
|
4999
5525
|
})
|
|
5526
|
+
let buttonListReports = eventsContainer.querySelectorAll('.button-list-reporting') as NodeListOf<HTMLButtonElement>
|
|
5527
|
+
for(let buttonListReport of buttonListReports){
|
|
5528
|
+
buttonListReport?.addEventListener('click',(ev:any) => {
|
|
5529
|
+
const id = ev.target.id;
|
|
5530
|
+
const idArr = id.split("-")
|
|
5531
|
+
const mmdd = idArr[3] + "/" + idArr[4];
|
|
5532
|
+
const yyyy = this.getCurrentYear(idArr[3]);
|
|
5533
|
+
const i = idArr[5];
|
|
5534
|
+
const j = idArr[6];
|
|
5535
|
+
let listReportingContainer = eventsContainer.querySelector('#list-reporting-container-'+i+'-'+j) as HTMLDivElement
|
|
5536
|
+
console.log('mmddyyyy', this.events[mmdd][j], 'display',listReportingContainer.style.display);
|
|
5537
|
+
if(listReportingContainer.style.display == 'none' || listReportingContainer.style.display == ''){
|
|
5538
|
+
this.renderListReporting(listReportingContainer,this.events[mmdd][j], mmdd + '/' + yyyy, (this._SfStreamContainer as HTMLDivElement))
|
|
5539
|
+
}else{
|
|
5540
|
+
listReportingContainer.innerHTML = '';
|
|
5541
|
+
listReportingContainer.style.display = 'none';
|
|
5542
|
+
}
|
|
5543
|
+
})
|
|
5544
|
+
}
|
|
5000
5545
|
const buttonArr = eventsContainer.querySelectorAll('.button-expand') as NodeListOf<HTMLButtonElement>;
|
|
5001
5546
|
|
|
5002
5547
|
for(var i = 0; i < buttonArr.length; i++) {
|
|
@@ -5025,7 +5570,7 @@ export class SfIEvents extends LitElement {
|
|
|
5025
5570
|
var yyyy = this.getCurrentYear(idArr[3]);
|
|
5026
5571
|
|
|
5027
5572
|
// this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, null);
|
|
5028
|
-
this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, null);
|
|
5573
|
+
this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, null, eventsContainer);
|
|
5029
5574
|
|
|
5030
5575
|
})
|
|
5031
5576
|
|
|
@@ -8247,6 +8792,25 @@ export class SfIEvents extends LitElement {
|
|
|
8247
8792
|
await this.fetchAndYearlyRenderUserCalendar_2(dateResult.startDate, dateResult.endDate);
|
|
8248
8793
|
this.renderThis(index);
|
|
8249
8794
|
})
|
|
8795
|
+
let buttonListReports = (this._SfThisContainer as HTMLDivElement).querySelectorAll('.button-list-reporting') as NodeListOf<HTMLButtonElement>
|
|
8796
|
+
for(let buttonListReport of buttonListReports){
|
|
8797
|
+
buttonListReport?.addEventListener('click',(ev:any) => {
|
|
8798
|
+
const id = ev.target.id;
|
|
8799
|
+
const idArr = id.split("-")
|
|
8800
|
+
const mmdd = idArr[3] + "/" + idArr[4];
|
|
8801
|
+
const yyyy = this.getCurrentYear(idArr[3]);
|
|
8802
|
+
const i = idArr[5];
|
|
8803
|
+
const j = idArr[6];
|
|
8804
|
+
let listReportingContainer = (this._SfThisContainer as HTMLDivElement).querySelector('#list-reporting-container-'+i+'-'+j) as HTMLDivElement
|
|
8805
|
+
console.log('mmddyyyy', this.events[mmdd][j], 'display',listReportingContainer.style.display);
|
|
8806
|
+
if(listReportingContainer.style.display == 'none' || listReportingContainer.style.display == ''){
|
|
8807
|
+
this.renderListReporting(listReportingContainer,this.events[mmdd][j], mmdd + '/' + yyyy, (this._SfStreamContainer as HTMLDivElement))
|
|
8808
|
+
}else{
|
|
8809
|
+
listReportingContainer.innerHTML = '';
|
|
8810
|
+
listReportingContainer.style.display = 'none';
|
|
8811
|
+
}
|
|
8812
|
+
})
|
|
8813
|
+
}
|
|
8250
8814
|
const buttonArr = (this._SfThisContainer as HTMLDivElement).querySelectorAll('.button-expand') as NodeListOf<HTMLButtonElement>;
|
|
8251
8815
|
|
|
8252
8816
|
for(i = 0; i < buttonArr.length; i++) {
|
|
@@ -8274,7 +8838,7 @@ export class SfIEvents extends LitElement {
|
|
|
8274
8838
|
var yyyy = this.getCurrentYear(idArr[3]);
|
|
8275
8839
|
|
|
8276
8840
|
// this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfThisContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement);
|
|
8277
|
-
this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfThisContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement);
|
|
8841
|
+
this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfThisContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement, this._SfThisContainer as HTMLDivElement);
|
|
8278
8842
|
|
|
8279
8843
|
})
|
|
8280
8844
|
|
|
@@ -8408,7 +8972,7 @@ export class SfIEvents extends LitElement {
|
|
|
8408
8972
|
|
|
8409
8973
|
renderButtonRefresh = (eventsContainer: HTMLDivElement) => {
|
|
8410
8974
|
document.addEventListener('scroll',() => {
|
|
8411
|
-
console.log('scroll',window.scrollY)
|
|
8975
|
+
// console.log('scroll',window.scrollY)
|
|
8412
8976
|
let buttonRefresh = eventsContainer.querySelector('#button-refresh') as HTMLButtonElement
|
|
8413
8977
|
if(window.scrollY > 720){
|
|
8414
8978
|
if(buttonRefresh.style.display == "flex"){
|
|
@@ -8610,6 +9174,7 @@ export class SfIEvents extends LitElement {
|
|
|
8610
9174
|
|
|
8611
9175
|
});
|
|
8612
9176
|
|
|
9177
|
+
|
|
8613
9178
|
// const buttonStatusMore = (this._SfStreamContainer as HTMLDivElement).querySelector('#button-status-more');
|
|
8614
9179
|
// buttonStatusMore?.addEventListener('click', () => {
|
|
8615
9180
|
|
|
@@ -8665,6 +9230,26 @@ export class SfIEvents extends LitElement {
|
|
|
8665
9230
|
this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
|
|
8666
9231
|
this.renderStream(index);
|
|
8667
9232
|
})
|
|
9233
|
+
|
|
9234
|
+
let buttonListReports = (this._SfStreamContainer as HTMLDivElement).querySelectorAll('.button-list-reporting') as NodeListOf<HTMLButtonElement>
|
|
9235
|
+
for(let buttonListReport of buttonListReports){
|
|
9236
|
+
buttonListReport?.addEventListener('click',(ev:any) => {
|
|
9237
|
+
const id = ev.target.id;
|
|
9238
|
+
const idArr = id.split("-")
|
|
9239
|
+
const mmdd = idArr[3] + "/" + idArr[4];
|
|
9240
|
+
const yyyy = this.getCurrentYear(idArr[3]);
|
|
9241
|
+
const i = idArr[5];
|
|
9242
|
+
const j = idArr[6];
|
|
9243
|
+
let listReportingContainer = (this._SfStreamContainer as HTMLDivElement).querySelector('#list-reporting-container-'+i+'-'+j) as HTMLDivElement
|
|
9244
|
+
console.log('mmddyyyy', this.events[mmdd][j], 'display',listReportingContainer.style.display);
|
|
9245
|
+
if(listReportingContainer.style.display == 'none' || listReportingContainer.style.display == ''){
|
|
9246
|
+
this.renderListReporting(listReportingContainer,this.events[mmdd][j], mmdd + '/' + yyyy, (this._SfStreamContainer as HTMLDivElement))
|
|
9247
|
+
}else{
|
|
9248
|
+
listReportingContainer.innerHTML = '';
|
|
9249
|
+
listReportingContainer.style.display = 'none';
|
|
9250
|
+
}
|
|
9251
|
+
})
|
|
9252
|
+
}
|
|
8668
9253
|
const buttonArr = (this._SfStreamContainer as HTMLDivElement).querySelectorAll('.button-expand') as NodeListOf<HTMLButtonElement>;
|
|
8669
9254
|
|
|
8670
9255
|
for(i = 0; i < buttonArr.length; i++) {
|
|
@@ -8695,7 +9280,7 @@ export class SfIEvents extends LitElement {
|
|
|
8695
9280
|
var yyyy = this.getCurrentYear(idArr[3]);
|
|
8696
9281
|
|
|
8697
9282
|
// this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement);
|
|
8698
|
-
this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement);
|
|
9283
|
+
this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement, this._SfStreamContainer as HTMLDivElement);
|
|
8699
9284
|
|
|
8700
9285
|
})
|
|
8701
9286
|
|
|
@@ -9725,7 +10310,7 @@ export class SfIEvents extends LitElement {
|
|
|
9725
10310
|
|
|
9726
10311
|
}
|
|
9727
10312
|
|
|
9728
|
-
fetchEventDetails = async (listEvent: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null) => {
|
|
10313
|
+
fetchEventDetails = async (listEvent: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement) => {
|
|
9729
10314
|
console.log('listEvent', listEvent, listEvent.id)
|
|
9730
10315
|
let url = "https://"+this.apiId+"/getalleventdetails";
|
|
9731
10316
|
|
|
@@ -9741,7 +10326,7 @@ export class SfIEvents extends LitElement {
|
|
|
9741
10326
|
|
|
9742
10327
|
const jsonRespose = JSON.parse(xhr.responseText);
|
|
9743
10328
|
console.log('jsonRespose', jsonRespose);
|
|
9744
|
-
this.renderEventDetail(jsonRespose.data,mmddyyyy, currentColumnButton);
|
|
10329
|
+
this.renderEventDetail(jsonRespose.data,mmddyyyy, currentColumnButton, eventsContainer);
|
|
9745
10330
|
|
|
9746
10331
|
} else {
|
|
9747
10332
|
|
|
@@ -9759,10 +10344,10 @@ export class SfIEvents extends LitElement {
|
|
|
9759
10344
|
}
|
|
9760
10345
|
}
|
|
9761
10346
|
|
|
9762
|
-
renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null) => {
|
|
10347
|
+
renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement) => {
|
|
9763
10348
|
console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
|
|
9764
10349
|
|
|
9765
|
-
let comments, docs, approved, dateOfCompletion
|
|
10350
|
+
let comments, docs, approved, /*dateOfCompletion,*/ makercheckers: Array<string>, docsOptional, documentType;
|
|
9766
10351
|
let entityId: string = "";
|
|
9767
10352
|
let locationId: string = "";
|
|
9768
10353
|
let statuteName: string = "";
|
|
@@ -9770,11 +10355,11 @@ export class SfIEvents extends LitElement {
|
|
|
9770
10355
|
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
9771
10356
|
entityId = event.entityid;
|
|
9772
10357
|
locationId = event.locationid;
|
|
9773
|
-
let completeness = this.getCompletenessStatus(event);
|
|
10358
|
+
// let completeness = this.getCompletenessStatus(event);
|
|
9774
10359
|
comments = event['comments'] == null ? [] : (event['comments']);
|
|
9775
10360
|
docs = event['documents'] == null ? [] : event['documents'] == null ? [] : (event['documents']);
|
|
9776
10361
|
approved = event['approved'] == null ? false : event['approved'] == null ? false : event['approved'];
|
|
9777
|
-
dateOfCompletion = event['dateofcompletion'] == null ? '' : event['dateofcompletion'] == null ? '' : event['dateofcompletion'];
|
|
10362
|
+
// dateOfCompletion = event['dateofcompletion'] == null ? '' : event['dateofcompletion'] == null ? '' : event['dateofcompletion'];
|
|
9778
10363
|
makercheckers = event['makercheckers'] == null ? [] : event['makercheckers'] == null ? [] : event['makercheckers'];
|
|
9779
10364
|
docsOptional = event['docs'] == null ? [] : event['docs'] == null ? [] : event['docs'];
|
|
9780
10365
|
documentType = event['documenttype'] == null ? null : event['documenttype'][0] == null ? null : event['documenttype'][0].split(" ")[0];
|
|
@@ -9793,6 +10378,12 @@ export class SfIEvents extends LitElement {
|
|
|
9793
10378
|
const complianceFields = ['specificity', 'reference', 'obligation', 'penalty', 'authority', 'frequency', 'obligationtype', 'duedate', 'applicability', 'form'];
|
|
9794
10379
|
const grcFields = ['internalcontrols', 'firstlineofdefence', 'risk', 'riskarea'];
|
|
9795
10380
|
|
|
10381
|
+
let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
|
|
10382
|
+
for(let tempReportingContainer of listReportingContainers){
|
|
10383
|
+
tempReportingContainer.style.display = 'none';
|
|
10384
|
+
tempReportingContainer.innerHTML = '';
|
|
10385
|
+
}
|
|
10386
|
+
|
|
9796
10387
|
var html = `
|
|
9797
10388
|
|
|
9798
10389
|
<div class="d-flex justify-between m-20">
|
|
@@ -10046,7 +10637,7 @@ export class SfIEvents extends LitElement {
|
|
|
10046
10637
|
//console.log('docs received', comments);
|
|
10047
10638
|
//console.log('docs received', approved);
|
|
10048
10639
|
|
|
10049
|
-
if(this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) {
|
|
10640
|
+
/* if(this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) {
|
|
10050
10641
|
|
|
10051
10642
|
if(comments.length > 0) {
|
|
10052
10643
|
|
|
@@ -10214,7 +10805,8 @@ export class SfIEvents extends LitElement {
|
|
|
10214
10805
|
html += '</div>';
|
|
10215
10806
|
html += '</div>';
|
|
10216
10807
|
|
|
10217
|
-
}
|
|
10808
|
+
} */
|
|
10809
|
+
html += this.renderReporting(event, mmddyyyy);
|
|
10218
10810
|
|
|
10219
10811
|
html += '<div class="d-flex justify-between m-20">';
|
|
10220
10812
|
html += '<h3 part="results-title" class="m-0"><br />Comments</h3>';
|
|
@@ -10963,7 +11555,7 @@ export class SfIEvents extends LitElement {
|
|
|
10963
11555
|
this.fetchStatuteDefinitionDetails(statuteName);
|
|
10964
11556
|
|
|
10965
11557
|
if(event['reportformat'] != null && event['reportformat'].length > 0){
|
|
10966
|
-
this.fetchReportFormat(reportformatName, event['reportformatschema'] ?? "", event['reportformatvalues'] ?? "");
|
|
11558
|
+
this.fetchReportFormat((this._SfDetailContainer as HTMLDivElement), reportformatName, event['reportformatschema'] ?? "", event['reportformatvalues'] ?? "");
|
|
10967
11559
|
}
|
|
10968
11560
|
}
|
|
10969
11561
|
|
|
@@ -12086,7 +12678,7 @@ export class SfIEvents extends LitElement {
|
|
|
12086
12678
|
if(equal) {
|
|
12087
12679
|
|
|
12088
12680
|
(multiArr[i] as SfIForm).preselectedValues = JSON.stringify(taggingArray.data.mappings.mappings[j][colName]);
|
|
12089
|
-
if(taggingArray.data.mappings.mappings[j][colName].length > 0) {
|
|
12681
|
+
if(taggingArray.data.mappings.mappings[j][colName] != null && taggingArray.data.mappings.mappings[j][colName].length > 0) {
|
|
12090
12682
|
((multiArr[i] as SfIForm).parentElement as HTMLTableCellElement).setAttribute("part", "row-mapped");
|
|
12091
12683
|
}
|
|
12092
12684
|
|
|
@@ -19297,7 +19889,7 @@ export class SfIEvents extends LitElement {
|
|
|
19297
19889
|
|
|
19298
19890
|
}
|
|
19299
19891
|
|
|
19300
|
-
fetchReportFormat = async(searchName: string, reportformatschema: string = "", reportformatvalues: string = "") => {
|
|
19892
|
+
fetchReportFormat = async(reportingContainer: HTMLDivElement, searchName: string, reportformatschema: string = "", reportformatvalues: string = "") => {
|
|
19301
19893
|
let jsonContentIndex:number;
|
|
19302
19894
|
let jsonContentFound:string = "";
|
|
19303
19895
|
if(reportformatschema == ""){
|
|
@@ -19322,15 +19914,17 @@ export class SfIEvents extends LitElement {
|
|
|
19322
19914
|
console.log('format not found');
|
|
19323
19915
|
return;
|
|
19324
19916
|
}
|
|
19325
|
-
(
|
|
19326
|
-
|
|
19327
|
-
|
|
19328
|
-
|
|
19329
|
-
|
|
19330
|
-
|
|
19331
|
-
(
|
|
19917
|
+
if(reportingContainer.querySelector('#report-format-container') != null){
|
|
19918
|
+
reportingContainer.querySelector('#report-format-container')!.innerHTML = `<slot name="reporting"></slot>`;
|
|
19919
|
+
console.log('innerhtml', reportingContainer.querySelector('#report-format-container')!.innerHTML);
|
|
19920
|
+
(this._SfReporting[0].querySelector('#reporting-format') as SfIReporting).name = searchName;
|
|
19921
|
+
(this._SfReporting[0].querySelector('#reporting-format') as SfIReporting).mode = reportformatvalues != "" ? "edit" : "new";
|
|
19922
|
+
(this._SfReporting[0].querySelector('#reporting-format') as SfIReporting).configjson = jsonContentFound;
|
|
19923
|
+
if(reportformatvalues != ""){
|
|
19924
|
+
(this._SfReporting[0].querySelector('#reporting-format') as SfIReporting).prepopulateValJson = reportformatvalues
|
|
19925
|
+
}
|
|
19926
|
+
(this._SfReporting[0].querySelector('#reporting-format') as SfIReporting).loadMode();
|
|
19332
19927
|
}
|
|
19333
|
-
(this._SfReporting[0].querySelector('#reporting-format') as SfIReporting).loadMode();
|
|
19334
19928
|
}
|
|
19335
19929
|
|
|
19336
19930
|
fetchSearchReportformats = async (searchString: string, cursor: string = "") => {
|
|
@@ -21613,7 +22207,7 @@ export class SfIEvents extends LitElement {
|
|
|
21613
22207
|
}
|
|
21614
22208
|
console.log('redering detail', this.myRole)
|
|
21615
22209
|
// this.renderEventDetail(eventsData[role][mmdd][j], mmdd + "/" + yyyy, null);
|
|
21616
|
-
this.fetchEventDetails(eventsData[role][mmdd][j], mmdd + "/" + yyyy, null);
|
|
22210
|
+
this.fetchEventDetails(eventsData[role][mmdd][j], mmdd + "/" + yyyy, null, (this._SfIEventsC as HTMLDivElement));
|
|
21617
22211
|
|
|
21618
22212
|
})
|
|
21619
22213
|
|