sf-i-events 1.0.964 → 1.0.966

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dev/index.html CHANGED
@@ -864,7 +864,7 @@
864
864
  allowdownload="yes"></sf-i-uploader></div>
865
865
  <div slot="reporting"><sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting></div>
866
866
  </sf-i-events> -->
867
- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
867
+ <!-- <sf-i-events name="Calendar" apiid="api2.flagggrc.tech/event-api" mode="consumer"
868
868
  apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
869
869
  apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
870
870
  apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
@@ -893,6 +893,35 @@
893
893
  <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
894
894
  </div>
895
895
 
896
+ </sf-i-events> -->
897
+ <sf-i-events name="Calendar" apiid="api2.flagggrc.tech/event-api" mode="consumer"
898
+ apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
899
+ apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
900
+ apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
901
+ apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws"
902
+ apiidagreements="swago3unro2te55ikvjuqwcrr40wluqh.lambda-url.us-east-1.on.aws"
903
+ apiidlicenses="lbtsbsctcdsyah4qdszkv4rctq0tnvel.lambda-url.us-east-1.on.aws"
904
+ apiidrcmresources="jra3sghasmaxn5aiq7rtv6pjzq0oeuaw.lambda-url.us-east-1.on.aws" fill="pattern"
905
+ username="Nirmal Rathod" userprofileid="d4d92385-1fa4-4055-b23c-d7ef5e18bc3d"
906
+ projectid="5a05b884-d7ed-4f63-b623-4d305ea2cfd6" projectname="Standard Radiators Private Limited"
907
+ countryid="17f9c73b-886d-40d7-b8f2-2ace42763d47" selectedcriteria="Country - India" enabledeletelatestreport="true"
908
+ features="[]"
909
+ eventfielddependencies="[{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;country&quot;, &quot;child&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;category&quot;, &quot;child&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;frequency&quot;, &quot;child&quot;: &quot;subfrequency&quot;}]"
910
+ eventfields="[{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/riskarea&quot;, &quot;field&quot;: &quot;riskarea&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/jurisdiction&quot;, &quot;field&quot;: &quot;jurisdiction&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/updatetype&quot;, &quot;field&quot;: &quot;updatetype&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/country&quot;, &quot;field&quot;: &quot;country&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/specificity&quot;, &quot;field&quot;: &quot;specificity&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/risk&quot;, &quot;field&quot;: &quot;risk&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/frequency&quot;, &quot;field&quot;: &quot;frequency&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/category&quot;, &quot;field&quot;: &quot;category&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/obligationtype&quot;, &quot;field&quot;: &quot;obligationtype&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/state&quot;, &quot;field&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subfrequency&quot;, &quot;field&quot;: &quot;subfrequency&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subcategory&quot;, &quot;field&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;sf-i-form&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/statute&quot;, &quot;field&quot;: &quot;statute&quot;, &quot;projectField&quot;: &quot;name&quot;}]"
911
+ eventpreviewfields="[&quot;obligationtitle&quot;]"
912
+ eventhidefields="[&quot;comments&quot;,&quot;documents&quot;,&quot;lastupdated&quot;,&quot;approved&quot;,&quot;tags&quot;]"
913
+ calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
914
+
915
+ <div slot="uploader">
916
+ <sf-i-uploader id="uploader" max="10" apiid="1peg5170d3"
917
+ allowedextensions="[&quot;jpg&quot;,&quot;jpeg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;,&quot;zip&quot;]"
918
+ extract="yes" projectid="5a05b884-d7ed-4f63-b623-4d305ea2cfd6" maxsize="31457280"
919
+ allowdownload="yes"></sf-i-uploader>
920
+ </div>
921
+ <div slot="reporting">
922
+ <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
923
+ </div>
924
+
896
925
  </sf-i-events>
897
926
  <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
898
927
  apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-events",
3
3
  "private": false,
4
- "version": "1.0.964",
4
+ "version": "1.0.966",
5
5
  "description": "Superflows Navigation Component",
6
6
  "main": "sf-i-events.js",
7
7
  "module": "sf-i-events.js",
package/sf-i-events.js CHANGED
@@ -3411,7 +3411,7 @@ let SfIEvents = class SfIEvents extends LitElement {
3411
3411
  this.maxRiskResidual = tempMaxRiskResidualLocal;
3412
3412
  }
3413
3413
  let showFinRisk = false;
3414
- if (this.selectedFeatures.indexOf('contracts') < 0 && this.selectedFeatures.indexOf('notices') && this.selectedFeatures.indexOf('licenses') < 0 && this.selectedFeatures.indexOf('rcmresources') < 0 && this.finRiskCurrency != "") {
3414
+ if (this.selectedFeatures.indexOf('contracts') < 0 && this.selectedFeatures.indexOf('notices') && this.selectedFeatures.indexOf('licenses') < 0 && this.selectedFeatures.indexOf('rcmresources') < 0 && this.finRiskCurrency != "" && (this.minRiskResidual > 0 || this.minRiskMitigated > 0 || this.maxRiskResidual > 0 || this.maxRiskMitigated > 0)) {
3415
3415
  showFinRisk = true;
3416
3416
  }
3417
3417
  //console.log('final risk severities', this.riskSeverityData);
@@ -3723,40 +3723,38 @@ let SfIEvents = class SfIEvents extends LitElement {
3723
3723
  if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
3724
3724
  html += '<label part="input-label">Date of Completion*</label>';
3725
3725
  html += '<input id="input-approver-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" disabled/><br />';
3726
- html += '<div class="d-flex justify-start align-center flex-wrap">';
3726
+ html += '<div class="d-flex justify-start align-center flex-wrap max-width-100">';
3727
3727
  html += '<div class="d-flex flex-col flex-grow">';
3728
3728
  html += '<label part="input-label">Completion Percentage</label>';
3729
3729
  html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1" disabled/><br />';
3730
3730
  html += '</div>';
3731
- html += '<div id="reporting-entity-container-0" class="reporting-entity-container d-flex flex-col flex-grow ml-20-m-0 hide">';
3731
+ html += '<div class="d-flex flex-col flex-grow max-width-100">';
3732
+ html += '<div id="reporting-entity-container-0" class="reporting-entity-container d-flex flex-col flex-grow ml-20-m-0 hide max-width-100">';
3732
3733
  html += '<label part="input-label">Entity</label>';
3733
3734
  html += '<select id="input-reporter-entity-0" part="input" disabled></select>';
3734
3735
  html += '</div>';
3735
- html += '<div id="reporting-location-container-0" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide">';
3736
+ html += '<div id="reporting-location-container-0" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide max-width-100">';
3736
3737
  html += '<label part="input-label">Location</label>';
3737
3738
  html += '<select id="input-reporter-location-0" class="input-reporter-location" part="input" disabled></select>';
3738
3739
  html += '</div>';
3739
- // html += '<button id="button-reporter-location-add-0" part="button-icon-small" class="button-reporter-location-add material-icons ml-10 hide">' + (this.reportedLocationsVals.length >= 1 ? 'remove' : 'add') + '</button><br /></div>'
3740
3740
  if (this.reportedLocationsVals.length > 1) {
3741
3741
  let indexLocation = 1;
3742
3742
  while (indexLocation < this.reportedLocationsVals.length) {
3743
- html += '<div class="d-flex justify-start align-end flex-wrap">';
3744
- html += '<div class="d-flex flex-col flex-grow">';
3745
- html += '<label class="invisible" part="input-label">Completion Percentage*</label>';
3746
- html += '</div>';
3747
- html += '<div id="reporting-entity-container-' + indexLocation + '" class="reporting-entity-container d-flex flex-col flex-grow ml-20-m-0 hide" disabled>';
3743
+ html += '<div class="d-flex justify-start align-end flex-wrap max-width-100">';
3744
+ html += '<div id="reporting-entity-container-' + indexLocation + '" class="reporting-entity-container d-flex flex-col ml-20-m-0 hide max-width-100">';
3748
3745
  html += '<label part="input-label">Entity</label>';
3749
3746
  html += '<select id="input-reporter-entity-' + indexLocation + '" part="input"></select>';
3750
3747
  html += '</div>';
3751
- html += '<div id="reporting-location-container-' + indexLocation + '" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide" disabled>';
3748
+ html += '<div id="reporting-location-container-' + indexLocation + '" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide max-width-100">';
3752
3749
  html += '<label part="input-label">Location</label>';
3753
- html += '<select id="input-reporter-location-' + indexLocation + '" class="input-reporter-location" part="input"></select>';
3750
+ html += '<select id="input-reporter-location-' + indexLocation + '" class="input-reporter-location" part="input"></select>';
3754
3751
  html += '</div>';
3755
- // html += '<button id="button-reporter-location-add-' + indexLocation + '" part="button-icon-small" class="button-reporter-location-add material-icons ml-10 hide">' + (indexLocation < this.reportedLocationsVals.length - 1 ? 'remove' : 'add') + '</button><br /></div>'
3752
+ html += '<button id="button-reporter-location-add-' + indexLocation + '" part="button-icon-small" class="button-reporter-location-add material-icons ml-10 hide">remove</button><br /></div>';
3756
3753
  indexLocation++;
3757
3754
  }
3758
3755
  }
3759
3756
  html += '</div>';
3757
+ html += '</div>';
3760
3758
  }
3761
3759
  html += '<div>';
3762
3760
  html += '<label part="input-label">Approve?*</label><br />';
@@ -3804,16 +3802,18 @@ let SfIEvents = class SfIEvents extends LitElement {
3804
3802
  if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
3805
3803
  html += '<label part="input-label">Date of Completion*</label>';
3806
3804
  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 />';
3807
- html += '<div class="d-flex justify-start align-end flex-wrap">';
3808
- html += '<div class="d-flex flex-col flex-grow">';
3805
+ html += '<div class="d-flex justify-start align-start flex-wrap">';
3806
+ html += '<div class="d-flex flex-col flex-grow max-width-100">';
3809
3807
  html += '<label part="input-label">Completion Percentage*</label>';
3810
3808
  html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1"/>';
3811
3809
  html += '</div>';
3812
- html += '<div id="reporting-entity-container-0" class="reporting-entity-container d-flex flex-col flex-grow ml-20-m-0 hide">';
3810
+ html += '<div class="d-flex flex-col max-width-100">';
3811
+ html += '<div class="d-flex justify-start align-end flex-wrap max-width-100">';
3812
+ html += '<div id="reporting-entity-container-0" class="reporting-entity-container d-flex flex-col ml-20-m-0 hide max-width-100">';
3813
3813
  html += '<label part="input-label">Entity</label>';
3814
3814
  html += '<select id="input-reporter-entity-0" part="input"></select>';
3815
3815
  html += '</div>';
3816
- html += '<div id="reporting-location-container-0" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide">';
3816
+ html += '<div id="reporting-location-container-0" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide max-width-100">';
3817
3817
  html += '<label part="input-label">Location</label>';
3818
3818
  html += '<select id="input-reporter-location-0" class="input-reporter-location" part="input"></select>';
3819
3819
  html += '</div>';
@@ -3821,15 +3821,12 @@ let SfIEvents = class SfIEvents extends LitElement {
3821
3821
  if (this.reportedLocationsVals.length > 1) {
3822
3822
  let indexLocation = 1;
3823
3823
  while (indexLocation < this.reportedLocationsVals.length) {
3824
- html += '<div class="d-flex justify-start align-end flex-wrap">';
3825
- html += '<div class="d-flex flex-col flex-grow">';
3826
- html += '<label class="invisible" part="input-label">Completion Percentage*</label>';
3827
- html += '</div>';
3828
- html += '<div id="reporting-entity-container-' + indexLocation + '" class="reporting-entity-container d-flex flex-col flex-grow ml-20-m-0 hide">';
3824
+ html += '<div class="d-flex justify-start align-end flex-wrap max-width-100">';
3825
+ html += '<div id="reporting-entity-container-' + indexLocation + '" class="reporting-entity-container d-flex flex-col ml-20-m-0 hide max-width-100">';
3829
3826
  html += '<label part="input-label">Entity</label>';
3830
3827
  html += '<select id="input-reporter-entity-' + indexLocation + '" part="input"></select>';
3831
3828
  html += '</div>';
3832
- html += '<div id="reporting-location-container-' + indexLocation + '" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide">';
3829
+ html += '<div id="reporting-location-container-' + indexLocation + '" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide max-width-100">';
3833
3830
  html += '<label part="input-label">Location</label>';
3834
3831
  html += '<select id="input-reporter-location-' + indexLocation + '" class="input-reporter-location" part="input"></select>';
3835
3832
  html += '</div>';
@@ -3837,6 +3834,8 @@ let SfIEvents = class SfIEvents extends LitElement {
3837
3834
  indexLocation++;
3838
3835
  }
3839
3836
  }
3837
+ html += '</div>';
3838
+ html += '</div>';
3840
3839
  html += '<div class="d-flex justify-end align-end mt-10" class="input-report-location-add-container">';
3841
3840
  html += '<button id="button-reporter-location-add-0" part="button-icon-small" class="button-reporter-location-add material-icons ml-10-m-0 hide">add</button><br /></div>';
3842
3841
  html += '<div part="input-reporter-percentage-message" class="input-reporter-percentage-message mb-20">For reporting full non-compliance, choose 0%. For reporting compliance with gaps, choose the appropriate % value.</div><br />';
@@ -3933,7 +3932,7 @@ let SfIEvents = class SfIEvents extends LitElement {
3933
3932
  return html;
3934
3933
  };
3935
3934
  this.renderListReporting = (listReportingContainer, event, mmddyyyy, eventsContainer) => {
3936
- var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m, _o;
3935
+ var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m;
3937
3936
  console.log('listreporting event', event, this.graphFilter);
3938
3937
  let html = '';
3939
3938
  let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1];
@@ -3983,23 +3982,26 @@ let SfIEvents = class SfIEvents extends LitElement {
3983
3982
  if (this._SfUploader[0] != null) {
3984
3983
  this._SfUploader[0].querySelector('#uploader').emailcontent = emailcontent;
3985
3984
  }
3986
- (_f = listReportingContainer.querySelector('.button-delete')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', async () => {
3987
- await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
3988
- this.setSuccess('Deleted successfully!');
3989
- setTimeout(() => {
3990
- this.clearMessages();
3991
- }, 3000);
3992
- //console.log('deleted', resultDelete);
3993
- if (this.getCurrentTab() == this.TAB_CUSTOM) {
3994
- this.processDateSelection(this._SfCustomContainer);
3995
- }
3996
- else {
3997
- // if(currentColumnButton != null) {
3998
- // currentColumnButton.click();
3999
- // }
4000
- }
4001
- });
4002
- (_g = listReportingContainer.querySelector('#button-auto-approve')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', async () => {
3985
+ let deleteButtons = listReportingContainer.querySelectorAll('.button-delete');
3986
+ for (let deleteButton of deleteButtons) {
3987
+ deleteButton === null || deleteButton === void 0 ? void 0 : deleteButton.addEventListener('click', async () => {
3988
+ await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
3989
+ this.setSuccess('Deleted successfully!');
3990
+ setTimeout(() => {
3991
+ this.clearMessages();
3992
+ }, 3000);
3993
+ //console.log('deleted', resultDelete);
3994
+ if (this.getCurrentTab() == this.TAB_CUSTOM) {
3995
+ this.processDateSelection(this._SfCustomContainer);
3996
+ }
3997
+ else {
3998
+ // if(currentColumnButton != null) {
3999
+ // currentColumnButton.click();
4000
+ // }
4001
+ }
4002
+ });
4003
+ }
4004
+ (_f = listReportingContainer.querySelector('#button-auto-approve')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', async () => {
4003
4005
  var _a, _b;
4004
4006
  if (this.selectedItemIds.length <= 1) {
4005
4007
  await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, (_a = event.module) !== null && _a !== void 0 ? _a : "compliance");
@@ -4046,7 +4048,7 @@ let SfIEvents = class SfIEvents extends LitElement {
4046
4048
  // }
4047
4049
  }
4048
4050
  });
4049
- (_h = listReportingContainer.querySelector('#upload-guidance-button')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', async () => {
4051
+ (_g = listReportingContainer.querySelector('#upload-guidance-button')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', async () => {
4050
4052
  var _a, _b, _c, _f, _g, _h;
4051
4053
  console.log('upload guidance clicked', event);
4052
4054
  let inputReportingPercentage = (_b = (_a = listReportingContainer.querySelector('#input-reporter-percentage')) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "100";
@@ -4133,7 +4135,7 @@ let SfIEvents = class SfIEvents extends LitElement {
4133
4135
  }
4134
4136
  event.percentage = inputReportingPercentage.value;
4135
4137
  event.reportedlocations = JSON.stringify(this.reportedLocationsVals);
4136
- if (this.reportedLocationsVals.length == 0 || (this.reportedLocationsVals.length == 1 && this.reportedLocationsVals[0] == "")) {
4138
+ if (this.reportedLocationsVals.length == 0) {
4137
4139
  event.percentage = "100";
4138
4140
  }
4139
4141
  console.log('rendering list reporting', event.percentage, event.reportedlocations);
@@ -4148,6 +4150,9 @@ let SfIEvents = class SfIEvents extends LitElement {
4148
4150
  let selectReportingEntity = listReportingContainer.querySelector('#input-reporter-entity-' + indexRepLoc);
4149
4151
  let selectReportingLocation = listReportingContainer.querySelector('#input-reporter-location-' + indexRepLoc);
4150
4152
  selectReportingEntity.innerHTML = '';
4153
+ let defaultOption = new Option("Select Location", "", true, true);
4154
+ defaultOption.disabled = true;
4155
+ selectReportingEntity.add(defaultOption);
4151
4156
  for (let country of Object.keys(projectUserMap)) {
4152
4157
  if (country == "roles") {
4153
4158
  continue;
@@ -4160,6 +4165,9 @@ let SfIEvents = class SfIEvents extends LitElement {
4160
4165
  }
4161
4166
  selectReportingEntity.addEventListener('change', (e) => {
4162
4167
  selectReportingLocation.innerHTML = '';
4168
+ let defaultOption = new Option("Select Location", "", true, true);
4169
+ defaultOption.disabled = true;
4170
+ selectReportingLocation.add(defaultOption);
4163
4171
  for (let country of Object.keys(projectUserMap)) {
4164
4172
  if (country == "roles") {
4165
4173
  continue;
@@ -4179,23 +4187,29 @@ let SfIEvents = class SfIEvents extends LitElement {
4179
4187
  selectReportingLocation.value = event.reportedlocations != null ? (Util.isJSONParsable(event.reportedlocations) ? JSON.parse(event.reportedlocations)[indexRepLoc] : event.reportedlocations) : "";
4180
4188
  });
4181
4189
  if (selectReportingLocation.innerHTML == '') {
4182
- for (let country of Object.keys(projectUserMap)) {
4183
- if (country == "roles") {
4184
- continue;
4185
- }
4186
- for (let entity of Object.keys(projectUserMap[country])) {
4187
- for (let location of Object.keys(projectUserMap[country][entity])) {
4188
- let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "");
4189
- let option = new Option(locationName, location);
4190
- selectReportingLocation.add(option);
4191
- break;
4192
- }
4193
- break;
4194
- }
4195
- break;
4196
- }
4190
+ let defaultOption = new Option("Select Location", "", true, true);
4191
+ defaultOption.disabled = true;
4192
+ selectReportingLocation.add(defaultOption);
4193
+ // for (let country of Object.keys(projectUserMap)) {
4194
+ // if (country == "roles") {
4195
+ // continue;
4196
+ // }
4197
+ // for (let entity of Object.keys(projectUserMap[country])) {
4198
+ // for (let location of Object.keys(projectUserMap[country][entity])) {
4199
+ // let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
4200
+ // let option = new Option(locationName, location)
4201
+ // selectReportingLocation.add(option);
4202
+ // break;
4203
+ // }
4204
+ // break;
4205
+ // }
4206
+ // break;
4207
+ // }
4197
4208
  }
4198
4209
  selectReportingLocation.addEventListener('change', (e) => {
4210
+ if (selectReportingEntity.value == "") {
4211
+ return;
4212
+ }
4199
4213
  let index = parseInt(e.target.id.split('-')[3]);
4200
4214
  this.reportedLocationsVals[index] = e.target.value;
4201
4215
  });
@@ -4229,7 +4243,7 @@ let SfIEvents = class SfIEvents extends LitElement {
4229
4243
  selectReportingLocation.value = "";
4230
4244
  }
4231
4245
  }
4232
- (_j = listReportingContainer.querySelector('#button-uploader-submit-approve')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', async (ev) => {
4246
+ (_h = listReportingContainer.querySelector('#button-uploader-submit-approve')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', async (ev) => {
4233
4247
  var _a, _b;
4234
4248
  let buttonClick = ev.target;
4235
4249
  buttonClick.innerHTML = "Saving...";
@@ -4358,7 +4372,7 @@ let SfIEvents = class SfIEvents extends LitElement {
4358
4372
  }
4359
4373
  }
4360
4374
  });
4361
- (_k = listReportingContainer.querySelector('#button-uploader-submit-audit')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', async (ev) => {
4375
+ (_j = listReportingContainer.querySelector('#button-uploader-submit-audit')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', async (ev) => {
4362
4376
  var _a, _b;
4363
4377
  let buttonClick = ev.target;
4364
4378
  buttonClick.innerHTML = "Saving...";
@@ -4486,7 +4500,7 @@ let SfIEvents = class SfIEvents extends LitElement {
4486
4500
  else {
4487
4501
  if (listReportingContainer.querySelector('#button-uploader-submit-report') != null) {
4488
4502
  listReportingContainer.querySelector('#button-uploader-submit-report').style.visibility = 'visible';
4489
- (_l = listReportingContainer.querySelector('#button-uploader-submit-report')) === null || _l === void 0 ? void 0 : _l.addEventListener('click', async (ev) => {
4503
+ (_k = listReportingContainer.querySelector('#button-uploader-submit-report')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', async (ev) => {
4490
4504
  var _a, _b, _c, _f;
4491
4505
  let buttonClick = ev.target;
4492
4506
  buttonClick.innerHTML = "Saving...";
@@ -4869,7 +4883,7 @@ let SfIEvents = class SfIEvents extends LitElement {
4869
4883
  }
4870
4884
  }
4871
4885
  if (event['reportformat'] != null && event['reportformat'].length > 0) {
4872
- this.fetchReportFormat(listReportingContainer, reportformatName, (_m = event['reportformatschema']) !== null && _m !== void 0 ? _m : "", (_o = event['reportformatvalues']) !== null && _o !== void 0 ? _o : "");
4886
+ this.fetchReportFormat(listReportingContainer, reportformatName, (_l = event['reportformatschema']) !== null && _l !== void 0 ? _l : "", (_m = event['reportformatvalues']) !== null && _m !== void 0 ? _m : "");
4873
4887
  }
4874
4888
  };
4875
4889
  this.attachListReportingListeners = (eventsContainer) => {
@@ -8232,10 +8246,10 @@ let SfIEvents = class SfIEvents extends LitElement {
8232
8246
  chooseDateInput.setAttribute('style', 'border:solid 2px ' + this.COLOR_REJECTED + ' !important');
8233
8247
  submitFlag = false;
8234
8248
  }
8235
- if (remarks == "") {
8236
- remarksInput.setAttribute('style', 'border:solid 2px ' + this.COLOR_REJECTED + ' !important');
8237
- submitFlag = false;
8238
- }
8249
+ // if (remarks == "") {
8250
+ // remarksInput.setAttribute('style', 'border:solid 2px ' + this.COLOR_REJECTED + ' !important');
8251
+ // submitFlag = false;
8252
+ // }
8239
8253
  if (submitFlag) {
8240
8254
  triggeredCompliances.push({
8241
8255
  compliances: compliances,
@@ -10821,19 +10835,34 @@ let SfIEvents = class SfIEvents extends LitElement {
10821
10835
  for (var k = 0; k < cols.length; k++) {
10822
10836
  if (!this.EXCLUDE_COLS_FROM_REGS.includes(cols[k].toLowerCase())) {
10823
10837
  if (cols[k].toLowerCase() == "attachment") {
10824
- html += '<div class="m-20">';
10825
- html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>';
10826
- for (let attachmentStr of data[k]) {
10827
- let attachment = {};
10828
- if (typeof attachmentStr === "object") {
10829
- attachment = attachmentStr;
10838
+ console.log('attachments', data[k]);
10839
+ if (typeof data[k] === "string") {
10840
+ let attachmentArr = JSON.parse(data[k].toString());
10841
+ if (attachmentArr.length > 0) {
10842
+ html += '<div class="m-20">';
10843
+ html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>';
10844
+ for (let attachment of attachmentArr) {
10845
+ html += `<sf-i-uploader class="event-attachment" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" prepopulatedInputArr="${JSON.stringify([{ "key": attachment.key, "ext": attachment.ext }]).replace(/"/g, '&quot;')}" extract="no" mode="view" maximize="yes" hidepreview="yes" displaydetail="yes"></sf-i-uploader>`;
10846
+ }
10847
+ html += '</div>';
10830
10848
  }
10831
- else {
10832
- attachment = JSON.parse(attachmentStr + "");
10849
+ }
10850
+ else {
10851
+ html += '<div class="m-20">';
10852
+ html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>';
10853
+ for (let attachmentStr of data[k]) {
10854
+ let attachment = {};
10855
+ if (typeof attachmentStr === "object") {
10856
+ attachment = attachmentStr;
10857
+ }
10858
+ else {
10859
+ attachment = JSON.parse(attachmentStr.toString());
10860
+ }
10861
+ html += `<sf-i-uploader class="event-attachment" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" prepopulatedInputArr="${JSON.stringify([{ "key": attachment.key, "ext": attachment.ext }]).replace(/"/g, '&quot;')}" extract="no" mode="view" maximize="yes" hidepreview="yes" displaydetail="yes"></sf-i-uploader>`;
10833
10862
  }
10834
- html += `<sf-i-uploader class="event-attachment" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" prepopulatedInputArr="${JSON.stringify([{ "key": attachment.key, "ext": attachment.ext }]).replace(/"/g, '&quot;')}" extract="no" mode="view" maximize="yes" hidepreview="yes" displaydetail="yes"></sf-i-uploader>`;
10863
+ html += '</div>';
10835
10864
  }
10836
- html += '</div>';
10865
+ // html += '</div>';
10837
10866
  }
10838
10867
  else {
10839
10868
  html += '<div class="m-20">';
@@ -14693,14 +14722,6 @@ let SfIEvents = class SfIEvents extends LitElement {
14693
14722
  obligationtitle: event.obligationtitle,
14694
14723
  obligation: event.obligation,
14695
14724
  });
14696
- // this.uploadTriggerMyEvent(
14697
- // event.id + ";" + event.shortid,
14698
- // feedbackMessage.value,
14699
- // event.countries.join(",").replace(/ *\([^)]*\) */g, ""),
14700
- // event.entities.join(',').replace(/ *\([^)]*\) */g, ""),
14701
- // event.locations.join(',').replace(/ *\([^)]*\) */g, ""),
14702
- // event.statute[0],
14703
- // event.subcategory[0]);
14704
14725
  buttonCancel.click();
14705
14726
  buttonClose.click();
14706
14727
  }
@@ -14738,7 +14759,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14738
14759
  }
14739
14760
  };
14740
14761
  this.renderEventDetailReporting = (eventDetailReportingContainer, event, mmddyyyy, eventDetailContainer) => {
14741
- var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m;
14762
+ var _a, _b, _c, _f, _g, _h, _j, _k, _l;
14742
14763
  console.log('detailreporting event', event, this.graphFilter);
14743
14764
  let html = '';
14744
14765
  let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1];
@@ -14759,23 +14780,26 @@ let SfIEvents = class SfIEvents extends LitElement {
14759
14780
  if (this._SfUploader[0] != null) {
14760
14781
  this._SfUploader[0].querySelector('#uploader').emailcontent = emailcontent;
14761
14782
  }
14762
- (_c = eventDetailReportingContainer.querySelector('.button-delete')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', async () => {
14763
- await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
14764
- this.setSuccess('Deleted successfully!');
14765
- setTimeout(() => {
14766
- this.clearMessages();
14767
- }, 3000);
14768
- //console.log('deleted', resultDelete);
14769
- if (this.getCurrentTab() == this.TAB_CUSTOM) {
14770
- this.processDateSelection(this._SfCustomContainer);
14771
- }
14772
- else {
14773
- // if(currentColumnButton != null) {
14774
- // currentColumnButton.click();
14775
- // }
14776
- }
14777
- });
14778
- (_f = eventDetailReportingContainer.querySelector('#button-auto-approve')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', async () => {
14783
+ let deleteButtons = eventDetailContainer.querySelectorAll('.button-delete');
14784
+ for (let deleteButton of deleteButtons) {
14785
+ deleteButton === null || deleteButton === void 0 ? void 0 : deleteButton.addEventListener('click', async () => {
14786
+ await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
14787
+ this.setSuccess('Deleted successfully!');
14788
+ setTimeout(() => {
14789
+ this.clearMessages();
14790
+ }, 3000);
14791
+ //console.log('deleted', resultDelete);
14792
+ if (this.getCurrentTab() == this.TAB_CUSTOM) {
14793
+ this.processDateSelection(this._SfCustomContainer);
14794
+ }
14795
+ else {
14796
+ // if(currentColumnButton != null) {
14797
+ // currentColumnButton.click();
14798
+ // }
14799
+ }
14800
+ });
14801
+ }
14802
+ (_c = eventDetailReportingContainer.querySelector('#button-auto-approve')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', async () => {
14779
14803
  var _a, _b;
14780
14804
  if (this.selectedItemIds.length <= 1) {
14781
14805
  await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, (_a = event.module) !== null && _a !== void 0 ? _a : "compliance");
@@ -14822,7 +14846,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14822
14846
  // }
14823
14847
  }
14824
14848
  });
14825
- (_g = eventDetailReportingContainer.querySelector('#upload-guidance-button')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', async () => {
14849
+ (_f = eventDetailReportingContainer.querySelector('#upload-guidance-button')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', async () => {
14826
14850
  var _a, _b, _c, _f, _g, _h;
14827
14851
  console.log('upload guidance clicked', event);
14828
14852
  let inputReportingPercentage = (_b = (_a = eventDetailReportingContainer.querySelector('#input-reporter-percentage')) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "100";
@@ -14909,10 +14933,10 @@ let SfIEvents = class SfIEvents extends LitElement {
14909
14933
  }
14910
14934
  event.percentage = inputReportingPercentage.value;
14911
14935
  event.reportedlocations = JSON.stringify(this.reportedLocationsVals);
14912
- if (this.reportedLocationsVals.length == 0 || (this.reportedLocationsVals.length == 1 && this.reportedLocationsVals[0] == "")) {
14936
+ if (this.reportedLocationsVals.length == 0) {
14913
14937
  event.percentage = "100";
14914
14938
  }
14915
- console.log('rendering list reporting', event.percentage, event.reportedlocations);
14939
+ console.log('rendering list reporting', this.reportedLocationsVals, event.percentage, event.reportedlocations);
14916
14940
  event.reportercomments = eventDetailReportingContainer.querySelector('#input-reporter-comments').value;
14917
14941
  event.dateofcompletion = eventDetailReportingContainer.querySelector('#input-reporter-doc').value.length > 0 ? (new Date(eventDetailReportingContainer.querySelector('#input-reporter-doc').value).getTime() + "") : "";
14918
14942
  event.documents = this._SfUploader[0].querySelector('#uploader').selectedValues();
@@ -14924,6 +14948,9 @@ let SfIEvents = class SfIEvents extends LitElement {
14924
14948
  let selectReportingEntity = eventDetailReportingContainer.querySelector('#input-reporter-entity-' + indexRepLoc);
14925
14949
  let selectReportingLocation = eventDetailReportingContainer.querySelector('#input-reporter-location-' + indexRepLoc);
14926
14950
  selectReportingEntity.innerHTML = '';
14951
+ let defaultOption = new Option("Select Entity", "", true, true);
14952
+ defaultOption.disabled = true;
14953
+ selectReportingEntity.add(defaultOption);
14927
14954
  for (let country of Object.keys(projectUserMap)) {
14928
14955
  if (country == "roles") {
14929
14956
  continue;
@@ -14936,6 +14963,9 @@ let SfIEvents = class SfIEvents extends LitElement {
14936
14963
  }
14937
14964
  selectReportingEntity.addEventListener('change', (e) => {
14938
14965
  selectReportingLocation.innerHTML = '';
14966
+ let defaultOption = new Option("Select Location", "", true, true);
14967
+ defaultOption.disabled = true;
14968
+ selectReportingLocation.add(defaultOption);
14939
14969
  for (let country of Object.keys(projectUserMap)) {
14940
14970
  if (country == "roles") {
14941
14971
  continue;
@@ -14955,27 +14985,33 @@ let SfIEvents = class SfIEvents extends LitElement {
14955
14985
  selectReportingLocation.value = event.reportedlocations != null ? (Util.isJSONParsable(event.reportedlocations) ? JSON.parse(event.reportedlocations)[indexRepLoc] : event.reportedlocations) : "";
14956
14986
  });
14957
14987
  if (selectReportingLocation.innerHTML == '') {
14958
- for (let country of Object.keys(projectUserMap)) {
14959
- if (country == "roles") {
14960
- continue;
14961
- }
14962
- for (let entity of Object.keys(projectUserMap[country])) {
14963
- for (let location of Object.keys(projectUserMap[country][entity])) {
14964
- let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "");
14965
- let option = new Option(locationName, location);
14966
- selectReportingLocation.add(option);
14967
- break;
14968
- }
14969
- break;
14970
- }
14971
- break;
14972
- }
14988
+ let defaultOption = new Option("Select Location", "", true, true);
14989
+ defaultOption.disabled = true;
14990
+ selectReportingLocation.add(defaultOption);
14991
+ // for (let country of Object.keys(projectUserMap)) {
14992
+ // if (country == "roles") {
14993
+ // continue;
14994
+ // }
14995
+ // for (let entity of Object.keys(projectUserMap[country])) {
14996
+ // for (let location of Object.keys(projectUserMap[country][entity])) {
14997
+ // let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
14998
+ // let option = new Option(locationName, location)
14999
+ // selectReportingLocation.add(option);
15000
+ // break;
15001
+ // }
15002
+ // break;
15003
+ // }
15004
+ // break;
15005
+ // }
14973
15006
  }
14974
15007
  selectReportingLocation.addEventListener('change', (e) => {
15008
+ if (selectReportingEntity.value == "") {
15009
+ return;
15010
+ }
14975
15011
  let index = parseInt(e.target.id.split('-')[3]);
14976
15012
  this.reportedLocationsVals[index] = e.target.value;
14977
15013
  });
14978
- if (event.reportedlocations != null && event.reportedlocations.length > 0) {
15014
+ if (event.reportedlocations != null && event.reportedlocations.length > indexRepLoc) {
14979
15015
  console.log('setting reportedlocations', event.reportedlocations);
14980
15016
  let tempReportedLocation = Util.isJSONParsable(event.reportedlocations) ? JSON.parse(event.reportedlocations)[indexRepLoc] : event.reportedlocations;
14981
15017
  for (let country of Object.keys(projectUserMap)) {
@@ -15005,7 +15041,7 @@ let SfIEvents = class SfIEvents extends LitElement {
15005
15041
  selectReportingLocation.value = "";
15006
15042
  }
15007
15043
  }
15008
- (_h = eventDetailReportingContainer.querySelector('#button-uploader-submit-approve')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', async (ev) => {
15044
+ (_g = eventDetailReportingContainer.querySelector('#button-uploader-submit-approve')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', async (ev) => {
15009
15045
  var _a, _b;
15010
15046
  let buttonClick = ev.target;
15011
15047
  buttonClick.innerHTML = "Saving...";
@@ -15134,7 +15170,7 @@ let SfIEvents = class SfIEvents extends LitElement {
15134
15170
  }
15135
15171
  }
15136
15172
  });
15137
- (_j = eventDetailReportingContainer.querySelector('#button-uploader-submit-audit')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', async (ev) => {
15173
+ (_h = eventDetailReportingContainer.querySelector('#button-uploader-submit-audit')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', async (ev) => {
15138
15174
  var _a, _b;
15139
15175
  let buttonClick = ev.target;
15140
15176
  buttonClick.innerHTML = "Saving...";
@@ -15262,7 +15298,7 @@ let SfIEvents = class SfIEvents extends LitElement {
15262
15298
  else {
15263
15299
  if (eventDetailReportingContainer.querySelector('#button-uploader-submit-report') != null) {
15264
15300
  eventDetailReportingContainer.querySelector('#button-uploader-submit-report').style.visibility = 'visible';
15265
- (_k = eventDetailReportingContainer.querySelector('#button-uploader-submit-report')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', async (ev) => {
15301
+ (_j = eventDetailReportingContainer.querySelector('#button-uploader-submit-report')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', async (ev) => {
15266
15302
  var _a, _b, _c, _f;
15267
15303
  let buttonClick = ev.target;
15268
15304
  buttonClick.innerHTML = "Saving...";
@@ -15645,7 +15681,7 @@ let SfIEvents = class SfIEvents extends LitElement {
15645
15681
  }
15646
15682
  }
15647
15683
  if (event['reportformat'] != null && event['reportformat'].length > 0) {
15648
- this.fetchReportFormat(eventDetailReportingContainer, reportformatName, (_l = event['reportformatschema']) !== null && _l !== void 0 ? _l : "", (_m = event['reportformatvalues']) !== null && _m !== void 0 ? _m : "");
15684
+ this.fetchReportFormat(eventDetailReportingContainer, reportformatName, (_k = event['reportformatschema']) !== null && _k !== void 0 ? _k : "", (_l = event['reportformatvalues']) !== null && _l !== void 0 ? _l : "");
15649
15685
  }
15650
15686
  };
15651
15687
  this.renderCalendar = () => {
@@ -22396,7 +22432,7 @@ let SfIEvents = class SfIEvents extends LitElement {
22396
22432
  }
22397
22433
  };
22398
22434
  this.uploadTriggerEvent = async (triggeredCompliances) => {
22399
- let url = "https://" + this.apiId + "/triggerevent";
22435
+ let url = "https://" + this.apiId + "/triggerevent1";
22400
22436
  const body = {
22401
22437
  "projectid": this.projectId,
22402
22438
  "triggers": triggeredCompliances
@@ -27549,6 +27585,9 @@ SfIEvents.styles = css `
27549
27585
  position: relative;
27550
27586
  }
27551
27587
 
27588
+ .max-width-100{
27589
+ max-width: 100%
27590
+ }
27552
27591
  @media (orientation: landscape) {
27553
27592
 
27554
27593
  .lb {
@@ -2779,6 +2779,9 @@ export class SfIEvents extends LitElement {
2779
2779
  position: relative;
2780
2780
  }
2781
2781
 
2782
+ .max-width-100{
2783
+ max-width: 100%
2784
+ }
2782
2785
  @media (orientation: landscape) {
2783
2786
 
2784
2787
  .lb {
@@ -4915,7 +4918,7 @@ export class SfIEvents extends LitElement {
4915
4918
  <sf-i-elastic-text exportparts="highlight,highlight-count"
4916
4919
  class="stream-event-title${!isBulk ? ' button-event-title' : ''}"
4917
4920
  id="stream-event-title-${mmddSanitized}-${itemNumber}-${moduleType}-${(isReportedLocation) ? 'reportedlocations' : ''}"
4918
- text="${event.obligationtitle.replace(/\\n/g,'')}"
4921
+ text="${event.obligationtitle.replace(/\\n/g, '')}"
4919
4922
  minLength="${event.concise == null ? '100' : '60'}">
4920
4923
  </sf-i-elastic-text>
4921
4924
  ${showLocationRisk ? `
@@ -4956,8 +4959,8 @@ export class SfIEvents extends LitElement {
4956
4959
 
4957
4960
  </div>
4958
4961
  `;
4959
- // ${this.finRiskCurrency == event['localcurrency'] ? `<div part="event-min" class="ml-10 d-flex align-center">${event['minlocal'] ?? ""}</div>` : `<div part="event-min" class="ml-10 d-flex align-center">${event['minglobal'] ?? ""}</div>`}
4960
- // ${this.finRiskCurrency == event['localcurrency'] ? `<div part="event-min" class="ml-10 d-flex align-center">${((event['maxlocal'] < event['minlocal']) ? event['minlocal'] : event['maxlocal']) ?? ""}</div>` : `<div part="event-min" class="ml-10 d-flex align-center">${((event['maxglobal'] < event['minglobal']) ? event['minglobal'] : event['maxglobal']) ?? ""}</div>`}
4962
+ // ${this.finRiskCurrency == event['localcurrency'] ? `<div part="event-min" class="ml-10 d-flex align-center">${event['minlocal'] ?? ""}</div>` : `<div part="event-min" class="ml-10 d-flex align-center">${event['minglobal'] ?? ""}</div>`}
4963
+ // ${this.finRiskCurrency == event['localcurrency'] ? `<div part="event-min" class="ml-10 d-flex align-center">${((event['maxlocal'] < event['minlocal']) ? event['minlocal'] : event['maxlocal']) ?? ""}</div>` : `<div part="event-min" class="ml-10 d-flex align-center">${((event['maxglobal'] < event['minglobal']) ? event['minglobal'] : event['maxglobal']) ?? ""}</div>`}
4961
4964
  if (event.concise == null && remarks.length > 0) {
4962
4965
  html += '<div part="stream-events-event-subtitle" class="stream-events-event-subtitle">' + remarks + ', occurred on ' + occurrenceDate + '</div>';
4963
4966
  }
@@ -5728,7 +5731,7 @@ export class SfIEvents extends LitElement {
5728
5731
  }
5729
5732
 
5730
5733
  let showFinRisk = false
5731
- if (this.selectedFeatures.indexOf('contracts') < 0 && this.selectedFeatures.indexOf('notices') && this.selectedFeatures.indexOf('licenses') < 0 && this.selectedFeatures.indexOf('rcmresources') < 0 && this.finRiskCurrency != "") {
5734
+ if (this.selectedFeatures.indexOf('contracts') < 0 && this.selectedFeatures.indexOf('notices') && this.selectedFeatures.indexOf('licenses') < 0 && this.selectedFeatures.indexOf('rcmresources') < 0 && this.finRiskCurrency != "" && (this.minRiskResidual > 0 || this.minRiskMitigated > 0 || this.maxRiskResidual > 0 || this.maxRiskMitigated > 0)) {
5732
5735
  showFinRisk = true
5733
5736
  }
5734
5737
  //console.log('final risk severities', this.riskSeverityData);
@@ -6089,40 +6092,38 @@ export class SfIEvents extends LitElement {
6089
6092
  if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
6090
6093
  html += '<label part="input-label">Date of Completion*</label>';
6091
6094
  html += '<input id="input-approver-doc" part="input" type="date" value="' + (dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0, 10)) + '" disabled/><br />';
6092
- html += '<div class="d-flex justify-start align-center flex-wrap">';
6095
+ html += '<div class="d-flex justify-start align-center flex-wrap max-width-100">';
6093
6096
  html += '<div class="d-flex flex-col flex-grow">';
6094
6097
  html += '<label part="input-label">Completion Percentage</label>';
6095
6098
  html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1" disabled/><br />';
6096
6099
  html += '</div>'
6097
- html += '<div id="reporting-entity-container-0" class="reporting-entity-container d-flex flex-col flex-grow ml-20-m-0 hide">';
6100
+ html += '<div class="d-flex flex-col flex-grow max-width-100">';
6101
+ html += '<div id="reporting-entity-container-0" class="reporting-entity-container d-flex flex-col flex-grow ml-20-m-0 hide max-width-100">';
6098
6102
  html += '<label part="input-label">Entity</label>';
6099
6103
  html += '<select id="input-reporter-entity-0" part="input" disabled></select>';
6100
6104
  html += '</div>'
6101
- html += '<div id="reporting-location-container-0" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide">';
6105
+ html += '<div id="reporting-location-container-0" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide max-width-100">';
6102
6106
  html += '<label part="input-label">Location</label>';
6103
6107
  html += '<select id="input-reporter-location-0" class="input-reporter-location" part="input" disabled></select>';
6104
6108
  html += '</div>'
6105
- // html += '<button id="button-reporter-location-add-0" part="button-icon-small" class="button-reporter-location-add material-icons ml-10 hide">' + (this.reportedLocationsVals.length >= 1 ? 'remove' : 'add') + '</button><br /></div>'
6106
6109
  if (this.reportedLocationsVals.length > 1) {
6107
6110
  let indexLocation = 1;
6108
6111
  while (indexLocation < this.reportedLocationsVals.length) {
6109
- html += '<div class="d-flex justify-start align-end flex-wrap">';
6110
- html += '<div class="d-flex flex-col flex-grow">';
6111
- html += '<label class="invisible" part="input-label">Completion Percentage*</label>';
6112
- html += '</div>'
6113
- html += '<div id="reporting-entity-container-' + indexLocation + '" class="reporting-entity-container d-flex flex-col flex-grow ml-20-m-0 hide" disabled>';
6112
+ html += '<div class="d-flex justify-start align-end flex-wrap max-width-100">';
6113
+ html += '<div id="reporting-entity-container-' + indexLocation + '" class="reporting-entity-container d-flex flex-col ml-20-m-0 hide max-width-100">';
6114
6114
  html += '<label part="input-label">Entity</label>';
6115
6115
  html += '<select id="input-reporter-entity-' + indexLocation + '" part="input"></select>';
6116
6116
  html += '</div>'
6117
- html += '<div id="reporting-location-container-' + indexLocation + '" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide" disabled>';
6117
+ html += '<div id="reporting-location-container-' + indexLocation + '" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide max-width-100">';
6118
6118
  html += '<label part="input-label">Location</label>';
6119
- html += '<select id="input-reporter-location-' + indexLocation + '" class="input-reporter-location" part="input"></select>';
6119
+ html += '<select id="input-reporter-location-' + indexLocation + '" class="input-reporter-location" part="input"></select>';
6120
6120
  html += '</div>'
6121
- // html += '<button id="button-reporter-location-add-' + indexLocation + '" part="button-icon-small" class="button-reporter-location-add material-icons ml-10 hide">' + (indexLocation < this.reportedLocationsVals.length - 1 ? 'remove' : 'add') + '</button><br /></div>'
6121
+ html += '<button id="button-reporter-location-add-' + indexLocation + '" part="button-icon-small" class="button-reporter-location-add material-icons ml-10 hide">remove</button><br /></div>'
6122
6122
  indexLocation++
6123
6123
  }
6124
6124
  }
6125
6125
  html += '</div>'
6126
+ html += '</div>'
6126
6127
 
6127
6128
  }
6128
6129
  html += '<div>'
@@ -6183,16 +6184,18 @@ export class SfIEvents extends LitElement {
6183
6184
  if (event.module != 'contract' && event.module != 'license' && event.module != 'rcmresource') {
6184
6185
  html += '<label part="input-label">Date of Completion*</label>';
6185
6186
  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 />';
6186
- html += '<div class="d-flex justify-start align-end flex-wrap">';
6187
- html += '<div class="d-flex flex-col flex-grow">';
6187
+ html += '<div class="d-flex justify-start align-start flex-wrap">';
6188
+ html += '<div class="d-flex flex-col flex-grow max-width-100">';
6188
6189
  html += '<label part="input-label">Completion Percentage*</label>';
6189
6190
  html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1"/>';
6190
6191
  html += '</div>'
6191
- html += '<div id="reporting-entity-container-0" class="reporting-entity-container d-flex flex-col flex-grow ml-20-m-0 hide">';
6192
+ html += '<div class="d-flex flex-col max-width-100">';
6193
+ html += '<div class="d-flex justify-start align-end flex-wrap max-width-100">';
6194
+ html += '<div id="reporting-entity-container-0" class="reporting-entity-container d-flex flex-col ml-20-m-0 hide max-width-100">';
6192
6195
  html += '<label part="input-label">Entity</label>';
6193
6196
  html += '<select id="input-reporter-entity-0" part="input"></select>';
6194
6197
  html += '</div>'
6195
- html += '<div id="reporting-location-container-0" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide">';
6198
+ html += '<div id="reporting-location-container-0" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide max-width-100">';
6196
6199
  html += '<label part="input-label">Location</label>';
6197
6200
  html += '<select id="input-reporter-location-0" class="input-reporter-location" part="input"></select>';
6198
6201
  html += '</div>'
@@ -6200,15 +6203,12 @@ export class SfIEvents extends LitElement {
6200
6203
  if (this.reportedLocationsVals.length > 1) {
6201
6204
  let indexLocation = 1;
6202
6205
  while (indexLocation < this.reportedLocationsVals.length) {
6203
- html += '<div class="d-flex justify-start align-end flex-wrap">';
6204
- html += '<div class="d-flex flex-col flex-grow">';
6205
- html += '<label class="invisible" part="input-label">Completion Percentage*</label>';
6206
- html += '</div>'
6207
- html += '<div id="reporting-entity-container-' + indexLocation + '" class="reporting-entity-container d-flex flex-col flex-grow ml-20-m-0 hide">';
6206
+ html += '<div class="d-flex justify-start align-end flex-wrap max-width-100">';
6207
+ html += '<div id="reporting-entity-container-' + indexLocation + '" class="reporting-entity-container d-flex flex-col ml-20-m-0 hide max-width-100">';
6208
6208
  html += '<label part="input-label">Entity</label>';
6209
6209
  html += '<select id="input-reporter-entity-' + indexLocation + '" part="input"></select>';
6210
6210
  html += '</div>'
6211
- html += '<div id="reporting-location-container-' + indexLocation + '" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide">';
6211
+ html += '<div id="reporting-location-container-' + indexLocation + '" class="reporting-location-container d-flex flex-col flex-grow ml-20-m-0 hide max-width-100">';
6212
6212
  html += '<label part="input-label">Location</label>';
6213
6213
  html += '<select id="input-reporter-location-' + indexLocation + '" class="input-reporter-location" part="input"></select>';
6214
6214
  html += '</div>'
@@ -6216,8 +6216,11 @@ export class SfIEvents extends LitElement {
6216
6216
  indexLocation++
6217
6217
  }
6218
6218
  }
6219
+ html += '</div>'
6220
+ html += '</div>'
6219
6221
  html += '<div class="d-flex justify-end align-end mt-10" class="input-report-location-add-container">';
6220
6222
  html += '<button id="button-reporter-location-add-0" part="button-icon-small" class="button-reporter-location-add material-icons ml-10-m-0 hide">add</button><br /></div>'
6223
+
6221
6224
  html += '<div part="input-reporter-percentage-message" class="input-reporter-percentage-message mb-20">For reporting full non-compliance, choose 0%. For reporting compliance with gaps, choose the appropriate % value.</div><br />'
6222
6225
 
6223
6226
  // if(docsOptional.length === 0) {
@@ -6375,23 +6378,26 @@ export class SfIEvents extends LitElement {
6375
6378
  if (this._SfUploader[0] != null) {
6376
6379
  (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.emailcontent = emailcontent;
6377
6380
  }
6378
- listReportingContainer.querySelector('.button-delete')?.addEventListener('click', async () => {
6381
+ let deleteButtons = listReportingContainer.querySelectorAll('.button-delete') as NodeListOf<HTMLButtonElement>
6382
+ for (let deleteButton of deleteButtons) {
6383
+ deleteButton?.addEventListener('click', async () => {
6379
6384
 
6380
- await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
6381
- this.setSuccess('Deleted successfully!')
6382
- setTimeout(() => {
6383
- this.clearMessages()
6384
- }, 3000);
6385
- //console.log('deleted', resultDelete);
6386
- if (this.getCurrentTab() == this.TAB_CUSTOM) {
6387
- this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
6388
- } else {
6389
- // if(currentColumnButton != null) {
6390
- // currentColumnButton.click();
6391
- // }
6392
- }
6385
+ await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
6386
+ this.setSuccess('Deleted successfully!')
6387
+ setTimeout(() => {
6388
+ this.clearMessages()
6389
+ }, 3000);
6390
+ //console.log('deleted', resultDelete);
6391
+ if (this.getCurrentTab() == this.TAB_CUSTOM) {
6392
+ this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
6393
+ } else {
6394
+ // if(currentColumnButton != null) {
6395
+ // currentColumnButton.click();
6396
+ // }
6397
+ }
6393
6398
 
6394
- });
6399
+ });
6400
+ }
6395
6401
  listReportingContainer.querySelector('#button-auto-approve')?.addEventListener('click', async () => {
6396
6402
  if (this.selectedItemIds.length <= 1) {
6397
6403
  await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, event.module ?? "compliance");
@@ -6520,7 +6526,7 @@ export class SfIEvents extends LitElement {
6520
6526
  }
6521
6527
  event.percentage = inputReportingPercentage.value;
6522
6528
  event.reportedlocations = JSON.stringify(this.reportedLocationsVals)
6523
- if (this.reportedLocationsVals.length == 0 || (this.reportedLocationsVals.length == 1 && this.reportedLocationsVals[0] == "")) {
6529
+ if (this.reportedLocationsVals.length == 0) {
6524
6530
  event.percentage = "100";
6525
6531
  }
6526
6532
  console.log('rendering list reporting', event.percentage, event.reportedlocations)
@@ -6536,6 +6542,9 @@ export class SfIEvents extends LitElement {
6536
6542
  let selectReportingEntity = listReportingContainer.querySelector('#input-reporter-entity-' + indexRepLoc) as HTMLSelectElement;
6537
6543
  let selectReportingLocation = listReportingContainer.querySelector('#input-reporter-location-' + indexRepLoc) as HTMLSelectElement;
6538
6544
  selectReportingEntity.innerHTML = '';
6545
+ let defaultOption = new Option("Select Location", "", true, true)
6546
+ defaultOption.disabled = true
6547
+ selectReportingEntity.add(defaultOption)
6539
6548
  for (let country of Object.keys(projectUserMap)) {
6540
6549
  if (country == "roles") {
6541
6550
  continue;
@@ -6548,6 +6557,9 @@ export class SfIEvents extends LitElement {
6548
6557
  }
6549
6558
  selectReportingEntity.addEventListener('change', (e: any) => {
6550
6559
  selectReportingLocation.innerHTML = ''
6560
+ let defaultOption = new Option("Select Location", "", true, true)
6561
+ defaultOption.disabled = true
6562
+ selectReportingLocation.add(defaultOption)
6551
6563
  for (let country of Object.keys(projectUserMap)) {
6552
6564
  if (country == "roles") {
6553
6565
  continue;
@@ -6567,23 +6579,29 @@ export class SfIEvents extends LitElement {
6567
6579
  selectReportingLocation.value = event.reportedlocations != null ? (Util.isJSONParsable(event.reportedlocations) ? JSON.parse(event.reportedlocations)[indexRepLoc] : event.reportedlocations) : "";
6568
6580
  })
6569
6581
  if (selectReportingLocation.innerHTML == '') {
6570
- for (let country of Object.keys(projectUserMap)) {
6571
- if (country == "roles") {
6572
- continue;
6573
- }
6574
- for (let entity of Object.keys(projectUserMap[country])) {
6575
- for (let location of Object.keys(projectUserMap[country][entity])) {
6576
- let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
6577
- let option = new Option(locationName, location)
6578
- selectReportingLocation.add(option);
6579
- break;
6580
- }
6581
- break;
6582
- }
6583
- break;
6584
- }
6582
+ let defaultOption = new Option("Select Location", "", true, true)
6583
+ defaultOption.disabled = true
6584
+ selectReportingLocation.add(defaultOption)
6585
+ // for (let country of Object.keys(projectUserMap)) {
6586
+ // if (country == "roles") {
6587
+ // continue;
6588
+ // }
6589
+ // for (let entity of Object.keys(projectUserMap[country])) {
6590
+ // for (let location of Object.keys(projectUserMap[country][entity])) {
6591
+ // let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
6592
+ // let option = new Option(locationName, location)
6593
+ // selectReportingLocation.add(option);
6594
+ // break;
6595
+ // }
6596
+ // break;
6597
+ // }
6598
+ // break;
6599
+ // }
6585
6600
  }
6586
6601
  selectReportingLocation.addEventListener('change', (e: any) => {
6602
+ if (selectReportingEntity.value == "") {
6603
+ return;
6604
+ }
6587
6605
  let index = parseInt(e.target.id.split('-')[3])
6588
6606
  this.reportedLocationsVals[index] = e.target.value
6589
6607
  })
@@ -11230,10 +11248,10 @@ export class SfIEvents extends LitElement {
11230
11248
  chooseDateInput.setAttribute('style', 'border:solid 2px ' + this.COLOR_REJECTED + ' !important');
11231
11249
  submitFlag = false;
11232
11250
  }
11233
- if (remarks == "") {
11234
- remarksInput.setAttribute('style', 'border:solid 2px ' + this.COLOR_REJECTED + ' !important');
11235
- submitFlag = false;
11236
- }
11251
+ // if (remarks == "") {
11252
+ // remarksInput.setAttribute('style', 'border:solid 2px ' + this.COLOR_REJECTED + ' !important');
11253
+ // submitFlag = false;
11254
+ // }
11237
11255
  if (submitFlag) {
11238
11256
  triggeredCompliances.push({
11239
11257
  compliances: compliances,
@@ -14313,18 +14331,34 @@ export class SfIEvents extends LitElement {
14313
14331
  if (!this.EXCLUDE_COLS_FROM_REGS.includes(cols[k].toLowerCase())) {
14314
14332
 
14315
14333
  if (cols[k].toLowerCase() == "attachment") {
14316
- html += '<div class="m-20">';
14317
- html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>'
14318
- for (let attachmentStr of data[k]) {
14319
- let attachment: any = {};
14320
- if (typeof attachmentStr === "object") {
14321
- attachment = attachmentStr;
14322
- } else {
14323
- attachment = JSON.parse(attachmentStr + "");
14334
+
14335
+ console.log('attachments', data[k]);
14336
+ if (typeof data[k] === "string") {
14337
+ let attachmentArr = JSON.parse(data[k].toString());
14338
+ if (attachmentArr.length > 0) {
14339
+ html += '<div class="m-20">';
14340
+ html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>'
14341
+ for (let attachment of attachmentArr) {
14342
+
14343
+ html += `<sf-i-uploader class="event-attachment" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" prepopulatedInputArr="${JSON.stringify([{ "key": attachment.key, "ext": attachment.ext }]).replace(/"/g, '&quot;')}" extract="no" mode="view" maximize="yes" hidepreview="yes" displaydetail="yes"></sf-i-uploader>`
14344
+ }
14345
+ html += '</div>';
14346
+ }
14347
+ } else {
14348
+ html += '<div class="m-20">';
14349
+ html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>'
14350
+ for (let attachmentStr of data[k]) {
14351
+ let attachment: any = {};
14352
+ if (typeof attachmentStr === "object") {
14353
+ attachment = attachmentStr;
14354
+ } else {
14355
+ attachment = JSON.parse(attachmentStr.toString());
14356
+ }
14357
+ html += `<sf-i-uploader class="event-attachment" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" prepopulatedInputArr="${JSON.stringify([{ "key": attachment.key, "ext": attachment.ext }]).replace(/"/g, '&quot;')}" extract="no" mode="view" maximize="yes" hidepreview="yes" displaydetail="yes"></sf-i-uploader>`
14324
14358
  }
14325
- html += `<sf-i-uploader class="event-attachment" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" prepopulatedInputArr="${JSON.stringify([{ "key": attachment.key, "ext": attachment.ext }]).replace(/"/g, '&quot;')}" extract="no" mode="view" maximize="yes" hidepreview="yes" displaydetail="yes"></sf-i-uploader>`
14359
+ html += '</div>';
14326
14360
  }
14327
- html += '</div>';
14361
+ // html += '</div>';
14328
14362
  } else {
14329
14363
  html += '<div class="m-20">';
14330
14364
  html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>'
@@ -16801,7 +16835,7 @@ export class SfIEvents extends LitElement {
16801
16835
  let reportformatschema: string = "";
16802
16836
  if (listEvent.customreporting != null) {
16803
16837
  let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting-1') as SfIReporting
16804
- if(reportingReporting == null){
16838
+ if (reportingReporting == null) {
16805
16839
  reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting-0') as SfIReporting
16806
16840
  }
16807
16841
  console.log('reportformatvalues', JSON.stringify(reportingReporting.selectedValues()))
@@ -18745,14 +18779,6 @@ export class SfIEvents extends LitElement {
18745
18779
  obligation: event.obligation,
18746
18780
  }
18747
18781
  );
18748
- // this.uploadTriggerMyEvent(
18749
- // event.id + ";" + event.shortid,
18750
- // feedbackMessage.value,
18751
- // event.countries.join(",").replace(/ *\([^)]*\) */g, ""),
18752
- // event.entities.join(',').replace(/ *\([^)]*\) */g, ""),
18753
- // event.locations.join(',').replace(/ *\([^)]*\) */g, ""),
18754
- // event.statute[0],
18755
- // event.subcategory[0]);
18756
18782
  buttonCancel.click();
18757
18783
  buttonClose.click();
18758
18784
  }
@@ -18820,23 +18846,26 @@ export class SfIEvents extends LitElement {
18820
18846
  if (this._SfUploader[0] != null) {
18821
18847
  (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.emailcontent = emailcontent;
18822
18848
  }
18823
- eventDetailReportingContainer.querySelector('.button-delete')?.addEventListener('click', async () => {
18849
+ let deleteButtons = eventDetailContainer.querySelectorAll('.button-delete') as NodeListOf<HTMLButtonElement>
18850
+ for (let deleteButton of deleteButtons) {
18851
+ deleteButton?.addEventListener('click', async () => {
18824
18852
 
18825
- await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
18826
- this.setSuccess('Deleted successfully!')
18827
- setTimeout(() => {
18828
- this.clearMessages()
18829
- }, 3000);
18830
- //console.log('deleted', resultDelete);
18831
- if (this.getCurrentTab() == this.TAB_CUSTOM) {
18832
- this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
18833
- } else {
18834
- // if(currentColumnButton != null) {
18835
- // currentColumnButton.click();
18836
- // }
18837
- }
18853
+ await this.fetchDeleteReview(event["id"], mmddyyyy, event.entityid, event.locationid);
18854
+ this.setSuccess('Deleted successfully!')
18855
+ setTimeout(() => {
18856
+ this.clearMessages()
18857
+ }, 3000);
18858
+ //console.log('deleted', resultDelete);
18859
+ if (this.getCurrentTab() == this.TAB_CUSTOM) {
18860
+ this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
18861
+ } else {
18862
+ // if(currentColumnButton != null) {
18863
+ // currentColumnButton.click();
18864
+ // }
18865
+ }
18838
18866
 
18839
- });
18867
+ });
18868
+ }
18840
18869
  eventDetailReportingContainer.querySelector('#button-auto-approve')?.addEventListener('click', async () => {
18841
18870
  if (this.selectedItemIds.length <= 1) {
18842
18871
  await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, event.module ?? "compliance");
@@ -18965,10 +18994,10 @@ export class SfIEvents extends LitElement {
18965
18994
  }
18966
18995
  event.percentage = inputReportingPercentage.value;
18967
18996
  event.reportedlocations = JSON.stringify(this.reportedLocationsVals)
18968
- if (this.reportedLocationsVals.length == 0 || (this.reportedLocationsVals.length == 1 && this.reportedLocationsVals[0] == "")) {
18997
+ if (this.reportedLocationsVals.length == 0) {
18969
18998
  event.percentage = "100";
18970
18999
  }
18971
- console.log('rendering list reporting', event.percentage, event.reportedlocations)
19000
+ console.log('rendering list reporting', this.reportedLocationsVals, event.percentage, event.reportedlocations)
18972
19001
  event.reportercomments = (eventDetailReportingContainer.querySelector('#input-reporter-comments') as HTMLInputElement).value;
18973
19002
  event.dateofcompletion = (eventDetailReportingContainer.querySelector('#input-reporter-doc') as HTMLInputElement).value.length > 0 ? (new Date((eventDetailReportingContainer.querySelector('#input-reporter-doc') as HTMLInputElement).value).getTime() + "") : "";
18974
19003
  event.documents = (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.selectedValues();
@@ -18981,6 +19010,9 @@ export class SfIEvents extends LitElement {
18981
19010
  let selectReportingEntity = eventDetailReportingContainer.querySelector('#input-reporter-entity-' + indexRepLoc) as HTMLSelectElement;
18982
19011
  let selectReportingLocation = eventDetailReportingContainer.querySelector('#input-reporter-location-' + indexRepLoc) as HTMLSelectElement;
18983
19012
  selectReportingEntity.innerHTML = '';
19013
+ let defaultOption = new Option("Select Entity", "", true, true)
19014
+ defaultOption.disabled = true
19015
+ selectReportingEntity.add(defaultOption)
18984
19016
  for (let country of Object.keys(projectUserMap)) {
18985
19017
  if (country == "roles") {
18986
19018
  continue;
@@ -18993,6 +19025,9 @@ export class SfIEvents extends LitElement {
18993
19025
  }
18994
19026
  selectReportingEntity.addEventListener('change', (e: any) => {
18995
19027
  selectReportingLocation.innerHTML = ''
19028
+ let defaultOption = new Option("Select Location", "", true, true)
19029
+ defaultOption.disabled = true
19030
+ selectReportingLocation.add(defaultOption)
18996
19031
  for (let country of Object.keys(projectUserMap)) {
18997
19032
  if (country == "roles") {
18998
19033
  continue;
@@ -19013,27 +19048,33 @@ export class SfIEvents extends LitElement {
19013
19048
  })
19014
19049
 
19015
19050
  if (selectReportingLocation.innerHTML == '') {
19016
- for (let country of Object.keys(projectUserMap)) {
19017
- if (country == "roles") {
19018
- continue;
19019
- }
19020
- for (let entity of Object.keys(projectUserMap[country])) {
19021
- for (let location of Object.keys(projectUserMap[country][entity])) {
19022
- let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
19023
- let option = new Option(locationName, location)
19024
- selectReportingLocation.add(option);
19025
- break;
19026
- }
19027
- break;
19028
- }
19029
- break;
19030
- }
19051
+ let defaultOption = new Option("Select Location", "", true, true)
19052
+ defaultOption.disabled = true
19053
+ selectReportingLocation.add(defaultOption)
19054
+ // for (let country of Object.keys(projectUserMap)) {
19055
+ // if (country == "roles") {
19056
+ // continue;
19057
+ // }
19058
+ // for (let entity of Object.keys(projectUserMap[country])) {
19059
+ // for (let location of Object.keys(projectUserMap[country][entity])) {
19060
+ // let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
19061
+ // let option = new Option(locationName, location)
19062
+ // selectReportingLocation.add(option);
19063
+ // break;
19064
+ // }
19065
+ // break;
19066
+ // }
19067
+ // break;
19068
+ // }
19031
19069
  }
19032
19070
  selectReportingLocation.addEventListener('change', (e: any) => {
19071
+ if (selectReportingEntity.value == "") {
19072
+ return;
19073
+ }
19033
19074
  let index = parseInt(e.target.id.split('-')[3])
19034
19075
  this.reportedLocationsVals[index] = e.target.value
19035
19076
  })
19036
- if (event.reportedlocations != null && event.reportedlocations.length > 0) {
19077
+ if (event.reportedlocations != null && event.reportedlocations.length > indexRepLoc) {
19037
19078
  console.log('setting reportedlocations', event.reportedlocations)
19038
19079
  let tempReportedLocation = Util.isJSONParsable(event.reportedlocations) ? JSON.parse(event.reportedlocations)[indexRepLoc] : event.reportedlocations
19039
19080
  for (let country of Object.keys(projectUserMap)) {
@@ -28263,7 +28304,7 @@ export class SfIEvents extends LitElement {
28263
28304
 
28264
28305
  uploadTriggerEvent = async (triggeredCompliances: any) => {
28265
28306
 
28266
- let url = "https://" + this.apiId + "/triggerevent";
28307
+ let url = "https://" + this.apiId + "/triggerevent1";
28267
28308
 
28268
28309
  const body = {
28269
28310
  "projectid": this.projectId,