sf-i-events 1.0.879 → 1.0.881

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.
@@ -1249,6 +1249,9 @@ export class SfIEvents extends LitElement {
1249
1249
  @property()
1250
1250
  apiIdLicenses!: string;
1251
1251
 
1252
+ @property()
1253
+ apiIdRCMResources!: string;
1254
+
1252
1255
  @property()
1253
1256
  apiMethodList!: string;
1254
1257
 
@@ -4270,7 +4273,7 @@ export class SfIEvents extends LitElement {
4270
4273
  getComplianceStatus = (completeness: string, timeliness: string, percentage?: string, event: any = {}) => {
4271
4274
  if (event.module == "contract") {
4272
4275
  console.log('compliance status', event.terminated, completeness, timeliness)
4273
- if(event.terminated){
4276
+ if (event.terminated) {
4274
4277
  return "terminated"
4275
4278
  }
4276
4279
  if (completeness == "not-started") {
@@ -4757,7 +4760,7 @@ export class SfIEvents extends LitElement {
4757
4760
  const moduleType = event.module ?? 'compliance';
4758
4761
  const partStatusSanitized = partStatus.replace(/-/g, '_');
4759
4762
  const entityIdSanitized = event.entityid.replace(/-/g, '_');
4760
- const locationIdSanitized = event.locationid.replace(/-/g, '_');
4763
+ const locationIdSanitized = (event.locationid ?? "").replace(/-/g, '_');
4761
4764
  const eventIdSanitized = event.id.replace(/-/g, '_');
4762
4765
  const mmddSanitized = mmdd.replace(/\//g, '-');
4763
4766
  const dueDateParts = event.duedate.split('/');
@@ -5157,11 +5160,25 @@ export class SfIEvents extends LitElement {
5157
5160
  html += this.renderCalendarEventSummary();
5158
5161
 
5159
5162
 
5160
- // csvCols += 'Period,Status,Id,ObligationTitle,Obligation,Duedate'
5161
- csvCols += 'Id,Country,Entity,Location,Function,Reporter,Approver,Functionhead,State,Jurisdiction,Category,Subcategory,Statute,Reference,Applicability,ObligationType,ObligationTitle,Obligation,Firstlineofdefence,Secondlineofdefence,Thirdlineofdefence,Internalcontrols,Penalty,Form,AdditionalUrl,Definition,Authority,RiskSeverity,RiskAreas,Frequency,SubFrequency,DueDate,Status,ReportParameter'
5162
- htmlCols += '<tr><th class="td-thin">Id</th><th class="td-thin">Country</th><th class="td-thin">State</th><th class="td-thin">Jurisdiction</th><th class="td-thin">Category</th><th class="td-thin">Subcategory</th><th class="td-wide">Statute</th><th class="td-thin">Reference</th><th class="td-thin">Applicability</th><th class="td-thin">ObligationType</th><th class="td-wide">ObligationTitle</th><th class="td-wide">Obligation</th><th class="td-thin">Firstlineofdefence</th><th class="td-thin">Secondlineofdefence</th><th class="td-thin">Thirdlineofdefence</th><th>InternalControls</th><th class="td-wide">Penalty</th><th class="td-thin">Form</th><th class="td-thin">Additional URL</th><th class="td-thin">Definition</th><th class="td-thin">Authority</th><th class="td-thin">RiskSeverity</th><th class="td-wide">RiskAreas</th><th class="td-thin">Frequency</th><th class="td-thin">SubFrequency</th><th class="td-thin">DueDate</th><th class="td-wide">Status</th><th class="td-wide">ReportParameter</th></tr>'
5163
+ if (this.selectedFeatures.indexOf('contracts') >= 0) {
5164
+ csvCols += 'Id,ReferenceNo.,Type,Country,Entity,Location,Party1,Party2,Party3,Reporter,Approver,Functionhead,DueDate,Status,ReportParameter'
5165
+ htmlCols += '<tr><th class="td-thin">Id</th><th class="td-thin">Reference No.</th><th class="td-thin">Type</th><th class="td-thin">Country</th><th class="td-thin">Entity</th><th class="td-thin">Location</th><th class="td-thin">Party 1</th><th class="td-thin">Party 2</th><th class="td-wide">Party 3</th><th class="td-thin">DueDate</th><th class="td-wide">Status</th><th class="td-wide">ReportParameter</th></tr>'
5166
+
5167
+ } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
5168
+ csvCols += 'Id,ReferenceNo.,Type,Country,Entity,Location,Reporter,Approver,Functionhead,State,Jurisdiction,Category,Subcategory,Statute,ObligationType,RiskSeverity,RiskAreas,Frequency,SubFrequency,DueDate,Status,ReportParameter'
5169
+ htmlCols += '<tr><th class="td-thin">Id</th><th class="td-thin">Reference No.</th><th class="td-thin">Type</th><th class="td-thin">Country</th><th class="td-thin">Entity</th><th class="td-thin">Location</th><th class="td-thin">State</th><th class="td-thin">Jurisdiction</th><th class="td-thin">Category</th><th class="td-thin">Subcategory</th><th class="td-wide">Statute</th><th class="td-thin">ObligationType</th><th class="td-thin">RiskSeverity</th><th class="td-wide">RiskAreas</th><th class="td-thin">Frequency</th><th class="td-thin">SubFrequency</th><th class="td-thin">DueDate</th><th class="td-wide">Status</th><th class="td-wide">ReportParameter</th></tr>'
5170
+ } else {
5171
+ csvCols += 'Id,Country,Entity,Location,Function,Reporter,Approver,Functionhead,State,Jurisdiction,Category,Subcategory,Statute,Reference,Applicability,ObligationType,ObligationTitle,Obligation,Firstlineofdefence,Secondlineofdefence,Thirdlineofdefence,Internalcontrols,Penalty,Form,AdditionalUrl,Definition,Authority,RiskSeverity,RiskAreas,Frequency,SubFrequency,DueDate,Status,ReportParameter'
5172
+ htmlCols += '<tr><th class="td-thin">Id</th><th class="td-thin">Country</th><th class="td-thin">State</th><th class="td-thin">Jurisdiction</th><th class="td-thin">Category</th><th class="td-thin">Subcategory</th><th class="td-wide">Statute</th><th class="td-thin">Reference</th><th class="td-thin">Applicability</th><th class="td-thin">ObligationType</th><th class="td-wide">ObligationTitle</th><th class="td-wide">Obligation</th><th class="td-thin">Firstlineofdefence</th><th class="td-thin">Secondlineofdefence</th><th class="td-thin">Thirdlineofdefence</th><th>InternalControls</th><th class="td-wide">Penalty</th><th class="td-thin">Form</th><th class="td-thin">Additional URL</th><th class="td-thin">Definition</th><th class="td-thin">Authority</th><th class="td-thin">RiskSeverity</th><th class="td-wide">RiskAreas</th><th class="td-thin">Frequency</th><th class="td-thin">SubFrequency</th><th class="td-thin">DueDate</th><th class="td-wide">Status</th><th class="td-wide">ReportParameter</th></tr>'
5173
+ }
5163
5174
 
5164
- htmlSummaryCols += '<tr><th class="td-thin">Id</th><th class="td-wide">ObligationTitle</th><th class="td-wide">Status</th><th class="td-wide">Documents</th></tr>'
5175
+ if (this.selectedFeatures.indexOf('contracts') >= 0) {
5176
+ htmlSummaryCols += '<tr><th class="td-thin">Id</th><th class="td-wide">Reference No.</th><th class="td-wide">Status</th><th class="td-wide">Documents</th></tr>'
5177
+ } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
5178
+ htmlSummaryCols += '<tr><th class="td-thin">Id</th><th class="td-wide">Reference No.</th><th class="td-wide">Status</th><th class="td-wide">Documents</th></tr>'
5179
+ } else {
5180
+ htmlSummaryCols += '<tr><th class="td-thin">Id</th><th class="td-wide">ObligationTitle</th><th class="td-wide">Status</th><th class="td-wide">Documents</th></tr>'
5181
+ }
5165
5182
 
5166
5183
  for (var i = iInit; i <= iLast; i++) {
5167
5184
 
@@ -5243,94 +5260,199 @@ export class SfIEvents extends LitElement {
5243
5260
 
5244
5261
  this.events[mmdd][j][this.FLOW_GRAPH_COMPLETENESS] = partStatus;
5245
5262
  this.events[mmdd][j][this.FLOW_GRAPH_TIMELINESS] = lateStatus;
5263
+ if(this.events[mmdd][j][this.FLOW_GRAPH_COMPLIANCE] != null){
5264
+ this.events[mmdd][j][this.FLOW_GRAPH_COMPLIANCE + "obj"] = this.events[mmdd][j][this.FLOW_GRAPH_COMPLIANCE];
5265
+ }
5246
5266
  this.events[mmdd][j][this.FLOW_GRAPH_COMPLIANCE] = complianceStatus;
5247
5267
 
5248
5268
  this.updateStats(this.events[mmdd][j], partStatus, lateStatus, complianceStatus);
5249
5269
  if (this.events[mmdd][j]["documents"] != null) {
5250
- //Id,Country,Entity,Location,Function,Reporter,Approver,Functionhead,State
5251
- csvValues += ('"' + (this.events[mmdd][j]["id"] + '",'));
5252
- csvValues += ('"' + ((this.events[mmdd][j]["countryname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5253
- csvValues += ('"' + ((this.events[mmdd][j]["entityname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5254
- csvValues += ('"' + ((this.events[mmdd][j]["locationname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5255
- csvValues += ('"' + ((((this.events[mmdd][j]["functions"] ?? [])[0] ?? "").split(';')[0] + "").replace(/\((.*?)\)/g, "") + '",'));
5256
- csvValues += ('"' + ((((this.events[mmdd][j]["reporters"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5257
- csvValues += ('"' + ((((this.events[mmdd][j]["approvers"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5258
- csvValues += ('"' + ((((this.events[mmdd][j]["functionheads"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5259
- csvValues += ('"' + (this.events[mmdd][j]["state"] + '",'));
5260
- csvValues += ('"' + (this.events[mmdd][j]["jurisdiction"] + '",'));
5261
- csvValues += ('"' + (this.events[mmdd][j]["category"] + '",'));
5262
- csvValues += ('"' + (this.events[mmdd][j]["subcategory"] + '",'));
5263
- csvValues += ('"' + (this.events[mmdd][j]["statute"] + '",'));
5264
- csvValues += ('"' + ((this.events[mmdd][j]["reference"] + "").replace(/"/g, "") + '",'));
5265
- csvValues += ('"' + ((this.events[mmdd][j]["applicability"] + "").replace(/"/g, "") + '",'));
5266
- csvValues += ('"' + ((this.events[mmdd][j]["obligationtype"] + "").replace(/"/g, "") + '",'));
5267
- csvValues += ('"' + ((this.events[mmdd][j]["obligationtitle"] + "").replace(/"/g, "") + '",'));
5268
- csvValues += ('"' + ((this.events[mmdd][j]["obligation"] + "").replace(/"/g, "") + '",'));
5269
- csvValues += ('"' + ((this.events[mmdd][j]["firstlineofdefence"] + "").replace(/"/g, "") + '",'));
5270
- csvValues += ('"' + ((this.events[mmdd][j]["secondlineofdefence"] + "").replace(/"/g, "") + '",'));
5271
- csvValues += ('"' + ((this.events[mmdd][j]["thirdlineofdefence"] + "").replace(/"/g, "") + '",'));
5272
- csvValues += ('"' + ((this.events[mmdd][j]["internalcontrols"] + "").replace(/"/g, "") + '",'));
5273
- csvValues += ('"' + ((this.events[mmdd][j]["penalty"] + "").replace(/"/g, "") + '",'));
5274
- csvValues += ('"' + ((this.events[mmdd][j]["form"] + "").replace(/"/g, "") + '",'));
5275
- csvValues += ('"' + ((this.events[mmdd][j]["additionalurls"] + "").replace(/"/g, "") + '",'));
5276
- csvValues += ('"' + ((this.events[mmdd][j]["definition"] + "").replace(/"/g, "") + '",'));
5277
- csvValues += ('"' + ((this.events[mmdd][j]["authority"] + "").replace(/"/g, "") + '",'));
5278
- csvValues += ('"' + ((this.events[mmdd][j]["risk"] + "").replace(/"/g, "") + '",'));
5279
- csvValues += ('"' + ((this.events[mmdd][j]["riskarea"] + "").replace(/"/g, "") + '",'));
5280
- csvValues += ('"' + ((this.events[mmdd][j]["frequency"] + "").replace(/"/g, "") + '",'));
5281
- csvValues += ('"' + ((this.events[mmdd][j]["subfrequency"] + "").replace(/"/g, "") + '",'));
5282
- csvValues += ('"' + ((this.events[mmdd][j]["duedate"] + "").replace(/"/g, "") + '",'));
5283
- csvValues += ('"' + (this.renderStatusString(partStatus, lateStatus, complianceStatus) + '",'));
5284
- csvValues += ('"' + (this.getGraphParam(this.events[mmdd][j]) + '"\n'));
5285
-
5286
- // csvValues += (period + ','
5287
- // + this.renderStatusString(partStatus, lateStatus, complianceStatus) + ','
5288
- // + this.events[mmdd][j]["id"] + ','
5289
- // + this.events[mmdd][j]["obligationtitle"] + ','
5290
- // + this.events[mmdd][j]["obligation"] + ','
5291
- // + this.events[mmdd][j]["duedate"]
5292
- // + '\n');
5293
-
5294
- htmlValues += ('<tr><td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["id"] + '</td>'
5295
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["country"] + '</td>'
5296
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["state"] + '</td>'
5297
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["jurisdiction"] + '</td>'
5298
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["category"] + '</td>'
5299
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["subcategory"] + '</td>'
5300
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["statute"] + '</td>'
5301
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["reference"] + '</td>'
5302
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["applicability"] + '</td>'
5303
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["obligationtype"] + '</td>'
5304
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["obligationtitle"] + '</td>'
5305
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["obligation"] + '</td>'
5306
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["firstlineofdefence"] + '</td>'
5307
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["secondlineofdefence"] + '</td>'
5308
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["thirdlineofdefence"] + '</td>'
5309
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["internalcontrols"] + '</td>'
5310
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["penalty"] + '</td>'
5311
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["form"] + '</td>'
5312
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["additionalurls"] + '</td>'
5313
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["definition"] + '</td>'
5314
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["authority"] + '</td>'
5315
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["risk"] + '</td>'
5316
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["riskarea"] + '</td>'
5317
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["frequency"] + '</td>'
5318
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["subfrequency"] + '</td>'
5319
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["duedate"] + '</td>'
5320
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide text-center status-format">' + this.renderStatusString(partStatus, lateStatus, complianceStatus) + '</td>'
5321
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide status-format">' + this.getGraphParam(this.events[mmdd][j]) + '</td>'
5322
- + '</tr>');
5323
- htmlSummaryValues += ('<tr><td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin"><sf-i-elastic-text text="' + this.events[mmdd][j]["id"] + '" minLength="10"></sf-i-elastic-text></td>'
5324
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide"><sf-i-elastic-text text="' + this.events[mmdd][j]["obligationtitle"] + '" minLength="100" lineSize="4"></sf-i-elastic-text></td>'
5325
- // + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide"><sf-i-elastic-text text="' + this.events[mmdd][j]["obligation"] + '" minLength="100" lineSize="4"></sf-i-elastic-text></td>'
5326
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide"><sf-i-elastic-text text="' + this.renderStatusString(partStatus, lateStatus, complianceStatus) + '" minLength="100" lineSize="4"></sf-i-elastic-text></td>'
5327
- + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">');
5328
-
5329
- for (let document of this.events[mmdd][j].documents) {
5330
- htmlSummaryValues += `<sf-i-uploader class="summary-report-doc" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" prepopulatedInputArr="${JSON.stringify([{ "key": document.key, "ext": document.ext }]).replace(/"/g, '&quot;')}" projectid="${this.projectId} " extract="no" mode="view" maximize="yes" hidepreview="yes"></sf-i-uploader><br />`
5270
+ if (this.selectedFeatures.indexOf('contracts') >= 0) {
5271
+ //Id,ReferenceNo.,Type,Country,Entity,Location,Party1,Party2,Party3,Reporter,Approver,Functionhead,DueDate,Status,ReportParameter
5272
+ csvValues += ('"' + (this.events[mmdd][j]["id"] + '",'));
5273
+ csvValues += ('"' + ((this.events[mmdd][j]["obligationtitle"] + "").replace(/"/g, "") + '",'));
5274
+ csvValues += ('"' + ((this.events[mmdd][j]["contracttypename"] + "").replace(/"/g, "") + '",'));
5275
+ csvValues += ('"' + ((this.events[mmdd][j]["countryname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5276
+ csvValues += ('"' + ((this.events[mmdd][j]["entityname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5277
+ csvValues += ('"' + ((this.events[mmdd][j]["locationname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5278
+ csvValues += ('"' + ((this.events[mmdd][j]["party1"] + "").replace(/"/g, "") + '",'));
5279
+ csvValues += ('"' + ((this.events[mmdd][j]["party2"] + "").replace(/"/g, "") + '",'));
5280
+ csvValues += ('"' + ((this.events[mmdd][j]["party3"] + "").replace(/"/g, "") + '",'));
5281
+ csvValues += ('"' + ((((this.events[mmdd][j]["reporters"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5282
+ csvValues += ('"' + ((((this.events[mmdd][j]["approvers"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5283
+ csvValues += ('"' + ((((this.events[mmdd][j]["functionheads"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5284
+ csvValues += ('"' + ((this.events[mmdd][j]["duedate"] + "").replace(/"/g, "") + '",'));
5285
+ csvValues += ('"' + (this.renderStatusString(partStatus, lateStatus, complianceStatus) + '",'));
5286
+ csvValues += ('"' + (this.getGraphParam(this.events[mmdd][j]) + '"\n'));
5287
+
5288
+ //Id,RefNo,Type,Country,Entity,Location,Party1,Party2,Party3,DueDate,Status,ReportParameter
5289
+ htmlValues += ('<tr><td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["id"] + '</td>'
5290
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["obligationtitle"] + '</td>'
5291
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["contracttypename"] + '</td>'
5292
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + (this.events[mmdd][j]["countryname"] + "").replace(/\((.*?)\)/g, "") + '</td>'
5293
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + (this.events[mmdd][j]["entityname"] + "").replace(/\((.*?)\)/g, "") + '</td>'
5294
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + (this.events[mmdd][j]["locationname"] + "").replace(/\((.*?)\)/g, "") + '</td>'
5295
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["party1"] + '</td>'
5296
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["party2"] + '</td>'
5297
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["party3"] + '</td>'
5298
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["duedate"] + '</td>'
5299
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide text-center status-format">' + this.renderStatusString(partStatus, lateStatus, complianceStatus) + '</td>'
5300
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide status-format">' + this.getGraphParam(this.events[mmdd][j]) + '</td>'
5301
+ + '</tr>');
5302
+ } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
5303
+ //Id,ReferenceNo.,Type,Country,Entity,Location,Reporter,Approver,Functionhead,State,Jurisdiction,Category,Subcategory,Statute,ObligationType,RiskSeverity,RiskAreas,Frequency,SubFrequency,DueDate,Status,ReportParameter
5304
+ csvValues += ('"' + (this.events[mmdd][j]["id"] + '",'));
5305
+ csvValues += ('"' + ((this.events[mmdd][j]["obligationtitle"] + "").replace(/"/g, "") + '",'));
5306
+ csvValues += ('"' + ((this.events[mmdd][j]["licensetypename"] + "").replace(/"/g, "") + '",'));
5307
+ csvValues += ('"' + ((this.events[mmdd][j]["countryname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5308
+ csvValues += ('"' + ((this.events[mmdd][j]["entityname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5309
+ csvValues += ('"' + ((this.events[mmdd][j]["locationname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5310
+ csvValues += ('"' + ((((this.events[mmdd][j]["reporters"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5311
+ csvValues += ('"' + ((((this.events[mmdd][j]["approvers"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5312
+ csvValues += ('"' + ((((this.events[mmdd][j]["functionheads"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5313
+ csvValues += ('"' + (this.events?.[mmdd]?.[j]?.statute?.state ?? "" + '",'));
5314
+ csvValues += ('"' + (this.events[mmdd][j]["jurisdiction"] + '",'));
5315
+ csvValues += ('"' + (this.events?.[mmdd]?.[j]?.complianceobj?.category ?? "" + '",'));
5316
+ csvValues += ('"' + (this.events[mmdd][j]["subcategory"] + '",'));
5317
+ csvValues += ('"' + (this.events?.[mmdd]?.[j]?.statute?.name + '",'));
5318
+ csvValues += ('"' + ((this.events[mmdd][j]["risk"] + "").replace(/"/g, "") + '",'));
5319
+ csvValues += ('"' + ((this.events[mmdd][j]["riskarea"] + "").replace(/"/g, "") + '",'));
5320
+ csvValues += ('"' + ((this.events[mmdd][j]["frequency"] + "").replace(/"/g, "") + '",'));
5321
+ csvValues += ('"' + (((this.events?.[mmdd]?.[j]?.complianceobj?.subfrequency ?? "") + "").replace(/"/g, "") + '",'));
5322
+ csvValues += ('"' + ((this.events[mmdd][j]["obligationtype"] + "").replace(/"/g, "") + '",'));
5323
+ csvValues += ('"' + ((this.events[mmdd][j]["duedate"] + "").replace(/"/g, "") + '",'));
5324
+ csvValues += ('"' + (this.renderStatusString(partStatus, lateStatus, complianceStatus) + '",'));
5325
+ csvValues += ('"' + (this.getGraphParam(this.events[mmdd][j]) + '"\n'));
5326
+
5327
+ //Id,ReferenceNo.,Type,Country,Entity,Location,State,Jurisdiction,Category,Subcategory,Statute,ObligationType,RiskSeverity,RiskAreas,Frequency,SubFrequency,DueDate,Status,ReportParameter
5328
+ htmlValues += ('<tr><td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["id"] + '</td>'
5329
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["obligationtitle"] + '</td>'
5330
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["licensetypename"] + '</td>'
5331
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + (this.events[mmdd][j]["countryname"] + "").replace(/\((.*?)\)/g, "") + '</td>'
5332
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + (this.events[mmdd][j]["entityname"] + "").replace(/\((.*?)\)/g, "") + '</td>'
5333
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + (this.events[mmdd][j]["locationname"] + "").replace(/\((.*?)\)/g, "") + '</td>'
5334
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + (this.events?.[mmdd]?.[j]?.statute?.state ?? "") + '</td>'
5335
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["jurisdiction"] + '</td>'
5336
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + (this.events?.[mmdd]?.[j]?.complianceobj?.category ?? "") + '</td>'
5337
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["subcategory"] + '</td>'
5338
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + (this.events?.[mmdd]?.[j]?.statute?.name ?? "") + '</td>'
5339
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["obligationtype"] + '</td>'
5340
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["risk"] + '</td>'
5341
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["riskarea"] + '</td>'
5342
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["frequency"] + '</td>'
5343
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + ((this.events?.[mmdd]?.[j]?.complianceobj?.subfrequency ?? "") + "").replace(/"/g, "") + '</td>'
5344
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["duedate"] + '</td>'
5345
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide text-center status-format">' + this.renderStatusString(partStatus, lateStatus, complianceStatus) + '</td>'
5346
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide status-format">' + this.getGraphParam(this.events[mmdd][j]) + '</td>'
5347
+ + '</tr>');
5348
+ } else {
5349
+ //Id,Country,Entity,Location,Function,Reporter,Approver,Functionhead,State
5350
+ csvValues += ('"' + (this.events[mmdd][j]["id"] + '",'));
5351
+ csvValues += ('"' + ((this.events[mmdd][j]["countryname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5352
+ csvValues += ('"' + ((this.events[mmdd][j]["entityname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5353
+ csvValues += ('"' + ((this.events[mmdd][j]["locationname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5354
+ csvValues += ('"' + ((((this.events[mmdd][j]["functions"] ?? [])[0] ?? "").split(';')[0] + "").replace(/\((.*?)\)/g, "") + '",'));
5355
+ csvValues += ('"' + ((((this.events[mmdd][j]["reporters"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5356
+ csvValues += ('"' + ((((this.events[mmdd][j]["approvers"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5357
+ csvValues += ('"' + ((((this.events[mmdd][j]["functionheads"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5358
+ csvValues += ('"' + (this.events[mmdd][j]["state"] + '",'));
5359
+ csvValues += ('"' + (this.events[mmdd][j]["jurisdiction"] + '",'));
5360
+ csvValues += ('"' + (this.events[mmdd][j]["category"] + '",'));
5361
+ csvValues += ('"' + (this.events[mmdd][j]["subcategory"] + '",'));
5362
+ csvValues += ('"' + (this.events[mmdd][j]["statute"] + '",'));
5363
+ csvValues += ('"' + ((this.events[mmdd][j]["reference"] + "").replace(/"/g, "") + '",'));
5364
+ csvValues += ('"' + ((this.events[mmdd][j]["applicability"] + "").replace(/"/g, "") + '",'));
5365
+ csvValues += ('"' + ((this.events[mmdd][j]["obligationtype"] + "").replace(/"/g, "") + '",'));
5366
+ csvValues += ('"' + ((this.events[mmdd][j]["obligationtitle"] + "").replace(/"/g, "") + '",'));
5367
+ csvValues += ('"' + ((this.events[mmdd][j]["obligation"] + "").replace(/"/g, "") + '",'));
5368
+ csvValues += ('"' + ((this.events[mmdd][j]["firstlineofdefence"] + "").replace(/"/g, "") + '",'));
5369
+ csvValues += ('"' + ((this.events[mmdd][j]["secondlineofdefence"] + "").replace(/"/g, "") + '",'));
5370
+ csvValues += ('"' + ((this.events[mmdd][j]["thirdlineofdefence"] + "").replace(/"/g, "") + '",'));
5371
+ csvValues += ('"' + ((this.events[mmdd][j]["internalcontrols"] + "").replace(/"/g, "") + '",'));
5372
+ csvValues += ('"' + ((this.events[mmdd][j]["penalty"] + "").replace(/"/g, "") + '",'));
5373
+ csvValues += ('"' + ((this.events[mmdd][j]["form"] + "").replace(/"/g, "") + '",'));
5374
+ csvValues += ('"' + ((this.events[mmdd][j]["additionalurls"] + "").replace(/"/g, "") + '",'));
5375
+ csvValues += ('"' + ((this.events[mmdd][j]["definition"] + "").replace(/"/g, "") + '",'));
5376
+ csvValues += ('"' + ((this.events[mmdd][j]["authority"] + "").replace(/"/g, "") + '",'));
5377
+ csvValues += ('"' + ((this.events[mmdd][j]["risk"] + "").replace(/"/g, "") + '",'));
5378
+ csvValues += ('"' + ((this.events[mmdd][j]["riskarea"] + "").replace(/"/g, "") + '",'));
5379
+ csvValues += ('"' + ((this.events[mmdd][j]["frequency"] + "").replace(/"/g, "") + '",'));
5380
+ csvValues += ('"' + ((this.events[mmdd][j]["subfrequency"] + "").replace(/"/g, "") + '",'));
5381
+ csvValues += ('"' + ((this.events[mmdd][j]["duedate"] + "").replace(/"/g, "") + '",'));
5382
+ csvValues += ('"' + (this.renderStatusString(partStatus, lateStatus, complianceStatus) + '",'));
5383
+ csvValues += ('"' + (this.getGraphParam(this.events[mmdd][j]) + '"\n'));
5384
+
5385
+ // csvValues += (period + ','
5386
+ // + this.renderStatusString(partStatus, lateStatus, complianceStatus) + ','
5387
+ // + this.events[mmdd][j]["id"] + ','
5388
+ // + this.events[mmdd][j]["obligationtitle"] + ','
5389
+ // + this.events[mmdd][j]["obligation"] + ','
5390
+ // + this.events[mmdd][j]["duedate"]
5391
+ // + '\n');
5392
+
5393
+ htmlValues += ('<tr><td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["id"] + '</td>'
5394
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["country"] + '</td>'
5395
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["state"] + '</td>'
5396
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["jurisdiction"] + '</td>'
5397
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["category"] + '</td>'
5398
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["subcategory"] + '</td>'
5399
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["statute"] + '</td>'
5400
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["reference"] + '</td>'
5401
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["applicability"] + '</td>'
5402
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["obligationtype"] + '</td>'
5403
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["obligationtitle"] + '</td>'
5404
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["obligation"] + '</td>'
5405
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["firstlineofdefence"] + '</td>'
5406
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["secondlineofdefence"] + '</td>'
5407
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["thirdlineofdefence"] + '</td>'
5408
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["internalcontrols"] + '</td>'
5409
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["penalty"] + '</td>'
5410
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["form"] + '</td>'
5411
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["additionalurls"] + '</td>'
5412
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["definition"] + '</td>'
5413
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["authority"] + '</td>'
5414
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["risk"] + '</td>'
5415
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["riskarea"] + '</td>'
5416
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["frequency"] + '</td>'
5417
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["subfrequency"] + '</td>'
5418
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["duedate"] + '</td>'
5419
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide text-center status-format">' + this.renderStatusString(partStatus, lateStatus, complianceStatus) + '</td>'
5420
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide status-format">' + this.getGraphParam(this.events[mmdd][j]) + '</td>'
5421
+ + '</tr>');
5422
+ }
5423
+ if (this.selectedFeatures.indexOf('contracts') >= 0) {
5424
+ htmlSummaryValues += ('<tr><td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin"><sf-i-elastic-text text="' + this.events[mmdd][j]["id"] + '" minLength="10"></sf-i-elastic-text></td>'
5425
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide"><sf-i-elastic-text text="' + this.events[mmdd][j]["obligationtitle"] + '" minLength="100" lineSize="4"></sf-i-elastic-text></td>'
5426
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide"><sf-i-elastic-text text="' + this.renderStatusString(partStatus, lateStatus, complianceStatus) + '" minLength="100" lineSize="4"></sf-i-elastic-text></td>'
5427
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">');
5428
+
5429
+ for (let document of this.events[mmdd][j].contractdocuments ?? []) {
5430
+ htmlSummaryValues += `<sf-i-uploader class="summary-report-doc" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" prepopulatedInputArr="${JSON.stringify([{ "key": document.key, "ext": document.ext }]).replace(/"/g, '&quot;')}" projectid="${this.projectId} " extract="no" mode="view" maximize="yes" hidepreview="yes"></sf-i-uploader><br />`
5431
+ }
5432
+ htmlSummaryValues += '</td></tr>'
5433
+ } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
5434
+ htmlSummaryValues += ('<tr><td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin"><sf-i-elastic-text text="' + this.events[mmdd][j]["id"] + '" minLength="10"></sf-i-elastic-text></td>'
5435
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide"><sf-i-elastic-text text="' + this.events[mmdd][j]["obligationtitle"] + '" minLength="100" lineSize="4"></sf-i-elastic-text></td>'
5436
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide"><sf-i-elastic-text text="' + this.renderStatusString(partStatus, lateStatus, complianceStatus) + '" minLength="100" lineSize="4"></sf-i-elastic-text></td>'
5437
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">');
5438
+
5439
+ for (let document of this.events[mmdd][j].licensedocuments ?? []) {
5440
+ htmlSummaryValues += `<sf-i-uploader class="summary-report-doc" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" prepopulatedInputArr="${JSON.stringify([{ "key": document.key, "ext": document.ext }]).replace(/"/g, '&quot;')}" projectid="${this.projectId} " extract="no" mode="view" maximize="yes" hidepreview="yes"></sf-i-uploader><br />`
5441
+ }
5442
+ htmlSummaryValues += '</td></tr>'
5443
+ } else {
5444
+ htmlSummaryValues += ('<tr><td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin"><sf-i-elastic-text text="' + this.events[mmdd][j]["id"] + '" minLength="10"></sf-i-elastic-text></td>'
5445
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide"><sf-i-elastic-text text="' + this.events[mmdd][j]["obligationtitle"] + '" minLength="100" lineSize="4"></sf-i-elastic-text></td>'
5446
+ // + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide"><sf-i-elastic-text text="' + this.events[mmdd][j]["obligation"] + '" minLength="100" lineSize="4"></sf-i-elastic-text></td>'
5447
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide"><sf-i-elastic-text text="' + this.renderStatusString(partStatus, lateStatus, complianceStatus) + '" minLength="100" lineSize="4"></sf-i-elastic-text></td>'
5448
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">');
5449
+
5450
+ for (let document of this.events[mmdd][j].documents) {
5451
+ htmlSummaryValues += `<sf-i-uploader class="summary-report-doc" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" prepopulatedInputArr="${JSON.stringify([{ "key": document.key, "ext": document.ext }]).replace(/"/g, '&quot;')}" projectid="${this.projectId} " extract="no" mode="view" maximize="yes" hidepreview="yes"></sf-i-uploader><br />`
5452
+ }
5453
+ // htmlSummaryValues += this.renderCalendarAnnotations(this.events[mmdd][j]);
5454
+ htmlSummaryValues += '</td></tr>'
5331
5455
  }
5332
- // htmlSummaryValues += this.renderCalendarAnnotations(this.events[mmdd][j]);
5333
- htmlSummaryValues += '</td></tr>'
5334
5456
  }
5335
5457
 
5336
5458
  html += this.renderCalendarRowDivItemDivStart(mmdd, this.events[mmdd][j], j, partStatus, bgStatus);
@@ -5692,7 +5814,7 @@ export class SfIEvents extends LitElement {
5692
5814
  html += '<button id="button-uploader-submit-approve" class="button-submit" part="button">Save</button>'
5693
5815
  html += '</div>'
5694
5816
 
5695
- if (this.myRole != this.TAB_FUNCTION_HEAD && docs.length > 0 && event.module != 'contract' && event.module != 'license') {
5817
+ if (this.myRole != this.TAB_FUNCTION_HEAD && docs.length > 0 && event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5696
5818
  html += '<div class="m-20">';
5697
5819
  html += '<label part="input-label">Supporting Documents</label>';
5698
5820
  html += '<slot name="uploader"></slot>';
@@ -5703,7 +5825,7 @@ export class SfIEvents extends LitElement {
5703
5825
  html += '<div class="d-flex m-20 flex-col">';
5704
5826
  html += '<label part="input-label">Approver Comments*</label>';
5705
5827
  html += '<input id="input-approver-comments" type="text" part="input" value=""/><br />';
5706
- if (event.module != 'contract' && event.module != 'license') {
5828
+ if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5707
5829
  html += '<label part="input-label">Date of Completion*</label>';
5708
5830
  html += '<input id="input-approver-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" disabled/><br />';
5709
5831
  html += '<label part="input-label">Percentage</label>';
@@ -5764,7 +5886,7 @@ export class SfIEvents extends LitElement {
5764
5886
  html += '<div class="d-flex m-20 flex-col">';
5765
5887
  html += '<label part="input-label">Reporter Comments*</label>';
5766
5888
  html += '<input id="input-reporter-comments" type="text" part="input" value=""/><br />';
5767
- if (event.module != 'contract' && event.module != 'license') {
5889
+ if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5768
5890
  html += '<label part="input-label">Date of Completion*</label>';
5769
5891
  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 />';
5770
5892
  html += '<label part="input-label">Completion Percentage*</label>';
@@ -5822,7 +5944,7 @@ export class SfIEvents extends LitElement {
5822
5944
  html += '<div class="d-flex m-20 flex-col">';
5823
5945
  html += '<label part="input-label">Auditor Comments</label>';
5824
5946
  html += '<input id="input-auditor-comments" type="text" part="input" value=""/><br />';
5825
- if (event.module != 'contract' && event.module != 'license') {
5947
+ if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5826
5948
  html += '<label part="input-label">Date of Completion</label>';
5827
5949
  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 />';
5828
5950
  html += '<label part="input-label">Percentage</label>';
@@ -5890,7 +6012,10 @@ export class SfIEvents extends LitElement {
5890
6012
  event.docsOptional = event['docs'] == null ? [] : event['docs'];
5891
6013
  html = this.renderReporting(event, mmddyyyy);
5892
6014
  console.log('reporting html', html);
6015
+ let ddmmyyyy = mmddyyyy.split('/')[1] + '/' + mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[2];
5893
6016
 
6017
+ let emailcontent = `<table border="0" cellspacing="0" style="color:#666666;border-radius:5px;border:solid 1px #efefef;width:100%; margin-top:20px"><tbody><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Compliance ID</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.id}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Country</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.countryname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Entity</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.entityname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Location</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.locationname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Statute</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.statute}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Subcategory</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.subcategory}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Due Date</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${ddmmyyyy}</td></tr></tbody></table>`;
6018
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.emailcontent = emailcontent;
5894
6019
  let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
5895
6020
  for (let tempReportingContainer of listReportingContainers) {
5896
6021
  tempReportingContainer.style.display = 'none';
@@ -6803,6 +6928,8 @@ export class SfIEvents extends LitElement {
6803
6928
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6804
6929
  } else if (module === "license") {
6805
6930
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6931
+ } else if (module === "rcmresource") {
6932
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6806
6933
  } else {
6807
6934
  let found = false;
6808
6935
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -6844,6 +6971,8 @@ export class SfIEvents extends LitElement {
6844
6971
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6845
6972
  } else if (module === "license") {
6846
6973
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6974
+ } else if (module === "rcmresource") {
6975
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6847
6976
  } else {
6848
6977
  let found = false;
6849
6978
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -10972,6 +11101,8 @@ export class SfIEvents extends LitElement {
10972
11101
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
10973
11102
  } else if (module === "license") {
10974
11103
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11104
+ } else if (module === "rcmresource") {
11105
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
10975
11106
  } else {
10976
11107
  let found = false;
10977
11108
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -11013,6 +11144,8 @@ export class SfIEvents extends LitElement {
11013
11144
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11014
11145
  } else if (module === "license") {
11015
11146
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11147
+ } else if (module === "rcmresource") {
11148
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11016
11149
  } else {
11017
11150
  let found = false;
11018
11151
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -11584,6 +11717,8 @@ export class SfIEvents extends LitElement {
11584
11717
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11585
11718
  } else if (module === "license") {
11586
11719
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11720
+ } else if (module === "rcmresource") {
11721
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11587
11722
  } else {
11588
11723
  let found = false;
11589
11724
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -11630,6 +11765,8 @@ export class SfIEvents extends LitElement {
11630
11765
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11631
11766
  } else if (module === "license") {
11632
11767
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11768
+ } else if (module === "rcmresource") {
11769
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11633
11770
  } else {
11634
11771
  let found = false;
11635
11772
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -14588,6 +14725,7 @@ export class SfIEvents extends LitElement {
14588
14725
 
14589
14726
  }
14590
14727
  }
14728
+
14591
14729
  fetchLicenseDetails = async (listEvent: any, mmddyyyy: string) => {
14592
14730
  let entityId = listEvent.entityid;
14593
14731
  let locationId = listEvent.locationid;
@@ -15482,14 +15620,15 @@ export class SfIEvents extends LitElement {
15482
15620
  }
15483
15621
  }
15484
15622
 
15485
- fetchEventDetails = async (listEvent: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement, flagUploadGuidance: boolean = false, listEventContainer: HTMLDivElement | null = null) => {
15486
- console.log('listEvent', listEvent, listEvent.id)
15487
- let url = "https://" + this.apiId + "/getalleventdetails";
15623
+ fetchRCMResourceDetails = async (listEvent: any, mmddyyyy: string) => {
15624
+ let entityId = listEvent.entityid;
15625
+ let locationId = listEvent.locationid;
15626
+ let url = "https://" + this.apiIdRCMResources + "/getallobjectdetails";
15488
15627
 
15489
- //console.log('fetch calendar url', url);
15490
- let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "eventid": listEvent.id, "entityid": listEvent.entityid, "locationid": listEvent.locationid, "mmddyyyy": mmddyyyy, "year": this.getFinancialYear(mmddyyyy) };
15628
+ console.log('fetch rcm resource details url', url);
15629
+ let urlBody: any = { projectid: this.projectId, objectid: listEvent.id, entityid: entityId, locationid: locationId, userprofileid: this.userProfileId, role: this.myRole, year: this.calendarStartYYYY, mmddyyyy: mmddyyyy };
15491
15630
 
15492
- //console.log('urlbody', urlBody);
15631
+ console.log('fetch rcm resource details urlbody', urlBody);
15493
15632
 
15494
15633
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
15495
15634
  const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
@@ -15497,194 +15636,1087 @@ export class SfIEvents extends LitElement {
15497
15636
  if (xhr.status == 200) {
15498
15637
 
15499
15638
  const jsonRespose = JSON.parse(xhr.responseText);
15500
- console.log('jsonRespose', jsonRespose);
15501
- if (flagUploadGuidance) {
15502
- if (listEventContainer != null) {
15503
- let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
15504
- if (this.events[mmdd] != null) {
15505
- for (var p = 0; p < this.events[mmdd].length; p++) {
15506
- if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == listEvent.locationid && this.events[mmdd][p].entityid == listEvent.entityid) {
15507
- this.events[mmdd][p].uploadguidance = jsonRespose.data.uploadguidance
15508
- }
15509
- }
15510
- }
15511
- this.renderListReporting(listEventContainer, jsonRespose.data, mmddyyyy, eventsContainer)
15512
- }
15513
- } else {
15514
- this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer);
15515
- }
15516
-
15639
+ console.log('jsonRespose agreement details', jsonRespose);
15640
+ this.renderRCMResourceDetails(jsonRespose.object, mmddyyyy)
15517
15641
  } else {
15518
15642
  if (xhr.status == 401) {
15519
15643
  let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
15520
15644
  this.dispatchEvent(changeEvent);
15521
- }
15522
- if (xhr.status === 404) {
15523
-
15524
- this.showChosenProject();
15525
- (this._SfTitleChosenProject as HTMLElement).innerHTML = (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedTexts()[0];
15526
- this.renderChosenProject();
15527
-
15528
15645
  } else {
15529
15646
  const jsonRespose = JSON.parse(xhr.responseText);
15530
15647
  this.setError(jsonRespose.error);
15531
15648
  }
15532
15649
 
15533
15650
  }
15651
+
15534
15652
  }
15535
15653
 
15536
- renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement) => {
15537
- console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
15654
+ renewRCMResource = async (listEvent: any, reportformatvalues: any) => {
15538
15655
 
15539
- let comments, docs, approved, /*dateOfCompletion,*/ makercheckers: Array<string>, docsOptional, documentType;
15540
- let entityId: string = "";
15541
- let locationId: string = "";
15542
- let statuteName: string = "";
15543
- let reportformatName: string = "";
15544
- let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
15545
- entityId = event.entityid;
15546
- locationId = event.locationid;
15547
- // let completeness = this.getCompletenessStatus(event);
15548
- comments = event['comments'] == null ? [] : (event['comments']);
15549
- docs = event['documents'] == null ? [] : event['documents'] == null ? [] : (event['documents']);
15550
- approved = event['approved'] == null ? false : event['approved'] == null ? false : event['approved'];
15551
- // dateOfCompletion = event['dateofcompletion'] == null ? '' : event['dateofcompletion'] == null ? '' : event['dateofcompletion'];
15552
- makercheckers = event['makercheckers'] == null ? [] : event['makercheckers'] == null ? [] : event['makercheckers'];
15553
- docsOptional = event['docs'] == null ? [] : event['docs'] == null ? [] : event['docs'];
15554
- documentType = event['documenttype'] == null ? null : event['documenttype'][0] == null ? null : event['documenttype'][0].split(" ")[0];
15656
+ let url = "https://" + this.apiIdRCMResources + "/reopen";
15555
15657
 
15556
- statuteName = event['statute'][0].trim();
15557
- if (event['reportformat'] != null) {
15558
- reportformatName = (event['reportformat'][0] ?? "").trim().replace('&amp;', '&');
15559
- }
15658
+ console.log('renewing', reportformatvalues)
15659
+ //console.log('fetch calendar url', url);
15660
+ let urlBody: any = { projectid: this.projectId, objectid: listEvent.id, newvalues: reportformatvalues == "" ? null : JSON.parse(reportformatvalues), published: true, terminated: (JSON.parse(reportformatvalues).terminated ?? false) };
15661
+ console.log('reopen body', url, urlBody)
15662
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
15663
+ const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
15664
+ this._SfLoader.innerHTML = '';
15665
+ if (xhr.status == 200) {
15560
15666
 
15561
- console.log('event detail', event, statuteName);
15562
- //console.log('event detail comments', comments);
15563
- //console.log('event dateofcompletion', dateOfCompletion);
15564
- //console.log('event detail documenttype', documentType);
15565
- const basicFields = ['id', 'shortid', 'entityname', 'locationname', 'functions'];
15566
- const statuteFields = ['jurisdiction', 'country', 'state', 'category', 'subcategory', 'statute'];
15567
- const complianceFields = ['specificity', 'reference', 'obligation', 'penalty', 'authority', 'frequency', 'subfrequency', 'obligationtype', 'duedate', 'applicability', 'form', 'additionalurls', 'adhocquestion', 'adhocquestionschedule', 'adhocinstances', 'uploadguidance', 'attachment'];
15568
- const grcFields = ['internalcontrols', 'firstlineofdefence', 'secondlineofdefence', 'thirdlineofdefence', 'risk', 'riskarea'];
15667
+ const jsonRespose = JSON.parse(xhr.responseText);
15668
+ console.log('jsonRespose agreement reopen', jsonRespose);
15669
+ } else {
15670
+ if (xhr.status == 401) {
15671
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
15672
+ this.dispatchEvent(changeEvent);
15673
+ } else {
15674
+ const jsonRespose = JSON.parse(xhr.responseText);
15675
+ this.setError(jsonRespose.error);
15676
+ }
15569
15677
 
15570
- let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
15571
- for (let tempReportingContainer of listReportingContainers) {
15572
- tempReportingContainer.style.display = 'none';
15573
- tempReportingContainer.innerHTML = '';
15574
- }
15575
- let buttonListReportings = eventsContainer.querySelectorAll('.button-list-reporting') as NodeListOf<HTMLButtonElement>
15576
- for (let buttonListReporting of buttonListReportings) {
15577
- buttonListReporting.setAttribute('part', 'button-list-reporting')
15578
- }
15579
- let streamEventTitles = eventsContainer.querySelectorAll('.stream-event-title') as NodeListOf<SfIElasticText>
15580
- for (let streamEventTitle of streamEventTitles) {
15581
- streamEventTitle.removeAttribute('part')
15582
15678
  }
15583
- var html = `
15584
-
15585
- <div part="compliance-detail-title" class="d-flex justify-between">
15586
- <button part="button-icon" class="material-icons invisible">close</button>
15587
- <h3 part="results-title" class="m-0">Compliance Details</h3>
15588
- <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
15589
- </div>
15590
-
15591
- `;
15592
-
15593
- if (this.selectedItemIds.length > 1) {
15594
-
15595
- html += `
15596
-
15597
- <div class="d-flex justify-between m-20">
15598
- <h4 class="m-0">${this.selectedItemIds.length - 1} other ` + ((this.selectedItemIds.length - 1) === 1 ? `item` : `items`) + ` also selected</h4>
15679
+ }
15680
+ renderRCMResourceDetails = async (listEvent: any, mmddyyyy: string) => {
15681
+ // await this.fetchAgreementDetails(listEvent, mmddyyyy);
15682
+ // return;
15683
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
15684
+ let entityId = listEvent.entityid;
15685
+ let locationId = listEvent.locationid;
15686
+ let comments = listEvent['comments'];
15687
+ let docs = listEvent['documents'] == null ? [] : listEvent['documents'] == null ? [] : (listEvent['documents']);
15688
+ let approved = listEvent['approved'] == null ? false : listEvent['approved'] == null ? false : listEvent['approved'];
15689
+ let makercheckers = listEvent['makercheckers'] == null ? [] : listEvent['makercheckers'] == null ? [] : listEvent['makercheckers'];
15690
+ // let docsOptional = listEvent['docs'] == null ? [] : listEvent['docs'] == null ? [] : listEvent['docs'];
15691
+ let html: string = '';
15692
+ let documentType = listEvent['documenttype'] == null ? null : listEvent['documenttype'][0] == null ? null : listEvent['documenttype'][0].split(" ")[0];
15693
+ html += `
15694
+ <div part="compliance-detail-title" class="d-flex justify-between">
15695
+ <button part="button-icon" class="material-icons invisible">close</button>
15696
+ <h3 part="results-title" class="m-0">RCM Resource Details</h3>
15697
+ <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
15599
15698
  </div>
15600
-
15601
- `;
15699
+ `
15700
+ html += `
15701
+ <div class="box-large" id="shimmer-container-agreements" part="shimmer-container-agreements">
15702
+ </div>
15703
+ `
15704
+ html += '<sf-i-reporting id="detail-reporting" class="hide" exportparts="uploader-extracted-text:reporting-uploader-extracted-text, uploader-sf-upload-message:reporting-uploader-sf-upload-message, uploader-sf-upload-submessage:reporting-uploader-sf-upload-submessage, uploader-extracted-text-chip:reporting-uploader-extracted-text-chip, uploader-extracted-text-chip-failed:reporting-uploader-extracted-text-chip-failed, uploader-doctype-verify-badge:reporting-uploader-doctype-verify-badge,span-submit-published:reporting-span-submit-published, span-submit-unpublished:reporting-span-submit-unpublished, reporting-container:reporting-reporting-container, button-icon:reporting-button-icon, uploader-button-icon:reporting-uploader-button-icon, sf-i-form-modal-container:reporting-sf-i-form-modal-container, next-calendar-date:reporting-next-calendar-date, last-calendar-date:reporting-last-calendar-date, input-publish-checkbox:reporting-input-publish-checkbox, button-icon-light:reporting-button-icon-light, button-icon-small:reporting-button-icon-small, uploader-input-label:reporting-uploader-input-label, input-radio:reporting-input-radio, radio-label:reporting-radio-label, input-textarea:reporting-input-textarea, input-textarea-disabled:reporting-input-textarea-disabled, input-date:reporting-input-date, input-date-disabled:reporting-input-date-disabled, input-select-single:reporting-input-select-single, textarea-container:reporting-textarea-container, section-body:reporting-section-body, section-container:reporting-section-container, date-container:reporting-date-container, input-sf-i-uploader:reporting-input-sf-i-uploader, published-container:reporting-published-container, selected-option:reporting-selected-option, input-select-multi-option:reporting-input-select-multi-option, select-option-label:reporting-select-option-label, input-sf-i-form:reporting-input-sf-i-form, input-sf-i-bricks:reporting-input-sf-i-bricks, uploader-input:reporting-uploader-input, form-container:reporting-form-container, published-container:reporting-published-container, form-container-published:reporting-form-container-published, subsection:reporting-subsection, results-title:reporting-results-title, td-head:reporting-td-head, td-action:reporting-td-action, td-body:reporting-td-body, td-body-2:reporting-td-body-2, add-button:reporting-add-button, uploader-button:reporting-uploader-button, section-head-collapsed:reporting-section-head-collapsed, section-title-expanded:reporting-section-title-expanded, section-title-collapsed:reporting-section-title-collapsed, section-head-expanded:reporting-section-head-expanded, progress-bar-finished:reporting-progress-bar-finished, progress-bar-complete:reporting-progress-bar-complete, progress-bar-incomplete:reporting-progress-bar-incomplete, section-success-icon:reporting-section-success-icon, section-body:reporting-section-body, title-section:reporting-title-section, button-lg:reporting-button-lg, uploader-detail-container:reporting-uploader-detail-container, textarea-label:reporting-textarea-label, date-label:reporting-date-label, commentbox:reporting-commentbox, comment-username:reporting-comment-username, detail-head:reporting-detail-head, reporting-uploader-extracted-text:reporting-reporting-uploader-extracted-text, reporting-uploader-sf-upload-message:reporting-reporting-uploader-sf-upload-message, reporting-uploader-sf-upload-submessage:reporting-reporting-uploader-sf-upload-submessage, reporting-uploader-extracted-text-chip:reporting-reporting-uploader-extracted-text-chip, reporting-uploader-extracted-text-chip-failed:reporting-reporting-uploader-extracted-text-chip-failed, reporting-uploader-doctype-verify-badge:reporting-reporting-uploader-doctype-verify-badge, reporting-span-submit-published:reporting-reporting-span-submit-published, reporting-span-submit-unpublished:reporting-reporting-span-submit-unpublished, reporting-reporting-container:reporting-reporting-reporting-container, reporting-button-icon:reporting-reporting-button-icon, reporting-uploader-button-icon:reporting-reporting-uploader-button-icon, reporting-sf-i-form-modal-container:reporting-reporting-sf-i-form-modal-container, reporting-next-calendar-date:reporting-reporting-next-calendar-date, reporting-last-calendar-date:reporting-reporting-last-calendar-date, reporting-input-publish-checkbox:reporting-reporting-input-publish-checkbox, reporting-button-icon-light:reporting-reporting-button-icon-light, reporting-button-icon-small:reporting-reporting-button-icon-small, reporting-uploader-input-label:reporting-reporting-uploader-input-label, reporting-input-radio:reporting-reporting-input-radio, reporting-radio-label:reporting-reporting-radio-label, reporting-input-textarea:reporting-reporting-input-textarea, reporting-input-textarea-disabled:reporting-reporting-input-textarea-disabled, reporting-input-date:reporting-reporting-input-date, reporting-input-date-disabled:reporting-reporting-input-date-disabled, reporting-input-select-single:reporting-reporting-input-select-single, reporting-textarea-container:reporting-reporting-textarea-container, reporting-section-body:reporting-reporting-section-body, reporting-section-container:reporting-reporting-section-container, reporting-date-container:reporting-reporting-date-container, reporting-input-sf-i-uploader:reporting-reporting-input-sf-i-uploader, reporting-published-container:reporting-reporting-published-container, reporting-selected-option:reporting-reporting-selected-option, reporting-input-select-multi-option:reporting-reporting-input-select-multi-option, reporting-select-option-label:reporting-reporting-select-option-label, reporting-input-sf-i-form:reporting-reporting-input-sf-i-form, reporting-input-sf-i-bricks:reporting-reporting-input-sf-i-bricks, reporting-uploader-input:reporting-reporting-uploader-input, reporting-form-container:reporting-reporting-form-container, reporting-published-container:reporting-reporting-published-container, reporting-form-container-published:reporting-reporting-form-container-published, reporting-subsection:reporting-reporting-subsection, reporting-results-title:reporting-reporting-results-title, reporting-td-head:reporting-reporting-td-head, reporting-td-action:reporting-reporting-td-action, reporting-td-body:reporting-reporting-td-body, reporting-td-body-2:reporting-reporting-td-body-2, reporting-add-button:reporting-reporting-add-button, reporting-uploader-button:reporting-reporting-uploader-button, reporting-section-head-collapsed:reporting-reporting-section-head-collapsed, reporting-section-title-expanded:reporting-reporting-section-title-expanded, reporting-section-title-collapsed:reporting-reporting-section-title-collapsed, reporting-section-head-expanded:reporting-reporting-section-head-expanded, reporting-progress-bar-finished:reporting-reporting-progress-bar-finished, reporting-progress-bar-complete:reporting-reporting-progress-bar-complete, reporting-progress-bar-incomplete:reporting-reporting-progress-bar-incomplete, reporting-section-success-icon:reporting-reporting-section-success-icon, reporting-section-body:reporting-reporting-section-body, reporting-title-section:reporting-reporting-title-section, reporting-button-lg:reporting-reporting-button-lg, reporting-uploader-detail-container:reporting-reporting-uploader-detail-container, reporting-textarea-label:reporting-reporting-textarea-label, reporting-date-label:reporting-reporting-date-label, reporting-commentbox:reporting-reporting-commentbox, reporting-comment-username:reporting-reporting-comment-username, reporting-detail-head:reporting-reporting-detail-head, input-sf-i-select:reporting-input-sf-i-select,reporting-input-sf-i-select:reporting-reporting-input-sf-i-select, select-input-select:reporting-select-input-select, checklist-container:reporting-checklist-container, checklist-title:reporting-checklist-title, checklist-list:reporting-checklist-list, checklist-item:reporting-checklist-item, checklist-checkbox:reporting-checklist-checkbox, checklist-checkbox-label:reporting-checklist-checkbox-label, reporting-checklist-container:reporting-reporting-checklist-container, reporting-checklist-title:reporting-reporting-checklist-title, reporting-checklist-list:reporting-reporting-checklist-list, reporting-checklist-item:reporting-reporting-checklist-item, reporting-checklist-checkbox:reporting-reporting-checklist-checkbox, reporting-checklist-checkbox-label:reporting-reporting-checklist-checkbox-label, checklist-add-input:reporting-checklist-add-input, checklist-add-button:reporting-checklist-add-button, terminate-container:reporting-terminate-container, terminate-container-terminated:reporting-terminate-container-terminated, terminate-container-active:reporting-terminate-container-active, input-terminate-checkbox: reporting-input-terminate-checkbox, reporting-terminate-container:reporting-reporting-terminate-container, reporting-terminate-container-terminated:reporting-reporting-terminate-container-terminated, reporting-terminate-container-active:reporting-reporting-terminate-container-active, reporting-input-terminate-checkbox: reporting-reporting-input-terminate-checkbox, uploader-container:reporting-uploader-container, reporting-uploader-container:reporting-reporting-uploader-container, not-selected:reporting-not-selected, reporting-not-selected:reportinig-reporting-not-selected" name="RCM Resource Details" apiiduploader="1peg5170d3" apiid="' + this.apiIdRCMResources + '" mode="admin" flow="details" projectid="' + this.projectId + '" projectname="' + this.projectName + '" editdisable="true" formviewclass="flex-wrap"></sf-i-reporting>';
15602
15705
 
15603
- }
15706
+ html += '<div part="reporting-view-container">'
15604
15707
 
15605
- html += '<div class="accordian-container m-20 pb-20" part="accordian-container">';
15708
+ html += this.renderReporting(listEvent, mmddyyyy);
15709
+ html += "</div>"
15606
15710
 
15607
- html += '<div part="detail-summary">';
15608
- html += ('<div part="detail-summary-title" class="pl-20 pr-20"><h1>' + event['obligationtitle'] + '</h1></div>');
15609
- html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + event['obligation'].replace(/\n/g, '<br />') + '</h3></div>');
15610
- html += ('<div part="detail-summary-content" class="pl-20 pr-20">' + ('<sf-i-elastic-text text="' + (event['internalcontrols'] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
15711
+ html += '<div class="d-flex justify-between m-20">';
15712
+ html += '<h3 part="results-title" class="m-0"><br />Comments</h3>';
15611
15713
  html += '</div>';
15612
15714
 
15613
- html += '<br />';
15715
+ html += '<div class="m-20">';
15614
15716
 
15615
- html += '<div class="accordian-section section-basic pl-20 pr-20" part="accordian-section">';
15616
- html += '<div class="d-flex justify-between accordian-head head-basic cursor" part="accordian-head">';
15617
- html += '<h3>Basic Information</h3>'
15618
- html += '<h3 class="head-indicator-basic">-</h3>'
15619
- html += '</div>';
15620
- html += '<div class="d-flex flex-wrap accordian-body body-basic" part="accordian-body">';
15717
+ html += '<div class="d-flex flex-col">';
15621
15718
 
15622
- for (var i = 0; i < basicFields.length; i++) {
15719
+ for (var i = 0; i < comments.length; i++) {
15720
+ html += '<div part="commentbox" class="d-flex commentbox ' + (comments[i].author + "").toLowerCase() + 'box">';
15721
+ html += '<div class="mr-20 d-flex flex-col align-end"><span part="comment-username">' + (comments[i].username != null ? comments[i].username : '') + '</span><span part="td-head">' + comments[i].author + '</span>' + ((i === (comments.length - 1) && this.enableDeleteLatestReport) ? '<br /><button class="mt-5 button-delete" part="button">Delete</button>' : '') + '</div>';
15623
15722
 
15624
- if (!this.getEventPreviewFields().includes(basicFields[i])) {
15723
+ const onlyCommentText = (comments[i].comment + "").replace(/ *\([^)]*\) */g, "").trim();
15724
+ try {
15625
15725
 
15626
- if (!this.getEventHideFields().includes(basicFields[i])) {
15726
+ const jsonComments = JSON.parse(onlyCommentText);
15627
15727
 
15628
- console.log('basicFields', event[basicFields[i]] + "");
15629
- if ((event[basicFields[i]] + "").indexOf("[") >= 0) {
15630
- html += '<div class="m-20">';
15631
- html += '<div part="detail-head"><strong>' + basicFields[i] + '</strong></div>'
15632
- html += this.getEventTexts(basicFields[i], JSON.parse(event[basicFields[i]]), event).replace(/ *\([^)]*\) */g, "").trim();
15633
- html += '</div>';
15634
- } else {
15635
- html += '<div class="m-20">';
15636
- html += '<div part="detail-head"><strong>' + basicFields[i] + '</strong></div>'
15637
- html += '<sf-i-elastic-text text="' + (event[basicFields[i]] + "").replace(/"/g, "").replace(/ *\([^)]*\) */g, "").trim().split(';')[0] + '" minLength="80"></sf-i-elastic-text>';
15638
- html += '</div>';
15728
+ if (Util.isInteger(jsonComments)) {
15729
+ html += '<div class="">' + comments[i].comment + '<br /><small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
15730
+ } else {
15731
+ //console.log('json comments', jsonComments);
15732
+ var htmlTable = '';
15733
+ for (var j = 0; j < Object.keys(jsonComments).length; j++) {
15734
+ htmlTable += '<div class="mb-20">';
15735
+ htmlTable += ('<div part="detail-head">' + Object.keys(jsonComments)[j] + '</div>');
15736
+ htmlTable += ('<sf-i-elastic-text text="' + jsonComments[Object.keys(jsonComments)[j]] + '" minLength="20"></sf-i-elastic-text>');
15737
+ htmlTable += '</div>';
15639
15738
  }
15640
-
15739
+ html += '<div class="">' + htmlTable + '<small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
15641
15740
  }
15642
- }
15643
-
15644
- }
15645
15741
 
15646
- if (this.mode == "consumer") {
15647
- if (approved) {
15648
- html += '<div class="m-20">';
15649
- html += '<div part="detail-head"><strong>Approved</strong></div>'
15650
- html += '<span class="material-icons color-done">check_circle</span>'
15651
- html += '</div>';
15742
+ } catch (e: any) {
15743
+ //console.log('json comments exception', comments[i]);
15744
+ html += '<div class="">' + comments[i].comment + '<br /><small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
15652
15745
  }
15653
- }
15654
15746
 
15655
- if (docs != null) {
15656
- html += '<div class="m-20">';
15657
- html += '<div part="detail-head"><strong>Documents</strong></div>'
15658
- html += '<span class="material-icons muted">description</span>'
15659
- html += docs.length
15660
15747
  html += '</div>';
15661
15748
  }
15662
-
15663
- if (comments != null) {
15664
- html += '<div class="m-20">';
15665
- html += '<div part="detail-head"><strong>Comments</strong></div>'
15666
- html += '<span class="material-icons muted">forum</span>'
15667
- html += comments.length
15668
- html += '</div>';
15749
+ if (comments.length === 0) {
15750
+ html += '<div><strong>No comments yet!</strong></div>';
15669
15751
  }
15670
15752
 
15671
- html += '<div class="m-20">';
15672
- html += '<div part="detail-head"><strong>Reporters</strong></div>'
15673
- html += this.getReporterDetailStringFromEvent(event);
15674
15753
  html += '</div>';
15675
15754
 
15676
- html += '<div class="m-20">';
15677
- html += '<div part="detail-head"><strong>Approvers</strong></div>'
15678
- html += this.getApproverDetailStringFromEvent(event);
15679
15755
  html += '</div>';
15756
+ console.log('selected event', JSON.stringify(listEvent));
15757
+ (this._SfDetailContainer as HTMLDivElement).innerHTML = html;
15758
+ (this._SfDetailContainer as HTMLDivElement).style.display = 'block';
15680
15759
 
15681
- html += '</div>';
15682
- html += '</div>';
15760
+ let usermap = Util.getUsermap();
15683
15761
 
15762
+ let sfireporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#detail-reporting') as SfIReporting
15763
+ sfireporting.usermap = JSON.stringify(usermap);
15764
+ sfireporting.selectedItem = listEvent;
15765
+ sfireporting.editdisable = "true"
15766
+ setTimeout(() => {
15767
+ console.log('sfireporting', sfireporting._SfReportingContainer);
15768
+ console.log('sfireporting', sfireporting.selectedItem);
15769
+ sfireporting.loadMode();
15770
+ }, 500);
15684
15771
 
15685
- html += '<div class="accordian-section section-statute pl-20 pr-20" part="accordian-section">';
15686
- html += '<div class="d-flex justify-between accordian-head head-statute cursor" part="accordian-head">';
15687
- html += '<h3>Statute Information</h3>'
15772
+ sfireporting.addEventListener('valueChanged', () => {
15773
+ sfireporting.classList.remove('hide');
15774
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#shimmer-container-agreements') as HTMLDivElement).classList.add('hide');
15775
+ });
15776
+ let reportingSchemaJson = "";
15777
+ let reportingSchemaValues = ""
15778
+ if (listEvent.reportformatschema != null) {
15779
+ reportingSchemaJson = listEvent.reportformatschema
15780
+ reportingSchemaValues = listEvent.reportformatvalues
15781
+ } else if (listEvent.customreporting != null) {
15782
+ reportingSchemaJson = listEvent.customreporting
15783
+ }
15784
+ if (listEvent.customreporting != null || listEvent.reportformatschema != null) {
15785
+ let reportingHtml = '<sf-i-reporting id="reporting-reporting" exportparts="uploader-extracted-text:reporting-uploader-extracted-text, uploader-sf-upload-message:reporting-uploader-sf-upload-message, uploader-sf-upload-submessage:reporting-uploader-sf-upload-submessage, uploader-extracted-text-chip:reporting-uploader-extracted-text-chip, uploader-extracted-text-chip-failed:reporting-uploader-extracted-text-chip-failed, uploader-doctype-verify-badge:reporting-uploader-doctype-verify-badge,span-submit-published:reporting-span-submit-published, span-submit-unpublished:reporting-span-submit-unpublished, reporting-container:reporting-reporting-container, button-icon:reporting-button-icon, uploader-button-icon:reporting-uploader-button-icon, sf-i-form-modal-container:reporting-sf-i-form-modal-container, next-calendar-date:reporting-next-calendar-date, last-calendar-date:reporting-last-calendar-date, input-publish-checkbox:reporting-input-publish-checkbox, button-icon-light:reporting-button-icon-light, button-icon-small:reporting-button-icon-small, uploader-input-label:reporting-uploader-input-label, input-radio:reporting-input-radio, radio-label:reporting-radio-label, input-textarea:reporting-input-textarea, input-textarea-disabled:reporting-input-textarea-disabled, input-date:reporting-input-date, input-date-disabled:reporting-input-date-disabled, input-select-single:reporting-input-select-single, textarea-container:reporting-textarea-container, section-body:reporting-section-body, section-container:reporting-section-container, date-container:reporting-date-container, input-sf-i-uploader:reporting-input-sf-i-uploader, published-container:reporting-published-container, selected-option:reporting-selected-option, input-select-multi-option:reporting-input-select-multi-option, select-option-label:reporting-select-option-label, input-sf-i-form:reporting-input-sf-i-form, input-sf-i-bricks:reporting-input-sf-i-bricks, uploader-input:reporting-uploader-input, form-container:reporting-form-container, published-container:reporting-published-container, form-container-published:reporting-form-container-published, subsection:reporting-subsection, results-title:reporting-results-title, td-head:reporting-td-head, td-action:reporting-td-action, td-body:reporting-td-body, td-body-2:reporting-td-body-2, add-button:reporting-add-button, uploader-button:reporting-uploader-button, section-head-collapsed:reporting-section-head-collapsed, section-title-expanded:reporting-section-title-expanded, section-title-collapsed:reporting-section-title-collapsed, section-head-expanded:reporting-section-head-expanded, progress-bar-finished:reporting-progress-bar-finished, progress-bar-complete:reporting-progress-bar-complete, progress-bar-incomplete:reporting-progress-bar-incomplete, section-success-icon:reporting-section-success-icon, section-body:reporting-section-body, title-section:reporting-title-section, button-lg:reporting-button-lg, uploader-detail-container:reporting-uploader-detail-container, textarea-label:reporting-textarea-label, date-label:reporting-date-label, commentbox:reporting-commentbox, comment-username:reporting-comment-username, detail-head:reporting-detail-head, reporting-uploader-extracted-text:reporting-reporting-uploader-extracted-text, reporting-uploader-sf-upload-message:reporting-reporting-uploader-sf-upload-message, reporting-uploader-sf-upload-submessage:reporting-reporting-uploader-sf-upload-submessage, reporting-uploader-extracted-text-chip:reporting-reporting-uploader-extracted-text-chip, reporting-uploader-extracted-text-chip-failed:reporting-reporting-uploader-extracted-text-chip-failed, reporting-uploader-doctype-verify-badge:reporting-reporting-uploader-doctype-verify-badge, reporting-span-submit-published:reporting-reporting-span-submit-published, reporting-span-submit-unpublished:reporting-reporting-span-submit-unpublished, reporting-reporting-container:reporting-reporting-reporting-container, reporting-button-icon:reporting-reporting-button-icon, reporting-uploader-button-icon:reporting-reporting-uploader-button-icon, reporting-sf-i-form-modal-container:reporting-reporting-sf-i-form-modal-container, reporting-next-calendar-date:reporting-reporting-next-calendar-date, reporting-last-calendar-date:reporting-reporting-last-calendar-date, reporting-input-publish-checkbox:reporting-reporting-input-publish-checkbox, reporting-button-icon-light:reporting-reporting-button-icon-light, reporting-button-icon-small:reporting-reporting-button-icon-small, reporting-uploader-input-label:reporting-reporting-uploader-input-label, reporting-input-radio:reporting-reporting-input-radio, reporting-radio-label:reporting-reporting-radio-label, reporting-input-textarea:reporting-reporting-input-textarea, reporting-input-textarea-disabled:reporting-reporting-input-textarea-disabled, reporting-input-date:reporting-reporting-input-date, reporting-input-date-disabled:reporting-reporting-input-date-disabled, reporting-input-select-single:reporting-reporting-input-select-single, reporting-textarea-container:reporting-reporting-textarea-container, reporting-section-body:reporting-reporting-section-body, reporting-section-container:reporting-reporting-section-container, reporting-date-container:reporting-reporting-date-container, reporting-input-sf-i-uploader:reporting-reporting-input-sf-i-uploader, reporting-published-container:reporting-reporting-published-container, reporting-selected-option:reporting-reporting-selected-option, reporting-input-select-multi-option:reporting-reporting-input-select-multi-option, reporting-select-option-label:reporting-reporting-select-option-label, reporting-input-sf-i-form:reporting-reporting-input-sf-i-form, reporting-input-sf-i-bricks:reporting-reporting-input-sf-i-bricks, reporting-uploader-input:reporting-reporting-uploader-input, reporting-form-container:reporting-reporting-form-container, reporting-published-container:reporting-reporting-published-container, reporting-form-container-published:reporting-reporting-form-container-published, reporting-subsection:reporting-reporting-subsection, reporting-results-title:reporting-reporting-results-title, reporting-td-head:reporting-reporting-td-head, reporting-td-action:reporting-reporting-td-action, reporting-td-body:reporting-reporting-td-body, reporting-td-body-2:reporting-reporting-td-body-2, reporting-add-button:reporting-reporting-add-button, reporting-uploader-button:reporting-reporting-uploader-button, reporting-section-head-collapsed:reporting-reporting-section-head-collapsed, reporting-section-title-expanded:reporting-reporting-section-title-expanded, reporting-section-title-collapsed:reporting-reporting-section-title-collapsed, reporting-section-head-expanded:reporting-reporting-section-head-expanded, reporting-progress-bar-finished:reporting-reporting-progress-bar-finished, reporting-progress-bar-complete:reporting-reporting-progress-bar-complete, reporting-progress-bar-incomplete:reporting-reporting-progress-bar-incomplete, reporting-section-success-icon:reporting-reporting-section-success-icon, reporting-section-body:reporting-reporting-section-body, reporting-title-section:reporting-reporting-title-section, reporting-button-lg:reporting-reporting-button-lg, reporting-uploader-detail-container:reporting-reporting-uploader-detail-container, reporting-textarea-label:reporting-reporting-textarea-label, reporting-date-label:reporting-reporting-date-label, reporting-commentbox:reporting-reporting-commentbox, reporting-comment-username:reporting-reporting-comment-username, reporting-detail-head:reporting-reporting-detail-head, input-sf-i-select:reporting-input-sf-i-select,reporting-input-sf-i-select:reporting-reporting-input-sf-i-select, select-input-select:reporting-select-input-select, checklist-container:reporting-checklist-container, checklist-title:reporting-checklist-title, checklist-list:reporting-checklist-list, checklist-item:reporting-checklist-item, checklist-checkbox:reporting-checklist-checkbox, checklist-checkbox-label:reporting-checklist-checkbox-label, reporting-checklist-container:reporting-reporting-checklist-container, reporting-checklist-title:reporting-reporting-checklist-title, reporting-checklist-list:reporting-reporting-checklist-list, reporting-checklist-item:reporting-reporting-checklist-item, reporting-checklist-checkbox:reporting-reporting-checklist-checkbox, reporting-checklist-checkbox-label:reporting-reporting-checklist-checkbox-label, checklist-add-input:reporting-checklist-add-input, checklist-add-button:reporting-checklist-add-button, terminate-container:reporting-terminate-container, terminate-container-terminated:reporting-terminate-container-terminated, terminate-container-active:reporting-terminate-container-active, input-terminate-checkbox: reporting-input-terminate-checkbox, reporting-terminate-container:reporting-reporting-terminate-container, reporting-terminate-container-terminated:reporting-reporting-terminate-container-terminated, reporting-terminate-container-active:reporting-reporting-terminate-container-active, reporting-input-terminate-checkbox: reporting-reporting-input-terminate-checkbox, uploader-container:reporting-uploader-container, reporting-uploader-container:reporting-reporting-uploader-container, not-selected:reporting-not-selected, reporting-not-selected:reportinig-reporting-not-selected" mode="edit" flow="reporting" name="RCM Resource Reporting" formviewclass="flex-wrap" showterminate="true" projectid="' + this.projectId + '"></sf-i-reporting>'
15786
+
15787
+ let reportFormatContainer = (this._SfDetailContainer as HTMLDivElement).querySelector('#report-format-container') as HTMLDivElement;
15788
+ if (reportFormatContainer != null) {
15789
+ reportFormatContainer.innerHTML = reportingHtml;
15790
+ }
15791
+
15792
+ }
15793
+ let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
15794
+
15795
+ if (reportingSchemaJson != "" && reportingReporting != null) {
15796
+ reportingReporting.configjson = reportingSchemaJson;
15797
+ if (reportingSchemaValues != "") reportingReporting.prepopulateValJson = reportingSchemaValues
15798
+ reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
15799
+ reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
15800
+ reportingReporting.flow = "reporting"
15801
+ setTimeout(() => {
15802
+ reportingReporting.loadMode();
15803
+ console.log('list-customreporting', reportingSchemaJson);
15804
+ console.log('list-customreporting1', reportingSchemaValues);
15805
+ console.log('list-customreporting2', reportingReporting.mode);
15806
+ }, 500)
15807
+ }
15808
+
15809
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close')?.addEventListener('click', () => {
15810
+
15811
+ (this._SfDetailContainer as HTMLDivElement).innerHTML = '';
15812
+ (this._SfDetailContainer as HTMLDivElement).style.display = 'none';
15813
+
15814
+ });
15815
+
15816
+ (this._SfDetailContainer as HTMLDivElement).querySelector('.button-delete')?.addEventListener('click', async () => {
15817
+
15818
+ // await this.fetchDeleteReview(listEvent["id"], mmddyyyy, entityId, locationId);
15819
+ // this.setSuccess('Deleted successfully!')
15820
+ // setTimeout(() => {
15821
+ // this.clearMessages()
15822
+ // }, 3000);
15823
+ // //console.log('deleted', resultDelete);
15824
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
15825
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
15826
+ // } else {
15827
+ // if(currentColumnButton != null) {
15828
+ // currentColumnButton.click();
15829
+ // }
15830
+ // }
15831
+
15832
+ console.log('delete review clicked')
15833
+
15834
+ var clickEvent = new MouseEvent("click", {
15835
+ "view": window,
15836
+ "bubbles": true,
15837
+ "cancelable": false
15838
+ });
15839
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
15840
+
15841
+ });
15842
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-auto-approve')?.addEventListener('click', async () => {
15843
+ if (this.selectedItemIds.length === 0) {
15844
+ console.log('audto approve single')
15845
+ } else {
15846
+ console.log('auto approve bulk')
15847
+ }
15848
+ //console.log('deleted', resultDelete);
15849
+ if (this.getCurrentTab() == this.TAB_CUSTOM) {
15850
+ this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
15851
+ } else {
15852
+ // if(currentColumnButton != null) {
15853
+ // currentColumnButton.click();
15854
+ // }
15855
+ }
15856
+
15857
+ var clickEvent = new MouseEvent("click", {
15858
+ "view": window,
15859
+ "bubbles": true,
15860
+ "cancelable": false
15861
+ });
15862
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
15863
+
15864
+ });
15865
+
15866
+ if (this.mode == "consumer" || this.mode == "next") {
15867
+
15868
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-approve')?.addEventListener('click', async (ev: any) => {
15869
+ let buttonClick = ev.target as HTMLButtonElement
15870
+ buttonClick.innerHTML = "Saving..."
15871
+ const comments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approver-comments') as HTMLInputElement).value;
15872
+ const approved = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked;
15873
+ let currStatus = this.getCompletenessStatus(listEvent);
15874
+ let newEvent = { ...listEvent };
15875
+ newEvent.comments = comments;
15876
+ newEvent.approved = approved;
15877
+ let newStatus = this.getCompletenessStatus(newEvent);
15878
+ if (currStatus == newStatus) {
15879
+ buttonClick.innerHTML = "Save"
15880
+ this.setError(approved ? 'Already Approved!' : 'Already Rejected!');
15881
+ setTimeout(() => {
15882
+ this.clearMessages();
15883
+ }, 3000);
15884
+ return;
15885
+ }
15886
+ let reportformatvalues = ""
15887
+ let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
15888
+ console.log('renew reporting', reportingReporting)
15889
+ if (reportingReporting != null) {
15890
+ reportformatvalues = JSON.stringify(reportingReporting!.selectedValues()) ?? "";
15891
+ }
15892
+ var clickEvent = new MouseEvent("click", {
15893
+ "view": window,
15894
+ "bubbles": true,
15895
+ "cancelable": false
15896
+ });
15897
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
15898
+
15899
+ // await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved)
15900
+ let flagBulk = false;
15901
+ if (this.selectedItemIds.length <= 1) {
15902
+ console.log('mmddyyyy', mmddyyyy)
15903
+ if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
15904
+ if (approved) {
15905
+ await this.renewRCMResource(listEvent, reportformatvalues);
15906
+ } else {
15907
+ console.log('renew reporting', reportformatvalues)
15908
+ }
15909
+ for (var p = 0; p < this.events[mmdd].length; p++) {
15910
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
15911
+ this.events[mmdd][p].approved = approved
15912
+ this.events[mmdd][p].terminated = (JSON.parse(reportformatvalues).terminated) ?? false
15913
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
15914
+ this.events[mmdd][p].lastupdated = new Date().toString()
15915
+ }
15916
+ }
15917
+ if (this.recentlyReported[mmdd] == null) {
15918
+ this.recentlyReported[mmdd] = []
15919
+ }
15920
+ this.recentlyReported[mmdd].push(listEvent)
15921
+ console.log('review single')
15922
+ }
15923
+ } else {
15924
+ let bulkBodyReview = []
15925
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
15926
+
15927
+ const selectedId = this.selectedItemIds[k];
15928
+ //console.log('selectedid', selectedId);
15929
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
15930
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
15931
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
15932
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
15933
+
15934
+ //console.log(entityId, locationId, eventId, mmddyyyy);
15935
+ bulkBodyReview.push({
15936
+ "mmddyyyy": mmddyyyy,
15937
+ "projectid": this.projectId,
15938
+ "type": "review",
15939
+ "eventid": eventId,
15940
+ "comments": comments,
15941
+ "approved": approved,
15942
+ "entityid": entityId,
15943
+ "locationid": locationId,
15944
+ "username": this.userName,
15945
+ "userid": this.userProfileId,
15946
+ "userrole": this.myRole,
15947
+ "year": this.calendarStartYYYY,
15948
+ "module": listEvent.module ?? "events"
15949
+ })
15950
+ // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, comments, approved)
15951
+
15952
+ // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
15953
+ // await this.sleep(2000);
15954
+ // this.clearMessages();
15955
+
15956
+ }
15957
+ await this.uploadReviewsBulk(bulkBodyReview);
15958
+
15959
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
15960
+
15961
+ const selectedId = this.selectedItemIds[k];
15962
+ //console.log('selectedid', selectedId);
15963
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
15964
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
15965
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
15966
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
15967
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
15968
+ for (var p = 0; p < this.events[mmdd].length; p++) {
15969
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
15970
+
15971
+ this.events[mmdd][p].isbulk = true
15972
+ flagBulk = true;
15973
+ if (this.recentlyReported[mmdd] == null) {
15974
+ this.recentlyReported[mmdd] = []
15975
+ }
15976
+ this.recentlyReported[mmdd].push(this.events[mmdd][p])
15977
+ }
15978
+ }
15979
+ }
15980
+ console.log('review bulk')
15981
+ }
15982
+
15983
+ if (this.mode == "next") {
15984
+ // this.fetchNext(this.nextPage)
15985
+ this.renderRoleTabsNext(this.nextPage)
15986
+ } else {
15987
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
15988
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
15989
+ // } else
15990
+ if (this.getCurrentTab() == this.TAB_FIND) {
15991
+ const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
15992
+ this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
15993
+ } else {
15994
+ if (this.selectedItemIds.length > 0) {
15995
+ await this.fetchBulkReportingData();
15996
+ }
15997
+ this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
15998
+ var clickEvent = new MouseEvent("click", {
15999
+ "view": window,
16000
+ "bubbles": true,
16001
+ "cancelable": false
16002
+ });
16003
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)?.dispatchEvent(clickEvent);
16004
+
16005
+ // if(currentColumnButton != null) {
16006
+ // currentColumnButton.click();
16007
+ // }
16008
+ }
16009
+ }
16010
+
16011
+ });
16012
+
16013
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-audit')?.addEventListener('click', async (ev: any) => {
16014
+ let buttonClick = ev.target as HTMLButtonElement
16015
+ buttonClick.innerHTML = "Saving..."
16016
+ const comments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-auditor-comments') as HTMLInputElement).value;
16017
+ const approved = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked;
16018
+ let currStatus = this.getCompletenessStatus(listEvent);
16019
+ let newEvent = { ...listEvent };
16020
+ newEvent.comments = comments;
16021
+ newEvent.approved = approved;
16022
+ let newStatus = this.getCompletenessStatus(newEvent);
16023
+ if (currStatus == newStatus) {
16024
+ buttonClick.innerHTML = "Save"
16025
+ this.setError(approved ? 'Already Approved!' : 'Already Rejected!');
16026
+ setTimeout(() => {
16027
+ this.clearMessages();
16028
+ }, 3000);
16029
+ return;
16030
+ }
16031
+ if (comments.trim().length === 0) {
16032
+ buttonClick.innerHTML = "Save"
16033
+ this.setError('Comments cannot be blank!');
16034
+ setTimeout(() => {
16035
+ this.clearMessages();
16036
+ }, 3000);
16037
+
16038
+ } else {
16039
+ let flagBulk = false;
16040
+ if (this.selectedItemIds.length <= 1) {
16041
+
16042
+ if (await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
16043
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16044
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16045
+ this.events[mmdd][p].approved = approved
16046
+ this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
16047
+ this.events[mmdd][p].lastupdated = new Date().toString()
16048
+ }
16049
+ }
16050
+ if (this.recentlyReported[mmdd] == null) {
16051
+ this.recentlyReported[mmdd] = []
16052
+ }
16053
+ this.recentlyReported[mmdd].push(listEvent)
16054
+ }
16055
+ console.log('uploadaudit single')
16056
+ } else {
16057
+ let bulkBodyAudit = []
16058
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
16059
+
16060
+ const selectedId = this.selectedItemIds[k];
16061
+ //console.log('selectedid', selectedId);
16062
+
16063
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
16064
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
16065
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
16066
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
16067
+
16068
+ //console.log(entityId, locationId, eventId, mmddyyyy);
16069
+ bulkBodyAudit.push({
16070
+ "mmddyyyy": mmddyyyy,
16071
+ "projectid": this.projectId,
16072
+ "type": "audit",
16073
+ "eventid": eventId,
16074
+ "comments": comments,
16075
+ "approved": approved,
16076
+ "entityid": entityId,
16077
+ "locationid": locationId,
16078
+ "username": this.userName,
16079
+ "userid": this.userProfileId,
16080
+ "userrole": this.myRole,
16081
+ "year": this.calendarStartYYYY,
16082
+ "module": listEvent.module ?? "events"
16083
+ })
16084
+ // await this.uploadAudit(entityId, locationId, mmddyyyy, eventId, comments, approved);
16085
+
16086
+ }
16087
+
16088
+ await this.uploadAuditsBulk(bulkBodyAudit);
16089
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
16090
+
16091
+ const selectedId = this.selectedItemIds[k];
16092
+ //console.log('selectedid', selectedId);
16093
+ let entityId = selectedId.split('-')[7].replace(/_/g, '-');
16094
+ let locationId = selectedId.split('-')[8].replace(/_/g, '-');
16095
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
16096
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
16097
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
16098
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16099
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16100
+
16101
+ this.events[mmdd][p].isbulk = true
16102
+ flagBulk = true;
16103
+ if (this.recentlyReported[mmdd] == null) {
16104
+ this.recentlyReported[mmdd] = []
16105
+ }
16106
+ this.recentlyReported[mmdd].push(this.events[mmdd][p])
16107
+ }
16108
+ }
16109
+ }
16110
+
16111
+ console.log('uploadAudit bulk')
16112
+
16113
+ }
16114
+
16115
+ var clickEvent = new MouseEvent("click", {
16116
+ "view": window,
16117
+ "bubbles": true,
16118
+ "cancelable": false
16119
+ });
16120
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
16121
+ if (this.mode == "next") {
16122
+ this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
16123
+ } else {
16124
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
16125
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
16126
+ // } else
16127
+ if (this.getCurrentTab() == this.TAB_FIND) {
16128
+ const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
16129
+ this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
16130
+ } else {
16131
+ if (this.selectedItemIds.length > 0) {
16132
+ await this.fetchBulkReportingData();
16133
+ }
16134
+ this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
16135
+ // if(currentColumnButton != null) {
16136
+ // currentColumnButton.click();
16137
+ // }
16138
+ }
16139
+ }
16140
+
16141
+ }
16142
+
16143
+
16144
+
16145
+ });
16146
+
16147
+ if (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) {
16148
+
16149
+ if (approved) {
16150
+
16151
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement) != null) {
16152
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement).style.visibility = 'hidden';
16153
+ }
16154
+
16155
+
16156
+ } else {
16157
+
16158
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement) != null) {
16159
+
16160
+
16161
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement).style.visibility = 'visible';
16162
+
16163
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report')?.addEventListener('click', async (ev: any) => {
16164
+ let buttonClick = ev.target as HTMLButtonElement
16165
+ buttonClick.innerHTML = "Saving..."
16166
+ const reportercomments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-comments') as HTMLInputElement).value;
16167
+
16168
+ //console.log('reporter comments 1', reportercomments);
16169
+
16170
+ // 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() + "") : "";
16171
+ const reporterdoc = new Date().getTime() + "";
16172
+ let docs: any[] = [];
16173
+
16174
+ //console.log('reporter comments 2', reportercomments);
16175
+
16176
+ // if(docsOptional.length === 0) {
16177
+ // docs = (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.selectedValues();
16178
+ // }
16179
+
16180
+ //console.log('docs', docs);
16181
+ let reportformatvalues: string = "";
16182
+ let reportformatschema: string = "";
16183
+ if (listEvent.customreporting != null) {
16184
+ let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
16185
+ console.log('reportformatvalues', JSON.stringify(reportingReporting.selectedValues()))
16186
+ reportformatvalues = JSON.stringify(reportingReporting!.selectedValues()) ?? "";
16187
+ reportformatschema = reportingReporting!.configjson ?? "";
16188
+ }
16189
+
16190
+ let percentage: string = "100";
16191
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement) != null) {
16192
+ percentage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement).value
16193
+ }
16194
+ // if (Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
16195
+
16196
+ // //console.log('reporter comments 3', reportercomments);
16197
+ // buttonClick.innerHTML = "Save"
16198
+ // this.setError('Invalid Percentage!');
16199
+ // setTimeout(() => {
16200
+ // this.clearMessages();
16201
+ // }, 3000);
16202
+
16203
+ // } else {
16204
+ // if (docs.length === 0 && docsOptional.length === 0) {
16205
+
16206
+ // //console.log('reporter comments 3', reportercomments);
16207
+ // buttonClick.innerHTML = "Save"
16208
+ // this.setError('No documents uploaded!');
16209
+ // setTimeout(() => {
16210
+ // this.clearMessages();
16211
+ // }, 3000);
16212
+
16213
+ // } else {
16214
+
16215
+ // //console.log('reporterdoc', reporterdoc);
16216
+
16217
+ // if (reporterdoc.length === 0) {
16218
+ // buttonClick.innerHTML = "Save"
16219
+ // this.setError('Date of completion not selected!');
16220
+ // setTimeout(() => {
16221
+ // this.clearMessages();
16222
+ // }, 3000);
16223
+
16224
+ // } else if (parseInt(reporterdoc) > new Date().getTime()) {
16225
+ // buttonClick.innerHTML = "Save"
16226
+ // this.setError('Date of completion cannot be in future!');
16227
+ // setTimeout(() => {
16228
+ // this.clearMessages();
16229
+ // }, 3000);
16230
+
16231
+ // } else {
16232
+
16233
+ //console.log('makerscheckers 1', reportercomments);
16234
+
16235
+ if (reportercomments.trim().length === 0) {
16236
+ buttonClick.innerHTML = "Save"
16237
+ this.setError('Comments cannot be blank!');
16238
+ setTimeout(() => {
16239
+ this.clearMessages();
16240
+ }, 3000);
16241
+
16242
+ } else {
16243
+
16244
+
16245
+ var clickEvent = new MouseEvent("click", {
16246
+ "view": window,
16247
+ "bubbles": true,
16248
+ "cancelable": false
16249
+ });
16250
+
16251
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
16252
+ let flagBulk = false;
16253
+ if (this.selectedItemIds.length <= 1) {
16254
+
16255
+ if (await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, listEvent.module, percentage, makercheckers)) {
16256
+ console.log('this.events', this.events);
16257
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16258
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16259
+ this.events[mmdd][p].documents = docs
16260
+ this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() })
16261
+ this.events[mmdd][p].lastupdated = new Date().toString()
16262
+ }
16263
+ }
16264
+ console.log('uploadReport single')
16265
+ if (makercheckers.length > 0) {
16266
+
16267
+ // await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
16268
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16269
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16270
+ this.events[mmdd][p].approved = true
16271
+ this.events[mmdd][p].terminated = (JSON.parse(reportformatvalues).terminated) ?? false
16272
+ // this.events[mmdd][p].documents = docs
16273
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() })
16274
+ this.events[mmdd][p].lastupdated = new Date().toString()
16275
+ }
16276
+ }
16277
+ await this.renewRCMResource(listEvent, reportformatvalues);
16278
+ console.log('upload report auto approve single')
16279
+ }
16280
+ if (this.recentlyReported[mmdd] == null) {
16281
+ this.recentlyReported[mmdd] = []
16282
+ }
16283
+ this.recentlyReported[mmdd].push(listEvent)
16284
+ }
16285
+ } else {
16286
+ let bulkBody = []
16287
+ let bulkBodyReview = []
16288
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
16289
+
16290
+ const selectedId = this.selectedItemIds[k];
16291
+ //console.log('selectedid', selectedId);
16292
+
16293
+ const makercheckersL = selectedId.split('-')[5];
16294
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
16295
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
16296
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
16297
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
16298
+
16299
+ //console.log(entityId, locationId, eventId, mmddyyyy);
16300
+
16301
+ // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
16302
+ // if(parseInt(makercheckersL) > 0) {
16303
+ // bulkBodyReview.push({
16304
+ // "mmddyyyy": mmddyyyy,
16305
+ // "projectid": this.projectId,
16306
+ // "type": "report",
16307
+ // "eventid": eventId,
16308
+ // "comments": reportercomments,
16309
+ // "dateofcompletion": reporterdoc,
16310
+ // "percentage": percentage,
16311
+ // "entityid": entityId,
16312
+ // "locationid": locationId,
16313
+ // "event": null,
16314
+ // "docs": JSON.stringify(docs),
16315
+ // "approved": true,
16316
+ // "username": this.userName,
16317
+ // "reportformatvalues": reportformatvalues,
16318
+ // "reportformatschema": reportformatschema,
16319
+ // "userid": this.userProfileId,
16320
+ // "userrole": this.myRole,
16321
+ // "year": this.calendarStartYYYY,
16322
+ // "module": listEvent.module ?? "events"
16323
+ // } )
16324
+ // // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
16325
+
16326
+ // }else{
16327
+ bulkBody.push({
16328
+ "mmddyyyy": mmddyyyy,
16329
+ "projectid": this.projectId,
16330
+ "type": "report",
16331
+ "eventid": eventId,
16332
+ "comments": reportercomments,
16333
+ "dateofcompletion": reporterdoc,
16334
+ "percentage": percentage,
16335
+ "entityid": entityId,
16336
+ "locationid": locationId,
16337
+ "event": null,
16338
+ "docs": JSON.stringify(docs),
16339
+ "username": this.userName,
16340
+ "reportformatvalues": reportformatvalues,
16341
+ "reportformatschema": reportformatschema,
16342
+ "userid": this.userProfileId,
16343
+ "userrole": this.myRole,
16344
+ "year": this.calendarStartYYYY,
16345
+ "module": listEvent.module ?? "events",
16346
+ "makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
16347
+ })
16348
+ // }
16349
+
16350
+ // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
16351
+ // await this.sleep(2000);
16352
+ // this.clearMessages();
16353
+
16354
+ }
16355
+
16356
+ // await this.uploadReportsBulk(bulkBody);
16357
+ // await this.fetchBulkReportingData();
16358
+ if (bulkBody.length > 0) {
16359
+ await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
16360
+ }
16361
+
16362
+ // if(bulkBodyReview.length > 0){
16363
+ // await this.uploadReportsReviewsBulk(bulkBodyReview)
16364
+ // }
16365
+ await this.fetchBulkReportingData();
16366
+ console.log('uploadReport bulk')
16367
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
16368
+
16369
+ const selectedId = this.selectedItemIds[k];
16370
+ //console.log('selectedid', selectedId);
16371
+ let entityId = selectedId.split('-')[7].replace(/_/g, '-');
16372
+ let locationId = selectedId.split('-')[8].replace(/_/g, '-');
16373
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
16374
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
16375
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
16376
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16377
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16378
+
16379
+ this.events[mmdd][p].isbulk = true
16380
+ flagBulk = true;
16381
+ if (this.recentlyReported[mmdd] == null) {
16382
+ this.recentlyReported[mmdd] = []
16383
+ }
16384
+ this.recentlyReported[mmdd].push(this.events[mmdd][p])
16385
+ }
16386
+ }
16387
+ }
16388
+
16389
+ }
16390
+
16391
+ if (this.mode == "next") {
16392
+ this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
16393
+ } else {
16394
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
16395
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
16396
+ // } else
16397
+ if (this.getCurrentTab() == this.TAB_FIND) {
16398
+ const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
16399
+ this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
16400
+ } else {
16401
+ if (this.selectedItemIds.length > 0) {
16402
+ await this.fetchBulkReportingData();
16403
+ }
16404
+ this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk)
16405
+ // if(currentColumnButton != null) {
16406
+ // currentColumnButton.click();
16407
+ // }
16408
+ }
16409
+ }
16410
+
16411
+ }
16412
+
16413
+
16414
+ // }
16415
+ // }
16416
+ // }
16417
+ });
16418
+
16419
+ }
16420
+
16421
+ }
16422
+
16423
+ }
16424
+
16425
+ if (this._SfUploader[0] != null) {
16426
+ (this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "none"
16427
+ this._SfUploader[0].querySelector('#uploader').addEventListener('analysisInProgress', (_ev: any) => {
16428
+ console.log('uploader analysisInProgress', _ev);
16429
+ (this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "block"
16430
+ });
16431
+ this._SfUploader[0].querySelector('#uploader').addEventListener('analysisCompleted', (_ev: any) => {
16432
+ console.log('uploader analysisInProgress', _ev);
16433
+ (this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "none"
16434
+ });
16435
+
16436
+
16437
+ //console.log('documentType checking', documentType);
16438
+
16439
+ if (documentType != null) {
16440
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.docType = documentType;
16441
+ }
16442
+
16443
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.prepopulatedInputArr = JSON.stringify([]);
16444
+ console.log('uploader', (this._SfUploader[0].querySelector('#uploader') as SfIUploader));
16445
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
16446
+
16447
+ if (docs.length > 0) {
16448
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.prepopulatedInputArr = JSON.stringify(docs);
16449
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
16450
+ }
16451
+
16452
+ if (this.myRole == this.TAB_APPROVER || approved) {
16453
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.readOnly = true;
16454
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
16455
+ } else {
16456
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.readOnly = false;
16457
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
16458
+ }
16459
+
16460
+ const dataPassthrough = {
16461
+ projectId: this.projectId,
16462
+ countryId: this.countryId,
16463
+ entityId: listEvent.entityid,
16464
+ locationId: listEvent.locationid,
16465
+ mmddyyyy: mmddyyyy,
16466
+ complianceId: listEvent['id'],
16467
+ path: "uploadextract"
16468
+ };
16469
+
16470
+ const callbackUrlHost = "8icpy39ru0.execute-api.us-east-1.amazonaws.com";
16471
+ const callbackUrlPath = "test/uploadextract";
16472
+
16473
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.projectId = this.projectId;
16474
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.dataPassthrough = JSON.stringify(dataPassthrough);
16475
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.callbackUrlHost = callbackUrlHost;
16476
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.callbackUrlPath = callbackUrlPath;
16477
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
16478
+
16479
+ }
16480
+
16481
+
16482
+
16483
+ //console.log('approved 1', event["approved"], this.myRole, this.TAB_APPROVER);
16484
+ if (this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_VIEWER || this.myRole == this.TAB_AUDITOR || this.myRole == this.TAB_FUNCTION_HEAD) {
16485
+ //console.log('approved 1', event["approved"], this.myRole, this.TAB_APPROVER);
16486
+ if (listEvent["approved"] != null) {
16487
+ if (listEvent["approved"] === true) {
16488
+ //console.log('approved 2', event["approved"], this.myRole, this.TAB_APPROVER);
16489
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement) != null) {
16490
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked = true;
16491
+ }
16492
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
16493
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement).checked = false;
16494
+ }
16495
+ } else {
16496
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement) != null) {
16497
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement)!.checked = false;
16498
+ }
16499
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
16500
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement)!.checked = true;
16501
+ }
16502
+ }
16503
+ } else {
16504
+ if ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement != null) {
16505
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked = false;
16506
+ }
16507
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
16508
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement).checked = true;
16509
+ }
16510
+
16511
+ }
16512
+ }
16513
+
16514
+ }
16515
+ }
16516
+
16517
+ fetchEventDetails = async (listEvent: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement, flagUploadGuidance: boolean = false, listEventContainer: HTMLDivElement | null = null) => {
16518
+ console.log('listEvent', listEvent, listEvent.id)
16519
+ let url = "https://" + this.apiId + "/getalleventdetails";
16520
+
16521
+ //console.log('fetch calendar url', url);
16522
+ let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "eventid": listEvent.id, "entityid": listEvent.entityid, "locationid": listEvent.locationid, "mmddyyyy": mmddyyyy, "year": this.getFinancialYear(mmddyyyy) };
16523
+
16524
+ //console.log('urlbody', urlBody);
16525
+
16526
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
16527
+ const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
16528
+ this._SfLoader.innerHTML = '';
16529
+ if (xhr.status == 200) {
16530
+
16531
+ const jsonRespose = JSON.parse(xhr.responseText);
16532
+ console.log('jsonRespose', jsonRespose);
16533
+ if (flagUploadGuidance) {
16534
+ if (listEventContainer != null) {
16535
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
16536
+ if (this.events[mmdd] != null) {
16537
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16538
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == listEvent.locationid && this.events[mmdd][p].entityid == listEvent.entityid) {
16539
+ this.events[mmdd][p].uploadguidance = jsonRespose.data.uploadguidance
16540
+ }
16541
+ }
16542
+ }
16543
+ this.renderListReporting(listEventContainer, jsonRespose.data, mmddyyyy, eventsContainer)
16544
+ }
16545
+ } else {
16546
+ this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer);
16547
+ }
16548
+
16549
+ } else {
16550
+ if (xhr.status == 401) {
16551
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
16552
+ this.dispatchEvent(changeEvent);
16553
+ }
16554
+ if (xhr.status === 404) {
16555
+
16556
+ this.showChosenProject();
16557
+ (this._SfTitleChosenProject as HTMLElement).innerHTML = (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedTexts()[0];
16558
+ this.renderChosenProject();
16559
+
16560
+ } else {
16561
+ const jsonRespose = JSON.parse(xhr.responseText);
16562
+ this.setError(jsonRespose.error);
16563
+ }
16564
+
16565
+ }
16566
+ }
16567
+
16568
+ renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement) => {
16569
+ console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
16570
+
16571
+ let comments, docs, approved, /*dateOfCompletion,*/ makercheckers: Array<string>, docsOptional, documentType;
16572
+ let entityId: string = "";
16573
+ let locationId: string = "";
16574
+ let statuteName: string = "";
16575
+ let reportformatName: string = "";
16576
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
16577
+ entityId = event.entityid;
16578
+ locationId = event.locationid;
16579
+ // let completeness = this.getCompletenessStatus(event);
16580
+ comments = event['comments'] == null ? [] : (event['comments']);
16581
+ docs = event['documents'] == null ? [] : event['documents'] == null ? [] : (event['documents']);
16582
+ approved = event['approved'] == null ? false : event['approved'] == null ? false : event['approved'];
16583
+ // dateOfCompletion = event['dateofcompletion'] == null ? '' : event['dateofcompletion'] == null ? '' : event['dateofcompletion'];
16584
+ makercheckers = event['makercheckers'] == null ? [] : event['makercheckers'] == null ? [] : event['makercheckers'];
16585
+ docsOptional = event['docs'] == null ? [] : event['docs'] == null ? [] : event['docs'];
16586
+ documentType = event['documenttype'] == null ? null : event['documenttype'][0] == null ? null : event['documenttype'][0].split(" ")[0];
16587
+
16588
+ statuteName = event['statute'][0].trim();
16589
+ if (event['reportformat'] != null) {
16590
+ reportformatName = (event['reportformat'][0] ?? "").trim().replace('&amp;', '&');
16591
+ }
16592
+
16593
+ console.log('event detail', event, statuteName);
16594
+ //console.log('event detail comments', comments);
16595
+ //console.log('event dateofcompletion', dateOfCompletion);
16596
+ //console.log('event detail documenttype', documentType);
16597
+ const basicFields = ['id', 'shortid', 'entityname', 'locationname', 'functions'];
16598
+ const statuteFields = ['jurisdiction', 'country', 'state', 'category', 'subcategory', 'statute'];
16599
+ const complianceFields = ['specificity', 'reference', 'obligation', 'penalty', 'authority', 'frequency', 'subfrequency', 'obligationtype', 'duedate', 'applicability', 'form', 'additionalurls', 'adhocquestion', 'adhocquestionschedule', 'adhocinstances', 'uploadguidance', 'attachment'];
16600
+ const grcFields = ['internalcontrols', 'firstlineofdefence', 'secondlineofdefence', 'thirdlineofdefence', 'risk', 'riskarea'];
16601
+
16602
+ let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
16603
+ for (let tempReportingContainer of listReportingContainers) {
16604
+ tempReportingContainer.style.display = 'none';
16605
+ tempReportingContainer.innerHTML = '';
16606
+ }
16607
+ let buttonListReportings = eventsContainer.querySelectorAll('.button-list-reporting') as NodeListOf<HTMLButtonElement>
16608
+ for (let buttonListReporting of buttonListReportings) {
16609
+ buttonListReporting.setAttribute('part', 'button-list-reporting')
16610
+ }
16611
+ let streamEventTitles = eventsContainer.querySelectorAll('.stream-event-title') as NodeListOf<SfIElasticText>
16612
+ for (let streamEventTitle of streamEventTitles) {
16613
+ streamEventTitle.removeAttribute('part')
16614
+ }
16615
+ var html = `
16616
+
16617
+ <div part="compliance-detail-title" class="d-flex justify-between">
16618
+ <button part="button-icon" class="material-icons invisible">close</button>
16619
+ <h3 part="results-title" class="m-0">Compliance Details</h3>
16620
+ <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
16621
+ </div>
16622
+
16623
+ `;
16624
+
16625
+ if (this.selectedItemIds.length > 1) {
16626
+
16627
+ html += `
16628
+
16629
+ <div class="d-flex justify-between m-20">
16630
+ <h4 class="m-0">${this.selectedItemIds.length - 1} other ` + ((this.selectedItemIds.length - 1) === 1 ? `item` : `items`) + ` also selected</h4>
16631
+ </div>
16632
+
16633
+ `;
16634
+
16635
+ }
16636
+
16637
+ html += '<div class="accordian-container m-20 pb-20" part="accordian-container">';
16638
+
16639
+ html += '<div part="detail-summary">';
16640
+ html += ('<div part="detail-summary-title" class="pl-20 pr-20"><h1>' + event['obligationtitle'] + '</h1></div>');
16641
+ html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + event['obligation'].replace(/\n/g, '<br />') + '</h3></div>');
16642
+ html += ('<div part="detail-summary-content" class="pl-20 pr-20">' + ('<sf-i-elastic-text text="' + (event['internalcontrols'] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
16643
+ html += '</div>';
16644
+
16645
+ html += '<br />';
16646
+
16647
+ html += '<div class="accordian-section section-basic pl-20 pr-20" part="accordian-section">';
16648
+ html += '<div class="d-flex justify-between accordian-head head-basic cursor" part="accordian-head">';
16649
+ html += '<h3>Basic Information</h3>'
16650
+ html += '<h3 class="head-indicator-basic">-</h3>'
16651
+ html += '</div>';
16652
+ html += '<div class="d-flex flex-wrap accordian-body body-basic" part="accordian-body">';
16653
+
16654
+ for (var i = 0; i < basicFields.length; i++) {
16655
+
16656
+ if (!this.getEventPreviewFields().includes(basicFields[i])) {
16657
+
16658
+ if (!this.getEventHideFields().includes(basicFields[i])) {
16659
+
16660
+ console.log('basicFields', event[basicFields[i]] + "");
16661
+ if ((event[basicFields[i]] + "").indexOf("[") >= 0) {
16662
+ html += '<div class="m-20">';
16663
+ html += '<div part="detail-head"><strong>' + basicFields[i] + '</strong></div>'
16664
+ html += this.getEventTexts(basicFields[i], JSON.parse(event[basicFields[i]]), event).replace(/ *\([^)]*\) */g, "").trim();
16665
+ html += '</div>';
16666
+ } else {
16667
+ html += '<div class="m-20">';
16668
+ html += '<div part="detail-head"><strong>' + basicFields[i] + '</strong></div>'
16669
+ html += '<sf-i-elastic-text text="' + (event[basicFields[i]] + "").replace(/"/g, "").replace(/ *\([^)]*\) */g, "").trim().split(';')[0] + '" minLength="80"></sf-i-elastic-text>';
16670
+ html += '</div>';
16671
+ }
16672
+
16673
+ }
16674
+ }
16675
+
16676
+ }
16677
+
16678
+ if (this.mode == "consumer") {
16679
+ if (approved) {
16680
+ html += '<div class="m-20">';
16681
+ html += '<div part="detail-head"><strong>Approved</strong></div>'
16682
+ html += '<span class="material-icons color-done">check_circle</span>'
16683
+ html += '</div>';
16684
+ }
16685
+ }
16686
+
16687
+ if (docs != null) {
16688
+ html += '<div class="m-20">';
16689
+ html += '<div part="detail-head"><strong>Documents</strong></div>'
16690
+ html += '<span class="material-icons muted">description</span>'
16691
+ html += docs.length
16692
+ html += '</div>';
16693
+ }
16694
+
16695
+ if (comments != null) {
16696
+ html += '<div class="m-20">';
16697
+ html += '<div part="detail-head"><strong>Comments</strong></div>'
16698
+ html += '<span class="material-icons muted">forum</span>'
16699
+ html += comments.length
16700
+ html += '</div>';
16701
+ }
16702
+
16703
+ html += '<div class="m-20">';
16704
+ html += '<div part="detail-head"><strong>Reporters</strong></div>'
16705
+ html += this.getReporterDetailStringFromEvent(event);
16706
+ html += '</div>';
16707
+
16708
+ html += '<div class="m-20">';
16709
+ html += '<div part="detail-head"><strong>Approvers</strong></div>'
16710
+ html += this.getApproverDetailStringFromEvent(event);
16711
+ html += '</div>';
16712
+
16713
+ html += '</div>';
16714
+ html += '</div>';
16715
+
16716
+
16717
+ html += '<div class="accordian-section section-statute pl-20 pr-20" part="accordian-section">';
16718
+ html += '<div class="d-flex justify-between accordian-head head-statute cursor" part="accordian-head">';
16719
+ html += '<h3>Statute Information</h3>'
15688
16720
  html += '<h3 class="head-indicator-statute">-</h3>'
15689
16721
  html += '</div>';
15690
16722
  html += '<div class="d-flex flex-wrap accordian-body body-statute" part="accordian-body">';
@@ -15940,6 +16972,11 @@ export class SfIEvents extends LitElement {
15940
16972
  // for(let attachmentUploader of attachmentUploaders){
15941
16973
  // attachmentUploader.loadMode();
15942
16974
  // }
16975
+
16976
+ let ddmmyyyy = mmddyyyy.split('/')[1] + '/' + mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[2];
16977
+
16978
+ let emailcontent = `<table border="0" cellspacing="0" style="color:#666666;border-radius:5px;border:solid 1px #efefef;width:100%; margin-top:20px"><tbody><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Compliance ID</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.id}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Country</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.countryname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Entity</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.entityname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Location</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.locationname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Statute</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.statute}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Subcategory</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.subcategory}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Due Date</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${ddmmyyyy}</td></tr></tbody></table>`;
16979
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader).emailcontent = emailcontent;
15943
16980
  (this._SfDetailContainer as HTMLDivElement).querySelector('.button-delete')?.addEventListener('click', async () => {
15944
16981
 
15945
16982
  await this.fetchDeleteReview(event["id"], mmddyyyy, entityId, locationId);
@@ -18261,17 +19298,26 @@ export class SfIEvents extends LitElement {
18261
19298
  console.log('csv data', tempArr)
18262
19299
  let changeCount = 0;
18263
19300
  for (let [i, obj] of tempArr.entries()) {
18264
- if (JSON.stringify(taggingArray.data.mappings.mappings[i]) !== JSON.stringify(obj)) {
19301
+ let tempObj = taggingArray.data.mappings.mappings[i]
19302
+ delete tempObj['delta'];
19303
+ delete tempObj['lastupdated'];
19304
+ if(tempObj["id"].indexOf("6fb88c28-d572-4b55-b16c-957a519733b9") >= 0 || tempObj["id"].indexOf("90dbfbcc-a009-4778-b28e-a463867ceea9") >= 0 || tempObj["id"].indexOf("62330e24-298d-4ef2-9449-c0e400e37cac") >= 0 || tempObj["id"].indexOf("b9370711-024a-498a-8ce2-21c549824600") >= 0){
19305
+ console.log('changed onboarding item', tempObj, obj, JSON.stringify(tempObj) !== JSON.stringify(obj))
19306
+ }
19307
+ if (JSON.stringify(tempObj) !== JSON.stringify(obj)) {
18265
19308
  // console.log('item changed', taggingArray.data.mappings.mappings[i], obj)
18266
19309
  let changedId = ""
18267
19310
  for (let [k, col] of uniqCols.entries()) {
18268
- changedId += taggingArray.data.mappings.mappings[i][col];
19311
+ changedId += tempObj[col];
18269
19312
  if (k < (uniqCols.length - 1)) {
18270
19313
  changedId += ";"
18271
19314
  }
18272
19315
  }
18273
19316
  // this.changedOnboardingItemIds.push(taggingArray.data.mappings.mappings[i].id + ";" + taggingArray.data.mappings.mappings[i].entityid + ";" + taggingArray.data.mappings.mappings[i].locationid)
18274
19317
  this.changedOnboardingItemIds.push(changedId)
19318
+ // if(changedId.indexOf("6fb88c28-d572-4b55-b16c-957a519733b9") >= 0){
19319
+ // console.log('changed onboarding item', tempObj, obj)
19320
+ // }
18275
19321
  changeCount++
18276
19322
  }
18277
19323
  }
@@ -19583,7 +20629,7 @@ export class SfIEvents extends LitElement {
19583
20629
 
19584
20630
  //console.log('rendering triggers...', (this._SfOnboardingTriggersContainer as HTMLDivElement).innerHTML);
19585
20631
 
19586
- this.renderTaggingTable((this._SfOnboardingTriggersListContainer as HTMLDivElement), mappedSerializedAlertSchedules, mappedTriggers, ["obligationtitle", "obligationtype"], this.uploadTriggersMapping, this.loadOnboardingTriggers, "triggers", ["id", "entityname", "locationname"], '', "", ["triggers"], triggersJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20632
+ this.renderTaggingTable((this._SfOnboardingTriggersListContainer as HTMLDivElement), mappedSerializedAlertSchedules, mappedTriggers, ["shortid","obligationtitle", "obligationtype"], this.uploadTriggersMapping, this.loadOnboardingTriggers, "triggers", ["id", "entityname", "locationname"], '', "", ["triggers"], triggersJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19587
20633
 
19588
20634
  }
19589
20635
 
@@ -19596,7 +20642,7 @@ export class SfIEvents extends LitElement {
19596
20642
 
19597
20643
  (this._SfOnboardingInternalControlsContainer as HTMLDivElement).innerHTML = html;
19598
20644
 
19599
- this.renderTaggingTable((this._SfOnboardingInternalControlsListContainer as HTMLDivElement), mappedSerializedTriggers, mappedInternalControls, ["obligationtitle", "obligationtype"], this.uploadInternalControlsMapping, this.loadOnboardingInternalControls, "internalcontrols", ["id", "entityname", "locationname"], '', "", ["internalcontrols"], internalcontrolsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20645
+ this.renderTaggingTable((this._SfOnboardingInternalControlsListContainer as HTMLDivElement), mappedSerializedTriggers, mappedInternalControls, ["shortid","obligationtitle", "obligationtype"], this.uploadInternalControlsMapping, this.loadOnboardingInternalControls, "internalcontrols", ["id", "entityname", "locationname"], '', "", ["internalcontrols"], internalcontrolsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19600
20646
 
19601
20647
  }
19602
20648
 
@@ -19609,7 +20655,7 @@ export class SfIEvents extends LitElement {
19609
20655
 
19610
20656
  (this._SfOnboardingActivationsContainer as HTMLDivElement).innerHTML = html;
19611
20657
 
19612
- this.renderTaggingTable((this._SfOnboardingActivationListContainer as HTMLDivElement), mappedSerializedExtensions, mappedActivations, ["obligationtitle", "obligationtype"], this.uploadActivationsMapping, this.loadOnboardingActivations, "activations", ["id", "entityname", "locationname"], '', "", ["activations"], activationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20658
+ this.renderTaggingTable((this._SfOnboardingActivationListContainer as HTMLDivElement), mappedSerializedExtensions, mappedActivations, ["shortid","obligationtitle", "obligationtype"], this.uploadActivationsMapping, this.loadOnboardingActivations, "activations", ["id", "entityname", "locationname"], '', "", ["activations"], activationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19613
20659
 
19614
20660
  }
19615
20661
 
@@ -19622,7 +20668,7 @@ export class SfIEvents extends LitElement {
19622
20668
 
19623
20669
  (this._SfOnboardingInvalidationsContainer as HTMLDivElement).innerHTML = html;
19624
20670
 
19625
- this.renderTaggingTable((this._SfOnboardingInvalidationListContainer as HTMLDivElement), mappedSerializedExtensions, mappedInvalidations, ["obligationtitle", "obligationtype"], this.uploadInvalidationsMapping, this.loadOnboardingInvalidations, "invalidations", ["id", "entityname", "locationname"], '', "", ["invalidations"], invalidationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20671
+ this.renderTaggingTable((this._SfOnboardingInvalidationListContainer as HTMLDivElement), mappedSerializedExtensions, mappedInvalidations, ["shortid","obligationtitle", "obligationtype"], this.uploadInvalidationsMapping, this.loadOnboardingInvalidations, "invalidations", ["id", "entityname", "locationname"], '', "", ["invalidations"], invalidationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19626
20672
 
19627
20673
  }
19628
20674
 
@@ -19635,7 +20681,7 @@ export class SfIEvents extends LitElement {
19635
20681
 
19636
20682
  (this._SfOnboardingAlertSchedulesContainer as HTMLDivElement).innerHTML = html;
19637
20683
 
19638
- this.renderTaggingTable((this._SfOnboardingAlertSchedulesListContainer as HTMLDivElement), mappedSerializedExtensions, mappedAlertSchedules, ["obligationtitle", "obligationtype"], this.uploadAlertSchedulesMapping, this.loadOnboardingAlertSchedules, "alertschedules", ["id", "entityname", "locationname"], '', "", ["alertschedules"], alertschedulesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20684
+ this.renderTaggingTable((this._SfOnboardingAlertSchedulesListContainer as HTMLDivElement), mappedSerializedExtensions, mappedAlertSchedules, ["shortid","obligationtitle", "obligationtype"], this.uploadAlertSchedulesMapping, this.loadOnboardingAlertSchedules, "alertschedules", ["id", "entityname", "locationname"], '', "", ["alertschedules"], alertschedulesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19639
20685
 
19640
20686
  }
19641
20687
 
@@ -19648,7 +20694,7 @@ export class SfIEvents extends LitElement {
19648
20694
 
19649
20695
  (this._SfOnboardingExtensionsContainer as HTMLDivElement).innerHTML = html;
19650
20696
 
19651
- this.renderTaggingTable((this._SfOnboardingExtensionsListContainer as HTMLDivElement), mappedSerializedDuedates, mappedExtensions, ["obligationtitle", "obligationtype"], this.uploadExtensionsMapping, this.loadOnboardingExtensions, "extensions", ["id", "entityname", "locationname"], '', "", ["extensions"], extensionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20697
+ this.renderTaggingTable((this._SfOnboardingExtensionsListContainer as HTMLDivElement), mappedSerializedDuedates, mappedExtensions, ["shortid","obligationtitle", "obligationtype"], this.uploadExtensionsMapping, this.loadOnboardingExtensions, "extensions", ["id", "entityname", "locationname"], '', "", ["extensions"], extensionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19652
20698
 
19653
20699
  }
19654
20700
 
@@ -19661,7 +20707,7 @@ export class SfIEvents extends LitElement {
19661
20707
 
19662
20708
  (this._SfOnboardingDuedatesContainer as HTMLDivElement).innerHTML = html;
19663
20709
 
19664
- this.renderTaggingTable((this._SfOnboardingDuedatesListContainer as HTMLDivElement), mappedSerializedMakerCheckers, mappedDuedates, ["obligationtitle", "obligationtype"], this.uploadDuedatesMapping, this.loadOnboardingDuedates, "duedates", ["id", "entityname", "locationname"], '', "", ["duedates"], duedatesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20710
+ this.renderTaggingTable((this._SfOnboardingDuedatesListContainer as HTMLDivElement), mappedSerializedMakerCheckers, mappedDuedates, ["shortid","obligationtitle", "obligationtype"], this.uploadDuedatesMapping, this.loadOnboardingDuedates, "duedates", ["id", "entityname", "locationname"], '', "", ["duedates"], duedatesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19665
20711
 
19666
20712
  }
19667
20713
 
@@ -19674,7 +20720,7 @@ export class SfIEvents extends LitElement {
19674
20720
 
19675
20721
  (this._SfOnboardingReportersContainer as HTMLDivElement).innerHTML = html;
19676
20722
 
19677
- this.renderTaggingTable((this._SfOnboardingReportersListContainer as HTMLDivElement), mappedSerializedTags, mappedReporters, ["obligationtitle", "obligationtype"], this.uploadReportersMapping, this.loadOnboardingReporters, "reporters", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["reporters"], reportersJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
20723
+ this.renderTaggingTable((this._SfOnboardingReportersListContainer as HTMLDivElement), mappedSerializedTags, mappedReporters, ["shortid","obligationtitle", "obligationtype"], this.uploadReportersMapping, this.loadOnboardingReporters, "reporters", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["reporters"], reportersJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
19678
20724
 
19679
20725
  }
19680
20726
 
@@ -19687,7 +20733,7 @@ export class SfIEvents extends LitElement {
19687
20733
 
19688
20734
  (this._SfOnboardingApproversContainer as HTMLDivElement).innerHTML = html;
19689
20735
 
19690
- this.renderTaggingTable((this._SfOnboardingApproversListContainer as HTMLDivElement), mappedSerializedReporters, mappedApprovers, ["obligationtitle", "obligationtype"], this.uploadApproversMapping, this.loadOnboardingApprovers, "approvers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["approvers"], approversJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
20736
+ this.renderTaggingTable((this._SfOnboardingApproversListContainer as HTMLDivElement), mappedSerializedReporters, mappedApprovers, ["shortid","obligationtitle", "obligationtype"], this.uploadApproversMapping, this.loadOnboardingApprovers, "approvers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["approvers"], approversJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
19691
20737
 
19692
20738
  }
19693
20739
 
@@ -19700,7 +20746,7 @@ export class SfIEvents extends LitElement {
19700
20746
 
19701
20747
  (this._SfOnboardingFunctionHeadsContainer as HTMLDivElement).innerHTML = html;
19702
20748
 
19703
- this.renderTaggingTable((this._SfOnboardingFunctionHeadsListContainer as HTMLDivElement), mappedSerializedApprovers, mappedFunctionHeads, ["obligationtitle", "obligationtype"], this.uploadFunctionHeadsMapping, this.loadOnboardingFunctionHeads, "functionheads", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["functionheads"], functionHeadsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
20749
+ this.renderTaggingTable((this._SfOnboardingFunctionHeadsListContainer as HTMLDivElement), mappedSerializedApprovers, mappedFunctionHeads, ["shortid","obligationtitle", "obligationtype"], this.uploadFunctionHeadsMapping, this.loadOnboardingFunctionHeads, "functionheads", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["functionheads"], functionHeadsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
19704
20750
 
19705
20751
  }
19706
20752
 
@@ -19713,7 +20759,7 @@ export class SfIEvents extends LitElement {
19713
20759
 
19714
20760
  (this._SfOnboardingMakerCheckersContainer as HTMLDivElement).innerHTML = html;
19715
20761
 
19716
- this.renderTaggingTable((this._SfOnboardingMakerCheckersListContainer as HTMLDivElement), mappedSerializedDocs, mappedMakerCheckers, ["obligationtitle", "obligationtype"], this.uploadMakerCheckersMapping, this.loadOnboardingMakerCheckers, "makercheckers", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["makercheckers"], makerCheckerJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20762
+ this.renderTaggingTable((this._SfOnboardingMakerCheckersListContainer as HTMLDivElement), mappedSerializedDocs, mappedMakerCheckers, ["shortid","obligationtitle", "obligationtype"], this.uploadMakerCheckersMapping, this.loadOnboardingMakerCheckers, "makercheckers", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["makercheckers"], makerCheckerJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19717
20763
 
19718
20764
  }
19719
20765
 
@@ -19726,7 +20772,7 @@ export class SfIEvents extends LitElement {
19726
20772
 
19727
20773
  (this._SfOnboardingDocsContainer as HTMLDivElement).innerHTML = html;
19728
20774
 
19729
- this.renderTaggingTable((this._SfOnboardingDocsListContainer as HTMLDivElement), mappedSerializedViewers, mappedDocs, ["obligationtitle", "obligationtype"], this.uploadDocsMapping, this.loadOnboardingDocs, "docs", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["docs"], docsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20775
+ this.renderTaggingTable((this._SfOnboardingDocsListContainer as HTMLDivElement), mappedSerializedViewers, mappedDocs, ["shortid","obligationtitle", "obligationtype"], this.uploadDocsMapping, this.loadOnboardingDocs, "docs", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["docs"], docsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19730
20776
 
19731
20777
  }
19732
20778
 
@@ -19741,7 +20787,7 @@ export class SfIEvents extends LitElement {
19741
20787
 
19742
20788
  (this._SfOnboardingAuditorsContainer as HTMLDivElement).innerHTML = html;
19743
20789
 
19744
- this.renderTaggingTable((this._SfOnboardingAuditorsListContainer as HTMLDivElement), mappedSerializedFunctionheads, mappedAuditors, ["obligationtitle", "obligationtype"], this.uploadAuditorsMapping, this.loadOnboardingAuditors, "auditors", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["auditors"], auditorsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
20790
+ this.renderTaggingTable((this._SfOnboardingAuditorsListContainer as HTMLDivElement), mappedSerializedFunctionheads, mappedAuditors, ["shortid","obligationtitle", "obligationtype"], this.uploadAuditorsMapping, this.loadOnboardingAuditors, "auditors", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["auditors"], auditorsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
19745
20791
 
19746
20792
  }
19747
20793
 
@@ -19756,7 +20802,7 @@ export class SfIEvents extends LitElement {
19756
20802
 
19757
20803
  (this._SfOnboardingViewersContainer as HTMLDivElement).innerHTML = html;
19758
20804
 
19759
- this.renderTaggingTable((this._SfOnboardingViewersListContainer as HTMLDivElement), mappedSerializedAuditors, mappedViewers, ["obligationtitle", "obligationtype"], this.uploadViewersMapping, this.loadOnboardingViewers, "viewers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["viewers"], viewersJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
20805
+ this.renderTaggingTable((this._SfOnboardingViewersListContainer as HTMLDivElement), mappedSerializedAuditors, mappedViewers, ["shortid","obligationtitle", "obligationtype"], this.uploadViewersMapping, this.loadOnboardingViewers, "viewers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["viewers"], viewersJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
19760
20806
 
19761
20807
  }
19762
20808
 
@@ -19769,7 +20815,7 @@ export class SfIEvents extends LitElement {
19769
20815
 
19770
20816
  (this._SfOnboardingTagsContainer as HTMLDivElement).innerHTML = html;
19771
20817
 
19772
- this.renderTaggingTable((this._SfOnboardingTagsListContainer as HTMLDivElement), mappedSerializedFunctions, mappedTags, ["obligationtitle", "obligationtype"], this.uploadTagsMapping, this.loadOnboardingTags, "tags", ["id", "countryname", "entityname", "locationname"], this.apiIdTags, "&Tag", ["tags"], tagsJobs, "tagtype", ["Client remarks", "FlaggGRC response"], null, "", "");
20818
+ this.renderTaggingTable((this._SfOnboardingTagsListContainer as HTMLDivElement), mappedSerializedFunctions, mappedTags, ["shortid","obligationtitle", "obligationtype"], this.uploadTagsMapping, this.loadOnboardingTags, "tags", ["id", "countryname", "entityname", "locationname"], this.apiIdTags, "&Tag", ["tags"], tagsJobs, "tagtype", ["Client remarks", "FlaggGRC response"], null, "", "");
19773
20819
 
19774
20820
  }
19775
20821
 
@@ -19790,7 +20836,7 @@ export class SfIEvents extends LitElement {
19790
20836
 
19791
20837
  (this._SfOnboardingFunctionsContainer as HTMLDivElement).innerHTML = html;
19792
20838
 
19793
- this.renderTaggingTable((this._SfOnboardingFunctionsListContainer as HTMLDivElement), mappedSerializedLocations, mappedFunctions, ["obligationtitle", "obligationtype"], this.uploadFunctionsMapping, this.loadOnboardingFunctions, "functions", ["id", "countryname", "entityname", "locationname"], this.apiIdTags, "&Function", ["functions"], functionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20839
+ this.renderTaggingTable((this._SfOnboardingFunctionsListContainer as HTMLDivElement), mappedSerializedLocations, mappedFunctions, ["shortid","obligationtitle", "obligationtype"], this.uploadFunctionsMapping, this.loadOnboardingFunctions, "functions", ["id", "countryname", "entityname", "locationname"], this.apiIdTags, "&Function", ["functions"], functionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19794
20840
 
19795
20841
  }
19796
20842
 
@@ -19803,7 +20849,7 @@ export class SfIEvents extends LitElement {
19803
20849
 
19804
20850
  (this._SfOnboardingLocationsContainer as HTMLDivElement).innerHTML = html;
19805
20851
 
19806
- this.renderTaggingTable((this._SfOnboardingLocationsListContainer as HTMLDivElement), mappedSerializedEntities, mappedLocations, ["shortid","firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "reference"], this.uploadLocationsMapping, this.loadOnboardingLocations, "locations", ["id", "countryname", "entityname"], this.apiIdTags, "&Location", ["locations"], locationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20852
+ this.renderTaggingTable((this._SfOnboardingLocationsListContainer as HTMLDivElement), mappedSerializedEntities, mappedLocations, ["shortid", "applicability", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "reference"], this.uploadLocationsMapping, this.loadOnboardingLocations, "locations", ["id", "countryname", "entityname"], this.apiIdTags, "&Location", ["locations"], locationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19807
20853
 
19808
20854
  }
19809
20855
 
@@ -19964,7 +21010,7 @@ export class SfIEvents extends LitElement {
19964
21010
 
19965
21011
  (this._SfOnboardingEntitiesContainer as HTMLDivElement).innerHTML = html;
19966
21012
 
19967
- this.renderTaggingTable((this._SfOnboardingEntitiesListContainer as HTMLDivElement), mappedSerializedCountries, mappedEntities, ["shortid","firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute"], this.uploadEntitiesMapping, this.loadOnboardingEntities, "entities", ["id", "countryname"], this.apiIdTags, "&Entity", ["entities"], entitiesJobs, null, ["Client remarks", "FlaggGRC response"], arrFeedbackReference, "Guideline", "");
21013
+ this.renderTaggingTable((this._SfOnboardingEntitiesListContainer as HTMLDivElement), mappedSerializedCountries, mappedEntities, ["shortid", "applicability", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute"], this.uploadEntitiesMapping, this.loadOnboardingEntities, "entities", ["id", "countryname"], this.apiIdTags, "&Entity", ["entities"], entitiesJobs, null, ["Client remarks", "FlaggGRC response"], arrFeedbackReference, "Guideline", "");
19968
21014
 
19969
21015
  }
19970
21016
 
@@ -19996,7 +21042,7 @@ export class SfIEvents extends LitElement {
19996
21042
 
19997
21043
  // mappedCountries.data.mappings.mappings = arr2;
19998
21044
 
19999
- this.renderTaggingTable((this._SfOnboardingCountriesListContainer as HTMLDivElement), mappedCompliances, mappedCountries, ["shortid","firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "state", "subcategory"], this.uploadCountriesMapping, this.loadOnboardingCountries, "countries", ["id"], this.apiIdTags, "-Country", ["countries"], countriesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
21045
+ this.renderTaggingTable((this._SfOnboardingCountriesListContainer as HTMLDivElement), mappedCompliances, mappedCountries, ["shortid", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "state", "subcategory"], this.uploadCountriesMapping, this.loadOnboardingCountries, "countries", ["id"], this.apiIdTags, "-Country", ["countries"], countriesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
20000
21046
 
20001
21047
  }
20002
21048
 
@@ -21278,7 +22324,7 @@ export class SfIEvents extends LitElement {
21278
22324
 
21279
22325
  let targetDiv = e.target as HTMLDivElement;
21280
22326
  let containerDiv = targetDiv.parentElement?.parentElement as HTMLDivElement;
21281
- if(containerDiv != null){
22327
+ if (containerDiv != null) {
21282
22328
  containerDiv.innerHTML = '';
21283
22329
  containerDiv.parentElement?.parentElement?.querySelector('#chart-control-settings')?.setAttribute('part', 'calendar-tab-button-not-selected');
21284
22330
  containerDiv.parentElement?.parentElement?.querySelector('#chart-control-summary')?.setAttribute('part', 'calendar-tab-button-not-selected');
@@ -21406,7 +22452,7 @@ export class SfIEvents extends LitElement {
21406
22452
  let targetDiv = e.target as HTMLDivElement;
21407
22453
  let containerDiv = targetDiv.parentElement?.parentElement as HTMLDivElement;
21408
22454
  console.log('containerDiv', containerDiv);
21409
- if(containerDiv != null){
22455
+ if (containerDiv != null) {
21410
22456
  containerDiv.innerHTML = '';
21411
22457
  containerDiv.parentElement?.parentElement?.querySelector('#chart-control-settings')?.setAttribute('part', 'calendar-tab-button-not-selected');
21412
22458
  containerDiv.parentElement?.parentElement?.querySelector('#chart-control-summary')?.setAttribute('part', 'calendar-tab-button-not-selected');
@@ -21415,7 +22461,7 @@ export class SfIEvents extends LitElement {
21415
22461
  });
21416
22462
 
21417
22463
  container.querySelector('#button-download-stats')?.addEventListener('click', async () => {
21418
- if (selectedTab === -1){
22464
+ if (selectedTab === -1) {
21419
22465
  if (this.selectedFeatures.indexOf('compliances') >= 0) {
21420
22466
  await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no")
21421
22467
  } else if (this.selectedFeatures.indexOf('notices') >= 0) {
@@ -21424,7 +22470,9 @@ export class SfIEvents extends LitElement {
21424
22470
  await this.fetchAndRenderContracts(this.sdate, this.edate, "", "no");
21425
22471
  } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
21426
22472
  await this.fetchAndRenderLicenses(this.sdate, this.edate, "", "no");
21427
- }
22473
+ } else if (this.selectedFeatures.indexOf('rcmresources') >= 0) {
22474
+ await this.fetchAndRenderRCMResources(this.sdate, this.edate, "", "no");
22475
+ }
21428
22476
  // await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no");
21429
22477
  }
21430
22478
  const radioCsv = (container.querySelector('#radio-csv') as HTMLInputElement);
@@ -21651,7 +22699,7 @@ export class SfIEvents extends LitElement {
21651
22699
  }
21652
22700
  html += '</div>';
21653
22701
 
21654
- if((container.querySelector('#chart-settings-controls') as HTMLDivElement) != null){
22702
+ if ((container.querySelector('#chart-settings-controls') as HTMLDivElement) != null) {
21655
22703
  (container.querySelector('#chart-settings-controls') as HTMLDivElement).innerHTML = html;
21656
22704
 
21657
22705
  (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-settings')?.addEventListener('click', () => {
@@ -22030,7 +23078,7 @@ export class SfIEvents extends LitElement {
22030
23078
  }
22031
23079
  }
22032
23080
 
22033
- //console.log('newarrlist', newArrList);
23081
+ console.log('newarrlist', newArrList);
22034
23082
 
22035
23083
  let filteredHTML = '';
22036
23084
 
@@ -22061,6 +23109,7 @@ export class SfIEvents extends LitElement {
22061
23109
  filteredHTML += (newArrList[i] as HTMLTableRowElement).outerHTML;
22062
23110
  }
22063
23111
  filteredHTML += '</table></div>';
23112
+ // console.log('filteredHTML', filteredHTML);
22064
23113
  return filteredHTML;
22065
23114
  }
22066
23115
 
@@ -23311,7 +24360,7 @@ export class SfIEvents extends LitElement {
23311
24360
  let graphparamname1Arr = (graphparamnames1[i] as HTMLDivElement).innerHTML.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ').split(' • ');
23312
24361
  let filterFound = false;
23313
24362
  for (let tempFilterStr of graphparamname1Arr) {
23314
- console.log('graphparamname1Arr', tempFilterStr,this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '),tempFilterStr == this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '));
24363
+ console.log('graphparamname1Arr', tempFilterStr, this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '), tempFilterStr == this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '));
23315
24364
  if (tempFilterStr == this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') || this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') == "") {
23316
24365
  filterFound = true;
23317
24366
  break;
@@ -25001,7 +26050,7 @@ export class SfIEvents extends LitElement {
25001
26050
  "makercheckers": makercheckers
25002
26051
  }
25003
26052
 
25004
- console.log('reportingbody',body);
26053
+ console.log('reportingbody', body);
25005
26054
  let retValue = true;
25006
26055
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
25007
26056
  const xhr: any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;
@@ -26572,6 +27621,8 @@ export class SfIEvents extends LitElement {
26572
27621
  this.fetchAndRenderContracts(startDate, endDate, searchString, list, month, year);
26573
27622
  } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
26574
27623
  this.fetchAndRenderLicenses(startDate, endDate, searchString, list, month, year);
27624
+ } else if (this.selectedFeatures.indexOf('rcmresources') >= 0) {
27625
+ this.fetchAndRenderRCMResources(startDate, endDate, searchString, list, month, year);
26575
27626
  }
26576
27627
  }
26577
27628
  fetchAndYearlyRenderUserCalendar_2 = async (startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
@@ -26842,16 +27893,17 @@ export class SfIEvents extends LitElement {
26842
27893
 
26843
27894
  const jsonRespose = JSON.parse(xhr.responseText);
26844
27895
  console.log('jsonRespose', jsonRespose);
26845
- let agreements = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
27896
+ let contracts = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
26846
27897
  await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
26847
27898
  this.lastupdated = Util.getDateTimeStrings(new Date().getTime())
26848
- let tempEvents = this.events
26849
- for (let mmddyyyy of Object.keys(agreements)) {
26850
- tempEvents[mmddyyyy] = [...(tempEvents[mmddyyyy] ?? []), ...agreements[mmddyyyy]]
26851
- }
26852
- this.events = tempEvents;
27899
+ // let tempEvents = this.events
27900
+ // for (let mmddyyyy of Object.keys(contracts)) {
27901
+ // tempEvents[mmddyyyy] = [...(tempEvents[mmddyyyy] ?? []), ...contracts[mmddyyyy]]
27902
+ // }
27903
+ // this.events = tempEvents;
27904
+ this.events = contracts;
26853
27905
  this.renderAppropriateStream(this.sdate, this.edate, true);
26854
- console.log('contracts', agreements, tempEvents);
27906
+ console.log('contracts', contracts);
26855
27907
  } else {
26856
27908
  if (xhr.status == 401) {
26857
27909
  let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
@@ -26923,13 +27975,89 @@ export class SfIEvents extends LitElement {
26923
27975
  let licenses = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
26924
27976
  await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
26925
27977
  this.lastupdated = Util.getDateTimeStrings(new Date().getTime())
26926
- let tempEvents = this.events
26927
- for (let mmddyyyy of Object.keys(licenses)) {
26928
- tempEvents[mmddyyyy] = [...(tempEvents[mmddyyyy] ?? []), ...licenses[mmddyyyy]]
27978
+ // let tempEvents = this.events
27979
+ // for (let mmddyyyy of Object.keys(licenses)) {
27980
+ // tempEvents[mmddyyyy] = [...(tempEvents[mmddyyyy] ?? []), ...licenses[mmddyyyy]]
27981
+ // }
27982
+ // this.events = tempEvents;
27983
+ this.events = licenses;
27984
+ this.renderAppropriateStream(this.sdate, this.edate, true);
27985
+ console.log('licenses', licenses);
27986
+ } else {
27987
+ if (xhr.status == 401) {
27988
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
27989
+ this.dispatchEvent(changeEvent);
26929
27990
  }
26930
- this.events = tempEvents;
27991
+ if (xhr.status === 404) {
27992
+
27993
+ this.showChosenProject();
27994
+ (this._SfTitleChosenProject as HTMLElement).innerHTML = (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedTexts()[0];
27995
+ this.renderChosenProject();
27996
+
27997
+ } else {
27998
+ const jsonRespose = JSON.parse(xhr.responseText);
27999
+ this.setError(jsonRespose.error);
28000
+ }
28001
+
28002
+ }
28003
+
28004
+ }
28005
+
28006
+ fetchAndRenderRCMResources = async (startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
28007
+
28008
+ let path = "", view = "";
28009
+ this.sdate = startDate;
28010
+ this.edate = endDate;
28011
+ if (this.tagId != null && this.tagId != "") {
28012
+ view = "tag";
28013
+ } else if (this.countryId != null && this.countryId != "") {
28014
+ view = "country";
28015
+ } else if (this.locationId != null && this.locationId != "") {
28016
+ view = "location";
28017
+ } else {
28018
+ view = "entity";
28019
+ }
28020
+
28021
+ path = "getallcountryobjects";
28022
+
28023
+ let sDate = "";
28024
+ let eDate = "";
28025
+
28026
+ //console.log('currenttab', this.getCurrentTab());
28027
+
28028
+ if (this.getCurrentTab() == this.TAB_YEAR) {
28029
+ sDate = "03/31/" + this.calendarStartYYYY;
28030
+ eDate = "04/01/" + (parseInt(this.calendarStartYYYY) + 1);
28031
+ } else {
28032
+ sDate = startDate;
28033
+ eDate = endDate;
28034
+ }
28035
+
28036
+
28037
+ let url = "https://" + this.apiIdRCMResources + "/" + path;
28038
+
28039
+ //console.log('fetch calendar url', url);
28040
+ let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": this.entityId, "countryid": this.countryId, "functionid": this.functionId, "locationid": this.locationId, "tagid": this.tagId, "adhoc": "false", "exclusivestartkey": 0, "sdate": sDate, "edate": eDate, "view": view, "year": year, "list": list, "month": month };
28041
+
28042
+ if (searchString.length > 0) {
28043
+ urlBody["searchstring"] = searchString;
28044
+ }
28045
+
28046
+ //console.log('urlbody', urlBody);
28047
+
28048
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
28049
+ const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
28050
+ this._SfLoader.innerHTML = '';
28051
+ if (xhr.status == 200) {
28052
+
28053
+ const jsonRespose = JSON.parse(xhr.responseText);
28054
+ console.log('jsonRespose', jsonRespose);
28055
+ let rcmresources = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
28056
+ await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
28057
+ this.lastupdated = Util.getDateTimeStrings(new Date().getTime())
28058
+ this.events = rcmresources;
26931
28059
  this.renderAppropriateStream(this.sdate, this.edate, true);
26932
- console.log('licenses', licenses, tempEvents);
28060
+ console.log('rcmresources', rcmresources);
26933
28061
  } else {
26934
28062
  if (xhr.status == 401) {
26935
28063
  let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
@@ -26981,6 +28109,8 @@ export class SfIEvents extends LitElement {
26981
28109
  url = "https://" + this.apiIdAgreements + "/" + path;
26982
28110
  } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
26983
28111
  url = "https://" + this.apiIdLicenses + "/" + path;
28112
+ } else if (this.selectedFeatures.indexOf('rcmresource') >= 0) {
28113
+ url = "https://" + this.apiIdRCMResources + "/" + path;
26984
28114
  }
26985
28115
 
26986
28116
  //console.log('fetch calendar url', url);