sf-i-events 1.0.880 → 1.0.881

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1249,6 +1249,9 @@ export class SfIEvents extends LitElement {
1249
1249
  @property()
1250
1250
  apiIdLicenses!: string;
1251
1251
 
1252
+ @property()
1253
+ apiIdRCMResources!: string;
1254
+
1252
1255
  @property()
1253
1256
  apiMethodList!: string;
1254
1257
 
@@ -4757,7 +4760,7 @@ export class SfIEvents extends LitElement {
4757
4760
  const moduleType = event.module ?? 'compliance';
4758
4761
  const partStatusSanitized = partStatus.replace(/-/g, '_');
4759
4762
  const entityIdSanitized = event.entityid.replace(/-/g, '_');
4760
- const locationIdSanitized = event.locationid.replace(/-/g, '_');
4763
+ const locationIdSanitized = (event.locationid ?? "").replace(/-/g, '_');
4761
4764
  const eventIdSanitized = event.id.replace(/-/g, '_');
4762
4765
  const mmddSanitized = mmdd.replace(/\//g, '-');
4763
4766
  const dueDateParts = event.duedate.split('/');
@@ -5811,7 +5814,7 @@ export class SfIEvents extends LitElement {
5811
5814
  html += '<button id="button-uploader-submit-approve" class="button-submit" part="button">Save</button>'
5812
5815
  html += '</div>'
5813
5816
 
5814
- if (this.myRole != this.TAB_FUNCTION_HEAD && docs.length > 0 && event.module != 'contract' && event.module != 'license') {
5817
+ if (this.myRole != this.TAB_FUNCTION_HEAD && docs.length > 0 && event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5815
5818
  html += '<div class="m-20">';
5816
5819
  html += '<label part="input-label">Supporting Documents</label>';
5817
5820
  html += '<slot name="uploader"></slot>';
@@ -5822,7 +5825,7 @@ export class SfIEvents extends LitElement {
5822
5825
  html += '<div class="d-flex m-20 flex-col">';
5823
5826
  html += '<label part="input-label">Approver Comments*</label>';
5824
5827
  html += '<input id="input-approver-comments" type="text" part="input" value=""/><br />';
5825
- if (event.module != 'contract' && event.module != 'license') {
5828
+ if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5826
5829
  html += '<label part="input-label">Date of Completion*</label>';
5827
5830
  html += '<input id="input-approver-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" disabled/><br />';
5828
5831
  html += '<label part="input-label">Percentage</label>';
@@ -5883,7 +5886,7 @@ export class SfIEvents extends LitElement {
5883
5886
  html += '<div class="d-flex m-20 flex-col">';
5884
5887
  html += '<label part="input-label">Reporter Comments*</label>';
5885
5888
  html += '<input id="input-reporter-comments" type="text" part="input" value=""/><br />';
5886
- if (event.module != 'contract' && event.module != 'license') {
5889
+ if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5887
5890
  html += '<label part="input-label">Date of Completion*</label>';
5888
5891
  html += '<input id="input-reporter-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" max="' + (new Date().toISOString().substring(0, 10)) + '"/><br />';
5889
5892
  html += '<label part="input-label">Completion Percentage*</label>';
@@ -5941,7 +5944,7 @@ export class SfIEvents extends LitElement {
5941
5944
  html += '<div class="d-flex m-20 flex-col">';
5942
5945
  html += '<label part="input-label">Auditor Comments</label>';
5943
5946
  html += '<input id="input-auditor-comments" type="text" part="input" value=""/><br />';
5944
- if (event.module != 'contract' && event.module != 'license') {
5947
+ if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
5945
5948
  html += '<label part="input-label">Date of Completion</label>';
5946
5949
  html += '<input id="input-auditor-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" max="' + (new Date().toISOString().substring(0, 10)) + '" readonly/><br />';
5947
5950
  html += '<label part="input-label">Percentage</label>';
@@ -6009,7 +6012,10 @@ export class SfIEvents extends LitElement {
6009
6012
  event.docsOptional = event['docs'] == null ? [] : event['docs'];
6010
6013
  html = this.renderReporting(event, mmddyyyy);
6011
6014
  console.log('reporting html', html);
6015
+ let ddmmyyyy = mmddyyyy.split('/')[1] + '/' + mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[2];
6012
6016
 
6017
+ let emailcontent = `<table border="0" cellspacing="0" style="color:#666666;border-radius:5px;border:solid 1px #efefef;width:100%; margin-top:20px"><tbody><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Compliance ID</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.id}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Country</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.countryname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Entity</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.entityname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Location</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.locationname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Statute</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.statute}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Subcategory</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.subcategory}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Due Date</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${ddmmyyyy}</td></tr></tbody></table>`;
6018
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.emailcontent = emailcontent;
6013
6019
  let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
6014
6020
  for (let tempReportingContainer of listReportingContainers) {
6015
6021
  tempReportingContainer.style.display = 'none';
@@ -6922,6 +6928,8 @@ export class SfIEvents extends LitElement {
6922
6928
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6923
6929
  } else if (module === "license") {
6924
6930
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6931
+ } else if (module === "rcmresource") {
6932
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6925
6933
  } else {
6926
6934
  let found = false;
6927
6935
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -6963,6 +6971,8 @@ export class SfIEvents extends LitElement {
6963
6971
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6964
6972
  } else if (module === "license") {
6965
6973
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6974
+ } else if (module === "rcmresource") {
6975
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
6966
6976
  } else {
6967
6977
  let found = false;
6968
6978
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -11091,6 +11101,8 @@ export class SfIEvents extends LitElement {
11091
11101
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11092
11102
  } else if (module === "license") {
11093
11103
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11104
+ } else if (module === "rcmresource") {
11105
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11094
11106
  } else {
11095
11107
  let found = false;
11096
11108
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -11132,6 +11144,8 @@ export class SfIEvents extends LitElement {
11132
11144
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11133
11145
  } else if (module === "license") {
11134
11146
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11147
+ } else if (module === "rcmresource") {
11148
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11135
11149
  } else {
11136
11150
  let found = false;
11137
11151
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -11703,6 +11717,8 @@ export class SfIEvents extends LitElement {
11703
11717
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11704
11718
  } else if (module === "license") {
11705
11719
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11720
+ } else if (module === "rcmresource") {
11721
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11706
11722
  } else {
11707
11723
  let found = false;
11708
11724
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -11749,6 +11765,8 @@ export class SfIEvents extends LitElement {
11749
11765
  this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11750
11766
  } else if (module === "license") {
11751
11767
  this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11768
+ } else if (module === "rcmresource") {
11769
+ this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
11752
11770
  } else {
11753
11771
  let found = false;
11754
11772
  for (var k = 0; k < this.selectedItemIds.length; k++) {
@@ -14707,6 +14725,7 @@ export class SfIEvents extends LitElement {
14707
14725
 
14708
14726
  }
14709
14727
  }
14728
+
14710
14729
  fetchLicenseDetails = async (listEvent: any, mmddyyyy: string) => {
14711
14730
  let entityId = listEvent.entityid;
14712
14731
  let locationId = listEvent.locationid;
@@ -15601,14 +15620,15 @@ export class SfIEvents extends LitElement {
15601
15620
  }
15602
15621
  }
15603
15622
 
15604
- fetchEventDetails = async (listEvent: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement, flagUploadGuidance: boolean = false, listEventContainer: HTMLDivElement | null = null) => {
15605
- console.log('listEvent', listEvent, listEvent.id)
15606
- let url = "https://" + this.apiId + "/getalleventdetails";
15623
+ fetchRCMResourceDetails = async (listEvent: any, mmddyyyy: string) => {
15624
+ let entityId = listEvent.entityid;
15625
+ let locationId = listEvent.locationid;
15626
+ let url = "https://" + this.apiIdRCMResources + "/getallobjectdetails";
15607
15627
 
15608
- //console.log('fetch calendar url', url);
15609
- let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "eventid": listEvent.id, "entityid": listEvent.entityid, "locationid": listEvent.locationid, "mmddyyyy": mmddyyyy, "year": this.getFinancialYear(mmddyyyy) };
15628
+ console.log('fetch rcm resource details url', url);
15629
+ let urlBody: any = { projectid: this.projectId, objectid: listEvent.id, entityid: entityId, locationid: locationId, userprofileid: this.userProfileId, role: this.myRole, year: this.calendarStartYYYY, mmddyyyy: mmddyyyy };
15610
15630
 
15611
- //console.log('urlbody', urlBody);
15631
+ console.log('fetch rcm resource details urlbody', urlBody);
15612
15632
 
15613
15633
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
15614
15634
  const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
@@ -15616,197 +15636,1090 @@ export class SfIEvents extends LitElement {
15616
15636
  if (xhr.status == 200) {
15617
15637
 
15618
15638
  const jsonRespose = JSON.parse(xhr.responseText);
15619
- console.log('jsonRespose', jsonRespose);
15620
- if (flagUploadGuidance) {
15621
- if (listEventContainer != null) {
15622
- let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
15623
- if (this.events[mmdd] != null) {
15624
- for (var p = 0; p < this.events[mmdd].length; p++) {
15625
- if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == listEvent.locationid && this.events[mmdd][p].entityid == listEvent.entityid) {
15626
- this.events[mmdd][p].uploadguidance = jsonRespose.data.uploadguidance
15627
- }
15628
- }
15629
- }
15630
- this.renderListReporting(listEventContainer, jsonRespose.data, mmddyyyy, eventsContainer)
15631
- }
15632
- } else {
15633
- this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer);
15634
- }
15635
-
15639
+ console.log('jsonRespose agreement details', jsonRespose);
15640
+ this.renderRCMResourceDetails(jsonRespose.object, mmddyyyy)
15636
15641
  } else {
15637
15642
  if (xhr.status == 401) {
15638
15643
  let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
15639
15644
  this.dispatchEvent(changeEvent);
15640
- }
15641
- if (xhr.status === 404) {
15642
-
15643
- this.showChosenProject();
15644
- (this._SfTitleChosenProject as HTMLElement).innerHTML = (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedTexts()[0];
15645
- this.renderChosenProject();
15646
-
15647
15645
  } else {
15648
15646
  const jsonRespose = JSON.parse(xhr.responseText);
15649
15647
  this.setError(jsonRespose.error);
15650
15648
  }
15651
15649
 
15652
15650
  }
15651
+
15653
15652
  }
15654
15653
 
15655
- renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement) => {
15656
- console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
15654
+ renewRCMResource = async (listEvent: any, reportformatvalues: any) => {
15657
15655
 
15658
- let comments, docs, approved, /*dateOfCompletion,*/ makercheckers: Array<string>, docsOptional, documentType;
15659
- let entityId: string = "";
15660
- let locationId: string = "";
15661
- let statuteName: string = "";
15662
- let reportformatName: string = "";
15663
- let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
15664
- entityId = event.entityid;
15665
- locationId = event.locationid;
15666
- // let completeness = this.getCompletenessStatus(event);
15667
- comments = event['comments'] == null ? [] : (event['comments']);
15668
- docs = event['documents'] == null ? [] : event['documents'] == null ? [] : (event['documents']);
15669
- approved = event['approved'] == null ? false : event['approved'] == null ? false : event['approved'];
15670
- // dateOfCompletion = event['dateofcompletion'] == null ? '' : event['dateofcompletion'] == null ? '' : event['dateofcompletion'];
15671
- makercheckers = event['makercheckers'] == null ? [] : event['makercheckers'] == null ? [] : event['makercheckers'];
15672
- docsOptional = event['docs'] == null ? [] : event['docs'] == null ? [] : event['docs'];
15673
- documentType = event['documenttype'] == null ? null : event['documenttype'][0] == null ? null : event['documenttype'][0].split(" ")[0];
15656
+ let url = "https://" + this.apiIdRCMResources + "/reopen";
15674
15657
 
15675
- statuteName = event['statute'][0].trim();
15676
- if (event['reportformat'] != null) {
15677
- reportformatName = (event['reportformat'][0] ?? "").trim().replace('&amp;', '&');
15678
- }
15658
+ console.log('renewing', reportformatvalues)
15659
+ //console.log('fetch calendar url', url);
15660
+ let urlBody: any = { projectid: this.projectId, objectid: listEvent.id, newvalues: reportformatvalues == "" ? null : JSON.parse(reportformatvalues), published: true, terminated: (JSON.parse(reportformatvalues).terminated ?? false) };
15661
+ console.log('reopen body', url, urlBody)
15662
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
15663
+ const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
15664
+ this._SfLoader.innerHTML = '';
15665
+ if (xhr.status == 200) {
15679
15666
 
15680
- console.log('event detail', event, statuteName);
15681
- //console.log('event detail comments', comments);
15682
- //console.log('event dateofcompletion', dateOfCompletion);
15683
- //console.log('event detail documenttype', documentType);
15684
- const basicFields = ['id', 'shortid', 'entityname', 'locationname', 'functions'];
15685
- const statuteFields = ['jurisdiction', 'country', 'state', 'category', 'subcategory', 'statute'];
15686
- const complianceFields = ['specificity', 'reference', 'obligation', 'penalty', 'authority', 'frequency', 'subfrequency', 'obligationtype', 'duedate', 'applicability', 'form', 'additionalurls', 'adhocquestion', 'adhocquestionschedule', 'adhocinstances', 'uploadguidance', 'attachment'];
15687
- const grcFields = ['internalcontrols', 'firstlineofdefence', 'secondlineofdefence', 'thirdlineofdefence', 'risk', 'riskarea'];
15667
+ const jsonRespose = JSON.parse(xhr.responseText);
15668
+ console.log('jsonRespose agreement reopen', jsonRespose);
15669
+ } else {
15670
+ if (xhr.status == 401) {
15671
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
15672
+ this.dispatchEvent(changeEvent);
15673
+ } else {
15674
+ const jsonRespose = JSON.parse(xhr.responseText);
15675
+ this.setError(jsonRespose.error);
15676
+ }
15688
15677
 
15689
- let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
15690
- for (let tempReportingContainer of listReportingContainers) {
15691
- tempReportingContainer.style.display = 'none';
15692
- tempReportingContainer.innerHTML = '';
15693
- }
15694
- let buttonListReportings = eventsContainer.querySelectorAll('.button-list-reporting') as NodeListOf<HTMLButtonElement>
15695
- for (let buttonListReporting of buttonListReportings) {
15696
- buttonListReporting.setAttribute('part', 'button-list-reporting')
15697
- }
15698
- let streamEventTitles = eventsContainer.querySelectorAll('.stream-event-title') as NodeListOf<SfIElasticText>
15699
- for (let streamEventTitle of streamEventTitles) {
15700
- streamEventTitle.removeAttribute('part')
15701
15678
  }
15702
- var html = `
15703
-
15704
- <div part="compliance-detail-title" class="d-flex justify-between">
15705
- <button part="button-icon" class="material-icons invisible">close</button>
15706
- <h3 part="results-title" class="m-0">Compliance Details</h3>
15707
- <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
15708
- </div>
15709
-
15710
- `;
15711
-
15712
- if (this.selectedItemIds.length > 1) {
15713
-
15714
- html += `
15715
-
15716
- <div class="d-flex justify-between m-20">
15717
- <h4 class="m-0">${this.selectedItemIds.length - 1} other ` + ((this.selectedItemIds.length - 1) === 1 ? `item` : `items`) + ` also selected</h4>
15679
+ }
15680
+ renderRCMResourceDetails = async (listEvent: any, mmddyyyy: string) => {
15681
+ // await this.fetchAgreementDetails(listEvent, mmddyyyy);
15682
+ // return;
15683
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
15684
+ let entityId = listEvent.entityid;
15685
+ let locationId = listEvent.locationid;
15686
+ let comments = listEvent['comments'];
15687
+ let docs = listEvent['documents'] == null ? [] : listEvent['documents'] == null ? [] : (listEvent['documents']);
15688
+ let approved = listEvent['approved'] == null ? false : listEvent['approved'] == null ? false : listEvent['approved'];
15689
+ let makercheckers = listEvent['makercheckers'] == null ? [] : listEvent['makercheckers'] == null ? [] : listEvent['makercheckers'];
15690
+ // let docsOptional = listEvent['docs'] == null ? [] : listEvent['docs'] == null ? [] : listEvent['docs'];
15691
+ let html: string = '';
15692
+ let documentType = listEvent['documenttype'] == null ? null : listEvent['documenttype'][0] == null ? null : listEvent['documenttype'][0].split(" ")[0];
15693
+ html += `
15694
+ <div part="compliance-detail-title" class="d-flex justify-between">
15695
+ <button part="button-icon" class="material-icons invisible">close</button>
15696
+ <h3 part="results-title" class="m-0">RCM Resource Details</h3>
15697
+ <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
15718
15698
  </div>
15719
-
15720
- `;
15699
+ `
15700
+ html += `
15701
+ <div class="box-large" id="shimmer-container-agreements" part="shimmer-container-agreements">
15702
+ </div>
15703
+ `
15704
+ html += '<sf-i-reporting id="detail-reporting" class="hide" exportparts="uploader-extracted-text:reporting-uploader-extracted-text, uploader-sf-upload-message:reporting-uploader-sf-upload-message, uploader-sf-upload-submessage:reporting-uploader-sf-upload-submessage, uploader-extracted-text-chip:reporting-uploader-extracted-text-chip, uploader-extracted-text-chip-failed:reporting-uploader-extracted-text-chip-failed, uploader-doctype-verify-badge:reporting-uploader-doctype-verify-badge,span-submit-published:reporting-span-submit-published, span-submit-unpublished:reporting-span-submit-unpublished, reporting-container:reporting-reporting-container, button-icon:reporting-button-icon, uploader-button-icon:reporting-uploader-button-icon, sf-i-form-modal-container:reporting-sf-i-form-modal-container, next-calendar-date:reporting-next-calendar-date, last-calendar-date:reporting-last-calendar-date, input-publish-checkbox:reporting-input-publish-checkbox, button-icon-light:reporting-button-icon-light, button-icon-small:reporting-button-icon-small, uploader-input-label:reporting-uploader-input-label, input-radio:reporting-input-radio, radio-label:reporting-radio-label, input-textarea:reporting-input-textarea, input-textarea-disabled:reporting-input-textarea-disabled, input-date:reporting-input-date, input-date-disabled:reporting-input-date-disabled, input-select-single:reporting-input-select-single, textarea-container:reporting-textarea-container, section-body:reporting-section-body, section-container:reporting-section-container, date-container:reporting-date-container, input-sf-i-uploader:reporting-input-sf-i-uploader, published-container:reporting-published-container, selected-option:reporting-selected-option, input-select-multi-option:reporting-input-select-multi-option, select-option-label:reporting-select-option-label, input-sf-i-form:reporting-input-sf-i-form, input-sf-i-bricks:reporting-input-sf-i-bricks, uploader-input:reporting-uploader-input, form-container:reporting-form-container, published-container:reporting-published-container, form-container-published:reporting-form-container-published, subsection:reporting-subsection, results-title:reporting-results-title, td-head:reporting-td-head, td-action:reporting-td-action, td-body:reporting-td-body, td-body-2:reporting-td-body-2, add-button:reporting-add-button, uploader-button:reporting-uploader-button, section-head-collapsed:reporting-section-head-collapsed, section-title-expanded:reporting-section-title-expanded, section-title-collapsed:reporting-section-title-collapsed, section-head-expanded:reporting-section-head-expanded, progress-bar-finished:reporting-progress-bar-finished, progress-bar-complete:reporting-progress-bar-complete, progress-bar-incomplete:reporting-progress-bar-incomplete, section-success-icon:reporting-section-success-icon, section-body:reporting-section-body, title-section:reporting-title-section, button-lg:reporting-button-lg, uploader-detail-container:reporting-uploader-detail-container, textarea-label:reporting-textarea-label, date-label:reporting-date-label, commentbox:reporting-commentbox, comment-username:reporting-comment-username, detail-head:reporting-detail-head, reporting-uploader-extracted-text:reporting-reporting-uploader-extracted-text, reporting-uploader-sf-upload-message:reporting-reporting-uploader-sf-upload-message, reporting-uploader-sf-upload-submessage:reporting-reporting-uploader-sf-upload-submessage, reporting-uploader-extracted-text-chip:reporting-reporting-uploader-extracted-text-chip, reporting-uploader-extracted-text-chip-failed:reporting-reporting-uploader-extracted-text-chip-failed, reporting-uploader-doctype-verify-badge:reporting-reporting-uploader-doctype-verify-badge, reporting-span-submit-published:reporting-reporting-span-submit-published, reporting-span-submit-unpublished:reporting-reporting-span-submit-unpublished, reporting-reporting-container:reporting-reporting-reporting-container, reporting-button-icon:reporting-reporting-button-icon, reporting-uploader-button-icon:reporting-reporting-uploader-button-icon, reporting-sf-i-form-modal-container:reporting-reporting-sf-i-form-modal-container, reporting-next-calendar-date:reporting-reporting-next-calendar-date, reporting-last-calendar-date:reporting-reporting-last-calendar-date, reporting-input-publish-checkbox:reporting-reporting-input-publish-checkbox, reporting-button-icon-light:reporting-reporting-button-icon-light, reporting-button-icon-small:reporting-reporting-button-icon-small, reporting-uploader-input-label:reporting-reporting-uploader-input-label, reporting-input-radio:reporting-reporting-input-radio, reporting-radio-label:reporting-reporting-radio-label, reporting-input-textarea:reporting-reporting-input-textarea, reporting-input-textarea-disabled:reporting-reporting-input-textarea-disabled, reporting-input-date:reporting-reporting-input-date, reporting-input-date-disabled:reporting-reporting-input-date-disabled, reporting-input-select-single:reporting-reporting-input-select-single, reporting-textarea-container:reporting-reporting-textarea-container, reporting-section-body:reporting-reporting-section-body, reporting-section-container:reporting-reporting-section-container, reporting-date-container:reporting-reporting-date-container, reporting-input-sf-i-uploader:reporting-reporting-input-sf-i-uploader, reporting-published-container:reporting-reporting-published-container, reporting-selected-option:reporting-reporting-selected-option, reporting-input-select-multi-option:reporting-reporting-input-select-multi-option, reporting-select-option-label:reporting-reporting-select-option-label, reporting-input-sf-i-form:reporting-reporting-input-sf-i-form, reporting-input-sf-i-bricks:reporting-reporting-input-sf-i-bricks, reporting-uploader-input:reporting-reporting-uploader-input, reporting-form-container:reporting-reporting-form-container, reporting-published-container:reporting-reporting-published-container, reporting-form-container-published:reporting-reporting-form-container-published, reporting-subsection:reporting-reporting-subsection, reporting-results-title:reporting-reporting-results-title, reporting-td-head:reporting-reporting-td-head, reporting-td-action:reporting-reporting-td-action, reporting-td-body:reporting-reporting-td-body, reporting-td-body-2:reporting-reporting-td-body-2, reporting-add-button:reporting-reporting-add-button, reporting-uploader-button:reporting-reporting-uploader-button, reporting-section-head-collapsed:reporting-reporting-section-head-collapsed, reporting-section-title-expanded:reporting-reporting-section-title-expanded, reporting-section-title-collapsed:reporting-reporting-section-title-collapsed, reporting-section-head-expanded:reporting-reporting-section-head-expanded, reporting-progress-bar-finished:reporting-reporting-progress-bar-finished, reporting-progress-bar-complete:reporting-reporting-progress-bar-complete, reporting-progress-bar-incomplete:reporting-reporting-progress-bar-incomplete, reporting-section-success-icon:reporting-reporting-section-success-icon, reporting-section-body:reporting-reporting-section-body, reporting-title-section:reporting-reporting-title-section, reporting-button-lg:reporting-reporting-button-lg, reporting-uploader-detail-container:reporting-reporting-uploader-detail-container, reporting-textarea-label:reporting-reporting-textarea-label, reporting-date-label:reporting-reporting-date-label, reporting-commentbox:reporting-reporting-commentbox, reporting-comment-username:reporting-reporting-comment-username, reporting-detail-head:reporting-reporting-detail-head, input-sf-i-select:reporting-input-sf-i-select,reporting-input-sf-i-select:reporting-reporting-input-sf-i-select, select-input-select:reporting-select-input-select, checklist-container:reporting-checklist-container, checklist-title:reporting-checklist-title, checklist-list:reporting-checklist-list, checklist-item:reporting-checklist-item, checklist-checkbox:reporting-checklist-checkbox, checklist-checkbox-label:reporting-checklist-checkbox-label, reporting-checklist-container:reporting-reporting-checklist-container, reporting-checklist-title:reporting-reporting-checklist-title, reporting-checklist-list:reporting-reporting-checklist-list, reporting-checklist-item:reporting-reporting-checklist-item, reporting-checklist-checkbox:reporting-reporting-checklist-checkbox, reporting-checklist-checkbox-label:reporting-reporting-checklist-checkbox-label, checklist-add-input:reporting-checklist-add-input, checklist-add-button:reporting-checklist-add-button, terminate-container:reporting-terminate-container, terminate-container-terminated:reporting-terminate-container-terminated, terminate-container-active:reporting-terminate-container-active, input-terminate-checkbox: reporting-input-terminate-checkbox, reporting-terminate-container:reporting-reporting-terminate-container, reporting-terminate-container-terminated:reporting-reporting-terminate-container-terminated, reporting-terminate-container-active:reporting-reporting-terminate-container-active, reporting-input-terminate-checkbox: reporting-reporting-input-terminate-checkbox, uploader-container:reporting-uploader-container, reporting-uploader-container:reporting-reporting-uploader-container, not-selected:reporting-not-selected, reporting-not-selected:reportinig-reporting-not-selected" name="RCM Resource Details" apiiduploader="1peg5170d3" apiid="' + this.apiIdRCMResources + '" mode="admin" flow="details" projectid="' + this.projectId + '" projectname="' + this.projectName + '" editdisable="true" formviewclass="flex-wrap"></sf-i-reporting>';
15721
15705
 
15722
- }
15706
+ html += '<div part="reporting-view-container">'
15723
15707
 
15724
- html += '<div class="accordian-container m-20 pb-20" part="accordian-container">';
15708
+ html += this.renderReporting(listEvent, mmddyyyy);
15709
+ html += "</div>"
15725
15710
 
15726
- html += '<div part="detail-summary">';
15727
- html += ('<div part="detail-summary-title" class="pl-20 pr-20"><h1>' + event['obligationtitle'] + '</h1></div>');
15728
- html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + event['obligation'].replace(/\n/g, '<br />') + '</h3></div>');
15729
- html += ('<div part="detail-summary-content" class="pl-20 pr-20">' + ('<sf-i-elastic-text text="' + (event['internalcontrols'] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
15711
+ html += '<div class="d-flex justify-between m-20">';
15712
+ html += '<h3 part="results-title" class="m-0"><br />Comments</h3>';
15730
15713
  html += '</div>';
15731
15714
 
15732
- html += '<br />';
15715
+ html += '<div class="m-20">';
15733
15716
 
15734
- html += '<div class="accordian-section section-basic pl-20 pr-20" part="accordian-section">';
15735
- html += '<div class="d-flex justify-between accordian-head head-basic cursor" part="accordian-head">';
15736
- html += '<h3>Basic Information</h3>'
15737
- html += '<h3 class="head-indicator-basic">-</h3>'
15738
- html += '</div>';
15739
- html += '<div class="d-flex flex-wrap accordian-body body-basic" part="accordian-body">';
15717
+ html += '<div class="d-flex flex-col">';
15740
15718
 
15741
- for (var i = 0; i < basicFields.length; i++) {
15719
+ for (var i = 0; i < comments.length; i++) {
15720
+ html += '<div part="commentbox" class="d-flex commentbox ' + (comments[i].author + "").toLowerCase() + 'box">';
15721
+ html += '<div class="mr-20 d-flex flex-col align-end"><span part="comment-username">' + (comments[i].username != null ? comments[i].username : '') + '</span><span part="td-head">' + comments[i].author + '</span>' + ((i === (comments.length - 1) && this.enableDeleteLatestReport) ? '<br /><button class="mt-5 button-delete" part="button">Delete</button>' : '') + '</div>';
15742
15722
 
15743
- if (!this.getEventPreviewFields().includes(basicFields[i])) {
15723
+ const onlyCommentText = (comments[i].comment + "").replace(/ *\([^)]*\) */g, "").trim();
15724
+ try {
15744
15725
 
15745
- if (!this.getEventHideFields().includes(basicFields[i])) {
15726
+ const jsonComments = JSON.parse(onlyCommentText);
15746
15727
 
15747
- console.log('basicFields', event[basicFields[i]] + "");
15748
- if ((event[basicFields[i]] + "").indexOf("[") >= 0) {
15749
- html += '<div class="m-20">';
15750
- html += '<div part="detail-head"><strong>' + basicFields[i] + '</strong></div>'
15751
- html += this.getEventTexts(basicFields[i], JSON.parse(event[basicFields[i]]), event).replace(/ *\([^)]*\) */g, "").trim();
15752
- html += '</div>';
15753
- } else {
15754
- html += '<div class="m-20">';
15755
- html += '<div part="detail-head"><strong>' + basicFields[i] + '</strong></div>'
15756
- html += '<sf-i-elastic-text text="' + (event[basicFields[i]] + "").replace(/"/g, "").replace(/ *\([^)]*\) */g, "").trim().split(';')[0] + '" minLength="80"></sf-i-elastic-text>';
15757
- html += '</div>';
15728
+ if (Util.isInteger(jsonComments)) {
15729
+ html += '<div class="">' + comments[i].comment + '<br /><small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
15730
+ } else {
15731
+ //console.log('json comments', jsonComments);
15732
+ var htmlTable = '';
15733
+ for (var j = 0; j < Object.keys(jsonComments).length; j++) {
15734
+ htmlTable += '<div class="mb-20">';
15735
+ htmlTable += ('<div part="detail-head">' + Object.keys(jsonComments)[j] + '</div>');
15736
+ htmlTable += ('<sf-i-elastic-text text="' + jsonComments[Object.keys(jsonComments)[j]] + '" minLength="20"></sf-i-elastic-text>');
15737
+ htmlTable += '</div>';
15758
15738
  }
15759
-
15739
+ html += '<div class="">' + htmlTable + '<small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
15760
15740
  }
15761
- }
15762
-
15763
- }
15764
15741
 
15765
- if (this.mode == "consumer") {
15766
- if (approved) {
15767
- html += '<div class="m-20">';
15768
- html += '<div part="detail-head"><strong>Approved</strong></div>'
15769
- html += '<span class="material-icons color-done">check_circle</span>'
15770
- html += '</div>';
15742
+ } catch (e: any) {
15743
+ //console.log('json comments exception', comments[i]);
15744
+ html += '<div class="">' + comments[i].comment + '<br /><small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
15771
15745
  }
15772
- }
15773
15746
 
15774
- if (docs != null) {
15775
- html += '<div class="m-20">';
15776
- html += '<div part="detail-head"><strong>Documents</strong></div>'
15777
- html += '<span class="material-icons muted">description</span>'
15778
- html += docs.length
15779
15747
  html += '</div>';
15780
15748
  }
15781
-
15782
- if (comments != null) {
15783
- html += '<div class="m-20">';
15784
- html += '<div part="detail-head"><strong>Comments</strong></div>'
15785
- html += '<span class="material-icons muted">forum</span>'
15786
- html += comments.length
15787
- html += '</div>';
15749
+ if (comments.length === 0) {
15750
+ html += '<div><strong>No comments yet!</strong></div>';
15788
15751
  }
15789
15752
 
15790
- html += '<div class="m-20">';
15791
- html += '<div part="detail-head"><strong>Reporters</strong></div>'
15792
- html += this.getReporterDetailStringFromEvent(event);
15793
15753
  html += '</div>';
15794
15754
 
15795
- html += '<div class="m-20">';
15796
- html += '<div part="detail-head"><strong>Approvers</strong></div>'
15797
- html += this.getApproverDetailStringFromEvent(event);
15798
15755
  html += '</div>';
15756
+ console.log('selected event', JSON.stringify(listEvent));
15757
+ (this._SfDetailContainer as HTMLDivElement).innerHTML = html;
15758
+ (this._SfDetailContainer as HTMLDivElement).style.display = 'block';
15799
15759
 
15800
- html += '</div>';
15801
- html += '</div>';
15760
+ let usermap = Util.getUsermap();
15802
15761
 
15762
+ let sfireporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#detail-reporting') as SfIReporting
15763
+ sfireporting.usermap = JSON.stringify(usermap);
15764
+ sfireporting.selectedItem = listEvent;
15765
+ sfireporting.editdisable = "true"
15766
+ setTimeout(() => {
15767
+ console.log('sfireporting', sfireporting._SfReportingContainer);
15768
+ console.log('sfireporting', sfireporting.selectedItem);
15769
+ sfireporting.loadMode();
15770
+ }, 500);
15803
15771
 
15804
- html += '<div class="accordian-section section-statute pl-20 pr-20" part="accordian-section">';
15805
- html += '<div class="d-flex justify-between accordian-head head-statute cursor" part="accordian-head">';
15806
- html += '<h3>Statute Information</h3>'
15807
- html += '<h3 class="head-indicator-statute">-</h3>'
15808
- html += '</div>';
15809
- html += '<div class="d-flex flex-wrap accordian-body body-statute" part="accordian-body">';
15772
+ sfireporting.addEventListener('valueChanged', () => {
15773
+ sfireporting.classList.remove('hide');
15774
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#shimmer-container-agreements') as HTMLDivElement).classList.add('hide');
15775
+ });
15776
+ let reportingSchemaJson = "";
15777
+ let reportingSchemaValues = ""
15778
+ if (listEvent.reportformatschema != null) {
15779
+ reportingSchemaJson = listEvent.reportformatschema
15780
+ reportingSchemaValues = listEvent.reportformatvalues
15781
+ } else if (listEvent.customreporting != null) {
15782
+ reportingSchemaJson = listEvent.customreporting
15783
+ }
15784
+ if (listEvent.customreporting != null || listEvent.reportformatschema != null) {
15785
+ let reportingHtml = '<sf-i-reporting id="reporting-reporting" exportparts="uploader-extracted-text:reporting-uploader-extracted-text, uploader-sf-upload-message:reporting-uploader-sf-upload-message, uploader-sf-upload-submessage:reporting-uploader-sf-upload-submessage, uploader-extracted-text-chip:reporting-uploader-extracted-text-chip, uploader-extracted-text-chip-failed:reporting-uploader-extracted-text-chip-failed, uploader-doctype-verify-badge:reporting-uploader-doctype-verify-badge,span-submit-published:reporting-span-submit-published, span-submit-unpublished:reporting-span-submit-unpublished, reporting-container:reporting-reporting-container, button-icon:reporting-button-icon, uploader-button-icon:reporting-uploader-button-icon, sf-i-form-modal-container:reporting-sf-i-form-modal-container, next-calendar-date:reporting-next-calendar-date, last-calendar-date:reporting-last-calendar-date, input-publish-checkbox:reporting-input-publish-checkbox, button-icon-light:reporting-button-icon-light, button-icon-small:reporting-button-icon-small, uploader-input-label:reporting-uploader-input-label, input-radio:reporting-input-radio, radio-label:reporting-radio-label, input-textarea:reporting-input-textarea, input-textarea-disabled:reporting-input-textarea-disabled, input-date:reporting-input-date, input-date-disabled:reporting-input-date-disabled, input-select-single:reporting-input-select-single, textarea-container:reporting-textarea-container, section-body:reporting-section-body, section-container:reporting-section-container, date-container:reporting-date-container, input-sf-i-uploader:reporting-input-sf-i-uploader, published-container:reporting-published-container, selected-option:reporting-selected-option, input-select-multi-option:reporting-input-select-multi-option, select-option-label:reporting-select-option-label, input-sf-i-form:reporting-input-sf-i-form, input-sf-i-bricks:reporting-input-sf-i-bricks, uploader-input:reporting-uploader-input, form-container:reporting-form-container, published-container:reporting-published-container, form-container-published:reporting-form-container-published, subsection:reporting-subsection, results-title:reporting-results-title, td-head:reporting-td-head, td-action:reporting-td-action, td-body:reporting-td-body, td-body-2:reporting-td-body-2, add-button:reporting-add-button, uploader-button:reporting-uploader-button, section-head-collapsed:reporting-section-head-collapsed, section-title-expanded:reporting-section-title-expanded, section-title-collapsed:reporting-section-title-collapsed, section-head-expanded:reporting-section-head-expanded, progress-bar-finished:reporting-progress-bar-finished, progress-bar-complete:reporting-progress-bar-complete, progress-bar-incomplete:reporting-progress-bar-incomplete, section-success-icon:reporting-section-success-icon, section-body:reporting-section-body, title-section:reporting-title-section, button-lg:reporting-button-lg, uploader-detail-container:reporting-uploader-detail-container, textarea-label:reporting-textarea-label, date-label:reporting-date-label, commentbox:reporting-commentbox, comment-username:reporting-comment-username, detail-head:reporting-detail-head, reporting-uploader-extracted-text:reporting-reporting-uploader-extracted-text, reporting-uploader-sf-upload-message:reporting-reporting-uploader-sf-upload-message, reporting-uploader-sf-upload-submessage:reporting-reporting-uploader-sf-upload-submessage, reporting-uploader-extracted-text-chip:reporting-reporting-uploader-extracted-text-chip, reporting-uploader-extracted-text-chip-failed:reporting-reporting-uploader-extracted-text-chip-failed, reporting-uploader-doctype-verify-badge:reporting-reporting-uploader-doctype-verify-badge, reporting-span-submit-published:reporting-reporting-span-submit-published, reporting-span-submit-unpublished:reporting-reporting-span-submit-unpublished, reporting-reporting-container:reporting-reporting-reporting-container, reporting-button-icon:reporting-reporting-button-icon, reporting-uploader-button-icon:reporting-reporting-uploader-button-icon, reporting-sf-i-form-modal-container:reporting-reporting-sf-i-form-modal-container, reporting-next-calendar-date:reporting-reporting-next-calendar-date, reporting-last-calendar-date:reporting-reporting-last-calendar-date, reporting-input-publish-checkbox:reporting-reporting-input-publish-checkbox, reporting-button-icon-light:reporting-reporting-button-icon-light, reporting-button-icon-small:reporting-reporting-button-icon-small, reporting-uploader-input-label:reporting-reporting-uploader-input-label, reporting-input-radio:reporting-reporting-input-radio, reporting-radio-label:reporting-reporting-radio-label, reporting-input-textarea:reporting-reporting-input-textarea, reporting-input-textarea-disabled:reporting-reporting-input-textarea-disabled, reporting-input-date:reporting-reporting-input-date, reporting-input-date-disabled:reporting-reporting-input-date-disabled, reporting-input-select-single:reporting-reporting-input-select-single, reporting-textarea-container:reporting-reporting-textarea-container, reporting-section-body:reporting-reporting-section-body, reporting-section-container:reporting-reporting-section-container, reporting-date-container:reporting-reporting-date-container, reporting-input-sf-i-uploader:reporting-reporting-input-sf-i-uploader, reporting-published-container:reporting-reporting-published-container, reporting-selected-option:reporting-reporting-selected-option, reporting-input-select-multi-option:reporting-reporting-input-select-multi-option, reporting-select-option-label:reporting-reporting-select-option-label, reporting-input-sf-i-form:reporting-reporting-input-sf-i-form, reporting-input-sf-i-bricks:reporting-reporting-input-sf-i-bricks, reporting-uploader-input:reporting-reporting-uploader-input, reporting-form-container:reporting-reporting-form-container, reporting-published-container:reporting-reporting-published-container, reporting-form-container-published:reporting-reporting-form-container-published, reporting-subsection:reporting-reporting-subsection, reporting-results-title:reporting-reporting-results-title, reporting-td-head:reporting-reporting-td-head, reporting-td-action:reporting-reporting-td-action, reporting-td-body:reporting-reporting-td-body, reporting-td-body-2:reporting-reporting-td-body-2, reporting-add-button:reporting-reporting-add-button, reporting-uploader-button:reporting-reporting-uploader-button, reporting-section-head-collapsed:reporting-reporting-section-head-collapsed, reporting-section-title-expanded:reporting-reporting-section-title-expanded, reporting-section-title-collapsed:reporting-reporting-section-title-collapsed, reporting-section-head-expanded:reporting-reporting-section-head-expanded, reporting-progress-bar-finished:reporting-reporting-progress-bar-finished, reporting-progress-bar-complete:reporting-reporting-progress-bar-complete, reporting-progress-bar-incomplete:reporting-reporting-progress-bar-incomplete, reporting-section-success-icon:reporting-reporting-section-success-icon, reporting-section-body:reporting-reporting-section-body, reporting-title-section:reporting-reporting-title-section, reporting-button-lg:reporting-reporting-button-lg, reporting-uploader-detail-container:reporting-reporting-uploader-detail-container, reporting-textarea-label:reporting-reporting-textarea-label, reporting-date-label:reporting-reporting-date-label, reporting-commentbox:reporting-reporting-commentbox, reporting-comment-username:reporting-reporting-comment-username, reporting-detail-head:reporting-reporting-detail-head, input-sf-i-select:reporting-input-sf-i-select,reporting-input-sf-i-select:reporting-reporting-input-sf-i-select, select-input-select:reporting-select-input-select, checklist-container:reporting-checklist-container, checklist-title:reporting-checklist-title, checklist-list:reporting-checklist-list, checklist-item:reporting-checklist-item, checklist-checkbox:reporting-checklist-checkbox, checklist-checkbox-label:reporting-checklist-checkbox-label, reporting-checklist-container:reporting-reporting-checklist-container, reporting-checklist-title:reporting-reporting-checklist-title, reporting-checklist-list:reporting-reporting-checklist-list, reporting-checklist-item:reporting-reporting-checklist-item, reporting-checklist-checkbox:reporting-reporting-checklist-checkbox, reporting-checklist-checkbox-label:reporting-reporting-checklist-checkbox-label, checklist-add-input:reporting-checklist-add-input, checklist-add-button:reporting-checklist-add-button, terminate-container:reporting-terminate-container, terminate-container-terminated:reporting-terminate-container-terminated, terminate-container-active:reporting-terminate-container-active, input-terminate-checkbox: reporting-input-terminate-checkbox, reporting-terminate-container:reporting-reporting-terminate-container, reporting-terminate-container-terminated:reporting-reporting-terminate-container-terminated, reporting-terminate-container-active:reporting-reporting-terminate-container-active, reporting-input-terminate-checkbox: reporting-reporting-input-terminate-checkbox, uploader-container:reporting-uploader-container, reporting-uploader-container:reporting-reporting-uploader-container, not-selected:reporting-not-selected, reporting-not-selected:reportinig-reporting-not-selected" mode="edit" flow="reporting" name="RCM Resource Reporting" formviewclass="flex-wrap" showterminate="true" projectid="' + this.projectId + '"></sf-i-reporting>'
15786
+
15787
+ let reportFormatContainer = (this._SfDetailContainer as HTMLDivElement).querySelector('#report-format-container') as HTMLDivElement;
15788
+ if (reportFormatContainer != null) {
15789
+ reportFormatContainer.innerHTML = reportingHtml;
15790
+ }
15791
+
15792
+ }
15793
+ let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
15794
+
15795
+ if (reportingSchemaJson != "" && reportingReporting != null) {
15796
+ reportingReporting.configjson = reportingSchemaJson;
15797
+ if (reportingSchemaValues != "") reportingReporting.prepopulateValJson = reportingSchemaValues
15798
+ reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
15799
+ reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
15800
+ reportingReporting.flow = "reporting"
15801
+ setTimeout(() => {
15802
+ reportingReporting.loadMode();
15803
+ console.log('list-customreporting', reportingSchemaJson);
15804
+ console.log('list-customreporting1', reportingSchemaValues);
15805
+ console.log('list-customreporting2', reportingReporting.mode);
15806
+ }, 500)
15807
+ }
15808
+
15809
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close')?.addEventListener('click', () => {
15810
+
15811
+ (this._SfDetailContainer as HTMLDivElement).innerHTML = '';
15812
+ (this._SfDetailContainer as HTMLDivElement).style.display = 'none';
15813
+
15814
+ });
15815
+
15816
+ (this._SfDetailContainer as HTMLDivElement).querySelector('.button-delete')?.addEventListener('click', async () => {
15817
+
15818
+ // await this.fetchDeleteReview(listEvent["id"], mmddyyyy, entityId, locationId);
15819
+ // this.setSuccess('Deleted successfully!')
15820
+ // setTimeout(() => {
15821
+ // this.clearMessages()
15822
+ // }, 3000);
15823
+ // //console.log('deleted', resultDelete);
15824
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
15825
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
15826
+ // } else {
15827
+ // if(currentColumnButton != null) {
15828
+ // currentColumnButton.click();
15829
+ // }
15830
+ // }
15831
+
15832
+ console.log('delete review clicked')
15833
+
15834
+ var clickEvent = new MouseEvent("click", {
15835
+ "view": window,
15836
+ "bubbles": true,
15837
+ "cancelable": false
15838
+ });
15839
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
15840
+
15841
+ });
15842
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-auto-approve')?.addEventListener('click', async () => {
15843
+ if (this.selectedItemIds.length === 0) {
15844
+ console.log('audto approve single')
15845
+ } else {
15846
+ console.log('auto approve bulk')
15847
+ }
15848
+ //console.log('deleted', resultDelete);
15849
+ if (this.getCurrentTab() == this.TAB_CUSTOM) {
15850
+ this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
15851
+ } else {
15852
+ // if(currentColumnButton != null) {
15853
+ // currentColumnButton.click();
15854
+ // }
15855
+ }
15856
+
15857
+ var clickEvent = new MouseEvent("click", {
15858
+ "view": window,
15859
+ "bubbles": true,
15860
+ "cancelable": false
15861
+ });
15862
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
15863
+
15864
+ });
15865
+
15866
+ if (this.mode == "consumer" || this.mode == "next") {
15867
+
15868
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-approve')?.addEventListener('click', async (ev: any) => {
15869
+ let buttonClick = ev.target as HTMLButtonElement
15870
+ buttonClick.innerHTML = "Saving..."
15871
+ const comments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approver-comments') as HTMLInputElement).value;
15872
+ const approved = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked;
15873
+ let currStatus = this.getCompletenessStatus(listEvent);
15874
+ let newEvent = { ...listEvent };
15875
+ newEvent.comments = comments;
15876
+ newEvent.approved = approved;
15877
+ let newStatus = this.getCompletenessStatus(newEvent);
15878
+ if (currStatus == newStatus) {
15879
+ buttonClick.innerHTML = "Save"
15880
+ this.setError(approved ? 'Already Approved!' : 'Already Rejected!');
15881
+ setTimeout(() => {
15882
+ this.clearMessages();
15883
+ }, 3000);
15884
+ return;
15885
+ }
15886
+ let reportformatvalues = ""
15887
+ let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
15888
+ console.log('renew reporting', reportingReporting)
15889
+ if (reportingReporting != null) {
15890
+ reportformatvalues = JSON.stringify(reportingReporting!.selectedValues()) ?? "";
15891
+ }
15892
+ var clickEvent = new MouseEvent("click", {
15893
+ "view": window,
15894
+ "bubbles": true,
15895
+ "cancelable": false
15896
+ });
15897
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
15898
+
15899
+ // await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved)
15900
+ let flagBulk = false;
15901
+ if (this.selectedItemIds.length <= 1) {
15902
+ console.log('mmddyyyy', mmddyyyy)
15903
+ if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
15904
+ if (approved) {
15905
+ await this.renewRCMResource(listEvent, reportformatvalues);
15906
+ } else {
15907
+ console.log('renew reporting', reportformatvalues)
15908
+ }
15909
+ for (var p = 0; p < this.events[mmdd].length; p++) {
15910
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
15911
+ this.events[mmdd][p].approved = approved
15912
+ this.events[mmdd][p].terminated = (JSON.parse(reportformatvalues).terminated) ?? false
15913
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
15914
+ this.events[mmdd][p].lastupdated = new Date().toString()
15915
+ }
15916
+ }
15917
+ if (this.recentlyReported[mmdd] == null) {
15918
+ this.recentlyReported[mmdd] = []
15919
+ }
15920
+ this.recentlyReported[mmdd].push(listEvent)
15921
+ console.log('review single')
15922
+ }
15923
+ } else {
15924
+ let bulkBodyReview = []
15925
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
15926
+
15927
+ const selectedId = this.selectedItemIds[k];
15928
+ //console.log('selectedid', selectedId);
15929
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
15930
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
15931
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
15932
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
15933
+
15934
+ //console.log(entityId, locationId, eventId, mmddyyyy);
15935
+ bulkBodyReview.push({
15936
+ "mmddyyyy": mmddyyyy,
15937
+ "projectid": this.projectId,
15938
+ "type": "review",
15939
+ "eventid": eventId,
15940
+ "comments": comments,
15941
+ "approved": approved,
15942
+ "entityid": entityId,
15943
+ "locationid": locationId,
15944
+ "username": this.userName,
15945
+ "userid": this.userProfileId,
15946
+ "userrole": this.myRole,
15947
+ "year": this.calendarStartYYYY,
15948
+ "module": listEvent.module ?? "events"
15949
+ })
15950
+ // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, comments, approved)
15951
+
15952
+ // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
15953
+ // await this.sleep(2000);
15954
+ // this.clearMessages();
15955
+
15956
+ }
15957
+ await this.uploadReviewsBulk(bulkBodyReview);
15958
+
15959
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
15960
+
15961
+ const selectedId = this.selectedItemIds[k];
15962
+ //console.log('selectedid', selectedId);
15963
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
15964
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
15965
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
15966
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
15967
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
15968
+ for (var p = 0; p < this.events[mmdd].length; p++) {
15969
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
15970
+
15971
+ this.events[mmdd][p].isbulk = true
15972
+ flagBulk = true;
15973
+ if (this.recentlyReported[mmdd] == null) {
15974
+ this.recentlyReported[mmdd] = []
15975
+ }
15976
+ this.recentlyReported[mmdd].push(this.events[mmdd][p])
15977
+ }
15978
+ }
15979
+ }
15980
+ console.log('review bulk')
15981
+ }
15982
+
15983
+ if (this.mode == "next") {
15984
+ // this.fetchNext(this.nextPage)
15985
+ this.renderRoleTabsNext(this.nextPage)
15986
+ } else {
15987
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
15988
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
15989
+ // } else
15990
+ if (this.getCurrentTab() == this.TAB_FIND) {
15991
+ const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
15992
+ this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
15993
+ } else {
15994
+ if (this.selectedItemIds.length > 0) {
15995
+ await this.fetchBulkReportingData();
15996
+ }
15997
+ this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
15998
+ var clickEvent = new MouseEvent("click", {
15999
+ "view": window,
16000
+ "bubbles": true,
16001
+ "cancelable": false
16002
+ });
16003
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)?.dispatchEvent(clickEvent);
16004
+
16005
+ // if(currentColumnButton != null) {
16006
+ // currentColumnButton.click();
16007
+ // }
16008
+ }
16009
+ }
16010
+
16011
+ });
16012
+
16013
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-audit')?.addEventListener('click', async (ev: any) => {
16014
+ let buttonClick = ev.target as HTMLButtonElement
16015
+ buttonClick.innerHTML = "Saving..."
16016
+ const comments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-auditor-comments') as HTMLInputElement).value;
16017
+ const approved = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked;
16018
+ let currStatus = this.getCompletenessStatus(listEvent);
16019
+ let newEvent = { ...listEvent };
16020
+ newEvent.comments = comments;
16021
+ newEvent.approved = approved;
16022
+ let newStatus = this.getCompletenessStatus(newEvent);
16023
+ if (currStatus == newStatus) {
16024
+ buttonClick.innerHTML = "Save"
16025
+ this.setError(approved ? 'Already Approved!' : 'Already Rejected!');
16026
+ setTimeout(() => {
16027
+ this.clearMessages();
16028
+ }, 3000);
16029
+ return;
16030
+ }
16031
+ if (comments.trim().length === 0) {
16032
+ buttonClick.innerHTML = "Save"
16033
+ this.setError('Comments cannot be blank!');
16034
+ setTimeout(() => {
16035
+ this.clearMessages();
16036
+ }, 3000);
16037
+
16038
+ } else {
16039
+ let flagBulk = false;
16040
+ if (this.selectedItemIds.length <= 1) {
16041
+
16042
+ if (await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
16043
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16044
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16045
+ this.events[mmdd][p].approved = approved
16046
+ this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
16047
+ this.events[mmdd][p].lastupdated = new Date().toString()
16048
+ }
16049
+ }
16050
+ if (this.recentlyReported[mmdd] == null) {
16051
+ this.recentlyReported[mmdd] = []
16052
+ }
16053
+ this.recentlyReported[mmdd].push(listEvent)
16054
+ }
16055
+ console.log('uploadaudit single')
16056
+ } else {
16057
+ let bulkBodyAudit = []
16058
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
16059
+
16060
+ const selectedId = this.selectedItemIds[k];
16061
+ //console.log('selectedid', selectedId);
16062
+
16063
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
16064
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
16065
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
16066
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
16067
+
16068
+ //console.log(entityId, locationId, eventId, mmddyyyy);
16069
+ bulkBodyAudit.push({
16070
+ "mmddyyyy": mmddyyyy,
16071
+ "projectid": this.projectId,
16072
+ "type": "audit",
16073
+ "eventid": eventId,
16074
+ "comments": comments,
16075
+ "approved": approved,
16076
+ "entityid": entityId,
16077
+ "locationid": locationId,
16078
+ "username": this.userName,
16079
+ "userid": this.userProfileId,
16080
+ "userrole": this.myRole,
16081
+ "year": this.calendarStartYYYY,
16082
+ "module": listEvent.module ?? "events"
16083
+ })
16084
+ // await this.uploadAudit(entityId, locationId, mmddyyyy, eventId, comments, approved);
16085
+
16086
+ }
16087
+
16088
+ await this.uploadAuditsBulk(bulkBodyAudit);
16089
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
16090
+
16091
+ const selectedId = this.selectedItemIds[k];
16092
+ //console.log('selectedid', selectedId);
16093
+ let entityId = selectedId.split('-')[7].replace(/_/g, '-');
16094
+ let locationId = selectedId.split('-')[8].replace(/_/g, '-');
16095
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
16096
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
16097
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
16098
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16099
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16100
+
16101
+ this.events[mmdd][p].isbulk = true
16102
+ flagBulk = true;
16103
+ if (this.recentlyReported[mmdd] == null) {
16104
+ this.recentlyReported[mmdd] = []
16105
+ }
16106
+ this.recentlyReported[mmdd].push(this.events[mmdd][p])
16107
+ }
16108
+ }
16109
+ }
16110
+
16111
+ console.log('uploadAudit bulk')
16112
+
16113
+ }
16114
+
16115
+ var clickEvent = new MouseEvent("click", {
16116
+ "view": window,
16117
+ "bubbles": true,
16118
+ "cancelable": false
16119
+ });
16120
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
16121
+ if (this.mode == "next") {
16122
+ this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
16123
+ } else {
16124
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
16125
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
16126
+ // } else
16127
+ if (this.getCurrentTab() == this.TAB_FIND) {
16128
+ const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
16129
+ this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
16130
+ } else {
16131
+ if (this.selectedItemIds.length > 0) {
16132
+ await this.fetchBulkReportingData();
16133
+ }
16134
+ this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
16135
+ // if(currentColumnButton != null) {
16136
+ // currentColumnButton.click();
16137
+ // }
16138
+ }
16139
+ }
16140
+
16141
+ }
16142
+
16143
+
16144
+
16145
+ });
16146
+
16147
+ if (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) {
16148
+
16149
+ if (approved) {
16150
+
16151
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement) != null) {
16152
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement).style.visibility = 'hidden';
16153
+ }
16154
+
16155
+
16156
+ } else {
16157
+
16158
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement) != null) {
16159
+
16160
+
16161
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement).style.visibility = 'visible';
16162
+
16163
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report')?.addEventListener('click', async (ev: any) => {
16164
+ let buttonClick = ev.target as HTMLButtonElement
16165
+ buttonClick.innerHTML = "Saving..."
16166
+ const reportercomments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-comments') as HTMLInputElement).value;
16167
+
16168
+ //console.log('reporter comments 1', reportercomments);
16169
+
16170
+ // const reporterdoc = ((((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-doc') as HTMLInputElement) != null) && ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-doc') as HTMLInputElement).value.length > 0) ? (new Date(((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-doc') as HTMLInputElement).value).getTime() + "") : "";
16171
+ const reporterdoc = new Date().getTime() + "";
16172
+ let docs: any[] = [];
16173
+
16174
+ //console.log('reporter comments 2', reportercomments);
16175
+
16176
+ // if(docsOptional.length === 0) {
16177
+ // docs = (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.selectedValues();
16178
+ // }
16179
+
16180
+ //console.log('docs', docs);
16181
+ let reportformatvalues: string = "";
16182
+ let reportformatschema: string = "";
16183
+ if (listEvent.customreporting != null) {
16184
+ let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
16185
+ console.log('reportformatvalues', JSON.stringify(reportingReporting.selectedValues()))
16186
+ reportformatvalues = JSON.stringify(reportingReporting!.selectedValues()) ?? "";
16187
+ reportformatschema = reportingReporting!.configjson ?? "";
16188
+ }
16189
+
16190
+ let percentage: string = "100";
16191
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement) != null) {
16192
+ percentage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement).value
16193
+ }
16194
+ // if (Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
16195
+
16196
+ // //console.log('reporter comments 3', reportercomments);
16197
+ // buttonClick.innerHTML = "Save"
16198
+ // this.setError('Invalid Percentage!');
16199
+ // setTimeout(() => {
16200
+ // this.clearMessages();
16201
+ // }, 3000);
16202
+
16203
+ // } else {
16204
+ // if (docs.length === 0 && docsOptional.length === 0) {
16205
+
16206
+ // //console.log('reporter comments 3', reportercomments);
16207
+ // buttonClick.innerHTML = "Save"
16208
+ // this.setError('No documents uploaded!');
16209
+ // setTimeout(() => {
16210
+ // this.clearMessages();
16211
+ // }, 3000);
16212
+
16213
+ // } else {
16214
+
16215
+ // //console.log('reporterdoc', reporterdoc);
16216
+
16217
+ // if (reporterdoc.length === 0) {
16218
+ // buttonClick.innerHTML = "Save"
16219
+ // this.setError('Date of completion not selected!');
16220
+ // setTimeout(() => {
16221
+ // this.clearMessages();
16222
+ // }, 3000);
16223
+
16224
+ // } else if (parseInt(reporterdoc) > new Date().getTime()) {
16225
+ // buttonClick.innerHTML = "Save"
16226
+ // this.setError('Date of completion cannot be in future!');
16227
+ // setTimeout(() => {
16228
+ // this.clearMessages();
16229
+ // }, 3000);
16230
+
16231
+ // } else {
16232
+
16233
+ //console.log('makerscheckers 1', reportercomments);
16234
+
16235
+ if (reportercomments.trim().length === 0) {
16236
+ buttonClick.innerHTML = "Save"
16237
+ this.setError('Comments cannot be blank!');
16238
+ setTimeout(() => {
16239
+ this.clearMessages();
16240
+ }, 3000);
16241
+
16242
+ } else {
16243
+
16244
+
16245
+ var clickEvent = new MouseEvent("click", {
16246
+ "view": window,
16247
+ "bubbles": true,
16248
+ "cancelable": false
16249
+ });
16250
+
16251
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
16252
+ let flagBulk = false;
16253
+ if (this.selectedItemIds.length <= 1) {
16254
+
16255
+ if (await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, listEvent.module, percentage, makercheckers)) {
16256
+ console.log('this.events', this.events);
16257
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16258
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16259
+ this.events[mmdd][p].documents = docs
16260
+ this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() })
16261
+ this.events[mmdd][p].lastupdated = new Date().toString()
16262
+ }
16263
+ }
16264
+ console.log('uploadReport single')
16265
+ if (makercheckers.length > 0) {
16266
+
16267
+ // await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
16268
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16269
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16270
+ this.events[mmdd][p].approved = true
16271
+ this.events[mmdd][p].terminated = (JSON.parse(reportformatvalues).terminated) ?? false
16272
+ // this.events[mmdd][p].documents = docs
16273
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() })
16274
+ this.events[mmdd][p].lastupdated = new Date().toString()
16275
+ }
16276
+ }
16277
+ await this.renewRCMResource(listEvent, reportformatvalues);
16278
+ console.log('upload report auto approve single')
16279
+ }
16280
+ if (this.recentlyReported[mmdd] == null) {
16281
+ this.recentlyReported[mmdd] = []
16282
+ }
16283
+ this.recentlyReported[mmdd].push(listEvent)
16284
+ }
16285
+ } else {
16286
+ let bulkBody = []
16287
+ let bulkBodyReview = []
16288
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
16289
+
16290
+ const selectedId = this.selectedItemIds[k];
16291
+ //console.log('selectedid', selectedId);
16292
+
16293
+ const makercheckersL = selectedId.split('-')[5];
16294
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
16295
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
16296
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
16297
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
16298
+
16299
+ //console.log(entityId, locationId, eventId, mmddyyyy);
16300
+
16301
+ // await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
16302
+ // if(parseInt(makercheckersL) > 0) {
16303
+ // bulkBodyReview.push({
16304
+ // "mmddyyyy": mmddyyyy,
16305
+ // "projectid": this.projectId,
16306
+ // "type": "report",
16307
+ // "eventid": eventId,
16308
+ // "comments": reportercomments,
16309
+ // "dateofcompletion": reporterdoc,
16310
+ // "percentage": percentage,
16311
+ // "entityid": entityId,
16312
+ // "locationid": locationId,
16313
+ // "event": null,
16314
+ // "docs": JSON.stringify(docs),
16315
+ // "approved": true,
16316
+ // "username": this.userName,
16317
+ // "reportformatvalues": reportformatvalues,
16318
+ // "reportformatschema": reportformatschema,
16319
+ // "userid": this.userProfileId,
16320
+ // "userrole": this.myRole,
16321
+ // "year": this.calendarStartYYYY,
16322
+ // "module": listEvent.module ?? "events"
16323
+ // } )
16324
+ // // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
16325
+
16326
+ // }else{
16327
+ bulkBody.push({
16328
+ "mmddyyyy": mmddyyyy,
16329
+ "projectid": this.projectId,
16330
+ "type": "report",
16331
+ "eventid": eventId,
16332
+ "comments": reportercomments,
16333
+ "dateofcompletion": reporterdoc,
16334
+ "percentage": percentage,
16335
+ "entityid": entityId,
16336
+ "locationid": locationId,
16337
+ "event": null,
16338
+ "docs": JSON.stringify(docs),
16339
+ "username": this.userName,
16340
+ "reportformatvalues": reportformatvalues,
16341
+ "reportformatschema": reportformatschema,
16342
+ "userid": this.userProfileId,
16343
+ "userrole": this.myRole,
16344
+ "year": this.calendarStartYYYY,
16345
+ "module": listEvent.module ?? "events",
16346
+ "makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
16347
+ })
16348
+ // }
16349
+
16350
+ // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
16351
+ // await this.sleep(2000);
16352
+ // this.clearMessages();
16353
+
16354
+ }
16355
+
16356
+ // await this.uploadReportsBulk(bulkBody);
16357
+ // await this.fetchBulkReportingData();
16358
+ if (bulkBody.length > 0) {
16359
+ await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
16360
+ }
16361
+
16362
+ // if(bulkBodyReview.length > 0){
16363
+ // await this.uploadReportsReviewsBulk(bulkBodyReview)
16364
+ // }
16365
+ await this.fetchBulkReportingData();
16366
+ console.log('uploadReport bulk')
16367
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
16368
+
16369
+ const selectedId = this.selectedItemIds[k];
16370
+ //console.log('selectedid', selectedId);
16371
+ let entityId = selectedId.split('-')[7].replace(/_/g, '-');
16372
+ let locationId = selectedId.split('-')[8].replace(/_/g, '-');
16373
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
16374
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
16375
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
16376
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16377
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
16378
+
16379
+ this.events[mmdd][p].isbulk = true
16380
+ flagBulk = true;
16381
+ if (this.recentlyReported[mmdd] == null) {
16382
+ this.recentlyReported[mmdd] = []
16383
+ }
16384
+ this.recentlyReported[mmdd].push(this.events[mmdd][p])
16385
+ }
16386
+ }
16387
+ }
16388
+
16389
+ }
16390
+
16391
+ if (this.mode == "next") {
16392
+ this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
16393
+ } else {
16394
+ // if(this.getCurrentTab() == this.TAB_CUSTOM) {
16395
+ // this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
16396
+ // } else
16397
+ if (this.getCurrentTab() == this.TAB_FIND) {
16398
+ const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
16399
+ this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
16400
+ } else {
16401
+ if (this.selectedItemIds.length > 0) {
16402
+ await this.fetchBulkReportingData();
16403
+ }
16404
+ this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk)
16405
+ // if(currentColumnButton != null) {
16406
+ // currentColumnButton.click();
16407
+ // }
16408
+ }
16409
+ }
16410
+
16411
+ }
16412
+
16413
+
16414
+ // }
16415
+ // }
16416
+ // }
16417
+ });
16418
+
16419
+ }
16420
+
16421
+ }
16422
+
16423
+ }
16424
+
16425
+ if (this._SfUploader[0] != null) {
16426
+ (this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "none"
16427
+ this._SfUploader[0].querySelector('#uploader').addEventListener('analysisInProgress', (_ev: any) => {
16428
+ console.log('uploader analysisInProgress', _ev);
16429
+ (this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "block"
16430
+ });
16431
+ this._SfUploader[0].querySelector('#uploader').addEventListener('analysisCompleted', (_ev: any) => {
16432
+ console.log('uploader analysisInProgress', _ev);
16433
+ (this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "none"
16434
+ });
16435
+
16436
+
16437
+ //console.log('documentType checking', documentType);
16438
+
16439
+ if (documentType != null) {
16440
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.docType = documentType;
16441
+ }
16442
+
16443
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.prepopulatedInputArr = JSON.stringify([]);
16444
+ console.log('uploader', (this._SfUploader[0].querySelector('#uploader') as SfIUploader));
16445
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
16446
+
16447
+ if (docs.length > 0) {
16448
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.prepopulatedInputArr = JSON.stringify(docs);
16449
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
16450
+ }
16451
+
16452
+ if (this.myRole == this.TAB_APPROVER || approved) {
16453
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.readOnly = true;
16454
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
16455
+ } else {
16456
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.readOnly = false;
16457
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
16458
+ }
16459
+
16460
+ const dataPassthrough = {
16461
+ projectId: this.projectId,
16462
+ countryId: this.countryId,
16463
+ entityId: listEvent.entityid,
16464
+ locationId: listEvent.locationid,
16465
+ mmddyyyy: mmddyyyy,
16466
+ complianceId: listEvent['id'],
16467
+ path: "uploadextract"
16468
+ };
16469
+
16470
+ const callbackUrlHost = "8icpy39ru0.execute-api.us-east-1.amazonaws.com";
16471
+ const callbackUrlPath = "test/uploadextract";
16472
+
16473
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.projectId = this.projectId;
16474
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.dataPassthrough = JSON.stringify(dataPassthrough);
16475
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.callbackUrlHost = callbackUrlHost;
16476
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.callbackUrlPath = callbackUrlPath;
16477
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
16478
+
16479
+ }
16480
+
16481
+
16482
+
16483
+ //console.log('approved 1', event["approved"], this.myRole, this.TAB_APPROVER);
16484
+ if (this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_VIEWER || this.myRole == this.TAB_AUDITOR || this.myRole == this.TAB_FUNCTION_HEAD) {
16485
+ //console.log('approved 1', event["approved"], this.myRole, this.TAB_APPROVER);
16486
+ if (listEvent["approved"] != null) {
16487
+ if (listEvent["approved"] === true) {
16488
+ //console.log('approved 2', event["approved"], this.myRole, this.TAB_APPROVER);
16489
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement) != null) {
16490
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked = true;
16491
+ }
16492
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
16493
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement).checked = false;
16494
+ }
16495
+ } else {
16496
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement) != null) {
16497
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement)!.checked = false;
16498
+ }
16499
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
16500
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement)!.checked = true;
16501
+ }
16502
+ }
16503
+ } else {
16504
+ if ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement != null) {
16505
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked = false;
16506
+ }
16507
+ if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
16508
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement).checked = true;
16509
+ }
16510
+
16511
+ }
16512
+ }
16513
+
16514
+ }
16515
+ }
16516
+
16517
+ fetchEventDetails = async (listEvent: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement, flagUploadGuidance: boolean = false, listEventContainer: HTMLDivElement | null = null) => {
16518
+ console.log('listEvent', listEvent, listEvent.id)
16519
+ let url = "https://" + this.apiId + "/getalleventdetails";
16520
+
16521
+ //console.log('fetch calendar url', url);
16522
+ let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "eventid": listEvent.id, "entityid": listEvent.entityid, "locationid": listEvent.locationid, "mmddyyyy": mmddyyyy, "year": this.getFinancialYear(mmddyyyy) };
16523
+
16524
+ //console.log('urlbody', urlBody);
16525
+
16526
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
16527
+ const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
16528
+ this._SfLoader.innerHTML = '';
16529
+ if (xhr.status == 200) {
16530
+
16531
+ const jsonRespose = JSON.parse(xhr.responseText);
16532
+ console.log('jsonRespose', jsonRespose);
16533
+ if (flagUploadGuidance) {
16534
+ if (listEventContainer != null) {
16535
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
16536
+ if (this.events[mmdd] != null) {
16537
+ for (var p = 0; p < this.events[mmdd].length; p++) {
16538
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == listEvent.locationid && this.events[mmdd][p].entityid == listEvent.entityid) {
16539
+ this.events[mmdd][p].uploadguidance = jsonRespose.data.uploadguidance
16540
+ }
16541
+ }
16542
+ }
16543
+ this.renderListReporting(listEventContainer, jsonRespose.data, mmddyyyy, eventsContainer)
16544
+ }
16545
+ } else {
16546
+ this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer);
16547
+ }
16548
+
16549
+ } else {
16550
+ if (xhr.status == 401) {
16551
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
16552
+ this.dispatchEvent(changeEvent);
16553
+ }
16554
+ if (xhr.status === 404) {
16555
+
16556
+ this.showChosenProject();
16557
+ (this._SfTitleChosenProject as HTMLElement).innerHTML = (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedTexts()[0];
16558
+ this.renderChosenProject();
16559
+
16560
+ } else {
16561
+ const jsonRespose = JSON.parse(xhr.responseText);
16562
+ this.setError(jsonRespose.error);
16563
+ }
16564
+
16565
+ }
16566
+ }
16567
+
16568
+ renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement) => {
16569
+ console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
16570
+
16571
+ let comments, docs, approved, /*dateOfCompletion,*/ makercheckers: Array<string>, docsOptional, documentType;
16572
+ let entityId: string = "";
16573
+ let locationId: string = "";
16574
+ let statuteName: string = "";
16575
+ let reportformatName: string = "";
16576
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
16577
+ entityId = event.entityid;
16578
+ locationId = event.locationid;
16579
+ // let completeness = this.getCompletenessStatus(event);
16580
+ comments = event['comments'] == null ? [] : (event['comments']);
16581
+ docs = event['documents'] == null ? [] : event['documents'] == null ? [] : (event['documents']);
16582
+ approved = event['approved'] == null ? false : event['approved'] == null ? false : event['approved'];
16583
+ // dateOfCompletion = event['dateofcompletion'] == null ? '' : event['dateofcompletion'] == null ? '' : event['dateofcompletion'];
16584
+ makercheckers = event['makercheckers'] == null ? [] : event['makercheckers'] == null ? [] : event['makercheckers'];
16585
+ docsOptional = event['docs'] == null ? [] : event['docs'] == null ? [] : event['docs'];
16586
+ documentType = event['documenttype'] == null ? null : event['documenttype'][0] == null ? null : event['documenttype'][0].split(" ")[0];
16587
+
16588
+ statuteName = event['statute'][0].trim();
16589
+ if (event['reportformat'] != null) {
16590
+ reportformatName = (event['reportformat'][0] ?? "").trim().replace('&amp;', '&');
16591
+ }
16592
+
16593
+ console.log('event detail', event, statuteName);
16594
+ //console.log('event detail comments', comments);
16595
+ //console.log('event dateofcompletion', dateOfCompletion);
16596
+ //console.log('event detail documenttype', documentType);
16597
+ const basicFields = ['id', 'shortid', 'entityname', 'locationname', 'functions'];
16598
+ const statuteFields = ['jurisdiction', 'country', 'state', 'category', 'subcategory', 'statute'];
16599
+ const complianceFields = ['specificity', 'reference', 'obligation', 'penalty', 'authority', 'frequency', 'subfrequency', 'obligationtype', 'duedate', 'applicability', 'form', 'additionalurls', 'adhocquestion', 'adhocquestionschedule', 'adhocinstances', 'uploadguidance', 'attachment'];
16600
+ const grcFields = ['internalcontrols', 'firstlineofdefence', 'secondlineofdefence', 'thirdlineofdefence', 'risk', 'riskarea'];
16601
+
16602
+ let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
16603
+ for (let tempReportingContainer of listReportingContainers) {
16604
+ tempReportingContainer.style.display = 'none';
16605
+ tempReportingContainer.innerHTML = '';
16606
+ }
16607
+ let buttonListReportings = eventsContainer.querySelectorAll('.button-list-reporting') as NodeListOf<HTMLButtonElement>
16608
+ for (let buttonListReporting of buttonListReportings) {
16609
+ buttonListReporting.setAttribute('part', 'button-list-reporting')
16610
+ }
16611
+ let streamEventTitles = eventsContainer.querySelectorAll('.stream-event-title') as NodeListOf<SfIElasticText>
16612
+ for (let streamEventTitle of streamEventTitles) {
16613
+ streamEventTitle.removeAttribute('part')
16614
+ }
16615
+ var html = `
16616
+
16617
+ <div part="compliance-detail-title" class="d-flex justify-between">
16618
+ <button part="button-icon" class="material-icons invisible">close</button>
16619
+ <h3 part="results-title" class="m-0">Compliance Details</h3>
16620
+ <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
16621
+ </div>
16622
+
16623
+ `;
16624
+
16625
+ if (this.selectedItemIds.length > 1) {
16626
+
16627
+ html += `
16628
+
16629
+ <div class="d-flex justify-between m-20">
16630
+ <h4 class="m-0">${this.selectedItemIds.length - 1} other ` + ((this.selectedItemIds.length - 1) === 1 ? `item` : `items`) + ` also selected</h4>
16631
+ </div>
16632
+
16633
+ `;
16634
+
16635
+ }
16636
+
16637
+ html += '<div class="accordian-container m-20 pb-20" part="accordian-container">';
16638
+
16639
+ html += '<div part="detail-summary">';
16640
+ html += ('<div part="detail-summary-title" class="pl-20 pr-20"><h1>' + event['obligationtitle'] + '</h1></div>');
16641
+ html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + event['obligation'].replace(/\n/g, '<br />') + '</h3></div>');
16642
+ html += ('<div part="detail-summary-content" class="pl-20 pr-20">' + ('<sf-i-elastic-text text="' + (event['internalcontrols'] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
16643
+ html += '</div>';
16644
+
16645
+ html += '<br />';
16646
+
16647
+ html += '<div class="accordian-section section-basic pl-20 pr-20" part="accordian-section">';
16648
+ html += '<div class="d-flex justify-between accordian-head head-basic cursor" part="accordian-head">';
16649
+ html += '<h3>Basic Information</h3>'
16650
+ html += '<h3 class="head-indicator-basic">-</h3>'
16651
+ html += '</div>';
16652
+ html += '<div class="d-flex flex-wrap accordian-body body-basic" part="accordian-body">';
16653
+
16654
+ for (var i = 0; i < basicFields.length; i++) {
16655
+
16656
+ if (!this.getEventPreviewFields().includes(basicFields[i])) {
16657
+
16658
+ if (!this.getEventHideFields().includes(basicFields[i])) {
16659
+
16660
+ console.log('basicFields', event[basicFields[i]] + "");
16661
+ if ((event[basicFields[i]] + "").indexOf("[") >= 0) {
16662
+ html += '<div class="m-20">';
16663
+ html += '<div part="detail-head"><strong>' + basicFields[i] + '</strong></div>'
16664
+ html += this.getEventTexts(basicFields[i], JSON.parse(event[basicFields[i]]), event).replace(/ *\([^)]*\) */g, "").trim();
16665
+ html += '</div>';
16666
+ } else {
16667
+ html += '<div class="m-20">';
16668
+ html += '<div part="detail-head"><strong>' + basicFields[i] + '</strong></div>'
16669
+ html += '<sf-i-elastic-text text="' + (event[basicFields[i]] + "").replace(/"/g, "").replace(/ *\([^)]*\) */g, "").trim().split(';')[0] + '" minLength="80"></sf-i-elastic-text>';
16670
+ html += '</div>';
16671
+ }
16672
+
16673
+ }
16674
+ }
16675
+
16676
+ }
16677
+
16678
+ if (this.mode == "consumer") {
16679
+ if (approved) {
16680
+ html += '<div class="m-20">';
16681
+ html += '<div part="detail-head"><strong>Approved</strong></div>'
16682
+ html += '<span class="material-icons color-done">check_circle</span>'
16683
+ html += '</div>';
16684
+ }
16685
+ }
16686
+
16687
+ if (docs != null) {
16688
+ html += '<div class="m-20">';
16689
+ html += '<div part="detail-head"><strong>Documents</strong></div>'
16690
+ html += '<span class="material-icons muted">description</span>'
16691
+ html += docs.length
16692
+ html += '</div>';
16693
+ }
16694
+
16695
+ if (comments != null) {
16696
+ html += '<div class="m-20">';
16697
+ html += '<div part="detail-head"><strong>Comments</strong></div>'
16698
+ html += '<span class="material-icons muted">forum</span>'
16699
+ html += comments.length
16700
+ html += '</div>';
16701
+ }
16702
+
16703
+ html += '<div class="m-20">';
16704
+ html += '<div part="detail-head"><strong>Reporters</strong></div>'
16705
+ html += this.getReporterDetailStringFromEvent(event);
16706
+ html += '</div>';
16707
+
16708
+ html += '<div class="m-20">';
16709
+ html += '<div part="detail-head"><strong>Approvers</strong></div>'
16710
+ html += this.getApproverDetailStringFromEvent(event);
16711
+ html += '</div>';
16712
+
16713
+ html += '</div>';
16714
+ html += '</div>';
16715
+
16716
+
16717
+ html += '<div class="accordian-section section-statute pl-20 pr-20" part="accordian-section">';
16718
+ html += '<div class="d-flex justify-between accordian-head head-statute cursor" part="accordian-head">';
16719
+ html += '<h3>Statute Information</h3>'
16720
+ html += '<h3 class="head-indicator-statute">-</h3>'
16721
+ html += '</div>';
16722
+ html += '<div class="d-flex flex-wrap accordian-body body-statute" part="accordian-body">';
15810
16723
 
15811
16724
  for (var i = 0; i < statuteFields.length; i++) {
15812
16725
 
@@ -16059,6 +16972,11 @@ export class SfIEvents extends LitElement {
16059
16972
  // for(let attachmentUploader of attachmentUploaders){
16060
16973
  // attachmentUploader.loadMode();
16061
16974
  // }
16975
+
16976
+ let ddmmyyyy = mmddyyyy.split('/')[1] + '/' + mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[2];
16977
+
16978
+ let emailcontent = `<table border="0" cellspacing="0" style="color:#666666;border-radius:5px;border:solid 1px #efefef;width:100%; margin-top:20px"><tbody><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Compliance ID</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.id}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Country</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.countryname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Entity</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.entityname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Location</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.locationname}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%;font-weight:bold">Statute</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#fbfbfb;font-size:110%">${event.statute}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Subcategory</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${event.subcategory}</td></tr><tr><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%;font-weight:bold">Due Date</td><td style="padding:10px;padding-top:10px;padding-bottom:10px;vertical-align:top;background-color:#f5f5f5;font-size:110%">${ddmmyyyy}</td></tr></tbody></table>`;
16979
+ (this._SfUploader[0].querySelector('#uploader') as SfIUploader).emailcontent = emailcontent;
16062
16980
  (this._SfDetailContainer as HTMLDivElement).querySelector('.button-delete')?.addEventListener('click', async () => {
16063
16981
 
16064
16982
  await this.fetchDeleteReview(event["id"], mmddyyyy, entityId, locationId);
@@ -21552,6 +22470,8 @@ export class SfIEvents extends LitElement {
21552
22470
  await this.fetchAndRenderContracts(this.sdate, this.edate, "", "no");
21553
22471
  } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
21554
22472
  await this.fetchAndRenderLicenses(this.sdate, this.edate, "", "no");
22473
+ } else if (this.selectedFeatures.indexOf('rcmresources') >= 0) {
22474
+ await this.fetchAndRenderRCMResources(this.sdate, this.edate, "", "no");
21555
22475
  }
21556
22476
  // await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no");
21557
22477
  }
@@ -26701,6 +27621,8 @@ export class SfIEvents extends LitElement {
26701
27621
  this.fetchAndRenderContracts(startDate, endDate, searchString, list, month, year);
26702
27622
  } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
26703
27623
  this.fetchAndRenderLicenses(startDate, endDate, searchString, list, month, year);
27624
+ } else if (this.selectedFeatures.indexOf('rcmresources') >= 0) {
27625
+ this.fetchAndRenderRCMResources(startDate, endDate, searchString, list, month, year);
26704
27626
  }
26705
27627
  }
26706
27628
  fetchAndYearlyRenderUserCalendar_2 = async (startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
@@ -27081,6 +28003,81 @@ export class SfIEvents extends LitElement {
27081
28003
 
27082
28004
  }
27083
28005
 
28006
+ fetchAndRenderRCMResources = async (startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
28007
+
28008
+ let path = "", view = "";
28009
+ this.sdate = startDate;
28010
+ this.edate = endDate;
28011
+ if (this.tagId != null && this.tagId != "") {
28012
+ view = "tag";
28013
+ } else if (this.countryId != null && this.countryId != "") {
28014
+ view = "country";
28015
+ } else if (this.locationId != null && this.locationId != "") {
28016
+ view = "location";
28017
+ } else {
28018
+ view = "entity";
28019
+ }
28020
+
28021
+ path = "getallcountryobjects";
28022
+
28023
+ let sDate = "";
28024
+ let eDate = "";
28025
+
28026
+ //console.log('currenttab', this.getCurrentTab());
28027
+
28028
+ if (this.getCurrentTab() == this.TAB_YEAR) {
28029
+ sDate = "03/31/" + this.calendarStartYYYY;
28030
+ eDate = "04/01/" + (parseInt(this.calendarStartYYYY) + 1);
28031
+ } else {
28032
+ sDate = startDate;
28033
+ eDate = endDate;
28034
+ }
28035
+
28036
+
28037
+ let url = "https://" + this.apiIdRCMResources + "/" + path;
28038
+
28039
+ //console.log('fetch calendar url', url);
28040
+ let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": this.entityId, "countryid": this.countryId, "functionid": this.functionId, "locationid": this.locationId, "tagid": this.tagId, "adhoc": "false", "exclusivestartkey": 0, "sdate": sDate, "edate": eDate, "view": view, "year": year, "list": list, "month": month };
28041
+
28042
+ if (searchString.length > 0) {
28043
+ urlBody["searchstring"] = searchString;
28044
+ }
28045
+
28046
+ //console.log('urlbody', urlBody);
28047
+
28048
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
28049
+ const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
28050
+ this._SfLoader.innerHTML = '';
28051
+ if (xhr.status == 200) {
28052
+
28053
+ const jsonRespose = JSON.parse(xhr.responseText);
28054
+ console.log('jsonRespose', jsonRespose);
28055
+ let rcmresources = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
28056
+ await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
28057
+ this.lastupdated = Util.getDateTimeStrings(new Date().getTime())
28058
+ this.events = rcmresources;
28059
+ this.renderAppropriateStream(this.sdate, this.edate, true);
28060
+ console.log('rcmresources', rcmresources);
28061
+ } else {
28062
+ if (xhr.status == 401) {
28063
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
28064
+ this.dispatchEvent(changeEvent);
28065
+ }
28066
+ if (xhr.status === 404) {
28067
+
28068
+ this.showChosenProject();
28069
+ (this._SfTitleChosenProject as HTMLElement).innerHTML = (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedTexts()[0];
28070
+ this.renderChosenProject();
28071
+
28072
+ } else {
28073
+ const jsonRespose = JSON.parse(xhr.responseText);
28074
+ this.setError(jsonRespose.error);
28075
+ }
28076
+
28077
+ }
28078
+
28079
+ }
28080
+
27084
28081
  fetchStatistics = async (startDate: string = "", endDate: string = "", filtercriteria: string, filterid: string, subfiltercriteria: string, subfilterid: string) => {
27085
28082
 
27086
28083
  let path = "";
@@ -27112,6 +28109,8 @@ export class SfIEvents extends LitElement {
27112
28109
  url = "https://" + this.apiIdAgreements + "/" + path;
27113
28110
  } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
27114
28111
  url = "https://" + this.apiIdLicenses + "/" + path;
28112
+ } else if (this.selectedFeatures.indexOf('rcmresource') >= 0) {
28113
+ url = "https://" + this.apiIdRCMResources + "/" + path;
27115
28114
  }
27116
28115
 
27117
28116
  //console.log('fetch calendar url', url);