sf-i-events 1.0.963 → 1.0.965

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-events",
3
3
  "private": false,
4
- "version": "1.0.963",
4
+ "version": "1.0.965",
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
@@ -2663,7 +2663,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2663
2663
  <sf-i-elastic-text exportparts="highlight,highlight-count"
2664
2664
  class="stream-event-title${!isBulk ? ' button-event-title' : ''}"
2665
2665
  id="stream-event-title-${mmddSanitized}-${itemNumber}-${moduleType}-${(isReportedLocation) ? 'reportedlocations' : ''}"
2666
- text="${event.obligationtitle}"
2666
+ text="${event.obligationtitle.replace(/\\n/g, '')}"
2667
2667
  minLength="${event.concise == null ? '100' : '60'}">
2668
2668
  </sf-i-elastic-text>
2669
2669
  ${showLocationRisk ? `
@@ -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 />';
@@ -3849,7 +3848,7 @@ let SfIEvents = class SfIEvents extends LitElement {
3849
3848
  else if (uploadGuidance != 0) {
3850
3849
  html += '<div part="upload-guidance-content">';
3851
3850
  html += '<div part="detail-head" class="mb-5"><strong>Upload Guidance</strong></div>';
3852
- html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event['uploadguidance'] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="150"></sf-i-elastic-text>';
3851
+ html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event['uploadguidance'] + "").replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="150"></sf-i-elastic-text>';
3853
3852
  html += '</div>';
3854
3853
  }
3855
3854
  html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>';
@@ -4133,7 +4132,7 @@ let SfIEvents = class SfIEvents extends LitElement {
4133
4132
  }
4134
4133
  event.percentage = inputReportingPercentage.value;
4135
4134
  event.reportedlocations = JSON.stringify(this.reportedLocationsVals);
4136
- if (this.reportedLocationsVals.length == 0 || (this.reportedLocationsVals.length == 1 && this.reportedLocationsVals[0] == "")) {
4135
+ if (this.reportedLocationsVals.length == 0) {
4137
4136
  event.percentage = "100";
4138
4137
  }
4139
4138
  console.log('rendering list reporting', event.percentage, event.reportedlocations);
@@ -4148,6 +4147,9 @@ let SfIEvents = class SfIEvents extends LitElement {
4148
4147
  let selectReportingEntity = listReportingContainer.querySelector('#input-reporter-entity-' + indexRepLoc);
4149
4148
  let selectReportingLocation = listReportingContainer.querySelector('#input-reporter-location-' + indexRepLoc);
4150
4149
  selectReportingEntity.innerHTML = '';
4150
+ let defaultOption = new Option("Select Location", "", true, true);
4151
+ defaultOption.disabled = true;
4152
+ selectReportingEntity.add(defaultOption);
4151
4153
  for (let country of Object.keys(projectUserMap)) {
4152
4154
  if (country == "roles") {
4153
4155
  continue;
@@ -4160,6 +4162,9 @@ let SfIEvents = class SfIEvents extends LitElement {
4160
4162
  }
4161
4163
  selectReportingEntity.addEventListener('change', (e) => {
4162
4164
  selectReportingLocation.innerHTML = '';
4165
+ let defaultOption = new Option("Select Location", "", true, true);
4166
+ defaultOption.disabled = true;
4167
+ selectReportingLocation.add(defaultOption);
4163
4168
  for (let country of Object.keys(projectUserMap)) {
4164
4169
  if (country == "roles") {
4165
4170
  continue;
@@ -4179,23 +4184,29 @@ let SfIEvents = class SfIEvents extends LitElement {
4179
4184
  selectReportingLocation.value = event.reportedlocations != null ? (Util.isJSONParsable(event.reportedlocations) ? JSON.parse(event.reportedlocations)[indexRepLoc] : event.reportedlocations) : "";
4180
4185
  });
4181
4186
  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
- }
4187
+ let defaultOption = new Option("Select Location", "", true, true);
4188
+ defaultOption.disabled = true;
4189
+ selectReportingLocation.add(defaultOption);
4190
+ // for (let country of Object.keys(projectUserMap)) {
4191
+ // if (country == "roles") {
4192
+ // continue;
4193
+ // }
4194
+ // for (let entity of Object.keys(projectUserMap[country])) {
4195
+ // for (let location of Object.keys(projectUserMap[country][entity])) {
4196
+ // let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
4197
+ // let option = new Option(locationName, location)
4198
+ // selectReportingLocation.add(option);
4199
+ // break;
4200
+ // }
4201
+ // break;
4202
+ // }
4203
+ // break;
4204
+ // }
4197
4205
  }
4198
4206
  selectReportingLocation.addEventListener('change', (e) => {
4207
+ if (selectReportingEntity.value == "") {
4208
+ return;
4209
+ }
4199
4210
  let index = parseInt(e.target.id.split('-')[3]);
4200
4211
  this.reportedLocationsVals[index] = e.target.value;
4201
4212
  });
@@ -10821,19 +10832,34 @@ let SfIEvents = class SfIEvents extends LitElement {
10821
10832
  for (var k = 0; k < cols.length; k++) {
10822
10833
  if (!this.EXCLUDE_COLS_FROM_REGS.includes(cols[k].toLowerCase())) {
10823
10834
  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;
10835
+ console.log('attachments', data[k]);
10836
+ if (typeof data[k] === "string") {
10837
+ let attachmentArr = JSON.parse(data[k].toString());
10838
+ if (attachmentArr.length > 0) {
10839
+ html += '<div class="m-20">';
10840
+ html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>';
10841
+ for (let attachment of attachmentArr) {
10842
+ 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>`;
10843
+ }
10844
+ html += '</div>';
10830
10845
  }
10831
- else {
10832
- attachment = JSON.parse(attachmentStr + "");
10846
+ }
10847
+ else {
10848
+ html += '<div class="m-20">';
10849
+ html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>';
10850
+ for (let attachmentStr of data[k]) {
10851
+ let attachment = {};
10852
+ if (typeof attachmentStr === "object") {
10853
+ attachment = attachmentStr;
10854
+ }
10855
+ else {
10856
+ attachment = JSON.parse(attachmentStr.toString());
10857
+ }
10858
+ 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
10859
  }
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>`;
10860
+ html += '</div>';
10835
10861
  }
10836
- html += '</div>';
10862
+ // html += '</div>';
10837
10863
  }
10838
10864
  else {
10839
10865
  html += '<div class="m-20">';
@@ -14220,12 +14246,13 @@ let SfIEvents = class SfIEvents extends LitElement {
14220
14246
  html += '<div part="detail-summary">';
14221
14247
  html += ('<div part="detail-summary-title" class="pl-20 pr-20"><h1>' + event['obligationtitle'] + '</h1></div>');
14222
14248
  let obligationArr = event['obligation'].split('More information:');
14223
- html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + obligationArr[0].replace(/\n/g, '<br />') + '</h3></div>');
14249
+ console.log('detailsObligation', obligationArr[0].replace(/\\n/g, '<br />'));
14250
+ html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + obligationArr[0].replace(/\\n/g, '<br />') + '</h3></div>');
14224
14251
  if (obligationArr.length > 1) {
14225
14252
  let tempObligationArr = obligationArr.slice(1);
14226
- html += ('<div part="detail-summary-subtitle-more-info" class="pl-20 pr-20 pb-10">' + ('<sf-i-elastic-text exportparts="highlight,highlight-count" text="More information:' + (tempObligationArr.join('')).replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
14253
+ html += ('<div part="detail-summary-subtitle-more-info" class="pl-20 pr-20 pb-10">' + ('<sf-i-elastic-text exportparts="highlight,highlight-count" text="More information:' + (tempObligationArr.join('')).replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
14227
14254
  }
14228
- html += ('<div part="detail-summary-content" class="pl-20 pr-20 pt-20">' + ('<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event['internalcontrols'] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
14255
+ html += ('<div part="detail-summary-content" class="pl-20 pr-20 pt-20">' + ('<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event['internalcontrols'] + "").replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
14229
14256
  html += '</div>';
14230
14257
  html += '<br />';
14231
14258
  html += '<div class="accordian-section section-basic pl-20 pr-20" part="accordian-section">';
@@ -14331,7 +14358,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14331
14358
  html += this.getEventTexts(complianceFields[i], JSON.parse(event[complianceFields[i]]), event) + "&nbsp;<a href=\"" + res + "\" target=\"_blank\">Open</a>";
14332
14359
  }
14333
14360
  else {
14334
- html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[complianceFields[i]] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>' + "&nbsp;<a href=\"" + res + "\" target=\"_blank\">Open</a>";
14361
+ html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[complianceFields[i]] + "").replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>' + "&nbsp;<a href=\"" + res + "\" target=\"_blank\">Open</a>";
14335
14362
  }
14336
14363
  html += '</div>';
14337
14364
  }
@@ -14371,7 +14398,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14371
14398
  html += this.getEventTexts(complianceFields[i], JSON.parse(event[complianceFields[i]]), event);
14372
14399
  }
14373
14400
  else {
14374
- html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[complianceFields[i]] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>';
14401
+ html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[complianceFields[i]] + "").replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>';
14375
14402
  }
14376
14403
  html += '</div>';
14377
14404
  }
@@ -14406,7 +14433,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14406
14433
  }
14407
14434
  else {
14408
14435
  //console.log('grcfield', event[grcFields[i]]);
14409
- html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[grcFields[i]] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>';
14436
+ html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[grcFields[i]] + "").replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>';
14410
14437
  }
14411
14438
  }
14412
14439
  html += '</div>';
@@ -14908,10 +14935,10 @@ let SfIEvents = class SfIEvents extends LitElement {
14908
14935
  }
14909
14936
  event.percentage = inputReportingPercentage.value;
14910
14937
  event.reportedlocations = JSON.stringify(this.reportedLocationsVals);
14911
- if (this.reportedLocationsVals.length == 0 || (this.reportedLocationsVals.length == 1 && this.reportedLocationsVals[0] == "")) {
14938
+ if (this.reportedLocationsVals.length == 0) {
14912
14939
  event.percentage = "100";
14913
14940
  }
14914
- console.log('rendering list reporting', event.percentage, event.reportedlocations);
14941
+ console.log('rendering list reporting', this.reportedLocationsVals, event.percentage, event.reportedlocations);
14915
14942
  event.reportercomments = eventDetailReportingContainer.querySelector('#input-reporter-comments').value;
14916
14943
  event.dateofcompletion = eventDetailReportingContainer.querySelector('#input-reporter-doc').value.length > 0 ? (new Date(eventDetailReportingContainer.querySelector('#input-reporter-doc').value).getTime() + "") : "";
14917
14944
  event.documents = this._SfUploader[0].querySelector('#uploader').selectedValues();
@@ -14923,6 +14950,9 @@ let SfIEvents = class SfIEvents extends LitElement {
14923
14950
  let selectReportingEntity = eventDetailReportingContainer.querySelector('#input-reporter-entity-' + indexRepLoc);
14924
14951
  let selectReportingLocation = eventDetailReportingContainer.querySelector('#input-reporter-location-' + indexRepLoc);
14925
14952
  selectReportingEntity.innerHTML = '';
14953
+ let defaultOption = new Option("Select Entity", "", true, true);
14954
+ defaultOption.disabled = true;
14955
+ selectReportingEntity.add(defaultOption);
14926
14956
  for (let country of Object.keys(projectUserMap)) {
14927
14957
  if (country == "roles") {
14928
14958
  continue;
@@ -14935,6 +14965,9 @@ let SfIEvents = class SfIEvents extends LitElement {
14935
14965
  }
14936
14966
  selectReportingEntity.addEventListener('change', (e) => {
14937
14967
  selectReportingLocation.innerHTML = '';
14968
+ let defaultOption = new Option("Select Location", "", true, true);
14969
+ defaultOption.disabled = true;
14970
+ selectReportingLocation.add(defaultOption);
14938
14971
  for (let country of Object.keys(projectUserMap)) {
14939
14972
  if (country == "roles") {
14940
14973
  continue;
@@ -14954,27 +14987,33 @@ let SfIEvents = class SfIEvents extends LitElement {
14954
14987
  selectReportingLocation.value = event.reportedlocations != null ? (Util.isJSONParsable(event.reportedlocations) ? JSON.parse(event.reportedlocations)[indexRepLoc] : event.reportedlocations) : "";
14955
14988
  });
14956
14989
  if (selectReportingLocation.innerHTML == '') {
14957
- for (let country of Object.keys(projectUserMap)) {
14958
- if (country == "roles") {
14959
- continue;
14960
- }
14961
- for (let entity of Object.keys(projectUserMap[country])) {
14962
- for (let location of Object.keys(projectUserMap[country][entity])) {
14963
- let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "");
14964
- let option = new Option(locationName, location);
14965
- selectReportingLocation.add(option);
14966
- break;
14967
- }
14968
- break;
14969
- }
14970
- break;
14971
- }
14990
+ let defaultOption = new Option("Select Location", "", true, true);
14991
+ defaultOption.disabled = true;
14992
+ selectReportingLocation.add(defaultOption);
14993
+ // for (let country of Object.keys(projectUserMap)) {
14994
+ // if (country == "roles") {
14995
+ // continue;
14996
+ // }
14997
+ // for (let entity of Object.keys(projectUserMap[country])) {
14998
+ // for (let location of Object.keys(projectUserMap[country][entity])) {
14999
+ // let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
15000
+ // let option = new Option(locationName, location)
15001
+ // selectReportingLocation.add(option);
15002
+ // break;
15003
+ // }
15004
+ // break;
15005
+ // }
15006
+ // break;
15007
+ // }
14972
15008
  }
14973
15009
  selectReportingLocation.addEventListener('change', (e) => {
15010
+ if (selectReportingEntity.value == "") {
15011
+ return;
15012
+ }
14974
15013
  let index = parseInt(e.target.id.split('-')[3]);
14975
15014
  this.reportedLocationsVals[index] = e.target.value;
14976
15015
  });
14977
- if (event.reportedlocations != null && event.reportedlocations.length > 0) {
15016
+ if (event.reportedlocations != null && event.reportedlocations.length > indexRepLoc) {
14978
15017
  console.log('setting reportedlocations', event.reportedlocations);
14979
15018
  let tempReportedLocation = Util.isJSONParsable(event.reportedlocations) ? JSON.parse(event.reportedlocations)[indexRepLoc] : event.reportedlocations;
14980
15019
  for (let country of Object.keys(projectUserMap)) {
@@ -27548,6 +27587,9 @@ SfIEvents.styles = css `
27548
27587
  position: relative;
27549
27588
  }
27550
27589
 
27590
+ .max-width-100{
27591
+ max-width: 100%
27592
+ }
27551
27593
  @media (orientation: landscape) {
27552
27594
 
27553
27595
  .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}"
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) {
@@ -6230,7 +6233,7 @@ export class SfIEvents extends LitElement {
6230
6233
  } else if (uploadGuidance != 0) {
6231
6234
  html += '<div part="upload-guidance-content">'
6232
6235
  html += '<div part="detail-head" class="mb-5"><strong>Upload Guidance</strong></div>'
6233
- html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event['uploadguidance'] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="150"></sf-i-elastic-text>';
6236
+ html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event['uploadguidance'] + "").replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="150"></sf-i-elastic-text>';
6234
6237
  html += '</div>'
6235
6238
  }
6236
6239
  html += '<div part="uploader-analysis-message" class="uploader-analysis-message mt-20">The analysis is running in the background. You can proceed further.</div>'
@@ -6520,7 +6523,7 @@ export class SfIEvents extends LitElement {
6520
6523
  }
6521
6524
  event.percentage = inputReportingPercentage.value;
6522
6525
  event.reportedlocations = JSON.stringify(this.reportedLocationsVals)
6523
- if (this.reportedLocationsVals.length == 0 || (this.reportedLocationsVals.length == 1 && this.reportedLocationsVals[0] == "")) {
6526
+ if (this.reportedLocationsVals.length == 0) {
6524
6527
  event.percentage = "100";
6525
6528
  }
6526
6529
  console.log('rendering list reporting', event.percentage, event.reportedlocations)
@@ -6536,6 +6539,9 @@ export class SfIEvents extends LitElement {
6536
6539
  let selectReportingEntity = listReportingContainer.querySelector('#input-reporter-entity-' + indexRepLoc) as HTMLSelectElement;
6537
6540
  let selectReportingLocation = listReportingContainer.querySelector('#input-reporter-location-' + indexRepLoc) as HTMLSelectElement;
6538
6541
  selectReportingEntity.innerHTML = '';
6542
+ let defaultOption = new Option("Select Location", "", true, true)
6543
+ defaultOption.disabled = true
6544
+ selectReportingEntity.add(defaultOption)
6539
6545
  for (let country of Object.keys(projectUserMap)) {
6540
6546
  if (country == "roles") {
6541
6547
  continue;
@@ -6548,6 +6554,9 @@ export class SfIEvents extends LitElement {
6548
6554
  }
6549
6555
  selectReportingEntity.addEventListener('change', (e: any) => {
6550
6556
  selectReportingLocation.innerHTML = ''
6557
+ let defaultOption = new Option("Select Location", "", true, true)
6558
+ defaultOption.disabled = true
6559
+ selectReportingLocation.add(defaultOption)
6551
6560
  for (let country of Object.keys(projectUserMap)) {
6552
6561
  if (country == "roles") {
6553
6562
  continue;
@@ -6567,23 +6576,29 @@ export class SfIEvents extends LitElement {
6567
6576
  selectReportingLocation.value = event.reportedlocations != null ? (Util.isJSONParsable(event.reportedlocations) ? JSON.parse(event.reportedlocations)[indexRepLoc] : event.reportedlocations) : "";
6568
6577
  })
6569
6578
  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
- }
6579
+ let defaultOption = new Option("Select Location", "", true, true)
6580
+ defaultOption.disabled = true
6581
+ selectReportingLocation.add(defaultOption)
6582
+ // for (let country of Object.keys(projectUserMap)) {
6583
+ // if (country == "roles") {
6584
+ // continue;
6585
+ // }
6586
+ // for (let entity of Object.keys(projectUserMap[country])) {
6587
+ // for (let location of Object.keys(projectUserMap[country][entity])) {
6588
+ // let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
6589
+ // let option = new Option(locationName, location)
6590
+ // selectReportingLocation.add(option);
6591
+ // break;
6592
+ // }
6593
+ // break;
6594
+ // }
6595
+ // break;
6596
+ // }
6585
6597
  }
6586
6598
  selectReportingLocation.addEventListener('change', (e: any) => {
6599
+ if(selectReportingEntity.value == ""){
6600
+ return;
6601
+ }
6587
6602
  let index = parseInt(e.target.id.split('-')[3])
6588
6603
  this.reportedLocationsVals[index] = e.target.value
6589
6604
  })
@@ -14313,18 +14328,34 @@ export class SfIEvents extends LitElement {
14313
14328
  if (!this.EXCLUDE_COLS_FROM_REGS.includes(cols[k].toLowerCase())) {
14314
14329
 
14315
14330
  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 + "");
14331
+
14332
+ console.log('attachments', data[k]);
14333
+ if (typeof data[k] === "string") {
14334
+ let attachmentArr = JSON.parse(data[k].toString());
14335
+ if (attachmentArr.length > 0) {
14336
+ html += '<div class="m-20">';
14337
+ html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>'
14338
+ for (let attachment of attachmentArr) {
14339
+
14340
+ 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>`
14341
+ }
14342
+ html += '</div>';
14324
14343
  }
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>`
14344
+ } else {
14345
+ html += '<div class="m-20">';
14346
+ html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>'
14347
+ for (let attachmentStr of data[k]) {
14348
+ let attachment: any = {};
14349
+ if (typeof attachmentStr === "object") {
14350
+ attachment = attachmentStr;
14351
+ } else {
14352
+ attachment = JSON.parse(attachmentStr.toString());
14353
+ }
14354
+ 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>`
14355
+ }
14356
+ html += '</div>';
14326
14357
  }
14327
- html += '</div>';
14358
+ // html += '</div>';
14328
14359
  } else {
14329
14360
  html += '<div class="m-20">';
14330
14361
  html += '<div part="detail-head"><strong>' + cols[k] + '</strong></div>'
@@ -16801,7 +16832,7 @@ export class SfIEvents extends LitElement {
16801
16832
  let reportformatschema: string = "";
16802
16833
  if (listEvent.customreporting != null) {
16803
16834
  let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting-1') as SfIReporting
16804
- if(reportingReporting == null){
16835
+ if (reportingReporting == null) {
16805
16836
  reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting-0') as SfIReporting
16806
16837
  }
16807
16838
  console.log('reportformatvalues', JSON.stringify(reportingReporting.selectedValues()))
@@ -18170,12 +18201,13 @@ export class SfIEvents extends LitElement {
18170
18201
  html += '<div part="detail-summary">';
18171
18202
  html += ('<div part="detail-summary-title" class="pl-20 pr-20"><h1>' + event['obligationtitle'] + '</h1></div>');
18172
18203
  let obligationArr = event['obligation'].split('More information:');
18173
- html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + obligationArr[0].replace(/\n/g, '<br />') + '</h3></div>');
18204
+ console.log('detailsObligation', obligationArr[0].replace(/\\n/g, '<br />'))
18205
+ html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + obligationArr[0].replace(/\\n/g, '<br />') + '</h3></div>');
18174
18206
  if (obligationArr.length > 1) {
18175
18207
  let tempObligationArr = obligationArr.slice(1);
18176
- html += ('<div part="detail-summary-subtitle-more-info" class="pl-20 pr-20 pb-10">' + ('<sf-i-elastic-text exportparts="highlight,highlight-count" text="More information:' + (tempObligationArr.join('')).replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
18208
+ html += ('<div part="detail-summary-subtitle-more-info" class="pl-20 pr-20 pb-10">' + ('<sf-i-elastic-text exportparts="highlight,highlight-count" text="More information:' + (tempObligationArr.join('')).replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
18177
18209
  }
18178
- html += ('<div part="detail-summary-content" class="pl-20 pr-20 pt-20">' + ('<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event['internalcontrols'] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
18210
+ html += ('<div part="detail-summary-content" class="pl-20 pr-20 pt-20">' + ('<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event['internalcontrols'] + "").replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
18179
18211
  html += '</div>';
18180
18212
 
18181
18213
  html += '<br />';
@@ -18307,7 +18339,7 @@ export class SfIEvents extends LitElement {
18307
18339
  if ((event[complianceFields[i]] + "").indexOf("[") >= 0) {
18308
18340
  html += this.getEventTexts(complianceFields[i], JSON.parse(event[complianceFields[i]]), event) + "&nbsp;<a href=\"" + res + "\" target=\"_blank\">Open</a>";
18309
18341
  } else {
18310
- html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[complianceFields[i]] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>' + "&nbsp;<a href=\"" + res + "\" target=\"_blank\">Open</a>";
18342
+ html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[complianceFields[i]] + "").replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>' + "&nbsp;<a href=\"" + res + "\" target=\"_blank\">Open</a>";
18311
18343
  }
18312
18344
  html += '</div>';
18313
18345
 
@@ -18346,7 +18378,7 @@ export class SfIEvents extends LitElement {
18346
18378
  if ((event[complianceFields[i]] + "").indexOf("[") >= 0) {
18347
18379
  html += this.getEventTexts(complianceFields[i], JSON.parse(event[complianceFields[i]]), event);
18348
18380
  } else {
18349
- html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[complianceFields[i]] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>';
18381
+ html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[complianceFields[i]] + "").replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>';
18350
18382
  }
18351
18383
  html += '</div>';
18352
18384
 
@@ -18389,7 +18421,7 @@ export class SfIEvents extends LitElement {
18389
18421
  html += this.getEventTexts(grcFields[i], JSON.parse(event[grcFields[i]]), event);
18390
18422
  } else {
18391
18423
  //console.log('grcfield', event[grcFields[i]]);
18392
- html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[grcFields[i]] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>';
18424
+ html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[grcFields[i]] + "").replace(/"/g, "").replace(/\\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>';
18393
18425
  }
18394
18426
  }
18395
18427
 
@@ -18964,10 +18996,10 @@ export class SfIEvents extends LitElement {
18964
18996
  }
18965
18997
  event.percentage = inputReportingPercentage.value;
18966
18998
  event.reportedlocations = JSON.stringify(this.reportedLocationsVals)
18967
- if (this.reportedLocationsVals.length == 0 || (this.reportedLocationsVals.length == 1 && this.reportedLocationsVals[0] == "")) {
18999
+ if (this.reportedLocationsVals.length == 0) {
18968
19000
  event.percentage = "100";
18969
19001
  }
18970
- console.log('rendering list reporting', event.percentage, event.reportedlocations)
19002
+ console.log('rendering list reporting', this.reportedLocationsVals, event.percentage, event.reportedlocations)
18971
19003
  event.reportercomments = (eventDetailReportingContainer.querySelector('#input-reporter-comments') as HTMLInputElement).value;
18972
19004
  event.dateofcompletion = (eventDetailReportingContainer.querySelector('#input-reporter-doc') as HTMLInputElement).value.length > 0 ? (new Date((eventDetailReportingContainer.querySelector('#input-reporter-doc') as HTMLInputElement).value).getTime() + "") : "";
18973
19005
  event.documents = (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.selectedValues();
@@ -18980,6 +19012,9 @@ export class SfIEvents extends LitElement {
18980
19012
  let selectReportingEntity = eventDetailReportingContainer.querySelector('#input-reporter-entity-' + indexRepLoc) as HTMLSelectElement;
18981
19013
  let selectReportingLocation = eventDetailReportingContainer.querySelector('#input-reporter-location-' + indexRepLoc) as HTMLSelectElement;
18982
19014
  selectReportingEntity.innerHTML = '';
19015
+ let defaultOption = new Option("Select Entity", "", true, true)
19016
+ defaultOption.disabled = true
19017
+ selectReportingEntity.add(defaultOption)
18983
19018
  for (let country of Object.keys(projectUserMap)) {
18984
19019
  if (country == "roles") {
18985
19020
  continue;
@@ -18992,6 +19027,9 @@ export class SfIEvents extends LitElement {
18992
19027
  }
18993
19028
  selectReportingEntity.addEventListener('change', (e: any) => {
18994
19029
  selectReportingLocation.innerHTML = ''
19030
+ let defaultOption = new Option("Select Location", "", true, true)
19031
+ defaultOption.disabled = true
19032
+ selectReportingLocation.add(defaultOption)
18995
19033
  for (let country of Object.keys(projectUserMap)) {
18996
19034
  if (country == "roles") {
18997
19035
  continue;
@@ -19012,27 +19050,33 @@ export class SfIEvents extends LitElement {
19012
19050
  })
19013
19051
 
19014
19052
  if (selectReportingLocation.innerHTML == '') {
19015
- for (let country of Object.keys(projectUserMap)) {
19016
- if (country == "roles") {
19017
- continue;
19018
- }
19019
- for (let entity of Object.keys(projectUserMap[country])) {
19020
- for (let location of Object.keys(projectUserMap[country][entity])) {
19021
- let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
19022
- let option = new Option(locationName, location)
19023
- selectReportingLocation.add(option);
19024
- break;
19025
- }
19026
- break;
19027
- }
19028
- break;
19029
- }
19053
+ let defaultOption = new Option("Select Location", "", true, true)
19054
+ defaultOption.disabled = true
19055
+ selectReportingLocation.add(defaultOption)
19056
+ // for (let country of Object.keys(projectUserMap)) {
19057
+ // if (country == "roles") {
19058
+ // continue;
19059
+ // }
19060
+ // for (let entity of Object.keys(projectUserMap[country])) {
19061
+ // for (let location of Object.keys(projectUserMap[country][entity])) {
19062
+ // let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
19063
+ // let option = new Option(locationName, location)
19064
+ // selectReportingLocation.add(option);
19065
+ // break;
19066
+ // }
19067
+ // break;
19068
+ // }
19069
+ // break;
19070
+ // }
19030
19071
  }
19031
19072
  selectReportingLocation.addEventListener('change', (e: any) => {
19073
+ if(selectReportingEntity.value == ""){
19074
+ return;
19075
+ }
19032
19076
  let index = parseInt(e.target.id.split('-')[3])
19033
19077
  this.reportedLocationsVals[index] = e.target.value
19034
19078
  })
19035
- if (event.reportedlocations != null && event.reportedlocations.length > 0) {
19079
+ if (event.reportedlocations != null && event.reportedlocations.length > indexRepLoc) {
19036
19080
  console.log('setting reportedlocations', event.reportedlocations)
19037
19081
  let tempReportedLocation = Util.isJSONParsable(event.reportedlocations) ? JSON.parse(event.reportedlocations)[indexRepLoc] : event.reportedlocations
19038
19082
  for (let country of Object.keys(projectUserMap)) {