sf-i-events 1.0.913 → 1.0.915

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
@@ -829,6 +829,36 @@
829
829
  disablesignoff="yes" disableclientresponse="yes">
830
830
 
831
831
  </sf-i-events> -->
832
+ <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
833
+ apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
834
+ apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
835
+ apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
836
+ apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws"
837
+ apiidagreements="swago3unro2te55ikvjuqwcrr40wluqh.lambda-url.us-east-1.on.aws"
838
+ apiidlicenses="lbtsbsctcdsyah4qdszkv4rctq0tnvel.lambda-url.us-east-1.on.aws"
839
+ apiidrcmresources="jra3sghasmaxn5aiq7rtv6pjzq0oeuaw.lambda-url.us-east-1.on.aws" fill="solid"
840
+ username="Local Reporter 1" userprofileid="e9684b5d-ddbc-46d3-ae07-51706bf75410"
841
+ projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global"
842
+ countryid="8ee18117-0cca-49be-80f4-1f712d871fef" selectedcriteria="Country - Singapore" myrole="reporter"
843
+ showregisterexport="false"
844
+ features="[&quot;notices&quot;,&quot;contracts&quot;,&quot;licenses&quot;,&quot;rcmresources&quot;]"
845
+ 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;}]"
846
+ 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;}]"
847
+ eventpreviewfields="[&quot;obligation&quot;]"
848
+ eventhidefields="[&quot;comments&quot;,&quot;documents&quot;,&quot;lastupdated&quot;,&quot;approved&quot;,&quot;tags&quot;]"
849
+ calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
850
+
851
+ <div slot="uploader">
852
+ <sf-i-uploader id="uploader" max="10" apiid="1peg5170d3"
853
+ 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;]"
854
+ extract="yes" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" maxsize="31457280"
855
+ allowdownload="yes"></sf-i-uploader>
856
+ </div>
857
+ <div slot="reporting">
858
+ <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
859
+ </div>
860
+
861
+ </sf-i-events>
832
862
  <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
833
863
  apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
834
864
  apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
@@ -928,7 +958,7 @@
928
958
  </div>
929
959
 
930
960
  </sf-i-events> -->
931
- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
961
+ <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
932
962
  apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
933
963
  apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
934
964
  apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
@@ -956,7 +986,7 @@
956
986
  <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
957
987
  </div>
958
988
 
959
- </sf-i-events>
989
+ </sf-i-events> -->
960
990
  <!-- <sf-i-events projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" mode="onboarding"
961
991
  locations="{&quot;India&quot;:{&quot;Maharashtra&quot;:[&quot;Pune&quot;,&quot;Mumbai&quot;],&quot;Telangana&quot;:[&quot;Telangana&quot;]},&quot;Canada&quot;:{&quot;CanadaSO&quot;:[&quot;CanadaLO&quot;]},&quot;Singapore&quot;:{&quot;SingaporeSO&quot;:[&quot;Orchard&quot;,&quot;Raffles&quot;,&quot;Robinson&quot;,&quot;Tanjong&quot;,&quot;Tras&quot;]},&quot;United Kingdom&quot;:{&quot;UnitedSO&quot;:[&quot;UnitedLO&quot;]},&quot;United States of America&quot;:{&quot;AmericaSO&quot;:[&quot;AmericaLO&quot;]}}"
962
992
  contractstartdate="1/4/2024" apiid="dwqyez2puoxmu.cloudfront.net/event" username="ninad.t@flagggrc.tech"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-events",
3
3
  "private": false,
4
- "version": "1.0.913",
4
+ "version": "1.0.915",
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
@@ -3570,6 +3570,10 @@ let SfIEvents = class SfIEvents extends LitElement {
3570
3570
  html += '<label part="input-label">Completion Percentage</label>';
3571
3571
  html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1" disabled/><br />';
3572
3572
  html += '</div>';
3573
+ html += '<div id="reporting-entity-container" class="d-flex flex-col flex-grow ml-20 hide">';
3574
+ html += '<label part="input-label">Entity</label>';
3575
+ html += '<select id="input-reporter-entity" part="input"></select><br />';
3576
+ html += '</div>';
3573
3577
  html += '<div id="reporting-location-container" class="d-flex flex-col flex-grow ml-20 hide">';
3574
3578
  html += '<label part="input-label">Location</label>';
3575
3579
  html += '<select id="input-reporter-location" part="input"></select><br />';
@@ -3627,6 +3631,10 @@ let SfIEvents = class SfIEvents extends LitElement {
3627
3631
  html += '<label part="input-label">Completion Percentage*</label>';
3628
3632
  html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1"/><br />';
3629
3633
  html += '</div>';
3634
+ html += '<div id="reporting-entity-container" class="d-flex flex-col flex-grow ml-20 hide">';
3635
+ html += '<label part="input-label">Entity</label>';
3636
+ html += '<select id="input-reporter-entity" part="input"></select><br />';
3637
+ html += '</div>';
3630
3638
  html += '<div id="reporting-location-container" class="d-flex flex-col flex-grow ml-20 hide">';
3631
3639
  html += '<label part="input-label">Location</label>';
3632
3640
  html += '<select id="input-reporter-location" part="input"></select><br />';
@@ -3765,7 +3773,7 @@ let SfIEvents = class SfIEvents extends LitElement {
3765
3773
  }
3766
3774
  let streamEventTitles = eventsContainer.querySelectorAll('.stream-event-title');
3767
3775
  for (let streamEventTitle of streamEventTitles) {
3768
- if (streamEventTitle.id == 'stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + (((_c = event.module) !== null && _c !== void 0 ? _c : false) ? event.module : 'compliance')) {
3776
+ if (streamEventTitle.id == 'stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + (((_c = event.module) !== null && _c !== void 0 ? _c : false) ? event.module : 'compliance') + '-') {
3769
3777
  streamEventTitle.setAttribute('part', 'stream-event-title-selected');
3770
3778
  }
3771
3779
  else {
@@ -3874,9 +3882,10 @@ let SfIEvents = class SfIEvents extends LitElement {
3874
3882
  let percentage = inputReportingPercentage.value;
3875
3883
  console.log('percentage', percentage, inputReportingPercentage, inputReportingPercentage.value);
3876
3884
  if (percentage != null && percentage.length > 0 && parseInt(percentage) < 100) {
3877
- listReportingContainer.querySelector('#reporting-location-container').classList.remove('hide');
3885
+ listReportingContainer.querySelector('#reporting-entity-container').classList.remove('hide');
3878
3886
  }
3879
3887
  else {
3888
+ listReportingContainer.querySelector('#reporting-entity-container').classList.add('hide');
3880
3889
  listReportingContainer.querySelector('#reporting-location-container').classList.add('hide');
3881
3890
  }
3882
3891
  if ((percentage != null && parseInt(percentage) == 0) || event.docsOptional.length > 0) {
@@ -3887,21 +3896,41 @@ let SfIEvents = class SfIEvents extends LitElement {
3887
3896
  }
3888
3897
  }, 200);
3889
3898
  });
3899
+ let selectReportingEntity = listReportingContainer.querySelector('#input-reporter-entity');
3890
3900
  let selectReportingLocation = listReportingContainer.querySelector('#input-reporter-location');
3891
- selectReportingLocation.innerHTML = '';
3901
+ selectReportingEntity.innerHTML = '';
3892
3902
  let projectUserMap = Util.getProjectUsermap();
3893
3903
  for (let country of Object.keys(projectUserMap)) {
3894
3904
  if (country == "roles") {
3895
3905
  continue;
3896
3906
  }
3897
3907
  for (let entity of Object.keys(projectUserMap[country])) {
3898
- for (let location of Object.keys(projectUserMap[country][entity])) {
3899
- let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "");
3900
- let option = new Option(locationName, location);
3901
- selectReportingLocation.add(option);
3902
- }
3908
+ let entityName = entity.split(';')[0].replace(/ *\([^)]*\) */g, "");
3909
+ let option = new Option(entityName, entity);
3910
+ selectReportingEntity.add(option);
3903
3911
  }
3904
3912
  }
3913
+ selectReportingEntity.addEventListener('change', (e) => {
3914
+ var _a;
3915
+ selectReportingLocation.innerHTML = '';
3916
+ for (let country of Object.keys(projectUserMap)) {
3917
+ if (country == "roles") {
3918
+ continue;
3919
+ }
3920
+ for (let entity of Object.keys(projectUserMap[country])) {
3921
+ if (entity.indexOf(e.target.value) < 0) {
3922
+ continue;
3923
+ }
3924
+ for (let location of Object.keys(projectUserMap[country][entity])) {
3925
+ let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "");
3926
+ let option = new Option(locationName, location);
3927
+ selectReportingLocation.add(option);
3928
+ }
3929
+ }
3930
+ }
3931
+ listReportingContainer.querySelector('#reporting-location-container').classList.remove('hide');
3932
+ selectReportingLocation.value = (_a = event.reportedlocations) !== null && _a !== void 0 ? _a : "";
3933
+ });
3905
3934
  selectReportingLocation.value = (_j = event.reportedlocations) !== null && _j !== void 0 ? _j : "";
3906
3935
  (_k = listReportingContainer.querySelector('#button-uploader-submit-approve')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', async (ev) => {
3907
3936
  var _a, _b;
@@ -4819,7 +4848,7 @@ let SfIEvents = class SfIEvents extends LitElement {
4819
4848
  listReportingContainer.innerHTML = '';
4820
4849
  let buttonListReporting = eventsContainer.querySelector('#button-list-reporting-' + mmdd.replace(/\//g, '-') + '-' + j + '-');
4821
4850
  buttonListReporting.setAttribute('part', 'button-list-reporting');
4822
- let streamEventTitle = eventsContainer.querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module);
4851
+ let streamEventTitle = eventsContainer.querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module + '-');
4823
4852
  streamEventTitle.removeAttribute('part');
4824
4853
  }
4825
4854
  if (this.selectedItemIds.length === 0) {
@@ -8614,7 +8643,7 @@ let SfIEvents = class SfIEvents extends LitElement {
8614
8643
  listReportingContainer.innerHTML = '';
8615
8644
  let buttonListReporting = this._SfThisContainer.querySelector('#button-list-reporting-' + mmdd.replace(/\//g, '-') + '-' + j + '-');
8616
8645
  buttonListReporting.setAttribute('part', 'button-list-reporting');
8617
- let streamEventTitle = this._SfThisContainer.querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module);
8646
+ let streamEventTitle = this._SfThisContainer.querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module + '-');
8618
8647
  streamEventTitle.removeAttribute('part');
8619
8648
  }
8620
8649
  if (this.selectedItemIds.length === 0) {
@@ -9139,7 +9168,7 @@ let SfIEvents = class SfIEvents extends LitElement {
9139
9168
  listReportingContainer.innerHTML = '';
9140
9169
  let buttonListReporting = this._SfStreamContainer.querySelector('#button-list-reporting-' + mmdd.replace(/\//g, '-') + '-' + j + '-');
9141
9170
  buttonListReporting.setAttribute('part', 'button-list-reporting');
9142
- let streamEventTitle = this._SfStreamContainer.querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module);
9171
+ let streamEventTitle = this._SfStreamContainer.querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module + '-');
9143
9172
  streamEventTitle.removeAttribute('part');
9144
9173
  }
9145
9174
  if (this.selectedItemIds.length === 0) {
@@ -13498,7 +13527,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13498
13527
  if (!this.getEventHideFields().includes(statuteFields[i])) {
13499
13528
  html += '<div class="m-20">';
13500
13529
  html += '<div part="detail-head"><strong>' + statuteFields[i] + '</strong></div>';
13501
- if ((event[statuteFields[i]] + "").indexOf("[") >= 0) {
13530
+ if ((event[statuteFields[i]] + "").indexOf("[") >= 0 && Util.isJSONParsable((event[statuteFields[i]] + ""))) {
13502
13531
  html += this.getEventTexts(statuteFields[i], JSON.parse(event[statuteFields[i]]), event);
13503
13532
  }
13504
13533
  else {
@@ -13941,21 +13970,41 @@ let SfIEvents = class SfIEvents extends LitElement {
13941
13970
  }
13942
13971
  }, 200);
13943
13972
  });
13973
+ let selectReportingEntity = this._SfDetailContainer.querySelector('#input-reporter-entity');
13944
13974
  let selectReportingLocation = this._SfDetailContainer.querySelector('#input-reporter-location');
13945
- selectReportingLocation.innerHTML = '';
13975
+ selectReportingEntity.innerHTML = '';
13946
13976
  let projectUserMap = Util.getProjectUsermap();
13947
13977
  for (let country of Object.keys(projectUserMap)) {
13948
13978
  if (country == "roles") {
13949
13979
  continue;
13950
13980
  }
13951
13981
  for (let entity of Object.keys(projectUserMap[country])) {
13952
- for (let location of Object.keys(projectUserMap[country][entity])) {
13953
- let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "");
13954
- let option = new Option(locationName, location);
13955
- selectReportingLocation.add(option);
13956
- }
13982
+ let entityName = entity.split(';')[0].replace(/ *\([^)]*\) */g, "");
13983
+ let option = new Option(entityName, entity);
13984
+ selectReportingEntity.add(option);
13957
13985
  }
13958
13986
  }
13987
+ selectReportingEntity.addEventListener('change', (e) => {
13988
+ var _a;
13989
+ selectReportingLocation.innerHTML = '';
13990
+ for (let country of Object.keys(projectUserMap)) {
13991
+ if (country == "roles") {
13992
+ continue;
13993
+ }
13994
+ for (let entity of Object.keys(projectUserMap[country])) {
13995
+ if (entity.indexOf(e.target.value) < 0) {
13996
+ continue;
13997
+ }
13998
+ for (let location of Object.keys(projectUserMap[country][entity])) {
13999
+ let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "");
14000
+ let option = new Option(locationName, location);
14001
+ selectReportingLocation.add(option);
14002
+ }
14003
+ }
14004
+ }
14005
+ this._SfDetailContainer.querySelector('#reporting-location-container').classList.remove('hide');
14006
+ selectReportingLocation.value = (_a = event.reportedlocations) !== null && _a !== void 0 ? _a : "";
14007
+ });
13959
14008
  selectReportingLocation.value = (_t = event.reportedlocations) !== null && _t !== void 0 ? _t : "";
13960
14009
  (_u = this._SfDetailContainer.querySelector('#button-uploader-submit-approve')) === null || _u === void 0 ? void 0 : _u.addEventListener('click', async (ev) => {
13961
14010
  var _a, _b, _c;
@@ -5903,6 +5903,10 @@ export class SfIEvents extends LitElement {
5903
5903
  html += '<label part="input-label">Completion Percentage</label>';
5904
5904
  html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1" disabled/><br />';
5905
5905
  html += '</div>'
5906
+ html += '<div id="reporting-entity-container" class="d-flex flex-col flex-grow ml-20 hide">';
5907
+ html += '<label part="input-label">Entity</label>';
5908
+ html += '<select id="input-reporter-entity" part="input"></select><br />';
5909
+ html += '</div>'
5906
5910
  html += '<div id="reporting-location-container" class="d-flex flex-col flex-grow ml-20 hide">';
5907
5911
  html += '<label part="input-label">Location</label>';
5908
5912
  html += '<select id="input-reporter-location" part="input"></select><br />';
@@ -5973,6 +5977,10 @@ export class SfIEvents extends LitElement {
5973
5977
  html += '<label part="input-label">Completion Percentage*</label>';
5974
5978
  html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1"/><br />';
5975
5979
  html += '</div>'
5980
+ html += '<div id="reporting-entity-container" class="d-flex flex-col flex-grow ml-20 hide">';
5981
+ html += '<label part="input-label">Entity</label>';
5982
+ html += '<select id="input-reporter-entity" part="input"></select><br />';
5983
+ html += '</div>'
5976
5984
  html += '<div id="reporting-location-container" class="d-flex flex-col flex-grow ml-20 hide">';
5977
5985
  html += '<label part="input-label">Location</label>';
5978
5986
  html += '<select id="input-reporter-location" part="input"></select><br />';
@@ -6125,7 +6133,7 @@ export class SfIEvents extends LitElement {
6125
6133
  }
6126
6134
  let streamEventTitles = eventsContainer.querySelectorAll('.stream-event-title') as NodeListOf<SfIElasticText>
6127
6135
  for (let streamEventTitle of streamEventTitles) {
6128
- if (streamEventTitle.id == 'stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + ((event.module ?? false) ? event.module : 'compliance')) {
6136
+ if (streamEventTitle.id == 'stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + ((event.module ?? false) ? event.module : 'compliance') + '-') {
6129
6137
  streamEventTitle.setAttribute('part', 'stream-event-title-selected')
6130
6138
  } else {
6131
6139
  streamEventTitle.removeAttribute('part')
@@ -6232,8 +6240,9 @@ export class SfIEvents extends LitElement {
6232
6240
  let percentage = inputReportingPercentage.value
6233
6241
  console.log('percentage', percentage, inputReportingPercentage, inputReportingPercentage.value);
6234
6242
  if (percentage != null && percentage.length > 0 && parseInt(percentage) < 100) {
6235
- (listReportingContainer.querySelector('#reporting-location-container') as HTMLDivElement).classList.remove('hide')
6243
+ (listReportingContainer.querySelector('#reporting-entity-container') as HTMLDivElement).classList.remove('hide')
6236
6244
  } else {
6245
+ (listReportingContainer.querySelector('#reporting-entity-container') as HTMLDivElement).classList.add('hide');
6237
6246
  (listReportingContainer.querySelector('#reporting-location-container') as HTMLDivElement).classList.add('hide')
6238
6247
  }
6239
6248
  if ((percentage != null && parseInt(percentage) == 0) || event.docsOptional.length > 0) {
@@ -6243,21 +6252,41 @@ export class SfIEvents extends LitElement {
6243
6252
  }
6244
6253
  }, 200);
6245
6254
  })
6255
+ let selectReportingEntity = listReportingContainer.querySelector('#input-reporter-entity') as HTMLSelectElement;
6246
6256
  let selectReportingLocation = listReportingContainer.querySelector('#input-reporter-location') as HTMLSelectElement;
6247
- selectReportingLocation.innerHTML = '';
6257
+ selectReportingEntity.innerHTML = '';
6248
6258
  let projectUserMap = Util.getProjectUsermap()
6249
6259
  for (let country of Object.keys(projectUserMap)) {
6250
6260
  if (country == "roles") {
6251
6261
  continue;
6252
6262
  }
6253
6263
  for (let entity of Object.keys(projectUserMap[country])) {
6254
- for (let location of Object.keys(projectUserMap[country][entity])) {
6255
- let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
6256
- let option = new Option(locationName, location)
6257
- selectReportingLocation.add(option);
6258
- }
6264
+ let entityName = entity.split(';')[0].replace(/ *\([^)]*\) */g, "")
6265
+ let option = new Option(entityName, entity)
6266
+ selectReportingEntity.add(option);
6259
6267
  }
6260
6268
  }
6269
+ selectReportingEntity.addEventListener('change', (e: any) => {
6270
+ selectReportingLocation.innerHTML = ''
6271
+ for (let country of Object.keys(projectUserMap)) {
6272
+ if (country == "roles") {
6273
+ continue;
6274
+ }
6275
+ for (let entity of Object.keys(projectUserMap[country])) {
6276
+ if(entity.indexOf(e.target.value) < 0){
6277
+ continue;
6278
+ }
6279
+ for (let location of Object.keys(projectUserMap[country][entity])) {
6280
+ let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
6281
+ let option = new Option(locationName, location)
6282
+ selectReportingLocation.add(option);
6283
+ }
6284
+ }
6285
+ }
6286
+ (listReportingContainer.querySelector('#reporting-location-container') as HTMLDivElement).classList.remove('hide')
6287
+ selectReportingLocation.value = event.reportedlocations ?? "";
6288
+ })
6289
+
6261
6290
  selectReportingLocation.value = event.reportedlocations ?? "";
6262
6291
  listReportingContainer.querySelector('#button-uploader-submit-approve')?.addEventListener('click', async (ev: any) => {
6263
6292
  let buttonClick = ev.target as HTMLButtonElement
@@ -7267,7 +7296,7 @@ export class SfIEvents extends LitElement {
7267
7296
  listReportingContainer.innerHTML = '';
7268
7297
  let buttonListReporting = eventsContainer.querySelector('#button-list-reporting-' + mmdd.replace(/\//g, '-') + '-' + j + '-') as HTMLButtonElement
7269
7298
  buttonListReporting.setAttribute('part', 'button-list-reporting')
7270
- let streamEventTitle = eventsContainer.querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module) as SfIElasticText
7299
+ let streamEventTitle = eventsContainer.querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module + '-') as SfIElasticText
7271
7300
  streamEventTitle.removeAttribute('part')
7272
7301
  }
7273
7302
 
@@ -8248,7 +8277,7 @@ export class SfIEvents extends LitElement {
8248
8277
  if (!this.tablecols.includes('ID') && !this.EXCLUDE_COLS_FROM_REGS.includes('ID')) {
8249
8278
  this.tablecols.push('ID')
8250
8279
  }
8251
-
8280
+
8252
8281
  for (let col of cols) {
8253
8282
  if (!this.tablecols.includes(col.toLowerCase()) && !this.EXCLUDE_COLS_FROM_REGS.includes(col.toLowerCase())) {
8254
8283
  this.tablecols.push(col)
@@ -8344,7 +8373,7 @@ export class SfIEvents extends LitElement {
8344
8373
  break;
8345
8374
  }
8346
8375
  }
8347
-
8376
+
8348
8377
  html += '<th class="td-body" part="td-body-register"><div class="d-flex align-start"><span part="' + (allSelected ? 'td-head' : 'td-head-selected') + '" style="padding-left: 0px !important">' + colName + '</span><div class="filter-button-container ml-10"><button part="' + (allSelected ? 'col-icon' : 'col-icon-selected') + '" id="filter-button-' + this.tablecols.indexOf(colName) + '" class="filter-button material-symbols-outlined">filter_list</button>'
8349
8378
  html += '<div id="filter-list-container-' + this.tablecols.indexOf(colName) + '" class="filter-list-container hide flex-col justify-between align-start p-10" part="filter-list-container" anchor="filter-button">'
8350
8379
  html += `<div id="filter-label-container-${this.tablecols.indexOf(colName)}" class="filter-label-container d-flex justify-between align-center" part="filter-label-container"><div class="d-flex align-center"><input class="input-select-filter" type="checkbox" ${allSelected ? 'checked' : ''} id="input-select-filter-${this.tablecols.indexOf(colName)}-all" name="features" part="input-select-feature" value="all-${colName}"></input><label class="filter-label" part="filter-label" for="input-select-filter-${this.tablecols.indexOf(colName)}-all">All</label></div><button id="button-submit-filters-${this.tablecols.indexOf(colName)}" part="col-option-icon" class="button-submit-filters material-icons invisible">check</button></div>`
@@ -8481,7 +8510,7 @@ export class SfIEvents extends LitElement {
8481
8510
  }
8482
8511
  console.log('csvData', csvData);
8483
8512
  const ts = new Date();
8484
- let fileName = 'register_' + statute.replace(/ /g,'_').slice(0, 25) + '_' + ts + '.xlsx'
8513
+ let fileName = 'register_' + statute.replace(/ /g, '_').slice(0, 25) + '_' + ts + '.xlsx'
8485
8514
  Util.downloadExcelFromCSV(csvData, fileName, "Register Export", this.projectName);
8486
8515
  })
8487
8516
  }
@@ -8592,7 +8621,7 @@ export class SfIEvents extends LitElement {
8592
8621
  }
8593
8622
  }
8594
8623
  if (JSON.stringify(compliance).toLowerCase().includes(searchVal.toLowerCase())) {
8595
- if(flagFilter){
8624
+ if (flagFilter) {
8596
8625
  events[Object.keys(events)[index]][statute][complianceId].hide = false;
8597
8626
  }
8598
8627
  } else {
@@ -11790,7 +11819,7 @@ export class SfIEvents extends LitElement {
11790
11819
  listReportingContainer.innerHTML = '';
11791
11820
  let buttonListReporting = (this._SfThisContainer as HTMLDivElement).querySelector('#button-list-reporting-' + mmdd.replace(/\//g, '-') + '-' + j + '-') as HTMLButtonElement
11792
11821
  buttonListReporting.setAttribute('part', 'button-list-reporting')
11793
- let streamEventTitle = (this._SfThisContainer as HTMLDivElement).querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module) as SfIElasticText
11822
+ let streamEventTitle = (this._SfThisContainer as HTMLDivElement).querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module + '-') as SfIElasticText
11794
11823
  streamEventTitle.removeAttribute('part')
11795
11824
 
11796
11825
  }
@@ -12415,7 +12444,7 @@ export class SfIEvents extends LitElement {
12415
12444
  listReportingContainer.innerHTML = '';
12416
12445
  let buttonListReporting = (this._SfStreamContainer as HTMLDivElement).querySelector('#button-list-reporting-' + mmdd.replace(/\//g, '-') + '-' + j + '-') as HTMLButtonElement
12417
12446
  buttonListReporting.setAttribute('part', 'button-list-reporting')
12418
- let streamEventTitle = (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module) as SfIElasticText
12447
+ let streamEventTitle = (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + j + '-' + module + '-') as SfIElasticText
12419
12448
  streamEventTitle.removeAttribute('part')
12420
12449
  }
12421
12450
 
@@ -17487,7 +17516,7 @@ export class SfIEvents extends LitElement {
17487
17516
 
17488
17517
  html += '<div class="m-20">';
17489
17518
  html += '<div part="detail-head"><strong>' + statuteFields[i] + '</strong></div>'
17490
- if ((event[statuteFields[i]] + "").indexOf("[") >= 0) {
17519
+ if ((event[statuteFields[i]] + "").indexOf("[") >= 0 && Util.isJSONParsable((event[statuteFields[i]] + ""))) {
17491
17520
  html += this.getEventTexts(statuteFields[i], JSON.parse(event[statuteFields[i]]), event);
17492
17521
  } else {
17493
17522
  html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + (event[statuteFields[i]] + "").replace(/"/g, "") + '" minLength="80"></sf-i-elastic-text>';
@@ -18020,21 +18049,41 @@ export class SfIEvents extends LitElement {
18020
18049
  }
18021
18050
  }, 200);
18022
18051
  })
18052
+ let selectReportingEntity = (this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-entity') as HTMLSelectElement;
18023
18053
  let selectReportingLocation = (this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-location') as HTMLSelectElement;
18024
- selectReportingLocation.innerHTML = '';
18054
+ selectReportingEntity.innerHTML = '';
18025
18055
  let projectUserMap = Util.getProjectUsermap()
18026
18056
  for (let country of Object.keys(projectUserMap)) {
18027
18057
  if (country == "roles") {
18028
18058
  continue;
18029
18059
  }
18030
18060
  for (let entity of Object.keys(projectUserMap[country])) {
18031
- for (let location of Object.keys(projectUserMap[country][entity])) {
18032
- let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
18033
- let option = new Option(locationName, location)
18034
- selectReportingLocation.add(option);
18035
- }
18061
+ let entityName = entity.split(';')[0].replace(/ *\([^)]*\) */g, "")
18062
+ let option = new Option(entityName, entity)
18063
+ selectReportingEntity.add(option);
18036
18064
  }
18037
18065
  }
18066
+ selectReportingEntity.addEventListener('change', (e: any) => {
18067
+ selectReportingLocation.innerHTML = ''
18068
+ for (let country of Object.keys(projectUserMap)) {
18069
+ if (country == "roles") {
18070
+ continue;
18071
+ }
18072
+ for (let entity of Object.keys(projectUserMap[country])) {
18073
+ if(entity.indexOf(e.target.value) < 0){
18074
+ continue;
18075
+ }
18076
+ for (let location of Object.keys(projectUserMap[country][entity])) {
18077
+ let locationName = location.split(';')[0].replace(/ *\([^)]*\) */g, "")
18078
+ let option = new Option(locationName, location)
18079
+ selectReportingLocation.add(option);
18080
+ }
18081
+ }
18082
+ }
18083
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-location-container') as HTMLDivElement).classList.remove('hide')
18084
+ selectReportingLocation.value = event.reportedlocations ?? "";
18085
+ })
18086
+
18038
18087
  selectReportingLocation.value = event.reportedlocations ?? "";
18039
18088
  (this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-approve')?.addEventListener('click', async (ev: any) => {
18040
18089
  let buttonClick = ev.target as HTMLButtonElement
package/src/util.ts CHANGED
@@ -564,8 +564,18 @@ export const downloadExcelFromCSV = (csvString: string, fileName: string = 'repo
564
564
  document.body.removeChild(link);
565
565
  };
566
566
 
567
+ function isJSONParsable(str: unknown): boolean {
568
+ if (typeof str !== "string") return false;
569
+ try {
570
+ JSON.parse(str);
571
+ return true;
572
+ } catch {
573
+ return false;
574
+ }
575
+ }
576
+
567
577
  const exportFunctions = {
568
- callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV
578
+ callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV, isJSONParsable
569
579
  };
570
580
 
571
581
  export default exportFunctions;
package/util.d.ts CHANGED
@@ -22,6 +22,7 @@ declare function getProjectUsermap(): any;
22
22
  declare function setFeatures(features: any): void;
23
23
  declare function getFeatures(): any;
24
24
  export declare const downloadExcelFromCSV: (csvString: string, fileName: string | undefined, title: string, projectname: string) => void;
25
+ declare function isJSONParsable(str: unknown): boolean;
25
26
  declare const exportFunctions: {
26
27
  callApiPresignedDelete: typeof callApiPresignedDelete;
27
28
  callApiPresignedGet: typeof callApiPresignedGet;
@@ -49,6 +50,7 @@ declare const exportFunctions: {
49
50
  getFeatures: typeof getFeatures;
50
51
  getProjectUsermap: typeof getProjectUsermap;
51
52
  downloadExcelFromCSV: (csvString: string, fileName: string | undefined, title: string, projectname: string) => void;
53
+ isJSONParsable: typeof isJSONParsable;
52
54
  };
53
55
  export default exportFunctions;
54
56
  //# sourceMappingURL=util.d.ts.map
package/util.js CHANGED
@@ -475,8 +475,19 @@ export const downloadExcelFromCSV = (csvString, fileName = 'report.xlsx', title,
475
475
  link.click();
476
476
  document.body.removeChild(link);
477
477
  };
478
+ function isJSONParsable(str) {
479
+ if (typeof str !== "string")
480
+ return false;
481
+ try {
482
+ JSON.parse(str);
483
+ return true;
484
+ }
485
+ catch {
486
+ return false;
487
+ }
488
+ }
478
489
  const exportFunctions = {
479
- callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV
490
+ callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV, isJSONParsable
480
491
  };
481
492
  export default exportFunctions;
482
493
  //# sourceMappingURL=util.js.map