sf-i-events 1.0.880 → 1.0.882

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.
@@ -859,7 +859,7 @@ export class SfIEvents extends LitElement {
859
859
 
860
860
  EXCLUDE_COLS_FROM_REGS: Array<string> = ["updatetype", "question", "invalidations", "activations", "alertschedule", "clientquestion", "countryname", "countryid", "entityname", "entityid", "locationname", "locationid", "reporters", "approvers", "timeframe", "responsedays", "execmodule", "functions", "shortid", "shortnumid", "countries", "entities", "locations", "tagsmap", "reportersmap", "approversmap", "functionheadsmap", "auditorsmap", "viewersmap", "approved", "documents", "comments", "lastupdated", "dateofcompletion", "mmdd", "completeness", "timeliness", "compliance", "delta", "triggers"]
861
861
 
862
- CHARTS_LIST_BY_MODULES: { [key: string]: Array<string> } = { "compliances": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"], "notices": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"], "contracts": ["compliance", "timeliness", "completeness", "location"], "licenses": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"] };
862
+ CHARTS_LIST_BY_MODULES: { [key: string]: Array<string> } = { "compliances": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"], "notices": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"], "contracts": ["compliance", "timeliness", "completeness", "location"], "licenses": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"], "rcmresources": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"] };
863
863
 
864
864
  chartSelectedLegend: Array<number> = [];
865
865
 
@@ -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
 
@@ -1655,8 +1658,10 @@ export class SfIEvents extends LitElement {
1655
1658
 
1656
1659
  nextTabStatus: string = "";
1657
1660
 
1661
+ @property()
1658
1662
  sdate: string = "";
1659
1663
 
1664
+ @property()
1660
1665
  edate: string = "";
1661
1666
 
1662
1667
  lastupdated: string = "";
@@ -1735,6 +1740,9 @@ export class SfIEvents extends LitElement {
1735
1740
  #detail-container {
1736
1741
  z-index: 101;
1737
1742
  }
1743
+ #detail-list-container {
1744
+ z-index: 100;
1745
+ }
1738
1746
 
1739
1747
  .plain-filter-icon {
1740
1748
  cursor: pointer;
@@ -1780,6 +1788,7 @@ export class SfIEvents extends LitElement {
1780
1788
  opacity: 0.4;
1781
1789
  }
1782
1790
 
1791
+ .detail-list-container,
1783
1792
  .detail-container,
1784
1793
  .report-summary-container {
1785
1794
  width: 60%;
@@ -2830,6 +2839,9 @@ export class SfIEvents extends LitElement {
2830
2839
  @query('#detail-container')
2831
2840
  _SfDetailContainer: any;
2832
2841
 
2842
+ @query('#detail-list-container')
2843
+ _SfDetailListContainer: any;
2844
+
2833
2845
  @query('#report-summary-container')
2834
2846
  _SfReportSummaryContainer: any;
2835
2847
 
@@ -4115,7 +4127,7 @@ export class SfIEvents extends LitElement {
4115
4127
 
4116
4128
  updateRiskSeverityStats = (riskSeverities: Array<string>, partStatus: string, lateStatus: string, complianceStatus: string) => {
4117
4129
 
4118
- //console.log('updateRiskSeverityStats', riskSeverities, complianceStatus)
4130
+ console.log('updateRiskSeverityStats', riskSeverities, complianceStatus)
4119
4131
 
4120
4132
  const result = this.updateGraphStats(riskSeverities, this.riskSeverityData, this.riskSeverityPartStatusData, this.riskSeverityLateStatusData, this.riskSeverityComplianceStatusData, partStatus, lateStatus, complianceStatus);
4121
4133
  this.riskSeverityData = result.arrData;
@@ -4467,9 +4479,9 @@ export class SfIEvents extends LitElement {
4467
4479
  html += '<div part="chart-radio-item" class="chart-radio-item-secondary ' + (this.flowGraph == this.FLOW_GRAPH_FREQUENCY ? '' : 'hide') + '"><input type="radio" id="radio-frequency" name="graph-type" part="radio-graph" ' + ((this.flowGraph == this.FLOW_GRAPH_FREQUENCY) ? 'checked' : '') + '>';
4468
4480
  html += '<label for="radio-frequency" part="input-label" class="mr-10">Frequency</label></div>';
4469
4481
  }
4470
- if (this.CHARTS_LIST_BY_MODULES[this.selectedFeatures[0]] != null && this.CHARTS_LIST_BY_MODULES[this.selectedFeatures[0]].indexOf("subcategory") >= 0) {
4482
+ if (this.CHARTS_LIST_BY_MODULES[this.selectedFeatures[0]] != null && this.CHARTS_LIST_BY_MODULES[this.selectedFeatures[0]].indexOf("subCategory") >= 0) {
4471
4483
  html += '<div part="chart-radio-item" class="chart-radio-item-secondary ' + (this.flowGraph == this.FLOW_GRAPH_SUBCATEGORY ? '' : 'hide') + '"><input type="radio" id="radio-subcategory" name="graph-type" part="radio-graph" ' + ((this.flowGraph == this.FLOW_GRAPH_SUBCATEGORY) ? 'checked' : '') + '>';
4472
- html += '<label for="radio-frequency" part="input-label">SubCategory</label></div>';
4484
+ html += '<label for="radio-subcategory" part="input-label">SubCategory</label></div>';
4473
4485
  }
4474
4486
 
4475
4487
  html += '<button id="graph-radios-expander" class="ml-10" part="calendar-tab-button-not-selected"><span class="material-symbols-outlined">chevron_right</span></button>'
@@ -4619,7 +4631,7 @@ export class SfIEvents extends LitElement {
4619
4631
 
4620
4632
  }
4621
4633
 
4622
- renderStatisticsFiltersTableRow = (filterUser: boolean = false) => {
4634
+ renderStatisticsFiltersTableRow = (index: number, filterUser: boolean = false) => {
4623
4635
 
4624
4636
  var html = '';
4625
4637
  html += '<tr class="tablerow">'
@@ -4628,11 +4640,11 @@ export class SfIEvents extends LitElement {
4628
4640
  html += '<div part="td-head" class="pl-0-imp w-100 d-flex align-center">Last Access</div><div>DASHBOARD_LAST_ACTIVE</div><div part="td-head" class="pl-0-imp w-100 d-flex align-center">Last Action</div><div>DASHBOARD_LAST_ACTION</div>'
4629
4641
  }
4630
4642
  html += '</div></td>'
4631
- html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-icons color-not-started">schedule</span>&nbsp;&nbsp;Not Started</div><div>DASHBOARD_NOT_STARTED</div></div></td>'
4632
- html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-pending">pending</span>&nbsp;&nbsp;Pending Approval</div><div>DASHBOARD_PENDING_APPROVAL</div></div></td>'
4633
- html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-rejected">block</span>&nbsp;&nbsp;Rejected</div><div>DASHBOARD_REJECTED</div></div></td>'
4634
- html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-done">check_circle</span>&nbsp;&nbsp;Approved</div><div>DASHBOARD_APPROVED</div></div></td>'
4635
- html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center">Total</div><div>DASHBOARD_TOTAL</div></div></td>'
4643
+ html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" id="filter-not-started-' + index + '" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-icons color-not-started">schedule</span>&nbsp;&nbsp;Not Started</div><div>DASHBOARD_NOT_STARTED</div></div></td>'
4644
+ html += '<td part="td-body" id="filter-pending-approval-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-pending">pending</span>&nbsp;&nbsp;Pending Approval</div><div>DASHBOARD_PENDING_APPROVAL</div></div></td>'
4645
+ html += '<td part="td-body" id="filter-rejected-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-rejected">block</span>&nbsp;&nbsp;Rejected</div><div>DASHBOARD_REJECTED</div></div></td>'
4646
+ html += '<td part="td-body" id="filter-approved-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-done">check_circle</span>&nbsp;&nbsp;Approved</div><div>DASHBOARD_APPROVED</div></div></td>'
4647
+ html += '<td part="td-body" id="filter-total-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center">Total</div><div>DASHBOARD_TOTAL</div></div></td>'
4636
4648
  html += '</tr>';
4637
4649
 
4638
4650
  return html;
@@ -4757,7 +4769,7 @@ export class SfIEvents extends LitElement {
4757
4769
  const moduleType = event.module ?? 'compliance';
4758
4770
  const partStatusSanitized = partStatus.replace(/-/g, '_');
4759
4771
  const entityIdSanitized = event.entityid.replace(/-/g, '_');
4760
- const locationIdSanitized = event.locationid.replace(/-/g, '_');
4772
+ const locationIdSanitized = (event.locationid ?? "").replace(/-/g, '_');
4761
4773
  const eventIdSanitized = event.id.replace(/-/g, '_');
4762
4774
  const mmddSanitized = mmdd.replace(/\//g, '-');
4763
4775
  const dueDateParts = event.duedate.split('/');
@@ -5134,7 +5146,7 @@ export class SfIEvents extends LitElement {
5134
5146
  }
5135
5147
 
5136
5148
  //(firstDay, endDay, 1, lastDay, true, 0, (firstDate.getMonth()), period, firstDate,"From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'), showBackgroundButton)
5137
- renderEvents = (_firstDay: any, _endDay: any, iInit: number, iLast: number, showGraph: boolean, index: number, month: number, period: string, firstDate: any = null, parametersTitle: string, showBackgroundButton: boolean) => {
5149
+ renderEvents = (_firstDay: any, _endDay: any, iInit: number, iLast: number, showGraph: boolean, index: number, month: number, period: string, firstDate: any = null, parametersTitle: string, showBackgroundButton: boolean, fromDrilldown: boolean = false) => {
5138
5150
  var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0, compliedWithGaps = 0, reportedNonCompliance = 0, active = 0, aboutToExpire = 0, expired = 0, terminated = 0;
5139
5151
  var html = '';
5140
5152
  this.selectedItemIds = [];
@@ -5151,32 +5163,38 @@ export class SfIEvents extends LitElement {
5151
5163
  console.log('this.clearSelectedGraphParam(); 1', this.graphFilter);
5152
5164
  this.clearSelectedGraphParam();
5153
5165
  this.clearSelectedLegend();
5154
-
5155
- html += this.renderCalendarGraphs(showGraph, parametersTitle, showBackgroundButton);
5166
+ if (!fromDrilldown) {
5167
+ html += this.renderCalendarGraphs(showGraph, parametersTitle, showBackgroundButton);
5168
+ }
5156
5169
  html += this.renderCalendarContainerDivStart(index)
5157
5170
  html += this.renderCalendarEventSummary();
5158
5171
 
5172
+ if (!fromDrilldown) {
5173
+ if (this.selectedFeatures.indexOf('contracts') >= 0) {
5174
+ csvCols += 'Id,ReferenceNo.,Type,Country,Entity,Location,Party1,Party2,Party3,Reporter,Approver,Functionhead,DueDate,Status,ReportParameter'
5175
+ 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>'
5176
+
5177
+ } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
5178
+ csvCols += 'Id,ReferenceNo.,Type,Country,Entity,Location,Reporter,Approver,Functionhead,State,Jurisdiction,Category,Subcategory,Statute,ObligationType,RiskSeverity,RiskAreas,Frequency,SubFrequency,DueDate,Status,ReportParameter'
5179
+ 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>'
5180
+ } else if (this.selectedFeatures.indexOf('rcmresources') >= 0) {
5181
+ csvCols += 'Id,Name,Url,Country,Entity,Location,Reporter,Approver,Functionhead,LastCheckedDate,DueDate,Terminated,Status,ReportParameter'
5182
+ htmlCols += '<tr><th class="td-thin">Id</th><th class="td-thin">Name</th><th class="td-thin">Url</th><th class="td-thin">Country</th><th class="td-thin">Entity</th><th class="td-thin">Location</th><th class="td-thin">LastCheckedDate</th><th class="td-thin">DueDate</th><th class="td-thin">Terminated</th><th class="td-wide">Status</th><th class="td-wide">ReportParameter</th></tr>'
5183
+ } else {
5184
+ 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'
5185
+ 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>'
5186
+ }
5159
5187
 
5160
- if (this.selectedFeatures.indexOf('contracts') >= 0) {
5161
- csvCols += 'Id,ReferenceNo.,Type,Country,Entity,Location,Party1,Party2,Party3,Reporter,Approver,Functionhead,DueDate,Status,ReportParameter'
5162
- 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>'
5163
-
5164
- } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
5165
- csvCols += 'Id,ReferenceNo.,Type,Country,Entity,Location,Reporter,Approver,Functionhead,State,Jurisdiction,Category,Subcategory,Statute,ObligationType,RiskSeverity,RiskAreas,Frequency,SubFrequency,DueDate,Status,ReportParameter'
5166
- 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>'
5167
- } else {
5168
- 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'
5169
- 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>'
5170
- }
5171
-
5172
- if (this.selectedFeatures.indexOf('contracts') >= 0) {
5173
- 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>'
5174
- } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
5175
- 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>'
5176
- } else {
5177
- 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>'
5188
+ if (this.selectedFeatures.indexOf('contracts') >= 0) {
5189
+ 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>'
5190
+ } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
5191
+ 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>'
5192
+ } else if (this.selectedFeatures.indexOf('rcmresources') >= 0) {
5193
+ htmlSummaryCols += '<tr><th class="td-thin">Id</th><th class="td-wide">Name</th><th class="td-wide">Status</th><th class="td-wide">Url</th></tr>'
5194
+ } else {
5195
+ 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>'
5196
+ }
5178
5197
  }
5179
-
5180
5198
  for (var i = iInit; i <= iLast; i++) {
5181
5199
 
5182
5200
  let mmdd: string = "";
@@ -5257,13 +5275,13 @@ export class SfIEvents extends LitElement {
5257
5275
 
5258
5276
  this.events[mmdd][j][this.FLOW_GRAPH_COMPLETENESS] = partStatus;
5259
5277
  this.events[mmdd][j][this.FLOW_GRAPH_TIMELINESS] = lateStatus;
5260
- if(this.events[mmdd][j][this.FLOW_GRAPH_COMPLIANCE] != null){
5278
+ if (this.events[mmdd][j][this.FLOW_GRAPH_COMPLIANCE] != null) {
5261
5279
  this.events[mmdd][j][this.FLOW_GRAPH_COMPLIANCE + "obj"] = this.events[mmdd][j][this.FLOW_GRAPH_COMPLIANCE];
5262
5280
  }
5263
5281
  this.events[mmdd][j][this.FLOW_GRAPH_COMPLIANCE] = complianceStatus;
5264
5282
 
5265
5283
  this.updateStats(this.events[mmdd][j], partStatus, lateStatus, complianceStatus);
5266
- if (this.events[mmdd][j]["documents"] != null) {
5284
+ if (this.events[mmdd][j]["documents"] != null && !fromDrilldown) {
5267
5285
  if (this.selectedFeatures.indexOf('contracts') >= 0) {
5268
5286
  //Id,ReferenceNo.,Type,Country,Entity,Location,Party1,Party2,Party3,Reporter,Approver,Functionhead,DueDate,Status,ReportParameter
5269
5287
  csvValues += ('"' + (this.events[mmdd][j]["id"] + '",'));
@@ -5342,6 +5360,36 @@ export class SfIEvents extends LitElement {
5342
5360
  + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide text-center status-format">' + this.renderStatusString(partStatus, lateStatus, complianceStatus) + '</td>'
5343
5361
  + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide status-format">' + this.getGraphParam(this.events[mmdd][j]) + '</td>'
5344
5362
  + '</tr>');
5363
+ } else if (this.selectedFeatures.indexOf('rcmresources') >= 0) {
5364
+ //Id,Name,Url,Country,Entity,Location,Reporter,Approver,Functionhead,LastCheckedDate,DueDate,Terminated,Status,ReportParameter
5365
+ csvValues += ('"' + (this.events[mmdd][j]["id"] + '",'));
5366
+ csvValues += ('"' + ((this.events[mmdd][j]["obligationtitle"] + "").replace(/"/g, "") + '",'));
5367
+ csvValues += ('"' + ((this.events[mmdd][j]["url"] + "").replace(/"/g, "") + '",'));
5368
+ csvValues += ('"' + ((this.events[mmdd][j]["countryname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5369
+ csvValues += ('"' + ((this.events[mmdd][j]["entityname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5370
+ csvValues += ('"' + ((this.events[mmdd][j]["locationname"] + "").replace(/\((.*?)\)/g, "") + '",'));
5371
+ csvValues += ('"' + ((((this.events[mmdd][j]["reporters"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5372
+ csvValues += ('"' + ((((this.events[mmdd][j]["approvers"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5373
+ csvValues += ('"' + ((((this.events[mmdd][j]["functionheads"] ?? [])[0] ?? "").split(';')[0] + "").replace(/"/g, "") + '",'));
5374
+ csvValues += ('"' + (this.events[mmdd][j]["lastcheckeddate"] + '",'));
5375
+ csvValues += ('"' + ((this.events[mmdd][j]["duedate"] + "").replace(/"/g, "") + '",'));
5376
+ csvValues += ('"' + ((this.events[mmdd][j]["terminated"] ? "Yes" : "No").replace(/"/g, "") + '",'));
5377
+ csvValues += ('"' + (this.renderStatusString(partStatus, lateStatus, complianceStatus) + '",'));
5378
+ csvValues += ('"' + (this.getGraphParam(this.events[mmdd][j]) + '"\n'));
5379
+
5380
+ //Id,Name,Url,Country,Entity,Location,LastCheckedDate,DueDate,Terminated,Status,ReportParameter
5381
+ htmlValues += ('<tr><td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["id"] + '</td>'
5382
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["obligationtitle"] + '</td>'
5383
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide">' + this.events[mmdd][j]["url"] + '</td>'
5384
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + (this.events[mmdd][j]["countryname"] + "").replace(/\((.*?)\)/g, "") + '</td>'
5385
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + (this.events[mmdd][j]["entityname"] + "").replace(/\((.*?)\)/g, "") + '</td>'
5386
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + (this.events[mmdd][j]["locationname"] + "").replace(/\((.*?)\)/g, "") + '</td>'
5387
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["lastcheckeddate"] + '</td>'
5388
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + this.events[mmdd][j]["duedate"] + '</td>'
5389
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-thin">' + (this.events[mmdd][j]["terminated"] ? "Yes" : "No") + '</td>'
5390
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide text-center status-format">' + this.renderStatusString(partStatus, lateStatus, complianceStatus) + '</td>'
5391
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide status-format">' + this.getGraphParam(this.events[mmdd][j]) + '</td>'
5392
+ + '</tr>');
5345
5393
  } else {
5346
5394
  //Id,Country,Entity,Location,Function,Reporter,Approver,Functionhead,State
5347
5395
  csvValues += ('"' + (this.events[mmdd][j]["id"] + '",'));
@@ -5437,6 +5485,11 @@ export class SfIEvents extends LitElement {
5437
5485
  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 />`
5438
5486
  }
5439
5487
  htmlSummaryValues += '</td></tr>'
5488
+ } else if (this.selectedFeatures.indexOf('rcmresources') >= 0) {
5489
+ 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>'
5490
+ + '<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>'
5491
+ + '<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>'
5492
+ + '<td class="' + (total % 2 === 0 ? 'td-odd' : 'td-even') + ' td-wide"><sf-i-elastic-text text="' + this.events[mmdd][j]["url"] + '" minLength="100" lineSize="4"></sf-i-elastic-text></td></tr>')
5440
5493
  } else {
5441
5494
  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>'
5442
5495
  + '<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>'
@@ -5707,7 +5760,7 @@ export class SfIEvents extends LitElement {
5707
5760
  }
5708
5761
  }
5709
5762
  }
5710
- filtersTableHtml += this.renderStatisticsFiltersTableRow(lastAction != "" || lastActive != "")
5763
+ filtersTableHtml += this.renderStatisticsFiltersTableRow(filterindex, lastAction != "" || lastActive != "")
5711
5764
  if (filterindex % 2 == 0) {
5712
5765
  filtersTableHtml = filtersTableHtml.replace(/TD_BODY_CLASS/g, "td-light");
5713
5766
  } else {
@@ -5811,7 +5864,7 @@ export class SfIEvents extends LitElement {
5811
5864
  html += '<button id="button-uploader-submit-approve" class="button-submit" part="button">Save</button>'
5812
5865
  html += '</div>'
5813
5866
 
5814
- if (this.myRole != this.TAB_FUNCTION_HEAD && docs.length > 0 && event.module != 'contract' && event.module != 'license') {
5867
+ if (this.myRole != this.TAB_FUNCTION_HEAD && docs.length > 0 && event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5815
5868
  html += '<div class="m-20">';
5816
5869
  html += '<label part="input-label">Supporting Documents</label>';
5817
5870
  html += '<slot name="uploader"></slot>';
@@ -5822,7 +5875,7 @@ export class SfIEvents extends LitElement {
5822
5875
  html += '<div class="d-flex m-20 flex-col">';
5823
5876
  html += '<label part="input-label">Approver Comments*</label>';
5824
5877
  html += '<input id="input-approver-comments" type="text" part="input" value=""/><br />';
5825
- if (event.module != 'contract' && event.module != 'license') {
5878
+ if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5826
5879
  html += '<label part="input-label">Date of Completion*</label>';
5827
5880
  html += '<input id="input-approver-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" disabled/><br />';
5828
5881
  html += '<label part="input-label">Percentage</label>';
@@ -5883,7 +5936,7 @@ export class SfIEvents extends LitElement {
5883
5936
  html += '<div class="d-flex m-20 flex-col">';
5884
5937
  html += '<label part="input-label">Reporter Comments*</label>';
5885
5938
  html += '<input id="input-reporter-comments" type="text" part="input" value=""/><br />';
5886
- if (event.module != 'contract' && event.module != 'license') {
5939
+ if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5887
5940
  html += '<label part="input-label">Date of Completion*</label>';
5888
5941
  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 />';
5889
5942
  html += '<label part="input-label">Completion Percentage*</label>';
@@ -5941,7 +5994,7 @@ export class SfIEvents extends LitElement {
5941
5994
  html += '<div class="d-flex m-20 flex-col">';
5942
5995
  html += '<label part="input-label">Auditor Comments</label>';
5943
5996
  html += '<input id="input-auditor-comments" type="text" part="input" value=""/><br />';
5944
- if (event.module != 'contract' && event.module != 'license') {
5997
+ if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5945
5998
  html += '<label part="input-label">Date of Completion</label>';
5946
5999
  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 />';
5947
6000
  html += '<label part="input-label">Percentage</label>';
@@ -6009,7 +6062,10 @@ export class SfIEvents extends LitElement {
6009
6062
  event.docsOptional = event['docs'] == null ? [] : event['docs'];
6010
6063
  html = this.renderReporting(event, mmddyyyy);
6011
6064
  console.log('reporting html', html);
6065
+ let ddmmyyyy = mmddyyyy.split('/')[1] + '/' + mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[2];
6012
6066
 
6067
+ 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">Reporter</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.reporters[0].split(';')[0]}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Approver</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.approvers[0].split(';')[0]}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Due Date</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${ddmmyyyy}</td></tr></tbody></table>`;
6068
+
6013
6069
  let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
6014
6070
  for (let tempReportingContainer of listReportingContainers) {
6015
6071
  tempReportingContainer.style.display = 'none';
@@ -6039,6 +6095,7 @@ export class SfIEvents extends LitElement {
6039
6095
  }
6040
6096
  }
6041
6097
  listReportingContainer.innerHTML = html;
6098
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.emailcontent = emailcontent;
6042
6099
  listReportingContainer.querySelector('.button-delete')?.addEventListener('click', async () => {
6043
6100
 
6044
6101
  await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
@@ -6058,7 +6115,7 @@ export class SfIEvents extends LitElement {
6058
6115
  });
6059
6116
  listReportingContainer.querySelector('#button-auto-approve')?.addEventListener('click', async () => {
6060
6117
  if (this.selectedItemIds.length <= 1) {
6061
- await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, event.module ?? "events");
6118
+ await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, event.module ?? "compliance");
6062
6119
  this.setSuccess('Auto-Approved successfully!')
6063
6120
  setTimeout(() => {
6064
6121
  this.clearMessages()
@@ -6088,7 +6145,7 @@ export class SfIEvents extends LitElement {
6088
6145
  "userid": this.userProfileId,
6089
6146
  "userrole": this.myRole,
6090
6147
  "year": this.calendarStartYYYY,
6091
- "module": event.module ?? "events"
6148
+ "module": event.module ?? "compliance"
6092
6149
  })
6093
6150
  }
6094
6151
  await this.uploadReviewsBulk(bulkBodyReview);
@@ -6130,7 +6187,7 @@ export class SfIEvents extends LitElement {
6130
6187
  let flagBulk = false;
6131
6188
  if (this.selectedItemIds.length <= 1) {
6132
6189
  console.log('selectedevent', JSON.stringify(event));
6133
- if (await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved, event.module ?? "events")) {
6190
+ if (await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved, event.module ?? "compliance")) {
6134
6191
  for (var p = 0; p < this.events[mmdd].length; p++) {
6135
6192
  if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
6136
6193
  this.events[mmdd][p].approved = approved
@@ -6172,7 +6229,7 @@ export class SfIEvents extends LitElement {
6172
6229
  "userid": this.userProfileId,
6173
6230
  "userrole": this.myRole,
6174
6231
  "year": this.calendarStartYYYY,
6175
- "module": event.module ?? "events"
6232
+ "module": event.module ?? "compliance"
6176
6233
  })
6177
6234
  // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, comments, approved)
6178
6235
 
@@ -6243,7 +6300,7 @@ export class SfIEvents extends LitElement {
6243
6300
  } else {
6244
6301
  let flagBulk = false;
6245
6302
  if (this.selectedItemIds.length <= 1) {
6246
- if (await this.uploadAudit(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved, event.module ?? "events")) {
6303
+ if (await this.uploadAudit(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved, event.module ?? "compliance")) {
6247
6304
  for (var p = 0; p < this.events[mmdd].length; p++) {
6248
6305
  if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
6249
6306
  this.events[mmdd][p].approved = approved
@@ -6285,7 +6342,7 @@ export class SfIEvents extends LitElement {
6285
6342
  "userid": this.userProfileId,
6286
6343
  "userrole": this.myRole,
6287
6344
  "year": this.calendarStartYYYY,
6288
- "module": event.module ?? "events"
6345
+ "module": event.module ?? "compliance"
6289
6346
  })
6290
6347
  // await this.uploadAudit(entityId, locationId, mmddyyyy, eventId, comments, approved);
6291
6348
 
@@ -6436,7 +6493,7 @@ export class SfIEvents extends LitElement {
6436
6493
  let flagBulk = false;
6437
6494
  if (this.selectedItemIds.length <= 1) {
6438
6495
 
6439
- if (await this.uploadReport(event.entityid, event.locationid, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.module ?? "events", percentage, event.makercheckers)) {
6496
+ if (await this.uploadReport(event.entityid, event.locationid, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.module ?? "compliance", percentage, event.makercheckers)) {
6440
6497
 
6441
6498
  console.log('this.events', this.events);
6442
6499
  if (this.mode != "next") {
@@ -6450,7 +6507,7 @@ export class SfIEvents extends LitElement {
6450
6507
 
6451
6508
  if (event.makercheckers.length > 0) {
6452
6509
 
6453
- // await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, event.module ?? "events");
6510
+ // await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, event.module ?? "compliance");
6454
6511
  for (var p = 0; p < this.events[mmdd].length; p++) {
6455
6512
  if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
6456
6513
  this.events[mmdd][p].approved = true
@@ -6504,7 +6561,7 @@ export class SfIEvents extends LitElement {
6504
6561
  // "userid": this.userProfileId,
6505
6562
  // "userrole": this.myRole,
6506
6563
  // "year": this.calendarStartYYYY,
6507
- // "module": event.module ?? "events"
6564
+ // "module": event.module ?? "compliance"
6508
6565
  // } )
6509
6566
  // // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
6510
6567
 
@@ -6527,7 +6584,7 @@ export class SfIEvents extends LitElement {
6527
6584
  "userid": this.userProfileId,
6528
6585
  "userrole": this.myRole,
6529
6586
  "year": this.calendarStartYYYY,
6530
- "module": event.module ?? "events",
6587
+ "module": event.module ?? "compliance",
6531
6588
  "makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
6532
6589
  })
6533
6590
  // }
@@ -6922,6 +6979,8 @@ export class SfIEvents extends LitElement {
6922
6979
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6923
6980
  } else if (module === "license") {
6924
6981
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6982
+ } else if (module === "rcmresource") {
6983
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6925
6984
  } else {
6926
6985
  let found = false;
6927
6986
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -6963,6 +7022,8 @@ export class SfIEvents extends LitElement {
6963
7022
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6964
7023
  } else if (module === "license") {
6965
7024
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
7025
+ } else if (module === "rcmresource") {
7026
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6966
7027
  } else {
6967
7028
  let found = false;
6968
7029
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -7617,32 +7678,6 @@ export class SfIEvents extends LitElement {
7617
7678
  this.renderTabs(this.selectedTab)
7618
7679
  this.processDateSelectionViewer(eventsContainer);
7619
7680
  })
7620
- // const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
7621
- // selectFeatureAll.addEventListener('click',async(ev: any) => {
7622
- // let target = ev.target;
7623
- // if(target.checked){
7624
- // for(let feature of this.getFeatures()){
7625
- // if(this.selectedFeatures.indexOf(feature) < 0){
7626
- // this.selectedFeatures.push(feature);
7627
- // }
7628
- // }
7629
- // }else{
7630
- // this.selectedFeatures = []
7631
- // }
7632
- // const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
7633
- // for(let selectFeature of selectFeatures){
7634
- // let id = selectFeature.id;
7635
- // let i = id.split('-')[3];
7636
- // let selectedFeature = this.getFeatures()[parseInt(i)]
7637
- // selectFeature.checked = this.selectedFeatures.indexOf(selectedFeature) >= 0
7638
- // }
7639
- // filterSubmitButton.style.visibility = 'visible'
7640
- // })
7641
- // const selectFeatureAllLabel = filterList.querySelector('#input-select-feature-label-all') as HTMLLabelElement
7642
- // selectFeatureAllLabel.addEventListener('click',()=>{
7643
- // selectFeatureAll.checked = !selectFeatureAll.checked
7644
- // selectFeatureAll.click();
7645
- // })
7646
7681
  const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
7647
7682
  const selectFeatureLabels = filterList.querySelectorAll('.input-select-feature-label') as NodeListOf<HTMLLabelElement>
7648
7683
  for (let [i, selectFeature] of selectFeatures.entries()) {
@@ -7657,13 +7692,6 @@ export class SfIEvents extends LitElement {
7657
7692
  this.selectedFeatures = [selectedFeature]
7658
7693
  }
7659
7694
  }
7660
- // else{
7661
- // // selectFeatureAll.checked = false;
7662
- // if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
7663
- // this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
7664
- // }
7665
- // }
7666
- // filterSubmitButton.style.visibility = 'visible'
7667
7695
  filterSubmitButton.click();
7668
7696
  })
7669
7697
  selectFeatureLabels[i].addEventListener('click', () => {
@@ -7672,28 +7700,59 @@ export class SfIEvents extends LitElement {
7672
7700
  })
7673
7701
  }
7674
7702
  })
7675
- // let innerhtml = eventsContainer.innerHTML;
7676
- // innerhtml += this.renderSelectAllButtons();
7677
- // eventsContainer.innerHTML = innerhtml
7678
- // this.attachTimelineFilterHandlers(eventsContainer);
7679
-
7680
- // const radioExpander = eventsContainer.querySelector('#graph-radios-expander') as HTMLButtonElement;
7681
- // radioExpander?.addEventListener('click', (e: any) => {
7682
-
7683
- // const button = (e.currentTarget as HTMLButtonElement);
7684
- // button.style.display = 'none';
7685
-
7686
- // const arrRadios = eventsContainer.querySelectorAll('.chart-radio-item-secondary') as NodeListOf<HTMLDivElement>;
7687
- // arrRadios.forEach(div => {
7688
- // div.style.display = 'block';
7689
- // });
7690
- // });
7691
7703
 
7692
7704
  const buttonRefresh = eventsContainer.querySelector('#button-refresh') as HTMLButtonElement
7693
7705
  buttonRefresh.addEventListener('click', async () => {
7694
7706
  this.processDateSelectionViewer(eventsContainer)
7695
7707
  })
7696
-
7708
+ if (Object.keys(this.statisticsFiltersData).length > 0) {
7709
+ this.renderDrilldownListeners(eventsContainer);
7710
+ }
7711
+ }
7712
+
7713
+ renderDrilldownListeners = async (eventsContainer: HTMLDivElement) => {
7714
+ await new Promise(resolve => setTimeout(resolve, 1000));
7715
+ console.log('rendering drilldown listeners', this.statisticsFiltersData, this.statisticsMeta)
7716
+ let rows = eventsContainer.querySelectorAll('.tablerow') as NodeListOf<HTMLTableRowElement>
7717
+ let filtercriteria = Object.keys(this.statisticsFiltersData)[0]
7718
+ console.log('rendering statistics filters for criteria', filtercriteria, this.statisticsMeta[filtercriteria])
7719
+ let sortedFilters = Util.alphabeticalSort(this.statisticsMeta[filtercriteria])
7720
+ for (let [rowIndex, row] of rows.entries()) {
7721
+ let filterVal = sortedFilters[rowIndex]
7722
+ let filterValue = filterVal.split(';')[1]
7723
+ let filterName = filterVal.split(';')[0].replace(/\([^)]*\)/g, "")
7724
+
7725
+ let notStartedDiv = row.querySelector('#filter-not-started-' + rowIndex) as HTMLDivElement
7726
+ notStartedDiv.addEventListener('click', () => {
7727
+ console.log('clicked not started filter', rowIndex)
7728
+ console.log('filter', filtercriteria, filterValue, filterName)
7729
+ this.renderStatisticsDetails(filtercriteria, filterValue, filterName, "not-started")
7730
+ })
7731
+ let pendingApprovalDiv = row.querySelector('#filter-pending-approval-' + rowIndex) as HTMLDivElement
7732
+ pendingApprovalDiv.addEventListener('click', () => {
7733
+ console.log('clicked pending approval filter', rowIndex)
7734
+ console.log('filter', filtercriteria, filterValue, filterName)
7735
+ this.renderStatisticsDetails(filtercriteria, filterValue, filterName, "pending-approval")
7736
+ })
7737
+ let rejectedDiv = row.querySelector('#filter-rejected-' + rowIndex) as HTMLDivElement
7738
+ rejectedDiv.addEventListener('click', () => {
7739
+ console.log('clicked rejected filter', rowIndex)
7740
+ console.log('filter', filtercriteria, filterValue, filterName)
7741
+ this.renderStatisticsDetails(filtercriteria, filterValue, filterName, "rejected")
7742
+ })
7743
+ let approvedDiv = row.querySelector('#filter-approved-' + rowIndex) as HTMLDivElement
7744
+ approvedDiv.addEventListener('click', () => {
7745
+ console.log('clicked approved filter', rowIndex)
7746
+ console.log('filter', filtercriteria, filterValue, filterName)
7747
+ this.renderStatisticsDetails(filtercriteria, filterValue, filterName, "approved")
7748
+ })
7749
+ let totalDiv = row.querySelector('#filter-total-' + rowIndex) as HTMLDivElement
7750
+ totalDiv.addEventListener('click', () => {
7751
+ console.log('clicked total filter', rowIndex)
7752
+ console.log('filter', filtercriteria, filterValue, filterName)
7753
+ this.renderStatisticsDetails(filtercriteria, filterValue, filterName)
7754
+ })
7755
+ }
7697
7756
  }
7698
7757
 
7699
7758
  renderStatisticsFilters = (eventsContainer: HTMLDivElement) => {
@@ -7755,6 +7814,7 @@ export class SfIEvents extends LitElement {
7755
7814
  let inputLabelSubfilters = eventsContainer.querySelector('#input-label-subfilter') as HTMLLabelElement
7756
7815
  let selectSubfilterCriteria = eventsContainer.querySelector('#select-subfilter-criteria') as HTMLSelectElement
7757
7816
  selectSubfilterCriteria.value = ""
7817
+ selectSubfilterCriteria.length = 0
7758
7818
 
7759
7819
 
7760
7820
  selectFilterValues.innerHTML = ""
@@ -8268,6 +8328,10 @@ export class SfIEvents extends LitElement {
8268
8328
  valueEnd = ((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value;
8269
8329
  }
8270
8330
 
8331
+ if (this.mode == "viewer") {
8332
+ valueStart = this.sdate;
8333
+ valueEnd = this.edate;
8334
+ }
8271
8335
  //console.log('valuestart', valueStart);
8272
8336
  //console.log('valueend', valueEnd);
8273
8337
 
@@ -10324,7 +10388,11 @@ export class SfIEvents extends LitElement {
10324
10388
  html += '</div>';
10325
10389
 
10326
10390
  html += '<div class="d-flex w-100">';
10327
- html += '<div class="calendar-left-col desktop-only flex-col justify-start align-end">';
10391
+ html += '<div class="calendar-left-col desktop-only flex-col justify-start align-end';
10392
+ if (this.mode == "viewer") {
10393
+ html += ' hide';
10394
+ }
10395
+ html += '">';
10328
10396
 
10329
10397
  html += '<div class="title-item-date">';
10330
10398
  html += '<label part="input-label">Start Date</label><br />'
@@ -10493,7 +10561,7 @@ export class SfIEvents extends LitElement {
10493
10561
  this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
10494
10562
  });
10495
10563
 
10496
- if (this.selectedFeatures.indexOf('contracts') >= 0) {
10564
+ if (this.selectedFeatures.indexOf('contracts') >= 0 && this.mode != "viewer") {
10497
10565
  ((this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-year') as HTMLButtonElement).click();
10498
10566
  }
10499
10567
  // for(var i = 0; i < 3; i++) {
@@ -11091,6 +11159,8 @@ export class SfIEvents extends LitElement {
11091
11159
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11092
11160
  } else if (module === "license") {
11093
11161
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11162
+ } else if (module === "rcmresource") {
11163
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11094
11164
  } else {
11095
11165
  let found = false;
11096
11166
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -11132,6 +11202,8 @@ export class SfIEvents extends LitElement {
11132
11202
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11133
11203
  } else if (module === "license") {
11134
11204
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11205
+ } else if (module === "rcmresource") {
11206
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11135
11207
  } else {
11136
11208
  let found = false;
11137
11209
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -11703,6 +11775,8 @@ export class SfIEvents extends LitElement {
11703
11775
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11704
11776
  } else if (module === "license") {
11705
11777
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11778
+ } else if (module === "rcmresource") {
11779
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11706
11780
  } else {
11707
11781
  let found = false;
11708
11782
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -11749,6 +11823,8 @@ export class SfIEvents extends LitElement {
11749
11823
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11750
11824
  } else if (module === "license") {
11751
11825
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11826
+ } else if (module === "rcmresource") {
11827
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11752
11828
  } else {
11753
11829
  let found = false;
11754
11830
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -12729,7 +12805,7 @@ export class SfIEvents extends LitElement {
12729
12805
  }
12730
12806
 
12731
12807
  renderGraph = (divContainer: HTMLDivElement, pieData: any, partData: any, lateData: any, complianceData: any, param: string) => {
12732
- console.log('rendering graph chart2');
12808
+ console.log('rendering graph chart2', pieData, partData);
12733
12809
  this.clearSelectedGraphParam();
12734
12810
  // this.clearSelectedLegend();
12735
12811
 
@@ -12804,6 +12880,120 @@ export class SfIEvents extends LitElement {
12804
12880
 
12805
12881
  }
12806
12882
 
12883
+ renderStatisticsDetails = async (filter: string, filterid: string, filtervalue: string, filterstatus: string = "") => {
12884
+
12885
+
12886
+ let userid = this.userProfileId
12887
+ // let username = this.userName;
12888
+ let filterString = `countryid="${this.countryId}" locationid="${this.locationId}" entityid="${this.entityId}" tagid="${this.tagId}" selectedcriteria="${this.selectedCriteria}"`;
12889
+ let rolestr = "viewer"
12890
+ if (filter == "reporter" || filter == "approver" || filter == "functionhead") {
12891
+ userid = filterid;
12892
+ // username = filtervalue;
12893
+ rolestr = filter
12894
+ await this.fetchOnlyYearlyUserCalendar(this.sdate, this.edate, "", "yes", "00", this.calendarStartYYYY, userid, rolestr, this.entityId, this.countryId, this.locationId, this.tagId, this.functionId);
12895
+ filterString = `${filter} - ${filtervalue}`;
12896
+ } else if (filter == "function") {
12897
+ await this.fetchOnlyYearlyUserCalendar(this.sdate, this.edate, "", "yes", "00", this.calendarStartYYYY, this.userProfileId, rolestr, this.entityId, this.countryId, this.locationId, filterid, this.functionId);
12898
+ // filterString = `tagid="${filterid}" selectedcriteria="Tag - ${filtervalue}"`;
12899
+ filterString = `Function - ${filtervalue}`;
12900
+ } else if (filter == "location") {
12901
+ await this.fetchOnlyYearlyUserCalendar(this.sdate, this.edate, "", "yes", "00", this.calendarStartYYYY, this.userProfileId, rolestr, this.entityId, this.countryId, filterid, this.tagId, this.functionId);
12902
+ // filterString = `locationid="${filterid}" selectedcriteria="Location - ${filtervalue}"`;
12903
+ filterString = `Location - ${filtervalue}`;
12904
+ }
12905
+
12906
+ var html = `
12907
+
12908
+ <div class="d-flex justify-between m-20">
12909
+ <button part="button-icon" class="material-icons invisible">close</button>
12910
+ <h3 part="results-title" class="m-0">Statistics Details: <strong>${filterString}</strong></h3>
12911
+ <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
12912
+ </div>
12913
+
12914
+ `;
12915
+ html += `
12916
+ <div id="list-container" class="list-container m-20 pb-20" part="list-container"></div>
12917
+ `;
12918
+ // html += `
12919
+ // <sf-i-events id="statistics-drilldown" name="Statistics" apiid="dwqyez2puoxmu.cloudfront.net/event" exportparts="detail-container" mode="viewer"
12920
+ // apiidtags="${this.apiIdTags}"
12921
+ // apiidusers="${this.apiIdUsers}"
12922
+ // apiidstatutes="${this.apiIdStatutes}"
12923
+ // apiiddefinitions="${this.apiIdDefinitions}"
12924
+ // apiidreportformats="${this.apiidReportformats}"
12925
+ // apiidnotices="${this.apiIdNotices}"
12926
+ // apiidagreements="${this.apiIdAgreements}"
12927
+ // apiidlicenses="${this.apiIdLicenses}" username="${username}"
12928
+ // userprofileid="${userid}" projectid="${this.projectId}"
12929
+ // projectname="${this.projectName}" ${filterString}
12930
+ // myrole="${rolestr}" showregisterexport="false"
12931
+ // features="${this.features.replace(/"/g, "&quot;")}"
12932
+ // selectedfeatures="${JSON.stringify(this.selectedFeatures).replace(/"/g, "&quot;")}"
12933
+ // eventfielddependencies="${this.eventFieldDependencies.replace(/"/g, "&quot;")}"
12934
+ // eventfields="${this.eventFields.replace(/"/g, "&quot;")}"
12935
+ // eventpreviewfields="${this.eventPreviewFields.replace(/"/g, "&quot;")}"
12936
+ // eventhidefields="${this.eventHideFields.replace(/"/g, "&quot;")}"
12937
+ // calendarstartdd="${this.calendarStartDD}" calendarstartmm="${this.calendarStartMM}" calendarstartyyyy="${this.calendarStartYYYY}"
12938
+ // sdate="${this.sdate}" edate="${this.edate}"
12939
+ // flowgraphcompleteness="${this.FLOW_GRAPH_COMPLETENESS}">
12940
+
12941
+ // <div slot="uploader">
12942
+ // <sf-i-uploader id="uploader" max="10" apiid="1peg5170d3"
12943
+ // allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]"
12944
+ // extract="yes" projectid="${this.projectId}" maxsize="31457280"
12945
+ // allowdownload="yes"></sf-i-uploader>
12946
+ // </div>
12947
+ // <div slot="reporting">
12948
+ // <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
12949
+ // </div>
12950
+
12951
+ // </sf-i-events>
12952
+ // `;
12953
+ (this._SfDetailListContainer as HTMLDivElement).style.display = 'block';
12954
+ (this._SfDetailListContainer as HTMLDivElement).innerHTML = html;
12955
+
12956
+ // this.renderRangeEvents(new Date(this.sdate), ((new Date(this.edate).getTime()) - new Date(this.sdate).getTime()) / (1000 * 60 * 60 * 24), (this._SfDetailListContainer as HTMLDivElement).querySelector('.list-container') as HTMLDivElement);
12957
+
12958
+ const lastDay = ((new Date(this.edate).getTime()) - new Date(this.sdate).getTime()) / (1000 * 60 * 60 * 24)
12959
+ let firstDay = new Date((new Date(this.sdate)).getFullYear(), (new Date(this.sdate)).getMonth(), (new Date(this.sdate)).getDate());
12960
+ let endDay = new Date((new Date(this.sdate)).getFullYear(), (new Date(this.sdate)).getMonth(), (new Date(this.sdate)).getDate());
12961
+ endDay?.setDate(endDay.getDate() + lastDay);
12962
+ console.log('firstday', firstDay, endDay)
12963
+ var period = ("0" + (firstDay.getMonth() + 1)).slice(-2) + "/" + ("0" + firstDay.getDate()).slice(-2) + '/' + firstDay.getFullYear() + ' - ' + ("0" + (endDay.getMonth() + 1)).slice(-2) + "/" + ("0" + endDay.getDate()).slice(-2) + '/' + endDay.getFullYear();
12964
+
12965
+ console.log('rangeperiod', period, lastDay);
12966
+
12967
+ var htmlEvents = this.renderEvents(firstDay, endDay, 0, lastDay, false, 0, ((new Date(this.sdate)).getMonth()), period, (new Date(this.sdate)), "From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'), false, true);
12968
+
12969
+ ((this._SfDetailListContainer as HTMLDivElement).querySelector('#list-container') as HTMLDivElement).innerHTML = htmlEvents;
12970
+ let divContainer = ((this._SfDetailListContainer as HTMLDivElement).querySelector('#list-container') as HTMLDivElement)
12971
+ const itemsTimeliness = divContainer.querySelectorAll('.stat-timeliness') as NodeListOf<HTMLElement>;
12972
+ for (var i = 0; i < itemsTimeliness.length; i++) {
12973
+ itemsTimeliness[i].style.display = 'none';
12974
+ }
12975
+ const itemsCompliance = divContainer.querySelectorAll('.stat-compliance') as NodeListOf<HTMLElement>;
12976
+ for (var i = 0; i < itemsCompliance.length; i++) {
12977
+ itemsCompliance[i].style.display = 'none';
12978
+ }
12979
+ if(filterstatus != ""){
12980
+ this.processGraphFilter(filterstatus, divContainer);
12981
+ }
12982
+ (this._SfDetailListContainer as HTMLDivElement).querySelector('#button-detail-close')?.addEventListener('click', () => {
12983
+
12984
+ (this._SfDetailListContainer as HTMLDivElement).innerHTML = '';
12985
+ (this._SfDetailListContainer as HTMLDivElement).style.display = 'none';
12986
+
12987
+ });
12988
+
12989
+ // let statisticsDrilldown = (this._SfDetailContainer as HTMLDivElement).querySelector('#statistics-drilldown') as SfIEvents;
12990
+ // statisticsDrilldown.sdate = this.sdate
12991
+ // statisticsDrilldown.edate = this.edate
12992
+ // statisticsDrilldown.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
12993
+ // setTimeout(() => {
12994
+ // statisticsDrilldown.loadMode();
12995
+ // }, 1000);
12996
+ }
12807
12997
  renderEventDetailShort = (compliance: any) => {
12808
12998
 
12809
12999
  var html = `
@@ -13030,10 +13220,11 @@ export class SfIEvents extends LitElement {
13030
13220
  </div>
13031
13221
  `
13032
13222
  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, 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:repoortiinig-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:repoortiinig-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="Notice Details" apiiduploader="1peg5170d3" apiid="' + this.apiIdNotices + '" mode="admin" flow="details" projectid="' + this.projectId + '" projectname="' + this.projectName + '" editdisable="true" formviewclass="flex-wrap"></sf-i-reporting>';
13033
-
13034
- html += '<div part="reporting-view-container">'
13035
- html += this.renderReporting(listEvent, mmddyyyy);
13036
- html += "</div>"
13223
+ if (this.mode != "viewer") {
13224
+ html += '<div part="reporting-view-container">'
13225
+ html += this.renderReporting(listEvent, mmddyyyy);
13226
+ html += "</div>"
13227
+ }
13037
13228
 
13038
13229
  html += '<div class="d-flex justify-between m-20">';
13039
13230
  html += '<h3 part="results-title" class="m-0"><br />Comments</h3>';
@@ -13213,7 +13404,7 @@ export class SfIEvents extends LitElement {
13213
13404
  let flagBulk = false;
13214
13405
  if (this.selectedItemIds.length <= 1) {
13215
13406
  console.log('mmddyyyy', mmddyyyy)
13216
- if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
13407
+ if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "compliance")) {
13217
13408
  for (var p = 0; p < this.events[mmdd].length; p++) {
13218
13409
  if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
13219
13410
 
@@ -13252,7 +13443,7 @@ export class SfIEvents extends LitElement {
13252
13443
  "userid": this.userProfileId,
13253
13444
  "userrole": this.myRole,
13254
13445
  "year": this.calendarStartYYYY,
13255
- "module": listEvent.module ?? "events"
13446
+ "module": listEvent.module ?? "compliance"
13256
13447
  })
13257
13448
  // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, comments, approved)
13258
13449
 
@@ -13346,7 +13537,7 @@ export class SfIEvents extends LitElement {
13346
13537
  let flagBulk = false;
13347
13538
  if (this.selectedItemIds.length <= 1) {
13348
13539
 
13349
- if (await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
13540
+ if (await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "compliance")) {
13350
13541
  for (var p = 0; p < this.events[mmdd].length; p++) {
13351
13542
  if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
13352
13543
  this.events[mmdd][p].approved = approved
@@ -13386,7 +13577,7 @@ export class SfIEvents extends LitElement {
13386
13577
  "userid": this.userProfileId,
13387
13578
  "userrole": this.myRole,
13388
13579
  "year": this.calendarStartYYYY,
13389
- "module": listEvent.module ?? "events"
13580
+ "module": listEvent.module ?? "compliance"
13390
13581
  })
13391
13582
  // await this.uploadAudit(entityId, locationId, mmddyyyy, eventId, comments, approved);
13392
13583
 
@@ -13621,7 +13812,7 @@ export class SfIEvents extends LitElement {
13621
13812
  // "userid": this.userProfileId,
13622
13813
  // "userrole": this.myRole,
13623
13814
  // "year": this.calendarStartYYYY,
13624
- // "module": listEvent.module ?? "events"
13815
+ // "module": listEvent.module ?? "compliance"
13625
13816
  // } )
13626
13817
  // // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
13627
13818
 
@@ -13644,7 +13835,7 @@ export class SfIEvents extends LitElement {
13644
13835
  "userid": this.userProfileId,
13645
13836
  "userrole": this.myRole,
13646
13837
  "year": this.calendarStartYYYY,
13647
- "module": listEvent.module ?? "events",
13838
+ "module": listEvent.module ?? "compliance",
13648
13839
  "makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
13649
13840
  })
13650
13841
  // }
@@ -13709,13 +13900,906 @@ export class SfIEvents extends LitElement {
13709
13900
  // }
13710
13901
  }
13711
13902
  }
13712
-
13903
+
13904
+ }
13905
+
13906
+
13907
+ }
13908
+ }
13909
+ }
13910
+ });
13911
+
13912
+ }
13913
+
13914
+ }
13915
+
13916
+ }
13917
+
13918
+ if (this._SfUploader[0] != null) {
13919
+ (this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "none"
13920
+ this._SfUploader[0].querySelector('#uploader').addEventListener('analysisInProgress', (_ev: any) => {
13921
+ console.log('uploader analysisInProgress', _ev);
13922
+ (this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "block"
13923
+ });
13924
+ this._SfUploader[0].querySelector('#uploader').addEventListener('analysisCompleted', (_ev: any) => {
13925
+ console.log('uploader analysisInProgress', _ev);
13926
+ (this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "none"
13927
+ });
13928
+
13929
+
13930
+ //console.log('documentType checking', documentType);
13931
+
13932
+ if (documentType != null) {
13933
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.docType = documentType;
13934
+ }
13935
+
13936
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.prepopulatedInputArr = JSON.stringify([]);
13937
+ console.log('uploader', (this._SfUploader[0].querySelector('#uploader') as SfIUploader));
13938
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
13939
+
13940
+ if (docs.length > 0) {
13941
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.prepopulatedInputArr = JSON.stringify(docs);
13942
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
13943
+ }
13944
+
13945
+ if (this.myRole == this.TAB_APPROVER || approved) {
13946
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.readOnly = true;
13947
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
13948
+ } else {
13949
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.readOnly = false;
13950
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
13951
+ }
13952
+
13953
+ const dataPassthrough = {
13954
+ projectId: this.projectId,
13955
+ countryId: this.countryId,
13956
+ entityId: listEvent.entityid,
13957
+ locationId: listEvent.locationid,
13958
+ mmddyyyy: mmddyyyy,
13959
+ complianceId: listEvent['id'],
13960
+ path: "uploadextract"
13961
+ };
13962
+
13963
+ const callbackUrlHost = "8icpy39ru0.execute-api.us-east-1.amazonaws.com";
13964
+ const callbackUrlPath = "test/uploadextract";
13965
+
13966
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.projectId = this.projectId;
13967
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.dataPassthrough = JSON.stringify(dataPassthrough);
13968
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.callbackUrlHost = callbackUrlHost;
13969
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.callbackUrlPath = callbackUrlPath;
13970
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
13971
+
13972
+ }
13973
+
13974
+
13975
+
13976
+ //console.log('approved 1', event["approved"], this.myRole, this.TAB_APPROVER);
13977
+ if (this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_VIEWER || this.myRole == this.TAB_AUDITOR || this.myRole == this.TAB_FUNCTION_HEAD) {
13978
+ //console.log('approved 1', event["approved"], this.myRole, this.TAB_APPROVER);
13979
+ if (listEvent["approved"] != null) {
13980
+ if (listEvent["approved"] === true) {
13981
+ //console.log('approved 2', event["approved"], this.myRole, this.TAB_APPROVER);
13982
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement) != null) {
13983
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked = true;
13984
+ }
13985
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
13986
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement).checked = false;
13987
+ }
13988
+ } else {
13989
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement) != null) {
13990
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement)!.checked = false;
13991
+ }
13992
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
13993
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement)!.checked = true;
13994
+ }
13995
+ }
13996
+ } else {
13997
+ if ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement != null) {
13998
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked = false;
13999
+ }
14000
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
14001
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement).checked = true;
14002
+ }
14003
+
14004
+ }
14005
+ }
14006
+
14007
+ }
14008
+ }
14009
+ fetchContractDetails = async (listEvent: any, mmddyyyy: string) => {
14010
+ let entityId = listEvent.entityid;
14011
+ let locationId = listEvent.locationid;
14012
+ let url = "https://" + this.apiIdAgreements + "/getallobjectdetails";
14013
+
14014
+ //console.log('fetch calendar url', url);
14015
+ let urlBody: any = { projectid: this.projectId, objectid: listEvent.id, entityid: entityId, locationid: locationId, userprofileid: this.userProfileId, role: this.myRole, year: this.calendarStartYYYY, mmddyyyy: mmddyyyy };
14016
+
14017
+ //console.log('urlbody', urlBody);
14018
+
14019
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
14020
+ const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
14021
+ this._SfLoader.innerHTML = '';
14022
+ if (xhr.status == 200) {
14023
+
14024
+ const jsonRespose = JSON.parse(xhr.responseText);
14025
+ console.log('jsonRespose agreement details', jsonRespose);
14026
+ this.renderContractDetails(jsonRespose.object, mmddyyyy)
14027
+ } else {
14028
+ if (xhr.status == 401) {
14029
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
14030
+ this.dispatchEvent(changeEvent);
14031
+ } else {
14032
+ const jsonRespose = JSON.parse(xhr.responseText);
14033
+ this.setError(jsonRespose.error);
14034
+ }
14035
+
14036
+ }
14037
+
14038
+ }
14039
+
14040
+ renewContract = async (listEvent: any, reportformatvalues: any) => {
14041
+
14042
+ let url = "https://" + this.apiIdAgreements + "/reopen";
14043
+
14044
+ console.log('renewing', reportformatvalues)
14045
+ //console.log('fetch calendar url', url);
14046
+ let urlBody: any = { projectid: this.projectId, objectid: listEvent.id, newvalues: reportformatvalues == "" ? null : JSON.parse(reportformatvalues), published: true, terminated: (JSON.parse(reportformatvalues).terminated ?? false) };
14047
+ // console.log('reopen body', url, urlBody)
14048
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
14049
+ const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
14050
+ this._SfLoader.innerHTML = '';
14051
+ if (xhr.status == 200) {
14052
+
14053
+ const jsonRespose = JSON.parse(xhr.responseText);
14054
+ console.log('jsonRespose agreement reopen', jsonRespose);
14055
+ } else {
14056
+ if (xhr.status == 401) {
14057
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
14058
+ this.dispatchEvent(changeEvent);
14059
+ } else {
14060
+ const jsonRespose = JSON.parse(xhr.responseText);
14061
+ this.setError(jsonRespose.error);
14062
+ }
14063
+
14064
+ }
14065
+ }
14066
+ renderContractDetails = async (listEvent: any, mmddyyyy: string) => {
14067
+ // await this.fetchAgreementDetails(listEvent, mmddyyyy);
14068
+ // return;
14069
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
14070
+ let entityId = listEvent.entityid;
14071
+ let locationId = listEvent.locationid;
14072
+ let comments = listEvent['comments'];
14073
+ let docs = listEvent['documents'] == null ? [] : listEvent['documents'] == null ? [] : (listEvent['documents']);
14074
+ let approved = listEvent['approved'] == null ? false : listEvent['approved'] == null ? false : listEvent['approved'];
14075
+ let makercheckers = listEvent['makercheckers'] == null ? [] : listEvent['makercheckers'] == null ? [] : listEvent['makercheckers'];
14076
+ // let docsOptional = listEvent['docs'] == null ? [] : listEvent['docs'] == null ? [] : listEvent['docs'];
14077
+ let html: string = '';
14078
+ let documentType = listEvent['documenttype'] == null ? null : listEvent['documenttype'][0] == null ? null : listEvent['documenttype'][0].split(" ")[0];
14079
+ html += `
14080
+ <div part="compliance-detail-title" class="d-flex justify-between">
14081
+ <button part="button-icon" class="material-icons invisible">close</button>
14082
+ <h3 part="results-title" class="m-0">Agreement Details</h3>
14083
+ <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
14084
+ </div>
14085
+ `
14086
+ html += `
14087
+ <div class="box-large" id="shimmer-container-agreements" part="shimmer-container-agreements">
14088
+ </div>
14089
+ `
14090
+ 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="Contract Details" apiiduploader="1peg5170d3" apiid="' + this.apiIdAgreements + '" mode="admin" flow="details" projectid="' + this.projectId + '" projectname="' + this.projectName + '" editdisable="true" formviewclass="flex-wrap"></sf-i-reporting>';
14091
+ if (this.mode != "viewer") {
14092
+ html += '<div part="reporting-view-container">'
14093
+
14094
+ html += this.renderReporting(listEvent, mmddyyyy);
14095
+ html += "</div>"
14096
+ }
14097
+
14098
+ html += '<div class="d-flex justify-between m-20">';
14099
+ html += '<h3 part="results-title" class="m-0"><br />Comments</h3>';
14100
+ html += '</div>';
14101
+
14102
+ html += '<div class="m-20">';
14103
+
14104
+ html += '<div class="d-flex flex-col">';
14105
+
14106
+ for (var i = 0; i < comments.length; i++) {
14107
+ html += '<div part="commentbox" class="d-flex commentbox ' + (comments[i].author + "").toLowerCase() + 'box">';
14108
+ 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>';
14109
+
14110
+ const onlyCommentText = (comments[i].comment + "").replace(/ *\([^)]*\) */g, "").trim();
14111
+ try {
14112
+
14113
+ const jsonComments = JSON.parse(onlyCommentText);
14114
+
14115
+ if (Util.isInteger(jsonComments)) {
14116
+ html += '<div class="">' + comments[i].comment + '<br /><small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
14117
+ } else {
14118
+ //console.log('json comments', jsonComments);
14119
+ var htmlTable = '';
14120
+ for (var j = 0; j < Object.keys(jsonComments).length; j++) {
14121
+ htmlTable += '<div class="mb-20">';
14122
+ htmlTable += ('<div part="detail-head">' + Object.keys(jsonComments)[j] + '</div>');
14123
+ htmlTable += ('<sf-i-elastic-text text="' + jsonComments[Object.keys(jsonComments)[j]] + '" minLength="20"></sf-i-elastic-text>');
14124
+ htmlTable += '</div>';
14125
+ }
14126
+ html += '<div class="">' + htmlTable + '<small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
14127
+ }
14128
+
14129
+ } catch (e: any) {
14130
+ //console.log('json comments exception', comments[i]);
14131
+ html += '<div class="">' + comments[i].comment + '<br /><small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
14132
+ }
14133
+
14134
+ html += '</div>';
14135
+ }
14136
+ if (comments.length === 0) {
14137
+ html += '<div><strong>No comments yet!</strong></div>';
14138
+ }
14139
+
14140
+ html += '</div>';
14141
+
14142
+ html += '</div>';
14143
+ console.log('selected event', JSON.stringify(listEvent));
14144
+ (this._SfDetailContainer as HTMLDivElement).innerHTML = html;
14145
+ (this._SfDetailContainer as HTMLDivElement).style.display = 'block';
14146
+
14147
+ let usermap = Util.getUsermap();
14148
+
14149
+ let sfireporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#detail-reporting') as SfIReporting
14150
+ sfireporting.usermap = JSON.stringify(usermap);
14151
+ sfireporting.selectedItem = listEvent;
14152
+ sfireporting.editdisable = "true"
14153
+ setTimeout(() => {
14154
+ console.log('sfireporting', sfireporting._SfReportingContainer);
14155
+ sfireporting.loadMode();
14156
+ }, 500);
14157
+
14158
+ sfireporting.addEventListener('valueChanged', () => {
14159
+ sfireporting.classList.remove('hide');
14160
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#shimmer-container-agreements') as HTMLDivElement).classList.add('hide');
14161
+ });
14162
+ let reportingSchemaJson = "";
14163
+ let reportingSchemaValues = ""
14164
+ if (listEvent.reportformatschema != null) {
14165
+ reportingSchemaJson = listEvent.reportformatschema
14166
+ reportingSchemaValues = listEvent.reportformatvalues
14167
+ } else if (listEvent.customreporting != null) {
14168
+ reportingSchemaJson = listEvent.customreporting
14169
+ }
14170
+ if (listEvent.customreporting != null || listEvent.reportformatschema != null) {
14171
+ 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="Contract Reporting" formviewclass="flex-wrap" showterminate="true" projectid="' + this.projectId + '"></sf-i-reporting>'
14172
+
14173
+ let reportFormatContainer = (this._SfDetailContainer as HTMLDivElement).querySelector('#report-format-container') as HTMLDivElement;
14174
+ if (reportFormatContainer != null) {
14175
+ reportFormatContainer.innerHTML = reportingHtml;
14176
+ }
14177
+
14178
+ }
14179
+ let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
14180
+
14181
+ if (reportingSchemaJson != "" && reportingReporting != null) {
14182
+ reportingReporting.configjson = reportingSchemaJson;
14183
+ if (reportingSchemaValues != "") reportingReporting.prepopulateValJson = reportingSchemaValues
14184
+ reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
14185
+ reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
14186
+ reportingReporting.flow = "reporting"
14187
+ setTimeout(() => {
14188
+ reportingReporting.loadMode();
14189
+ console.log('list-customreporting', reportingSchemaJson);
14190
+ console.log('list-customreporting1', reportingSchemaValues);
14191
+ console.log('list-customreporting2', reportingReporting.mode);
14192
+ }, 500)
14193
+ }
14194
+
14195
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close')?.addEventListener('click', () => {
14196
+
14197
+ (this._SfDetailContainer as HTMLDivElement).innerHTML = '';
14198
+ (this._SfDetailContainer as HTMLDivElement).style.display = 'none';
14199
+
14200
+ });
14201
+
14202
+ (this._SfDetailContainer as HTMLDivElement).querySelector('.button-delete')?.addEventListener('click', async () => {
14203
+
14204
+ // await this.fetchDeleteReview(listEvent["id"], mmddyyyy, entityId, locationId);
14205
+ // this.setSuccess('Deleted successfully!')
14206
+ // setTimeout(() => {
14207
+ // this.clearMessages()
14208
+ // }, 3000);
14209
+ // //console.log('deleted', resultDelete);
14210
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
14211
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
14212
+ // } else {
14213
+ // if(currentColumnButton != null) {
14214
+ // currentColumnButton.click();
14215
+ // }
14216
+ // }
14217
+
14218
+ console.log('delete review clicked')
14219
+
14220
+ var clickEvent = new MouseEvent("click", {
14221
+ "view": window,
14222
+ "bubbles": true,
14223
+ "cancelable": false
14224
+ });
14225
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
14226
+
14227
+ });
14228
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-auto-approve')?.addEventListener('click', async () => {
14229
+ if (this.selectedItemIds.length === 0) {
14230
+ console.log('audto approve single')
14231
+ } else {
14232
+ console.log('auto approve bulk')
14233
+ }
14234
+ //console.log('deleted', resultDelete);
14235
+ if (this.getCurrentTab() == this.TAB_CUSTOM) {
14236
+ this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
14237
+ } else {
14238
+ // if(currentColumnButton != null) {
14239
+ // currentColumnButton.click();
14240
+ // }
14241
+ }
14242
+
14243
+ var clickEvent = new MouseEvent("click", {
14244
+ "view": window,
14245
+ "bubbles": true,
14246
+ "cancelable": false
14247
+ });
14248
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
14249
+
14250
+ });
14251
+
14252
+ if (this.mode == "consumer" || this.mode == "next") {
14253
+
14254
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-approve')?.addEventListener('click', async (ev: any) => {
14255
+ let buttonClick = ev.target as HTMLButtonElement
14256
+ buttonClick.innerHTML = "Saving..."
14257
+ const comments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approver-comments') as HTMLInputElement).value;
14258
+ const approved = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked;
14259
+ let currStatus = this.getCompletenessStatus(listEvent);
14260
+ let newEvent = { ...listEvent };
14261
+ newEvent.comments = comments;
14262
+ newEvent.approved = approved;
14263
+ let newStatus = this.getCompletenessStatus(newEvent);
14264
+ if (currStatus == newStatus) {
14265
+ buttonClick.innerHTML = "Save"
14266
+ this.setError(approved ? 'Already Approved!' : 'Already Rejected!');
14267
+ setTimeout(() => {
14268
+ this.clearMessages();
14269
+ }, 3000);
14270
+ return;
14271
+ }
14272
+ let reportformatvalues = ""
14273
+ let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
14274
+ console.log('renew reporting', reportingReporting)
14275
+ if (reportingReporting != null) {
14276
+ reportformatvalues = JSON.stringify(reportingReporting!.selectedValues()) ?? "";
14277
+ }
14278
+ var clickEvent = new MouseEvent("click", {
14279
+ "view": window,
14280
+ "bubbles": true,
14281
+ "cancelable": false
14282
+ });
14283
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
14284
+
14285
+ // await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved)
14286
+ let flagBulk = false;
14287
+ if (this.selectedItemIds.length <= 1) {
14288
+ console.log('mmddyyyy', mmddyyyy)
14289
+ if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "compliance")) {
14290
+ if (approved) {
14291
+ await this.renewContract(listEvent, reportformatvalues);
14292
+ } else {
14293
+ console.log('renew reporting', reportformatvalues)
14294
+ }
14295
+ for (var p = 0; p < this.events[mmdd].length; p++) {
14296
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
14297
+ this.events[mmdd][p].approved = approved
14298
+ this.events[mmdd][p].terminated = (JSON.parse(reportformatvalues).terminated) ?? false
14299
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
14300
+ this.events[mmdd][p].lastupdated = new Date().toString()
14301
+ }
14302
+ }
14303
+ if (this.recentlyReported[mmdd] == null) {
14304
+ this.recentlyReported[mmdd] = []
14305
+ }
14306
+ this.recentlyReported[mmdd].push(listEvent)
14307
+ console.log('review single')
14308
+ }
14309
+ } else {
14310
+ let bulkBodyReview = []
14311
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
14312
+
14313
+ const selectedId = this.selectedItemIds[k];
14314
+ //console.log('selectedid', selectedId);
14315
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
14316
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
14317
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
14318
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
14319
+
14320
+ //console.log(entityId, locationId, eventId, mmddyyyy);
14321
+ bulkBodyReview.push({
14322
+ "mmddyyyy": mmddyyyy,
14323
+ "projectid": this.projectId,
14324
+ "type": "review",
14325
+ "eventid": eventId,
14326
+ "comments": comments,
14327
+ "approved": approved,
14328
+ "entityid": entityId,
14329
+ "locationid": locationId,
14330
+ "username": this.userName,
14331
+ "userid": this.userProfileId,
14332
+ "userrole": this.myRole,
14333
+ "year": this.calendarStartYYYY,
14334
+ "module": listEvent.module ?? "compliance"
14335
+ })
14336
+ // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, comments, approved)
14337
+
14338
+ // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
14339
+ // await this.sleep(2000);
14340
+ // this.clearMessages();
14341
+
14342
+ }
14343
+ await this.uploadReviewsBulk(bulkBodyReview);
14344
+
14345
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
14346
+
14347
+ const selectedId = this.selectedItemIds[k];
14348
+ //console.log('selectedid', selectedId);
14349
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
14350
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
14351
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
14352
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
14353
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
14354
+ for (var p = 0; p < this.events[mmdd].length; p++) {
14355
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
14356
+
14357
+ this.events[mmdd][p].isbulk = true
14358
+ flagBulk = true;
14359
+ if (this.recentlyReported[mmdd] == null) {
14360
+ this.recentlyReported[mmdd] = []
14361
+ }
14362
+ this.recentlyReported[mmdd].push(this.events[mmdd][p])
14363
+ }
14364
+ }
14365
+ }
14366
+ console.log('review bulk')
14367
+ }
14368
+
14369
+ if (this.mode == "next") {
14370
+ // this.fetchNext(this.nextPage)
14371
+ this.renderRoleTabsNext(this.nextPage)
14372
+ } else {
14373
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
14374
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
14375
+ // } else
14376
+ if (this.getCurrentTab() == this.TAB_FIND) {
14377
+ const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
14378
+ this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
14379
+ } else {
14380
+ if (this.selectedItemIds.length > 0) {
14381
+ await this.fetchBulkReportingData();
14382
+ }
14383
+ this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
14384
+ var clickEvent = new MouseEvent("click", {
14385
+ "view": window,
14386
+ "bubbles": true,
14387
+ "cancelable": false
14388
+ });
14389
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)?.dispatchEvent(clickEvent);
14390
+
14391
+ // if(currentColumnButton != null) {
14392
+ // currentColumnButton.click();
14393
+ // }
14394
+ }
14395
+ }
14396
+
14397
+ });
14398
+
14399
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-audit')?.addEventListener('click', async (ev: any) => {
14400
+ let buttonClick = ev.target as HTMLButtonElement
14401
+ buttonClick.innerHTML = "Saving..."
14402
+ const comments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-auditor-comments') as HTMLInputElement).value;
14403
+ const approved = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked;
14404
+ let currStatus = this.getCompletenessStatus(listEvent);
14405
+ let newEvent = { ...listEvent };
14406
+ newEvent.comments = comments;
14407
+ newEvent.approved = approved;
14408
+ let newStatus = this.getCompletenessStatus(newEvent);
14409
+ if (currStatus == newStatus) {
14410
+ buttonClick.innerHTML = "Save"
14411
+ this.setError(approved ? 'Already Approved!' : 'Already Rejected!');
14412
+ setTimeout(() => {
14413
+ this.clearMessages();
14414
+ }, 3000);
14415
+ return;
14416
+ }
14417
+ if (comments.trim().length === 0) {
14418
+ buttonClick.innerHTML = "Save"
14419
+ this.setError('Comments cannot be blank!');
14420
+ setTimeout(() => {
14421
+ this.clearMessages();
14422
+ }, 3000);
14423
+
14424
+ } else {
14425
+ let flagBulk = false;
14426
+ if (this.selectedItemIds.length <= 1) {
14427
+
14428
+ if (await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "compliance")) {
14429
+ for (var p = 0; p < this.events[mmdd].length; p++) {
14430
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
14431
+ this.events[mmdd][p].approved = approved
14432
+ this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
14433
+ this.events[mmdd][p].lastupdated = new Date().toString()
14434
+ }
14435
+ }
14436
+ if (this.recentlyReported[mmdd] == null) {
14437
+ this.recentlyReported[mmdd] = []
14438
+ }
14439
+ this.recentlyReported[mmdd].push(listEvent)
14440
+ }
14441
+ console.log('uploadaudit single')
14442
+ } else {
14443
+ let bulkBodyAudit = []
14444
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
14445
+
14446
+ const selectedId = this.selectedItemIds[k];
14447
+ //console.log('selectedid', selectedId);
14448
+
14449
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
14450
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
14451
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
14452
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
14453
+
14454
+ //console.log(entityId, locationId, eventId, mmddyyyy);
14455
+ bulkBodyAudit.push({
14456
+ "mmddyyyy": mmddyyyy,
14457
+ "projectid": this.projectId,
14458
+ "type": "audit",
14459
+ "eventid": eventId,
14460
+ "comments": comments,
14461
+ "approved": approved,
14462
+ "entityid": entityId,
14463
+ "locationid": locationId,
14464
+ "username": this.userName,
14465
+ "userid": this.userProfileId,
14466
+ "userrole": this.myRole,
14467
+ "year": this.calendarStartYYYY,
14468
+ "module": listEvent.module ?? "compliance"
14469
+ })
14470
+ // await this.uploadAudit(entityId, locationId, mmddyyyy, eventId, comments, approved);
14471
+
14472
+ }
14473
+
14474
+ await this.uploadAuditsBulk(bulkBodyAudit);
14475
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
14476
+
14477
+ const selectedId = this.selectedItemIds[k];
14478
+ //console.log('selectedid', selectedId);
14479
+ let entityId = selectedId.split('-')[7].replace(/_/g, '-');
14480
+ let locationId = selectedId.split('-')[8].replace(/_/g, '-');
14481
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
14482
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
14483
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
14484
+ for (var p = 0; p < this.events[mmdd].length; p++) {
14485
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
14486
+
14487
+ this.events[mmdd][p].isbulk = true
14488
+ flagBulk = true;
14489
+ if (this.recentlyReported[mmdd] == null) {
14490
+ this.recentlyReported[mmdd] = []
14491
+ }
14492
+ this.recentlyReported[mmdd].push(this.events[mmdd][p])
14493
+ }
14494
+ }
14495
+ }
14496
+
14497
+ console.log('uploadAudit bulk')
14498
+
14499
+ }
14500
+
14501
+ var clickEvent = new MouseEvent("click", {
14502
+ "view": window,
14503
+ "bubbles": true,
14504
+ "cancelable": false
14505
+ });
14506
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
14507
+ if (this.mode == "next") {
14508
+ this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
14509
+ } else {
14510
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
14511
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
14512
+ // } else
14513
+ if (this.getCurrentTab() == this.TAB_FIND) {
14514
+ const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
14515
+ this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
14516
+ } else {
14517
+ if (this.selectedItemIds.length > 0) {
14518
+ await this.fetchBulkReportingData();
14519
+ }
14520
+ this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
14521
+ // if(currentColumnButton != null) {
14522
+ // currentColumnButton.click();
14523
+ // }
14524
+ }
14525
+ }
14526
+
14527
+ }
14528
+
14529
+
14530
+
14531
+ });
14532
+
14533
+ if (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) {
14534
+
14535
+ if (approved) {
14536
+
14537
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement) != null) {
14538
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement).style.visibility = 'hidden';
14539
+ }
14540
+
14541
+
14542
+ } else {
14543
+
14544
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement) != null) {
14545
+
14546
+
14547
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement).style.visibility = 'visible';
14548
+
14549
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report')?.addEventListener('click', async (ev: any) => {
14550
+ let buttonClick = ev.target as HTMLButtonElement
14551
+ buttonClick.innerHTML = "Saving..."
14552
+ const reportercomments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-comments') as HTMLInputElement).value;
14553
+
14554
+ //console.log('reporter comments 1', reportercomments);
14555
+
14556
+ // 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() + "") : "";
14557
+ const reporterdoc = new Date().getTime() + "";
14558
+ let docs: any[] = [];
14559
+
14560
+ //console.log('reporter comments 2', reportercomments);
14561
+
14562
+ // if(docsOptional.length === 0) {
14563
+ // docs = (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.selectedValues();
14564
+ // }
14565
+
14566
+ //console.log('docs', docs);
14567
+ let reportformatvalues: string = "";
14568
+ let reportformatschema: string = "";
14569
+ if (listEvent.customreporting != null) {
14570
+ let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
14571
+ console.log('reportformatvalues', JSON.stringify(reportingReporting.selectedValues()))
14572
+ reportformatvalues = JSON.stringify(reportingReporting!.selectedValues()) ?? "";
14573
+ reportformatschema = reportingReporting!.configjson ?? "";
14574
+ }
14575
+
14576
+ let percentage: string = "100";
14577
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement) != null) {
14578
+ percentage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement).value
14579
+ }
14580
+ // if (Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
14581
+
14582
+ // //console.log('reporter comments 3', reportercomments);
14583
+ // buttonClick.innerHTML = "Save"
14584
+ // this.setError('Invalid Percentage!');
14585
+ // setTimeout(() => {
14586
+ // this.clearMessages();
14587
+ // }, 3000);
14588
+
14589
+ // } else {
14590
+ // if (docs.length === 0 && docsOptional.length === 0) {
14591
+
14592
+ // //console.log('reporter comments 3', reportercomments);
14593
+ // buttonClick.innerHTML = "Save"
14594
+ // this.setError('No documents uploaded!');
14595
+ // setTimeout(() => {
14596
+ // this.clearMessages();
14597
+ // }, 3000);
14598
+
14599
+ // } else {
14600
+
14601
+ // //console.log('reporterdoc', reporterdoc);
14602
+
14603
+ // if (reporterdoc.length === 0) {
14604
+ // buttonClick.innerHTML = "Save"
14605
+ // this.setError('Date of completion not selected!');
14606
+ // setTimeout(() => {
14607
+ // this.clearMessages();
14608
+ // }, 3000);
14609
+
14610
+ // } else if (parseInt(reporterdoc) > new Date().getTime()) {
14611
+ // buttonClick.innerHTML = "Save"
14612
+ // this.setError('Date of completion cannot be in future!');
14613
+ // setTimeout(() => {
14614
+ // this.clearMessages();
14615
+ // }, 3000);
14616
+
14617
+ // } else {
14618
+
14619
+ //console.log('makerscheckers 1', reportercomments);
14620
+
14621
+ if (reportercomments.trim().length === 0) {
14622
+ buttonClick.innerHTML = "Save"
14623
+ this.setError('Comments cannot be blank!');
14624
+ setTimeout(() => {
14625
+ this.clearMessages();
14626
+ }, 3000);
14627
+
14628
+ } else {
14629
+
14630
+
14631
+ var clickEvent = new MouseEvent("click", {
14632
+ "view": window,
14633
+ "bubbles": true,
14634
+ "cancelable": false
14635
+ });
14636
+
14637
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
14638
+ let flagBulk = false;
14639
+ if (this.selectedItemIds.length <= 1) {
14640
+
14641
+ if (await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, listEvent.module, percentage, makercheckers)) {
14642
+ console.log('this.events', this.events);
14643
+ for (var p = 0; p < this.events[mmdd].length; p++) {
14644
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
14645
+ this.events[mmdd][p].documents = docs
14646
+ this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() })
14647
+ this.events[mmdd][p].lastupdated = new Date().toString()
14648
+ }
14649
+ }
14650
+ console.log('uploadReport single')
14651
+ if (makercheckers.length > 0) {
14652
+
14653
+ // await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
14654
+ for (var p = 0; p < this.events[mmdd].length; p++) {
14655
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
14656
+ this.events[mmdd][p].approved = true
14657
+ this.events[mmdd][p].terminated = (JSON.parse(reportformatvalues).terminated) ?? false
14658
+ // this.events[mmdd][p].documents = docs
14659
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() })
14660
+ this.events[mmdd][p].lastupdated = new Date().toString()
14661
+ }
14662
+ }
14663
+ await this.renewContract(listEvent, reportformatvalues);
14664
+ console.log('upload report auto approve single')
14665
+ }
14666
+ if (this.recentlyReported[mmdd] == null) {
14667
+ this.recentlyReported[mmdd] = []
14668
+ }
14669
+ this.recentlyReported[mmdd].push(listEvent)
14670
+ }
14671
+ } else {
14672
+ let bulkBody = []
14673
+ let bulkBodyReview = []
14674
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
14675
+
14676
+ const selectedId = this.selectedItemIds[k];
14677
+ //console.log('selectedid', selectedId);
14678
+
14679
+ const makercheckersL = selectedId.split('-')[5];
14680
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
14681
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
14682
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
14683
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
14684
+
14685
+ //console.log(entityId, locationId, eventId, mmddyyyy);
14686
+
14687
+ // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
14688
+ // if(parseInt(makercheckersL) > 0) {
14689
+ // bulkBodyReview.push({
14690
+ // "mmddyyyy": mmddyyyy,
14691
+ // "projectid": this.projectId,
14692
+ // "type": "report",
14693
+ // "eventid": eventId,
14694
+ // "comments": reportercomments,
14695
+ // "dateofcompletion": reporterdoc,
14696
+ // "percentage": percentage,
14697
+ // "entityid": entityId,
14698
+ // "locationid": locationId,
14699
+ // "event": null,
14700
+ // "docs": JSON.stringify(docs),
14701
+ // "approved": true,
14702
+ // "username": this.userName,
14703
+ // "reportformatvalues": reportformatvalues,
14704
+ // "reportformatschema": reportformatschema,
14705
+ // "userid": this.userProfileId,
14706
+ // "userrole": this.myRole,
14707
+ // "year": this.calendarStartYYYY,
14708
+ // "module": listEvent.module ?? "compliance"
14709
+ // } )
14710
+ // // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
14711
+
14712
+ // }else{
14713
+ bulkBody.push({
14714
+ "mmddyyyy": mmddyyyy,
14715
+ "projectid": this.projectId,
14716
+ "type": "report",
14717
+ "eventid": eventId,
14718
+ "comments": reportercomments,
14719
+ "dateofcompletion": reporterdoc,
14720
+ "percentage": percentage,
14721
+ "entityid": entityId,
14722
+ "locationid": locationId,
14723
+ "event": null,
14724
+ "docs": JSON.stringify(docs),
14725
+ "username": this.userName,
14726
+ "reportformatvalues": reportformatvalues,
14727
+ "reportformatschema": reportformatschema,
14728
+ "userid": this.userProfileId,
14729
+ "userrole": this.myRole,
14730
+ "year": this.calendarStartYYYY,
14731
+ "module": listEvent.module ?? "compliance",
14732
+ "makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
14733
+ })
14734
+ // }
14735
+
14736
+ // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
14737
+ // await this.sleep(2000);
14738
+ // this.clearMessages();
14739
+
14740
+ }
14741
+
14742
+ // await this.uploadReportsBulk(bulkBody);
14743
+ // await this.fetchBulkReportingData();
14744
+ if (bulkBody.length > 0) {
14745
+ await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
14746
+ }
14747
+
14748
+ // if(bulkBodyReview.length > 0){
14749
+ // await this.uploadReportsReviewsBulk(bulkBodyReview)
14750
+ // }
14751
+ await this.fetchBulkReportingData();
14752
+ console.log('uploadReport bulk')
14753
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
14754
+
14755
+ const selectedId = this.selectedItemIds[k];
14756
+ //console.log('selectedid', selectedId);
14757
+ let entityId = selectedId.split('-')[7].replace(/_/g, '-');
14758
+ let locationId = selectedId.split('-')[8].replace(/_/g, '-');
14759
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
14760
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
14761
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
14762
+ for (var p = 0; p < this.events[mmdd].length; p++) {
14763
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
14764
+
14765
+ this.events[mmdd][p].isbulk = true
14766
+ flagBulk = true;
14767
+ if (this.recentlyReported[mmdd] == null) {
14768
+ this.recentlyReported[mmdd] = []
14769
+ }
14770
+ this.recentlyReported[mmdd].push(this.events[mmdd][p])
14771
+ }
13713
14772
  }
14773
+ }
13714
14774
 
14775
+ }
13715
14776
 
14777
+ if (this.mode == "next") {
14778
+ this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
14779
+ } else {
14780
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
14781
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
14782
+ // } else
14783
+ if (this.getCurrentTab() == this.TAB_FIND) {
14784
+ const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
14785
+ this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
14786
+ } else {
14787
+ if (this.selectedItemIds.length > 0) {
14788
+ await this.fetchBulkReportingData();
14789
+ }
14790
+ this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk)
14791
+ // if(currentColumnButton != null) {
14792
+ // currentColumnButton.click();
14793
+ // }
13716
14794
  }
13717
14795
  }
14796
+
13718
14797
  }
14798
+
14799
+
14800
+ // }
14801
+ // }
14802
+ // }
13719
14803
  });
13720
14804
 
13721
14805
  }
@@ -13815,15 +14899,16 @@ export class SfIEvents extends LitElement {
13815
14899
 
13816
14900
  }
13817
14901
  }
13818
- fetchContractDetails = async (listEvent: any, mmddyyyy: string) => {
14902
+
14903
+ fetchLicenseDetails = async (listEvent: any, mmddyyyy: string) => {
13819
14904
  let entityId = listEvent.entityid;
13820
14905
  let locationId = listEvent.locationid;
13821
- let url = "https://" + this.apiIdAgreements + "/getallobjectdetails";
14906
+ let url = "https://" + this.apiIdLicenses + "/getallobjectdetails";
13822
14907
 
13823
- //console.log('fetch calendar url', url);
14908
+ console.log('fetch license details url', url);
13824
14909
  let urlBody: any = { projectid: this.projectId, objectid: listEvent.id, entityid: entityId, locationid: locationId, userprofileid: this.userProfileId, role: this.myRole, year: this.calendarStartYYYY, mmddyyyy: mmddyyyy };
13825
14910
 
13826
- //console.log('urlbody', urlBody);
14911
+ console.log('fetch license details urlbody', urlBody);
13827
14912
 
13828
14913
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
13829
14914
  const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
@@ -13832,7 +14917,7 @@ export class SfIEvents extends LitElement {
13832
14917
 
13833
14918
  const jsonRespose = JSON.parse(xhr.responseText);
13834
14919
  console.log('jsonRespose agreement details', jsonRespose);
13835
- this.renderContractDetails(jsonRespose.object, mmddyyyy)
14920
+ this.renderLicenseDetails(jsonRespose.object, mmddyyyy)
13836
14921
  } else {
13837
14922
  if (xhr.status == 401) {
13838
14923
  let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
@@ -13846,9 +14931,9 @@ export class SfIEvents extends LitElement {
13846
14931
 
13847
14932
  }
13848
14933
 
13849
- renewContract = async (listEvent: any, reportformatvalues: any) => {
14934
+ renewLicense = async (listEvent: any, reportformatvalues: any) => {
13850
14935
 
13851
- let url = "https://" + this.apiIdAgreements + "/reopen";
14936
+ let url = "https://" + this.apiIdLicenses + "/reopen";
13852
14937
 
13853
14938
  console.log('renewing', reportformatvalues)
13854
14939
  //console.log('fetch calendar url', url);
@@ -13872,7 +14957,7 @@ export class SfIEvents extends LitElement {
13872
14957
 
13873
14958
  }
13874
14959
  }
13875
- renderContractDetails = async (listEvent: any, mmddyyyy: string) => {
14960
+ renderLicenseDetails = async (listEvent: any, mmddyyyy: string) => {
13876
14961
  // await this.fetchAgreementDetails(listEvent, mmddyyyy);
13877
14962
  // return;
13878
14963
  let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
@@ -13888,7 +14973,7 @@ export class SfIEvents extends LitElement {
13888
14973
  html += `
13889
14974
  <div part="compliance-detail-title" class="d-flex justify-between">
13890
14975
  <button part="button-icon" class="material-icons invisible">close</button>
13891
- <h3 part="results-title" class="m-0">Agreement Details</h3>
14976
+ <h3 part="results-title" class="m-0">License Details</h3>
13892
14977
  <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
13893
14978
  </div>
13894
14979
  `
@@ -13896,12 +14981,13 @@ export class SfIEvents extends LitElement {
13896
14981
  <div class="box-large" id="shimmer-container-agreements" part="shimmer-container-agreements">
13897
14982
  </div>
13898
14983
  `
13899
- 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="Contract Details" apiiduploader="1peg5170d3" apiid="' + this.apiIdAgreements + '" mode="admin" flow="details" projectid="' + this.projectId + '" projectname="' + this.projectName + '" editdisable="true" formviewclass="flex-wrap"></sf-i-reporting>';
13900
-
13901
- html += '<div part="reporting-view-container">'
14984
+ 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="License Details" apiiduploader="1peg5170d3" apiid="' + this.apiIdLicenses + '" mode="admin" flow="details" projectid="' + this.projectId + '" projectname="' + this.projectName + '" editdisable="true" formviewclass="flex-wrap"></sf-i-reporting>';
14985
+ if (this.mode != "viewer") {
14986
+ html += '<div part="reporting-view-container">'
13902
14987
 
13903
- html += this.renderReporting(listEvent, mmddyyyy);
13904
- html += "</div>"
14988
+ html += this.renderReporting(listEvent, mmddyyyy);
14989
+ html += "</div>"
14990
+ }
13905
14991
 
13906
14992
  html += '<div class="d-flex justify-between m-20">';
13907
14993
  html += '<h3 part="results-title" class="m-0"><br />Comments</h3>';
@@ -13960,6 +15046,7 @@ export class SfIEvents extends LitElement {
13960
15046
  sfireporting.editdisable = "true"
13961
15047
  setTimeout(() => {
13962
15048
  console.log('sfireporting', sfireporting._SfReportingContainer);
15049
+ console.log('sfireporting', sfireporting.selectedItem);
13963
15050
  sfireporting.loadMode();
13964
15051
  }, 500);
13965
15052
 
@@ -13976,7 +15063,7 @@ export class SfIEvents extends LitElement {
13976
15063
  reportingSchemaJson = listEvent.customreporting
13977
15064
  }
13978
15065
  if (listEvent.customreporting != null || listEvent.reportformatschema != null) {
13979
- 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="Contract Reporting" formviewclass="flex-wrap" showterminate="true" projectid="' + this.projectId + '"></sf-i-reporting>'
15066
+ 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="License Reporting" formviewclass="flex-wrap" showterminate="true" projectid="' + this.projectId + '"></sf-i-reporting>'
13980
15067
 
13981
15068
  let reportFormatContainer = (this._SfDetailContainer as HTMLDivElement).querySelector('#report-format-container') as HTMLDivElement;
13982
15069
  if (reportFormatContainer != null) {
@@ -14094,9 +15181,9 @@ export class SfIEvents extends LitElement {
14094
15181
  let flagBulk = false;
14095
15182
  if (this.selectedItemIds.length <= 1) {
14096
15183
  console.log('mmddyyyy', mmddyyyy)
14097
- if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
15184
+ if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "compliance")) {
14098
15185
  if (approved) {
14099
- await this.renewContract(listEvent, reportformatvalues);
15186
+ await this.renewLicense(listEvent, reportformatvalues);
14100
15187
  } else {
14101
15188
  console.log('renew reporting', reportformatvalues)
14102
15189
  }
@@ -14139,7 +15226,7 @@ export class SfIEvents extends LitElement {
14139
15226
  "userid": this.userProfileId,
14140
15227
  "userrole": this.myRole,
14141
15228
  "year": this.calendarStartYYYY,
14142
- "module": listEvent.module ?? "events"
15229
+ "module": listEvent.module ?? "compliance"
14143
15230
  })
14144
15231
  // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, comments, approved)
14145
15232
 
@@ -14233,7 +15320,7 @@ export class SfIEvents extends LitElement {
14233
15320
  let flagBulk = false;
14234
15321
  if (this.selectedItemIds.length <= 1) {
14235
15322
 
14236
- if (await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
15323
+ if (await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "compliance")) {
14237
15324
  for (var p = 0; p < this.events[mmdd].length; p++) {
14238
15325
  if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
14239
15326
  this.events[mmdd][p].approved = approved
@@ -14273,7 +15360,7 @@ export class SfIEvents extends LitElement {
14273
15360
  "userid": this.userProfileId,
14274
15361
  "userrole": this.myRole,
14275
15362
  "year": this.calendarStartYYYY,
14276
- "module": listEvent.module ?? "events"
15363
+ "module": listEvent.module ?? "compliance"
14277
15364
  })
14278
15365
  // await this.uploadAudit(entityId, locationId, mmddyyyy, eventId, comments, approved);
14279
15366
 
@@ -14468,7 +15555,7 @@ export class SfIEvents extends LitElement {
14468
15555
  this.events[mmdd][p].lastupdated = new Date().toString()
14469
15556
  }
14470
15557
  }
14471
- await this.renewContract(listEvent, reportformatvalues);
15558
+ await this.renewLicense(listEvent, reportformatvalues);
14472
15559
  console.log('upload report auto approve single')
14473
15560
  }
14474
15561
  if (this.recentlyReported[mmdd] == null) {
@@ -14513,7 +15600,7 @@ export class SfIEvents extends LitElement {
14513
15600
  // "userid": this.userProfileId,
14514
15601
  // "userrole": this.myRole,
14515
15602
  // "year": this.calendarStartYYYY,
14516
- // "module": listEvent.module ?? "events"
15603
+ // "module": listEvent.module ?? "compliance"
14517
15604
  // } )
14518
15605
  // // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
14519
15606
 
@@ -14536,7 +15623,7 @@ export class SfIEvents extends LitElement {
14536
15623
  "userid": this.userProfileId,
14537
15624
  "userrole": this.myRole,
14538
15625
  "year": this.calendarStartYYYY,
14539
- "module": listEvent.module ?? "events",
15626
+ "module": listEvent.module ?? "compliance",
14540
15627
  "makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
14541
15628
  })
14542
15629
  // }
@@ -14707,15 +15794,16 @@ export class SfIEvents extends LitElement {
14707
15794
 
14708
15795
  }
14709
15796
  }
14710
- fetchLicenseDetails = async (listEvent: any, mmddyyyy: string) => {
15797
+
15798
+ fetchRCMResourceDetails = async (listEvent: any, mmddyyyy: string) => {
14711
15799
  let entityId = listEvent.entityid;
14712
15800
  let locationId = listEvent.locationid;
14713
- let url = "https://" + this.apiIdLicenses + "/getallobjectdetails";
15801
+ let url = "https://" + this.apiIdRCMResources + "/getallobjectdetails";
14714
15802
 
14715
- console.log('fetch license details url', url);
15803
+ console.log('fetch rcm resource details url', url);
14716
15804
  let urlBody: any = { projectid: this.projectId, objectid: listEvent.id, entityid: entityId, locationid: locationId, userprofileid: this.userProfileId, role: this.myRole, year: this.calendarStartYYYY, mmddyyyy: mmddyyyy };
14717
15805
 
14718
- console.log('fetch license details urlbody', urlBody);
15806
+ console.log('fetch rcm resource details urlbody', urlBody);
14719
15807
 
14720
15808
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
14721
15809
  const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
@@ -14724,7 +15812,7 @@ export class SfIEvents extends LitElement {
14724
15812
 
14725
15813
  const jsonRespose = JSON.parse(xhr.responseText);
14726
15814
  console.log('jsonRespose agreement details', jsonRespose);
14727
- this.renderLicenseDetails(jsonRespose.object, mmddyyyy)
15815
+ this.renderRCMResourceDetails(jsonRespose.object, mmddyyyy)
14728
15816
  } else {
14729
15817
  if (xhr.status == 401) {
14730
15818
  let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
@@ -14738,14 +15826,14 @@ export class SfIEvents extends LitElement {
14738
15826
 
14739
15827
  }
14740
15828
 
14741
- renewLicense = async (listEvent: any, reportformatvalues: any) => {
15829
+ renewRCMResource = async (listEvent: any, reportformatvalues: any) => {
14742
15830
 
14743
- let url = "https://" + this.apiIdLicenses + "/reopen";
15831
+ let url = "https://" + this.apiIdRCMResources + "/reopen";
14744
15832
 
14745
15833
  console.log('renewing', reportformatvalues)
14746
15834
  //console.log('fetch calendar url', url);
14747
15835
  let urlBody: any = { projectid: this.projectId, objectid: listEvent.id, newvalues: reportformatvalues == "" ? null : JSON.parse(reportformatvalues), published: true, terminated: (JSON.parse(reportformatvalues).terminated ?? false) };
14748
- // console.log('reopen body', url, urlBody)
15836
+ console.log('reopen body', url, urlBody)
14749
15837
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
14750
15838
  const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
14751
15839
  this._SfLoader.innerHTML = '';
@@ -14764,7 +15852,7 @@ export class SfIEvents extends LitElement {
14764
15852
 
14765
15853
  }
14766
15854
  }
14767
- renderLicenseDetails = async (listEvent: any, mmddyyyy: string) => {
15855
+ renderRCMResourceDetails = async (listEvent: any, mmddyyyy: string) => {
14768
15856
  // await this.fetchAgreementDetails(listEvent, mmddyyyy);
14769
15857
  // return;
14770
15858
  let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
@@ -14780,7 +15868,7 @@ export class SfIEvents extends LitElement {
14780
15868
  html += `
14781
15869
  <div part="compliance-detail-title" class="d-flex justify-between">
14782
15870
  <button part="button-icon" class="material-icons invisible">close</button>
14783
- <h3 part="results-title" class="m-0">License Details</h3>
15871
+ <h3 part="results-title" class="m-0">RCM Resource Details</h3>
14784
15872
  <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
14785
15873
  </div>
14786
15874
  `
@@ -14788,12 +15876,13 @@ export class SfIEvents extends LitElement {
14788
15876
  <div class="box-large" id="shimmer-container-agreements" part="shimmer-container-agreements">
14789
15877
  </div>
14790
15878
  `
14791
- 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="License Details" apiiduploader="1peg5170d3" apiid="' + this.apiIdLicenses + '" mode="admin" flow="details" projectid="' + this.projectId + '" projectname="' + this.projectName + '" editdisable="true" formviewclass="flex-wrap"></sf-i-reporting>';
14792
-
14793
- html += '<div part="reporting-view-container">'
15879
+ 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>';
15880
+ if (this.mode != "viewer") {
15881
+ html += '<div part="reporting-view-container">'
14794
15882
 
14795
- html += this.renderReporting(listEvent, mmddyyyy);
14796
- html += "</div>"
15883
+ html += this.renderReporting(listEvent, mmddyyyy);
15884
+ html += "</div>"
15885
+ }
14797
15886
 
14798
15887
  html += '<div class="d-flex justify-between m-20">';
14799
15888
  html += '<h3 part="results-title" class="m-0"><br />Comments</h3>';
@@ -14869,7 +15958,7 @@ export class SfIEvents extends LitElement {
14869
15958
  reportingSchemaJson = listEvent.customreporting
14870
15959
  }
14871
15960
  if (listEvent.customreporting != null || listEvent.reportformatschema != null) {
14872
- 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="License Reporting" formviewclass="flex-wrap" showterminate="true" projectid="' + this.projectId + '"></sf-i-reporting>'
15961
+ 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>'
14873
15962
 
14874
15963
  let reportFormatContainer = (this._SfDetailContainer as HTMLDivElement).querySelector('#report-format-container') as HTMLDivElement;
14875
15964
  if (reportFormatContainer != null) {
@@ -14987,9 +16076,9 @@ export class SfIEvents extends LitElement {
14987
16076
  let flagBulk = false;
14988
16077
  if (this.selectedItemIds.length <= 1) {
14989
16078
  console.log('mmddyyyy', mmddyyyy)
14990
- if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
16079
+ if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "compliance")) {
14991
16080
  if (approved) {
14992
- await this.renewLicense(listEvent, reportformatvalues);
16081
+ await this.renewRCMResource(listEvent, reportformatvalues);
14993
16082
  } else {
14994
16083
  console.log('renew reporting', reportformatvalues)
14995
16084
  }
@@ -15032,7 +16121,7 @@ export class SfIEvents extends LitElement {
15032
16121
  "userid": this.userProfileId,
15033
16122
  "userrole": this.myRole,
15034
16123
  "year": this.calendarStartYYYY,
15035
- "module": listEvent.module ?? "events"
16124
+ "module": listEvent.module ?? "compliance"
15036
16125
  })
15037
16126
  // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, comments, approved)
15038
16127
 
@@ -15126,7 +16215,7 @@ export class SfIEvents extends LitElement {
15126
16215
  let flagBulk = false;
15127
16216
  if (this.selectedItemIds.length <= 1) {
15128
16217
 
15129
- if (await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
16218
+ if (await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "compliance")) {
15130
16219
  for (var p = 0; p < this.events[mmdd].length; p++) {
15131
16220
  if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
15132
16221
  this.events[mmdd][p].approved = approved
@@ -15166,7 +16255,7 @@ export class SfIEvents extends LitElement {
15166
16255
  "userid": this.userProfileId,
15167
16256
  "userrole": this.myRole,
15168
16257
  "year": this.calendarStartYYYY,
15169
- "module": listEvent.module ?? "events"
16258
+ "module": listEvent.module ?? "compliance"
15170
16259
  })
15171
16260
  // await this.uploadAudit(entityId, locationId, mmddyyyy, eventId, comments, approved);
15172
16261
 
@@ -15361,7 +16450,7 @@ export class SfIEvents extends LitElement {
15361
16450
  this.events[mmdd][p].lastupdated = new Date().toString()
15362
16451
  }
15363
16452
  }
15364
- await this.renewLicense(listEvent, reportformatvalues);
16453
+ await this.renewRCMResource(listEvent, reportformatvalues);
15365
16454
  console.log('upload report auto approve single')
15366
16455
  }
15367
16456
  if (this.recentlyReported[mmdd] == null) {
@@ -15406,7 +16495,7 @@ export class SfIEvents extends LitElement {
15406
16495
  // "userid": this.userProfileId,
15407
16496
  // "userrole": this.myRole,
15408
16497
  // "year": this.calendarStartYYYY,
15409
- // "module": listEvent.module ?? "events"
16498
+ // "module": listEvent.module ?? "compliance"
15410
16499
  // } )
15411
16500
  // // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
15412
16501
 
@@ -15429,7 +16518,7 @@ export class SfIEvents extends LitElement {
15429
16518
  "userid": this.userProfileId,
15430
16519
  "userrole": this.myRole,
15431
16520
  "year": this.calendarStartYYYY,
15432
- "module": listEvent.module ?? "events",
16521
+ "module": listEvent.module ?? "compliance",
15433
16522
  "makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
15434
16523
  })
15435
16524
  // }
@@ -15966,11 +17055,12 @@ export class SfIEvents extends LitElement {
15966
17055
 
15967
17056
  html += '</div>';
15968
17057
 
15969
- if (this.mode == "consumer" || this.mode == "next") {
15970
-
15971
- html += '<div part="reporting-view-container">'
15972
- html += this.renderReporting(event, mmddyyyy);
15973
- html += "</div>"
17058
+ if (this.mode == "consumer" || this.mode == "next" || this.mode == "viewer") {
17059
+ if (this.mode != "viewer") {
17060
+ html += '<div part="reporting-view-container">'
17061
+ html += this.renderReporting(event, mmddyyyy);
17062
+ html += "</div>"
17063
+ }
15974
17064
 
15975
17065
  html += '<div class="d-flex justify-between m-20">';
15976
17066
  html += '<h3 part="results-title" class="m-0"><br />Comments</h3>';
@@ -16059,6 +17149,12 @@ export class SfIEvents extends LitElement {
16059
17149
  // for(let attachmentUploader of attachmentUploaders){
16060
17150
  // attachmentUploader.loadMode();
16061
17151
  // }
17152
+ if (this.mode != "viewer") {
17153
+ let ddmmyyyy = mmddyyyy.split('/')[1] + '/' + mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[2];
17154
+
17155
+ 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">Reporter</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.reporters[0].split(';')[0]}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Approver</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.approvers[0].split(';')[0]}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Due Date</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${ddmmyyyy}</td></tr></tbody></table>`;
17156
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader).emailcontent = emailcontent;
17157
+ }
16062
17158
  (this._SfDetailContainer as HTMLDivElement).querySelector('.button-delete')?.addEventListener('click', async () => {
16063
17159
 
16064
17160
  await this.fetchDeleteReview(event["id"], mmddyyyy, entityId, locationId);
@@ -16085,7 +17181,7 @@ export class SfIEvents extends LitElement {
16085
17181
  });
16086
17182
  (this._SfDetailContainer as HTMLDivElement).querySelector('#button-auto-approve')?.addEventListener('click', async () => {
16087
17183
  if (this.selectedItemIds.length <= 1) {
16088
- await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.module ?? "events");
17184
+ await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.module ?? "compliance");
16089
17185
  this.setSuccess('Auto-Approved successfully!')
16090
17186
  setTimeout(() => {
16091
17187
  this.clearMessages()
@@ -16115,7 +17211,7 @@ export class SfIEvents extends LitElement {
16115
17211
  "userid": this.userProfileId,
16116
17212
  "userrole": this.myRole,
16117
17213
  "year": this.calendarStartYYYY,
16118
- "module": event.module ?? "events"
17214
+ "module": event.module ?? "compliance"
16119
17215
  })
16120
17216
  }
16121
17217
  await this.uploadReviewsBulk(bulkBodyReview);
@@ -16342,7 +17438,7 @@ export class SfIEvents extends LitElement {
16342
17438
  let flagBulk = false;
16343
17439
  if (this.selectedItemIds.length <= 1) {
16344
17440
  // console.log('mmddyyyy', mmddyyyy)
16345
- if (await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved, event.module ?? "events")) {
17441
+ if (await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved, event.module ?? "compliance")) {
16346
17442
  for (var p = 0; p < this.events[mmdd].length; p++) {
16347
17443
  if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16348
17444
 
@@ -16380,7 +17476,7 @@ export class SfIEvents extends LitElement {
16380
17476
  "userid": this.userProfileId,
16381
17477
  "userrole": this.myRole,
16382
17478
  "year": this.calendarStartYYYY,
16383
- "module": event.module ?? "events"
17479
+ "module": event.module ?? "compliance"
16384
17480
  })
16385
17481
  // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, comments, approved)
16386
17482
 
@@ -16474,7 +17570,7 @@ export class SfIEvents extends LitElement {
16474
17570
  let flagBulk = false;
16475
17571
  if (this.selectedItemIds.length <= 1) {
16476
17572
 
16477
- if (await this.uploadAudit(entityId, locationId, mmddyyyy, event["id"], comments, approved, event.module ?? "events")) {
17573
+ if (await this.uploadAudit(entityId, locationId, mmddyyyy, event["id"], comments, approved, event.module ?? "compliance")) {
16478
17574
  for (var p = 0; p < this.events[mmdd].length; p++) {
16479
17575
  if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16480
17576
  this.events[mmdd][p].approved = approved
@@ -16513,7 +17609,7 @@ export class SfIEvents extends LitElement {
16513
17609
  "userid": this.userProfileId,
16514
17610
  "userrole": this.myRole,
16515
17611
  "year": this.calendarStartYYYY,
16516
- "module": event.module ?? "events"
17612
+ "module": event.module ?? "compliance"
16517
17613
  })
16518
17614
  // await this.uploadAudit(entityId, locationId, mmddyyyy, eventId, comments, approved);
16519
17615
 
@@ -16684,7 +17780,7 @@ export class SfIEvents extends LitElement {
16684
17780
  //console.log('makerscheckers', makercheckers, reportercomments);
16685
17781
  // console.log('reportformatvalues', reportformatvalues)
16686
17782
  // console.log('reportformatschema',reportformatschema)
16687
- if (await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.module ?? "events", percentage, makercheckers)) {
17783
+ if (await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.module ?? "compliance", percentage, makercheckers)) {
16688
17784
  console.log('this.events', this.events);
16689
17785
  for (var p = 0; p < this.events[mmdd].length; p++) {
16690
17786
  if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
@@ -16695,7 +17791,7 @@ export class SfIEvents extends LitElement {
16695
17791
  }
16696
17792
  if (makercheckers.length > 0) {
16697
17793
 
16698
- // await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.module ?? "events");
17794
+ // await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.module ?? "compliance");
16699
17795
  for (var p = 0; p < this.events[mmdd].length; p++) {
16700
17796
  if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16701
17797
  this.events[mmdd][p].approved = true
@@ -16742,7 +17838,7 @@ export class SfIEvents extends LitElement {
16742
17838
  // "userid": this.userProfileId,
16743
17839
  // "userrole": this.myRole,
16744
17840
  // "year": this.calendarStartYYYY,
16745
- // "module": event.module ?? "events"
17841
+ // "module": event.module ?? "compliance"
16746
17842
  // })
16747
17843
  // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
16748
17844
  // if(parseInt(makercheckersL) > 0) {
@@ -16765,7 +17861,7 @@ export class SfIEvents extends LitElement {
16765
17861
  // "userid": this.userProfileId,
16766
17862
  // "userrole": this.myRole,
16767
17863
  // "year": this.calendarStartYYYY,
16768
- // "module": event.module ?? "events"
17864
+ // "module": event.module ?? "compliance"
16769
17865
  // } )
16770
17866
  // // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
16771
17867
 
@@ -16788,7 +17884,7 @@ export class SfIEvents extends LitElement {
16788
17884
  "userid": this.userProfileId,
16789
17885
  "userrole": this.myRole,
16790
17886
  "year": this.calendarStartYYYY,
16791
- "module": event.module ?? "events",
17887
+ "module": event.module ?? "compliance",
16792
17888
  "makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
16793
17889
  })
16794
17890
  // }
@@ -18383,7 +19479,7 @@ export class SfIEvents extends LitElement {
18383
19479
  let tempObj = taggingArray.data.mappings.mappings[i]
18384
19480
  delete tempObj['delta'];
18385
19481
  delete tempObj['lastupdated'];
18386
- 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){
19482
+ 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) {
18387
19483
  console.log('changed onboarding item', tempObj, obj, JSON.stringify(tempObj) !== JSON.stringify(obj))
18388
19484
  }
18389
19485
  if (JSON.stringify(tempObj) !== JSON.stringify(obj)) {
@@ -19711,7 +20807,7 @@ export class SfIEvents extends LitElement {
19711
20807
 
19712
20808
  //console.log('rendering triggers...', (this._SfOnboardingTriggersContainer as HTMLDivElement).innerHTML);
19713
20809
 
19714
- 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, "", "");
20810
+ 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, "", "");
19715
20811
 
19716
20812
  }
19717
20813
 
@@ -19724,7 +20820,7 @@ export class SfIEvents extends LitElement {
19724
20820
 
19725
20821
  (this._SfOnboardingInternalControlsContainer as HTMLDivElement).innerHTML = html;
19726
20822
 
19727
- 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, "", "");
20823
+ 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, "", "");
19728
20824
 
19729
20825
  }
19730
20826
 
@@ -19737,7 +20833,7 @@ export class SfIEvents extends LitElement {
19737
20833
 
19738
20834
  (this._SfOnboardingActivationsContainer as HTMLDivElement).innerHTML = html;
19739
20835
 
19740
- 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, "", "");
20836
+ 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, "", "");
19741
20837
 
19742
20838
  }
19743
20839
 
@@ -19750,7 +20846,7 @@ export class SfIEvents extends LitElement {
19750
20846
 
19751
20847
  (this._SfOnboardingInvalidationsContainer as HTMLDivElement).innerHTML = html;
19752
20848
 
19753
- 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, "", "");
20849
+ 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, "", "");
19754
20850
 
19755
20851
  }
19756
20852
 
@@ -19763,7 +20859,7 @@ export class SfIEvents extends LitElement {
19763
20859
 
19764
20860
  (this._SfOnboardingAlertSchedulesContainer as HTMLDivElement).innerHTML = html;
19765
20861
 
19766
- 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, "", "");
20862
+ 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, "", "");
19767
20863
 
19768
20864
  }
19769
20865
 
@@ -19776,7 +20872,7 @@ export class SfIEvents extends LitElement {
19776
20872
 
19777
20873
  (this._SfOnboardingExtensionsContainer as HTMLDivElement).innerHTML = html;
19778
20874
 
19779
- 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, "", "");
20875
+ 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, "", "");
19780
20876
 
19781
20877
  }
19782
20878
 
@@ -19789,7 +20885,7 @@ export class SfIEvents extends LitElement {
19789
20885
 
19790
20886
  (this._SfOnboardingDuedatesContainer as HTMLDivElement).innerHTML = html;
19791
20887
 
19792
- 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, "", "");
20888
+ 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, "", "");
19793
20889
 
19794
20890
  }
19795
20891
 
@@ -19802,7 +20898,7 @@ export class SfIEvents extends LitElement {
19802
20898
 
19803
20899
  (this._SfOnboardingReportersContainer as HTMLDivElement).innerHTML = html;
19804
20900
 
19805
- 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", "");
20901
+ 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", "");
19806
20902
 
19807
20903
  }
19808
20904
 
@@ -19815,7 +20911,7 @@ export class SfIEvents extends LitElement {
19815
20911
 
19816
20912
  (this._SfOnboardingApproversContainer as HTMLDivElement).innerHTML = html;
19817
20913
 
19818
- 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", "");
20914
+ 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", "");
19819
20915
 
19820
20916
  }
19821
20917
 
@@ -19828,7 +20924,7 @@ export class SfIEvents extends LitElement {
19828
20924
 
19829
20925
  (this._SfOnboardingFunctionHeadsContainer as HTMLDivElement).innerHTML = html;
19830
20926
 
19831
- 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", "");
20927
+ 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", "");
19832
20928
 
19833
20929
  }
19834
20930
 
@@ -19841,7 +20937,7 @@ export class SfIEvents extends LitElement {
19841
20937
 
19842
20938
  (this._SfOnboardingMakerCheckersContainer as HTMLDivElement).innerHTML = html;
19843
20939
 
19844
- 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, "", "");
20940
+ 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, "", "");
19845
20941
 
19846
20942
  }
19847
20943
 
@@ -19854,7 +20950,7 @@ export class SfIEvents extends LitElement {
19854
20950
 
19855
20951
  (this._SfOnboardingDocsContainer as HTMLDivElement).innerHTML = html;
19856
20952
 
19857
- 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, "", "");
20953
+ 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, "", "");
19858
20954
 
19859
20955
  }
19860
20956
 
@@ -19869,7 +20965,7 @@ export class SfIEvents extends LitElement {
19869
20965
 
19870
20966
  (this._SfOnboardingAuditorsContainer as HTMLDivElement).innerHTML = html;
19871
20967
 
19872
- 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", "");
20968
+ 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", "");
19873
20969
 
19874
20970
  }
19875
20971
 
@@ -19884,7 +20980,7 @@ export class SfIEvents extends LitElement {
19884
20980
 
19885
20981
  (this._SfOnboardingViewersContainer as HTMLDivElement).innerHTML = html;
19886
20982
 
19887
- 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", "");
20983
+ 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", "");
19888
20984
 
19889
20985
  }
19890
20986
 
@@ -19897,7 +20993,7 @@ export class SfIEvents extends LitElement {
19897
20993
 
19898
20994
  (this._SfOnboardingTagsContainer as HTMLDivElement).innerHTML = html;
19899
20995
 
19900
- 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, "", "");
20996
+ 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, "", "");
19901
20997
 
19902
20998
  }
19903
20999
 
@@ -19918,7 +21014,7 @@ export class SfIEvents extends LitElement {
19918
21014
 
19919
21015
  (this._SfOnboardingFunctionsContainer as HTMLDivElement).innerHTML = html;
19920
21016
 
19921
- 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, "", "");
21017
+ 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, "", "");
19922
21018
 
19923
21019
  }
19924
21020
 
@@ -21552,6 +22648,8 @@ export class SfIEvents extends LitElement {
21552
22648
  await this.fetchAndRenderContracts(this.sdate, this.edate, "", "no");
21553
22649
  } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
21554
22650
  await this.fetchAndRenderLicenses(this.sdate, this.edate, "", "no");
22651
+ } else if (this.selectedFeatures.indexOf('rcmresources') >= 0) {
22652
+ await this.fetchAndRenderRCMResources(this.sdate, this.edate, "", "no");
21555
22653
  }
21556
22654
  // await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no");
21557
22655
  }
@@ -23349,34 +24447,35 @@ export class SfIEvents extends LitElement {
23349
24447
 
23350
24448
  }
23351
24449
 
23352
- processGraphFilter = (clickedValue: string) => {
24450
+ processGraphFilter = (clickedValue: string, detailsListContainer?: HTMLDivElement) => {
23353
24451
 
23354
- let eventContainer = null;
23355
- console.log('processGraphFilter called', clickedValue);
23356
- if (this.getCurrentTab() == this.TAB_STREAM) {
23357
- eventContainer = (this._SfStreamContainer as HTMLDivElement);
23358
- }
24452
+ let eventContainer = detailsListContainer;
24453
+ if (eventContainer == null) {
24454
+ console.log('processGraphFilter called', clickedValue);
24455
+ if (this.getCurrentTab() == this.TAB_STREAM) {
24456
+ eventContainer = (this._SfStreamContainer as HTMLDivElement);
24457
+ }
23359
24458
 
23360
- // if(this.getCurrentTab() == this.TAB_UPCOMING) {
23361
- // eventContainer = (this._SfUpcomingContainer as HTMLDivElement);
23362
- // }
24459
+ // if(this.getCurrentTab() == this.TAB_UPCOMING) {
24460
+ // eventContainer = (this._SfUpcomingContainer as HTMLDivElement);
24461
+ // }
23363
24462
 
23364
- if (this.getCurrentTab() == this.TAB_THIS) {
23365
- eventContainer = (this._SfThisContainer as HTMLDivElement);
23366
- }
24463
+ if (this.getCurrentTab() == this.TAB_THIS) {
24464
+ eventContainer = (this._SfThisContainer as HTMLDivElement);
24465
+ }
23367
24466
 
23368
- // if(this.getCurrentTab() == this.TAB_PAST) {
23369
- // eventContainer = (this._SfPastContainer as HTMLDivElement);
23370
- // }
24467
+ // if(this.getCurrentTab() == this.TAB_PAST) {
24468
+ // eventContainer = (this._SfPastContainer as HTMLDivElement);
24469
+ // }
23371
24470
 
23372
- if (this.getCurrentTab() == this.TAB_CUSTOM) {
23373
- eventContainer = (this._SfCustomContainer as HTMLDivElement);
23374
- }
24471
+ if (this.getCurrentTab() == this.TAB_CUSTOM) {
24472
+ eventContainer = (this._SfCustomContainer as HTMLDivElement);
24473
+ }
23375
24474
 
23376
- if (this.getCurrentTab() == this.TAB_FIND) {
23377
- eventContainer = (this._SfFindContainer as HTMLDivElement);
24475
+ if (this.getCurrentTab() == this.TAB_FIND) {
24476
+ eventContainer = (this._SfFindContainer as HTMLDivElement);
24477
+ }
23378
24478
  }
23379
-
23380
24479
  if (eventContainer == null) return;
23381
24480
  this.graphFilter = clickedValue
23382
24481
  this.selectedItemIds = [];
@@ -23420,7 +24519,7 @@ export class SfIEvents extends LitElement {
23420
24519
  value: clickedValue
23421
24520
  };
23422
24521
  (streamEventFilters as HTMLDivElement).style.display = 'block';
23423
- (streamEventFilters as HTMLDivElement).innerHTML = '<div part="badge-dashboard" class="d-flex align-center justify-between mr-10 mb-10 no-shrink"><div><span>Filtered by</span>&nbsp;&nbsp;<span id="graph-total" part="badge-filter-name">' + clickedValue + '</span></div><button id="button-filter-cancel" part="button-icon"><span class="material-symbols-outlined">close</span></button></div>';
24522
+ (streamEventFilters as HTMLDivElement).innerHTML = '<div part="badge-dashboard" class="d-flex align-center justify-between mr-10 mb-10 no-shrink"><div><span>Filtered by</span>&nbsp;&nbsp;<span id="graph-total" part="badge-filter-name">' + clickedValue + '</span></div>' + (detailsListContainer == null ? '<button id="button-filter-cancel" part="button-icon"><span class="material-symbols-outlined">close</span></button>':'') + '</div>';
23424
24523
  (streamEventFilters as HTMLDivElement).querySelector('#button-filter-cancel')?.addEventListener('click', () => {
23425
24524
  this.graphFilter = "";
23426
24525
  this.clearSelectedGraphParam();
@@ -23790,7 +24889,7 @@ export class SfIEvents extends LitElement {
23790
24889
 
23791
24890
  html += '<button class="tab-button mb-10" id="calendar-tab-month" part="' + (selectedTab == this.TAB_STREAM ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Month</button>';
23792
24891
  html += '<button class="tab-button mb-10" id="calendar-tab-custom" part="' + (selectedTab == this.TAB_CUSTOM ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">' + (this.myRole == this.TAB_VIEWER ? "Statistics" : "Range") + '</button>';
23793
- if (this.selectedFeatures.indexOf('contracts') < 0 && this.selectedFeatures.indexOf('licenses') < 0) {
24892
+ if (this.selectedFeatures.indexOf('contracts') < 0 && this.selectedFeatures.indexOf('licenses') < 0 && this.selectedFeatures.indexOf('rcmresources') < 0) {
23794
24893
  html += '<button class="tab-button mb-10" id="calendar-tab-register" part="' + (selectedTab == this.TAB_REGISTERS ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Registers</button>';
23795
24894
  html += '<button class="tab-button tab-button-secondary mb-10 ' + (selectedTab == this.TAB_FIND ? '' : 'hide') + '" id="calendar-tab-find" part="' + (selectedTab == this.TAB_FIND ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Search</button>';
23796
24895
  html += '<button class="tab-button tab-button-secondary mb-10 ' + (selectedTab == this.TAB_THIS ? '' : 'hide') + '" id="calendar-tab-this" part="' + (selectedTab == this.TAB_THIS ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Current</button>';
@@ -24935,7 +26034,7 @@ export class SfIEvents extends LitElement {
24935
26034
 
24936
26035
  }
24937
26036
 
24938
- uploadAudit = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, approved: any, module: string = "events") => {
26037
+ uploadAudit = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, approved: any, module: string = "compliance") => {
24939
26038
  let url = "https://" + this.apiId + "/uploadaudit1";
24940
26039
 
24941
26040
  const body = {
@@ -25005,7 +26104,7 @@ export class SfIEvents extends LitElement {
25005
26104
  }
25006
26105
  }
25007
26106
 
25008
- uploadReview = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, approved: any, module: string = "events") => {
26107
+ uploadReview = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, approved: any, module: string = "compliance") => {
25009
26108
  let url = "https://" + this.apiId + "/uploadreview1";
25010
26109
 
25011
26110
  const body = {
@@ -25105,7 +26204,7 @@ export class SfIEvents extends LitElement {
25105
26204
  }
25106
26205
  }
25107
26206
 
25108
- uploadReport = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, doc: string, docs: any, event: any, reportformatvalues: string = "", reportformatschema: string = "", module: string = "events", percentage: string = "100", makercheckers: any) => {
26207
+ uploadReport = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, doc: string, docs: any, event: any, reportformatvalues: string = "", reportformatschema: string = "", module: string = "compliance", percentage: string = "100", makercheckers: any) => {
25109
26208
  let url = "https://" + this.apiId + "/uploadreport1";
25110
26209
 
25111
26210
  let body = {
@@ -25241,7 +26340,7 @@ export class SfIEvents extends LitElement {
25241
26340
 
25242
26341
  let url = "https://" + this.apiId + "/synccalendar";
25243
26342
 
25244
- const body = { "projectid": (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedValues()[0], "events": JSON.stringify(this.events) }
26343
+ const body = { "projectid": (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedValues()[0], "compliance": JSON.stringify(this.events) }
25245
26344
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
25246
26345
  const xhr: any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;
25247
26346
  this._SfLoader.innerHTML = '';
@@ -26701,6 +27800,8 @@ export class SfIEvents extends LitElement {
26701
27800
  this.fetchAndRenderContracts(startDate, endDate, searchString, list, month, year);
26702
27801
  } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
26703
27802
  this.fetchAndRenderLicenses(startDate, endDate, searchString, list, month, year);
27803
+ } else if (this.selectedFeatures.indexOf('rcmresources') >= 0) {
27804
+ this.fetchAndRenderRCMResources(startDate, endDate, searchString, list, month, year);
26704
27805
  }
26705
27806
  }
26706
27807
  fetchAndYearlyRenderUserCalendar_2 = async (startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
@@ -26758,7 +27859,7 @@ export class SfIEvents extends LitElement {
26758
27859
  await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
26759
27860
  if (JSON.stringify(urlBody) == this.getallcountryevetsParams) {
26760
27861
  this.lastupdated = Util.getDateTimeStrings(new Date().getTime())
26761
- console.log('rendering appropriate string', list);
27862
+ console.log('rendering appropriate string', list, this.selectedTab);
26762
27863
  this.renderAppropriateStream(startDate, endDate, true);
26763
27864
  this.fetchBulkReportingData();
26764
27865
  }
@@ -26841,6 +27942,61 @@ export class SfIEvents extends LitElement {
26841
27942
 
26842
27943
  }
26843
27944
 
27945
+ }
27946
+ fetchOnlyYearlyUserCalendar = async (startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY, userprofileid: string = this.userProfileId, userrole: string = this.myRole, entityid = this.entityId, countryid = this.countryId, locationid = this.locationId, tagid = this.tagId, functionid = this.functionId) => {
27947
+
27948
+ let path = "", view = "";
27949
+ if (this.tagId != null && this.tagId != "") {
27950
+ view = "tag";
27951
+ } else if (this.countryId != null && this.countryId != "") {
27952
+ view = "country";
27953
+ } else if (this.locationId != null && this.locationId != "") {
27954
+ view = "location";
27955
+ } else {
27956
+ view = "entity";
27957
+ }
27958
+
27959
+ path = "getallcountryevents";
27960
+
27961
+ let url = "https://" + this.apiId + "/" + path;
27962
+
27963
+ //console.log('fetch calendar url', url);
27964
+ let urlBody: any = { "projectid": this.projectId, "userprofileid": userprofileid, "role": userrole, "entityid": entityid, "countryid": countryid, "functionid": functionid, "locationid": locationid, "tagid": tagid, "adhoc": "false", "exclusivestartkey": 0, "sdate": startDate, "edate": endDate, "view": view, "year": year, "list": list, "month": month };
27965
+
27966
+ if (searchString.length > 0) {
27967
+ urlBody["searchstring"] = searchString;
27968
+ }
27969
+
27970
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
27971
+ const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
27972
+ this._SfLoader.innerHTML = '';
27973
+ if (xhr.status == 200) {
27974
+
27975
+ const jsonRespose = JSON.parse(xhr.responseText);
27976
+ console.log('jsonRespose', jsonRespose);
27977
+ // if (JSON.stringify(urlBody) == this.getallcountryevetsParams) {
27978
+ this.events = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
27979
+ // }
27980
+ await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
27981
+
27982
+ } else {
27983
+ if (xhr.status == 401) {
27984
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
27985
+ this.dispatchEvent(changeEvent);
27986
+ }
27987
+ if (xhr.status === 404) {
27988
+
27989
+ this.showChosenProject();
27990
+ (this._SfTitleChosenProject as HTMLElement).innerHTML = (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedTexts()[0];
27991
+ this.renderChosenProject();
27992
+
27993
+ } else {
27994
+ const jsonRespose = JSON.parse(xhr.responseText);
27995
+ this.setError(jsonRespose.error);
27996
+ }
27997
+
27998
+ }
27999
+
26844
28000
  }
26845
28001
 
26846
28002
  fetchAndRenderNotices = async (startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
@@ -27081,6 +28237,81 @@ export class SfIEvents extends LitElement {
27081
28237
 
27082
28238
  }
27083
28239
 
28240
+ fetchAndRenderRCMResources = async (startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
28241
+
28242
+ let path = "", view = "";
28243
+ this.sdate = startDate;
28244
+ this.edate = endDate;
28245
+ if (this.tagId != null && this.tagId != "") {
28246
+ view = "tag";
28247
+ } else if (this.countryId != null && this.countryId != "") {
28248
+ view = "country";
28249
+ } else if (this.locationId != null && this.locationId != "") {
28250
+ view = "location";
28251
+ } else {
28252
+ view = "entity";
28253
+ }
28254
+
28255
+ path = "getallcountryobjects";
28256
+
28257
+ let sDate = "";
28258
+ let eDate = "";
28259
+
28260
+ //console.log('currenttab', this.getCurrentTab());
28261
+
28262
+ if (this.getCurrentTab() == this.TAB_YEAR) {
28263
+ sDate = "03/31/" + this.calendarStartYYYY;
28264
+ eDate = "04/01/" + (parseInt(this.calendarStartYYYY) + 1);
28265
+ } else {
28266
+ sDate = startDate;
28267
+ eDate = endDate;
28268
+ }
28269
+
28270
+
28271
+ let url = "https://" + this.apiIdRCMResources + "/" + path;
28272
+
28273
+ //console.log('fetch calendar url', url);
28274
+ 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 };
28275
+
28276
+ if (searchString.length > 0) {
28277
+ urlBody["searchstring"] = searchString;
28278
+ }
28279
+
28280
+ //console.log('urlbody', urlBody);
28281
+
28282
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
28283
+ const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
28284
+ this._SfLoader.innerHTML = '';
28285
+ if (xhr.status == 200) {
28286
+
28287
+ const jsonRespose = JSON.parse(xhr.responseText);
28288
+ console.log('jsonRespose', jsonRespose);
28289
+ let rcmresources = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
28290
+ await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
28291
+ this.lastupdated = Util.getDateTimeStrings(new Date().getTime())
28292
+ this.events = rcmresources;
28293
+ this.renderAppropriateStream(this.sdate, this.edate, true);
28294
+ console.log('rcmresources', rcmresources);
28295
+ } else {
28296
+ if (xhr.status == 401) {
28297
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
28298
+ this.dispatchEvent(changeEvent);
28299
+ }
28300
+ if (xhr.status === 404) {
28301
+
28302
+ this.showChosenProject();
28303
+ (this._SfTitleChosenProject as HTMLElement).innerHTML = (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedTexts()[0];
28304
+ this.renderChosenProject();
28305
+
28306
+ } else {
28307
+ const jsonRespose = JSON.parse(xhr.responseText);
28308
+ this.setError(jsonRespose.error);
28309
+ }
28310
+
28311
+ }
28312
+
28313
+ }
28314
+
27084
28315
  fetchStatistics = async (startDate: string = "", endDate: string = "", filtercriteria: string, filterid: string, subfiltercriteria: string, subfilterid: string) => {
27085
28316
 
27086
28317
  let path = "";
@@ -27112,6 +28343,8 @@ export class SfIEvents extends LitElement {
27112
28343
  url = "https://" + this.apiIdAgreements + "/" + path;
27113
28344
  } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
27114
28345
  url = "https://" + this.apiIdLicenses + "/" + path;
28346
+ } else if (this.selectedFeatures.indexOf('rcmresource') >= 0) {
28347
+ url = "https://" + this.apiIdRCMResources + "/" + path;
27115
28348
  }
27116
28349
 
27117
28350
  //console.log('fetch calendar url', url);
@@ -28745,6 +29978,11 @@ export class SfIEvents extends LitElement {
28745
29978
  this.renderRoleTabsNext(0, false)
28746
29979
  } else if (this.mode == "reports") {
28747
29980
  this.fetchReports();
29981
+ } else if (this.mode == "viewer") {
29982
+ this.enableCustom();
29983
+ this.selectedTab = this.TAB_CUSTOM
29984
+ this.renderCustom();
29985
+ this.renderWithFeatures(this.sdate, this.edate, "", "yes")
28748
29986
  } else {
28749
29987
 
28750
29988
  this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
@@ -29108,7 +30346,8 @@ export class SfIEvents extends LitElement {
29108
30346
  </div>
29109
30347
  <div class="rb"></div>
29110
30348
  </div>
29111
- <div id="detail-container" class="hide" part="detail-container">
30349
+ <div id="detail-container" class="hide" part="detail-container"></div>
30350
+ <div id="detail-list-container" class="hide" part="detail-list-container">
29112
30351
  </div>
29113
30352
  <div class="d-flex justify-between">
29114
30353
  <div class="lb"></div>
@@ -29295,7 +30534,8 @@ export class SfIEvents extends LitElement {
29295
30534
  </div>
29296
30535
  <div id="report-summary-container" class="hide" part="report-summary-container">
29297
30536
  </div>
29298
- <div id="detail-container" class="hide" part="detail-container">
30537
+ <div id="detail-container" class="hide" part="detail-container"></div>
30538
+ <div id="detail-list-container" class="hide" part="detail-list-container">
29299
30539
  </div>
29300
30540
  <div class="d-flex justify-between">
29301
30541
  <div class="lb"></div>