sf-i-events 1.0.749 → 1.0.751

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.
@@ -847,7 +847,7 @@ export class SfIEvents extends LitElement {
847
847
 
848
848
  chartSelectedLegend: Array<number>= [];
849
849
 
850
- selectedFilter: any = null;
850
+ selectedFilters: any = null;
851
851
 
852
852
  barCharDataSet2: Array<any> = [];
853
853
 
@@ -1613,6 +1613,15 @@ export class SfIEvents extends LitElement {
1613
1613
  @property()
1614
1614
  blocksize: string = "5";
1615
1615
 
1616
+ @property()
1617
+ features: string = "[]"
1618
+
1619
+ getFeatures = () => {
1620
+ return ['compliances',...JSON.parse(this.features)]
1621
+ }
1622
+
1623
+ selectedFeatures: string[] = this.getFeatures()
1624
+
1616
1625
  nextPage: number = 0;
1617
1626
 
1618
1627
  nextTabRole: string = "";
@@ -2633,6 +2642,14 @@ export class SfIEvents extends LitElement {
2633
2642
  overflow-x: auto;
2634
2643
  }
2635
2644
 
2645
+ .filter-list-container{
2646
+ position: absolute;
2647
+ right: 5px;
2648
+ background-color: white;
2649
+ border: solid 1px #888;
2650
+ border-radius: 5px
2651
+ }
2652
+
2636
2653
  @media (orientation: landscape) {
2637
2654
 
2638
2655
  .lb {
@@ -3023,7 +3040,7 @@ export class SfIEvents extends LitElement {
3023
3040
  }
3024
3041
  }
3025
3042
  }
3026
- this.selectedFilter = null;
3043
+ this.selectedFilters = null;
3027
3044
  }
3028
3045
 
3029
3046
  clearSelectedGraphParam = () => {
@@ -3050,7 +3067,7 @@ export class SfIEvents extends LitElement {
3050
3067
  }
3051
3068
 
3052
3069
  this.processGraphFilter("");
3053
- this.selectedFilter = null;
3070
+ this.selectedFilters = null;
3054
3071
  }
3055
3072
 
3056
3073
  getEventField = (field: string) => {
@@ -3760,9 +3777,9 @@ export class SfIEvents extends LitElement {
3760
3777
  } else {
3761
3778
  arrData[name]++;
3762
3779
  }
3763
- if(name.toLowerCase().indexOf('na - corp sec') >= 0) {
3764
- console.log('arrData[corpsec]', name, arrData[name]);
3765
- }
3780
+ // if(name.toLowerCase().indexOf('na - corp sec') >= 0) {
3781
+ // console.log('arrData[corpsec]', name, arrData[name]);
3782
+ // }
3766
3783
  }
3767
3784
 
3768
3785
  for(var i = 0; i < arr.length; i++) {
@@ -4076,8 +4093,6 @@ export class SfIEvents extends LitElement {
4076
4093
 
4077
4094
  getCompletenessStatus = (event: any) => {
4078
4095
 
4079
- console.log('completeness status',event);
4080
-
4081
4096
  if(event.comments == null || event.comments.length === 0) {
4082
4097
  return "not-started";
4083
4098
  } else {
@@ -4212,7 +4227,19 @@ export class SfIEvents extends LitElement {
4212
4227
  var html = '';
4213
4228
 
4214
4229
  html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
4215
- html += '<div class="align-center d-flex flex-wrap align-center mb-10 w-100-m-0" part="duration-title-container"><h4 part="duration-title">' + parametersTitle + '</h4><button id="button-refresh" part="button-duration-title" class="align-center d-flex justify-center"><h4 part="duration-title">' + parametersTitle + '</h4><span part="duration-title-icon" class="material-icons ml-10">refresh</span></button></div>';
4230
+ html += '<div class="align-center d-flex flex-wrap align-start justify-between mb-10 w-100-m-0" part="duration-title-container"><h4 part="duration-title" class="m-0">' + parametersTitle + '</h4>'
4231
+ if(this.getFeatures().length > 0){
4232
+ html += '<div class="filter-button-container"><button part="button-icon" id="filter-button" class="material-icons">filter_list</button>'
4233
+ html += '<div id="filter-list-container" class="filter-list-container hide flex-col justify-center align-start p-10" part="filter-list-container" anchor="filter-button">'
4234
+ html += `<div class="filter-input-container d-flex"><input class="input-select-feature-all" type="checkbox" ${this.selectedFeatures.length >= (this.getFeatures().length) ? 'checked' : ''} id="input-select-feature-all" part="input-select-feature" name="all"></input><label for="input-select-feature-all" class="input-select-feature-label" part="input-sellect-feature-label">all</label></div>`
4235
+ // html += `<div class="filter-input-container d-flex"><input class="input-select-feature-compliances" type="checkbox" ${this.selectedFeatures.indexOf('compliances') >= 0 ? 'checked' : ''} id="input-select-feature-compliances" part="input-select-feature" name="compliances"></input><label for="input-select-feature-compliances" class="input-select-feature-label" part="input-sellect-feature-label">compliances</label></div>`
4236
+ for(let [index,feature] of this.getFeatures().entries()){
4237
+ console.log('rendering features', feature, this.selectedFeatures);
4238
+ html += `<div class="filter-input-container d-flex"><input class="input-select-feature" type="checkbox" ${this.selectedFeatures.indexOf(feature) >= 0 ? 'checked' : ''} id="input-select-feature-${index}" part="input-select-feature" name="${feature}"></input><label for="input-select-feature-${index}" class="input-select-feature-label" part="input-sellect-feature-label">${feature}</label></div>`
4239
+ }
4240
+ html += '</div></div>'
4241
+ }
4242
+ html += '<button id="button-refresh" part="button-duration-title" class="align-center d-flex justify-center"><h4 part="duration-title">' + parametersTitle + '</h4><span part="duration-title-icon" class="material-icons ml-10">refresh</span></button></div>';
4216
4243
  html += '<div class="align-center d-flex flex-wrap align-center mb-10 w-100-m-0" part="last-update-title-container"><h6 part="last-update-title" class="align-center d-flex"><span class="material-symbols-outlined">update</span>&nbsp;&nbsp;Last Updated on ' + this.lastupdated + '</h6></div>';
4217
4244
  if(showGraph) {
4218
4245
  html += '<div part="stream-event-chart-selection" class="mb-20">';
@@ -4438,11 +4465,11 @@ export class SfIEvents extends LitElement {
4438
4465
  for(var i = 0; i < arrTriggers.length; i++) {
4439
4466
  const targetDates = arrTriggers[i].targetDates;
4440
4467
  for(var j = 0; j < targetDates.length; j++) {
4441
- console.log('comparing', targetDates[j], ddmm);
4468
+ // console.log('comparing', targetDates[j], ddmm);
4442
4469
  if(targetDates[j].indexOf(ddmm) >= 0) {
4443
4470
  remarks = arrTriggers[i].remarks;
4444
4471
  occurrenceDate = arrTriggers[i].occurrenceDate;
4445
- console.log('remarks', mmdd)
4472
+ // console.log('remarks', mmdd)
4446
4473
  }
4447
4474
  }
4448
4475
  }
@@ -6026,7 +6053,49 @@ export class SfIEvents extends LitElement {
6026
6053
  }
6027
6054
  this.renderButtonRefresh(eventsContainer);
6028
6055
  this.attachTimelineFilterHandlers(eventsContainer);
6029
-
6056
+ const filterButton = eventsContainer.querySelector('#filter-button') as HTMLButtonElement
6057
+ filterButton?.addEventListener('click',() => {
6058
+ const filterList = eventsContainer.querySelector('#filter-list-container') as HTMLDivElement
6059
+ filterList.style.display = (filterList.style.display != 'block' ? 'block' : 'none')
6060
+ const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
6061
+ for(let selectFeature of selectFeatures){
6062
+ selectFeature.addEventListener('click',(ev: any) => {
6063
+ let target = ev.target;
6064
+ let id = target.id;
6065
+ let index = id.split('-')[3];
6066
+ let selectedFeature = this.getFeatures()[index]
6067
+ if(target.checked){
6068
+ if(this.selectedFeatures.indexOf(selectedFeature) < 0){
6069
+ this.selectedFeatures.push(selectedFeature)
6070
+ }
6071
+ }else{
6072
+ if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
6073
+ this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
6074
+ }
6075
+ }
6076
+ this.processDateSelection(eventsContainer)
6077
+ })
6078
+ }
6079
+ })
6080
+ // const selectFeatures = eventsContainer.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
6081
+ // for(let selectFeature of selectFeatures){
6082
+ // selectFeature.addEventListener('click',(ev: any) => {
6083
+ // let target = ev.target;
6084
+ // let id = target.id;
6085
+ // let index = id.split('-')[3];
6086
+ // let selectedFeature = this.getFeatures()[index]
6087
+ // if(target.checked){
6088
+ // if(this.selectedFeatures.indexOf(selectedFeature) < 0){
6089
+ // this.selectedFeatures.push(selectedFeature)
6090
+ // }
6091
+ // }else{
6092
+ // if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
6093
+ // this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
6094
+ // }
6095
+ // }
6096
+ // this.processDateSelection(eventsContainer)
6097
+ // })
6098
+ // }
6030
6099
  const radioExpander = eventsContainer.querySelector('#graph-radios-expander') as HTMLButtonElement;
6031
6100
  radioExpander?.addEventListener('click', (e: any) => {
6032
6101
 
@@ -9684,6 +9753,66 @@ export class SfIEvents extends LitElement {
9684
9753
 
9685
9754
  (this._SfThisContainer as HTMLDivElement).innerHTML = html;
9686
9755
  this.renderButtonRefresh((this._SfThisContainer as HTMLDivElement));
9756
+ const filterButton = (this._SfThisContainer as HTMLDivElement).querySelector('#filter-button') as HTMLButtonElement
9757
+ filterButton?.addEventListener('click',() => {
9758
+ const filterList = (this._SfThisContainer as HTMLDivElement).querySelector('#filter-list-container') as HTMLDivElement
9759
+ filterList.style.display = (filterList.style.display != 'block' ? 'block' : 'none')
9760
+ const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
9761
+ selectFeatureAll.addEventListener('click',async(ev: any) => {
9762
+ let target = ev.target;
9763
+ if(target.checked){
9764
+ for(let feature of this.getFeatures()){
9765
+ if(this.selectedFeatures.indexOf(feature) < 0){
9766
+ this.selectedFeatures.push(feature);
9767
+ }
9768
+ }
9769
+ }else{
9770
+ this.selectedFeatures = []
9771
+ }
9772
+ const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
9773
+ for(let selectFeature of selectFeatures){
9774
+ let id = selectFeature.id;
9775
+ let i = id.split('-')[3];
9776
+ let selectedFeature = this.getFeatures()[parseInt(i)]
9777
+ selectFeature.checked = this.selectedFeatures.indexOf(selectedFeature) >= 0
9778
+ }
9779
+ const dateResult = this.calculateStartAndEndDateOfStream(index);
9780
+ console.log('dateresult', dateResult, index);
9781
+ console.log('selectedfeatures', this.selectedFeatures);
9782
+ this.currentColumnIndex = index + "";
9783
+ if(dateResult != null) {
9784
+ await this.renderWithFeatures(dateResult.startDate, dateResult.endDate);
9785
+ }
9786
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9787
+ this.renderStream(index);
9788
+ })
9789
+ const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
9790
+ for(let selectFeature of selectFeatures){
9791
+ selectFeature.addEventListener('click',async (ev: any) => {
9792
+ let target = ev.target;
9793
+ let id = target.id;
9794
+ let i = id.split('-')[3];
9795
+ let selectedFeature = this.getFeatures()[i]
9796
+ if(target.checked){
9797
+ if(this.selectedFeatures.indexOf(selectedFeature) < 0){
9798
+ this.selectedFeatures.push(selectedFeature)
9799
+ }
9800
+ }else{
9801
+ if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
9802
+ this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
9803
+ }
9804
+ }
9805
+ const dateResult = this.calculateStartAndEndDateOfStream(index);
9806
+ this.currentColumnIndex = index + "";
9807
+ if(dateResult != null) {
9808
+ await this.renderWithFeatures(dateResult.startDate, dateResult.endDate);
9809
+ }
9810
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9811
+ this.renderStream(index);
9812
+
9813
+ })
9814
+ }
9815
+ })
9687
9816
  const radioExpander = (this._SfThisContainer as HTMLDivElement).querySelector('#graph-radios-expander') as HTMLButtonElement;
9688
9817
  radioExpander?.addEventListener('click', (e: any) => {
9689
9818
 
@@ -10123,7 +10252,71 @@ export class SfIEvents extends LitElement {
10123
10252
  (this._SfStreamContainer as HTMLDivElement).innerHTML = html;
10124
10253
  this.renderButtonRefresh((this._SfStreamContainer as HTMLDivElement));
10125
10254
  this.attachTimelineFilterHandlers((this._SfStreamContainer as HTMLDivElement));
10126
-
10255
+ const filterButton = (this._SfStreamContainer as HTMLDivElement).querySelector('#filter-button') as HTMLButtonElement
10256
+ filterButton?.addEventListener('click',() => {
10257
+ const filterList = (this._SfStreamContainer as HTMLDivElement).querySelector('#filter-list-container') as HTMLDivElement
10258
+ filterList.style.display = (filterList.style.display != 'block' ? 'block' : 'none')
10259
+ const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
10260
+ selectFeatureAll.addEventListener('click',async(ev: any) => {
10261
+ let target = ev.target;
10262
+ if(target.checked){
10263
+ for(let feature of this.getFeatures()){
10264
+ if(this.selectedFeatures.indexOf(feature) < 0){
10265
+ this.selectedFeatures.push(feature);
10266
+ }
10267
+ }
10268
+ }else{
10269
+ this.selectedFeatures = []
10270
+ }
10271
+ const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
10272
+ for(let selectFeature of selectFeatures){
10273
+ let id = selectFeature.id;
10274
+ let i = id.split('-')[3];
10275
+ let selectedFeature = this.getFeatures()[parseInt(i)]
10276
+ selectFeature.checked = this.selectedFeatures.indexOf(selectedFeature) >= 0
10277
+ }
10278
+ const dateResult = this.calculateStartAndEndDateOfStream(index);
10279
+ const monthResult = this.calculateMonthFromIndex(index);
10280
+ console.log('monthResult', monthResult);
10281
+ console.log('dateresult', dateResult, index);
10282
+ console.log('selectedfeatures', this.selectedFeatures);
10283
+ this.currentColumnIndex = index + "";
10284
+ if(dateResult != null) {
10285
+ await this.renderWithFeatures(dateResult.startDate, dateResult.endDate,"","no",("0" + monthResult).slice(-2));
10286
+ }
10287
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
10288
+ this.renderStream(index);
10289
+ })
10290
+ const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
10291
+ for(let selectFeature of selectFeatures){
10292
+ selectFeature.addEventListener('click',async (ev: any) => {
10293
+ let target = ev.target;
10294
+ let id = target.id;
10295
+ let i = id.split('-')[3];
10296
+ let selectedFeature = this.getFeatures()[i]
10297
+ if(target.checked){
10298
+ if(this.selectedFeatures.indexOf(selectedFeature) < 0){
10299
+ this.selectedFeatures.push(selectedFeature)
10300
+ }
10301
+ }else{
10302
+ if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
10303
+ this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
10304
+ }
10305
+ }
10306
+ const dateResult = this.calculateStartAndEndDateOfStream(index);
10307
+ const monthResult = this.calculateMonthFromIndex(index);
10308
+ this.currentColumnIndex = index + "";
10309
+ console.log('rendering feature', monthResult, dateResult);
10310
+ if(dateResult != null) {
10311
+ await this.renderWithFeatures(dateResult.startDate, dateResult.endDate,"","no",("0" + monthResult).slice(-2));
10312
+ }
10313
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
10314
+ this.renderStream(index);
10315
+
10316
+ })
10317
+ }
10318
+ })
10319
+
10127
10320
  const radioExpander = (this._SfStreamContainer as HTMLDivElement).querySelector('#graph-radios-expander') as HTMLButtonElement;
10128
10321
  radioExpander?.addEventListener('click', (e: any) => {
10129
10322
 
@@ -10438,7 +10631,7 @@ export class SfIEvents extends LitElement {
10438
10631
  }
10439
10632
 
10440
10633
  if(showGraph) {
10441
-
10634
+ console.log('showing graph', showGraph)
10442
10635
  switch (this.flowGraph) {
10443
10636
  case this.FLOW_GRAPH_COMPLETENESS:
10444
10637
  this.renderCompletenessGraph((this._SfStreamContainer as HTMLDivElement));
@@ -18460,16 +18653,16 @@ export class SfIEvents extends LitElement {
18460
18653
  } else {
18461
18654
 
18462
18655
  if(cols.length > 0) {
18463
- if(this.selectedFilter == null) {
18656
+ if(this.selectedFilters == null) {
18464
18657
  newArrList.push(rows[i]);
18465
18658
  } else {
18466
18659
 
18467
- if(!this.selectedFilter.selected) {
18660
+ if(!this.selectedFilters.selected) {
18468
18661
 
18469
18662
  var found = false;
18470
18663
 
18471
- for(var j = 0; j < this.selectedFilter.length; j++) {
18472
- if(cols[cols.length - 1].innerHTML.toLowerCase().replace(/&amp;/g, '&').indexOf(this.selectedFilter[j].value.toLowerCase().replace(/&amp;/g, '&')) >= 0) {
18664
+ for(var j = 0; j < this.selectedFilters.length; j++) {
18665
+ if(cols[cols.length - 1].innerHTML.toLowerCase().replace(/&amp;/g, '&').indexOf(this.selectedFilters[j].value.toLowerCase().replace(/&amp;/g, '&')) >= 0) {
18473
18666
  found = true;
18474
18667
  }
18475
18668
  }
@@ -18482,7 +18675,7 @@ export class SfIEvents extends LitElement {
18482
18675
 
18483
18676
  //console.log('selected filter', this.selectedFilter, cols[cols.length - 1].innerHTML.toLowerCase(), '*-*', this.selectedFilter.value.toLowerCase());
18484
18677
 
18485
- if(cols[cols.length - 1].innerHTML.toLowerCase().replace(/&amp;/g, '&').indexOf(this.selectedFilter.value.toLowerCase().replace(/&amp;/g, '&')) >= 0) {
18678
+ if(cols[cols.length - 1].innerHTML.toLowerCase().replace(/&amp;/g, '&').indexOf(this.selectedFilters.value.toLowerCase().replace(/&amp;/g, '&')) >= 0) {
18486
18679
  newArrList.push(rows[i]);
18487
18680
  }
18488
18681
  }
@@ -18496,16 +18689,16 @@ export class SfIEvents extends LitElement {
18496
18689
 
18497
18690
  let filteredHTML = '';
18498
18691
 
18499
- if(this.selectedFilter != null) {
18500
- if(this.selectedFilter.selected) {
18501
- filteredHTML += '<small>Filter (included parameters): ' + this.selectedFilter.value.charAt(0).toUpperCase() + this.selectedFilter.value.slice(1) + '</small>';
18692
+ if(this.selectedFilters != null) {
18693
+ if(this.selectedFilters.selected) {
18694
+ filteredHTML += '<small>Filter (included parameters): ' + this.selectedFilters.value.charAt(0).toUpperCase() + this.selectedFilters.value.slice(1) + '</small>';
18502
18695
  } else {
18503
18696
 
18504
18697
  let params = "";
18505
- for(var i = 0; i < this.selectedFilter.length; i++) {
18698
+ for(var i = 0; i < this.selectedFilters.length; i++) {
18506
18699
 
18507
- params += this.selectedFilter[i].value.charAt(0).toUpperCase() + this.selectedFilter[i].value.slice(1);
18508
- if(i < (this.selectedFilter.length - 1)) {
18700
+ params += this.selectedFilters[i].value.charAt(0).toUpperCase() + this.selectedFilters[i].value.slice(1);
18701
+ if(i < (this.selectedFilters.length - 1)) {
18509
18702
  params += ',';
18510
18703
  }
18511
18704
 
@@ -18528,7 +18721,7 @@ export class SfIEvents extends LitElement {
18528
18721
 
18529
18722
  getFilteredStringSummary = () => {
18530
18723
 
18531
- console.log('selectedfilter', this.selectedFilter);
18724
+ console.log('selectedfilter', this.selectedFilters);
18532
18725
 
18533
18726
  var tempDiv = document.createElement('div');
18534
18727
  tempDiv.id = "div-filter-content";
@@ -18549,16 +18742,16 @@ export class SfIEvents extends LitElement {
18549
18742
  } else {
18550
18743
 
18551
18744
  if(cols.length > 0) {
18552
- if(this.selectedFilter == null) {
18745
+ if(this.selectedFilters == null) {
18553
18746
  newArrList.push(rows[i]);
18554
18747
  } else {
18555
18748
 
18556
- if(!this.selectedFilter.selected) {
18749
+ if(!this.selectedFilters.selected) {
18557
18750
 
18558
18751
  var found = false;
18559
18752
 
18560
- for(var j = 0; j < this.selectedFilter.length; j++) {
18561
- if(cols[cols.length - 2].innerHTML.toLowerCase().replace(/&amp;/g, '&').indexOf(this.selectedFilter[j].value.toLowerCase().replace(/&amp;/g, '&')) >= 0) {
18753
+ for(var j = 0; j < this.selectedFilters.length; j++) {
18754
+ if(cols[cols.length - 2].innerHTML.toLowerCase().replace(/&amp;/g, '&').indexOf(this.selectedFilters[j].value.toLowerCase().replace(/&amp;/g, '&')) >= 0) {
18562
18755
  found = true;
18563
18756
  }
18564
18757
  }
@@ -18569,9 +18762,9 @@ export class SfIEvents extends LitElement {
18569
18762
 
18570
18763
  } else {
18571
18764
 
18572
- console.log('selected filter', this.selectedFilter, cols[cols.length - 1].innerHTML.toLowerCase(), '*-*', this.selectedFilter.value.toLowerCase());
18765
+ console.log('selected filter', this.selectedFilters, cols[cols.length - 1].innerHTML.toLowerCase(), '*-*', this.selectedFilters.value.toLowerCase());
18573
18766
 
18574
- if(cols[cols.length - 2].innerHTML.toLowerCase().replace(/&amp;/g, '&').indexOf(this.selectedFilter.value.toLowerCase().replace(/&amp;/g, '&')) >= 0) {
18767
+ if(cols[cols.length - 2].innerHTML.toLowerCase().replace(/&amp;/g, '&').indexOf(this.selectedFilters.value.toLowerCase().replace(/&amp;/g, '&')) >= 0) {
18575
18768
  newArrList.push(rows[i]);
18576
18769
  }
18577
18770
  }
@@ -18585,16 +18778,16 @@ export class SfIEvents extends LitElement {
18585
18778
 
18586
18779
  let filteredHTML = '';
18587
18780
 
18588
- if(this.selectedFilter != null) {
18589
- if(this.selectedFilter.selected) {
18590
- filteredHTML += '<small>Filter (included parameters): ' + this.selectedFilter.value.charAt(0).toUpperCase() + this.selectedFilter.value.slice(1) + '</small>';
18781
+ if(this.selectedFilters != null) {
18782
+ if(this.selectedFilters.selected) {
18783
+ filteredHTML += '<small>Filter (included parameters): ' + this.selectedFilters.value.charAt(0).toUpperCase() + this.selectedFilters.value.slice(1) + '</small>';
18591
18784
  } else {
18592
18785
 
18593
18786
  let params = "";
18594
- for(var i = 0; i < this.selectedFilter.length; i++) {
18787
+ for(var i = 0; i < this.selectedFilters.length; i++) {
18595
18788
 
18596
- params += this.selectedFilter[i].value.charAt(0).toUpperCase() + this.selectedFilter[i].value.slice(1);
18597
- if(i < (this.selectedFilter.length - 1)) {
18789
+ params += this.selectedFilters[i].value.charAt(0).toUpperCase() + this.selectedFilters[i].value.slice(1);
18790
+ if(i < (this.selectedFilters.length - 1)) {
18598
18791
  params += ',';
18599
18792
  }
18600
18793
 
@@ -19553,18 +19746,18 @@ export class SfIEvents extends LitElement {
19553
19746
  //this.graphParam = clickedValue;
19554
19747
  streamEventSummary.style.display = 'none';
19555
19748
  //console.log('selectedfilter', this.selectedFilter);
19556
- if(this.selectedFilter == null) {
19557
- this.selectedFilter = [];
19749
+ if(this.selectedFilters == null) {
19750
+ this.selectedFilters = [];
19558
19751
  }
19559
- this.selectedFilter.push({
19752
+ this.selectedFilters.push({
19560
19753
  selected: false,
19561
19754
  value: clickedValue
19562
19755
  });
19563
19756
 
19564
19757
  var filterString = "";
19565
- for(var j = 0; j < this.selectedFilter.length; j++) {
19566
- filterString += this.selectedFilter[j].value;
19567
- if(j < (this.selectedFilter.length - 1)) {
19758
+ for(var j = 0; j < this.selectedFilters.length; j++) {
19759
+ filterString += this.selectedFilters[j].value;
19760
+ if(j < (this.selectedFilters.length - 1)) {
19568
19761
  filterString += ',';
19569
19762
  }
19570
19763
  }
@@ -19580,7 +19773,7 @@ export class SfIEvents extends LitElement {
19580
19773
  } else {
19581
19774
 
19582
19775
  streamEventSummary.style.display = 'flex';
19583
- this.selectedFilter = null;
19776
+ this.selectedFilters = null;
19584
19777
  (streamEventFilters as HTMLDivElement).style.display = 'none';
19585
19778
  (streamEventFilters as HTMLDivElement).innerHTML = '';
19586
19779
 
@@ -19606,10 +19799,10 @@ export class SfIEvents extends LitElement {
19606
19799
 
19607
19800
  var found = false;
19608
19801
 
19609
- if(this.selectedFilter != null) {
19610
- for(var j = 0; j < this.selectedFilter.length; j++) {
19802
+ if(this.selectedFilters != null) {
19803
+ for(var j = 0; j < this.selectedFilters.length; j++) {
19611
19804
  // if((graphparamnames1[i] as HTMLDivElement).innerHTML.toLowerCase().replace('&amp;', '&').indexOf(this.selectedFilter[j].value) >= 0) {
19612
- if((graphparamnames1[i] as HTMLDivElement).innerHTML.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') == this.selectedFilter[j].value.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ')) {
19805
+ if((graphparamnames1[i] as HTMLDivElement).innerHTML.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') == this.selectedFilters[j].value.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ')) {
19613
19806
 
19614
19807
  found = true;
19615
19808
  break;
@@ -19726,7 +19919,7 @@ export class SfIEvents extends LitElement {
19726
19919
 
19727
19920
  this.graphParam = "";
19728
19921
  streamEventSummary.style.display = 'flex';
19729
- this.selectedFilter = null;
19922
+ this.selectedFilters = null;
19730
19923
  (streamEventFilters as HTMLDivElement).style.display = 'none';
19731
19924
  (streamEventFilters as HTMLDivElement).innerHTML = '';
19732
19925
 
@@ -19734,7 +19927,7 @@ export class SfIEvents extends LitElement {
19734
19927
 
19735
19928
  this.graphParam = clickedValue;
19736
19929
  streamEventSummary.style.display = 'none';
19737
- this.selectedFilter = {
19930
+ this.selectedFilters = {
19738
19931
  selected: true,
19739
19932
  value: clickedValue
19740
19933
  };
@@ -23099,6 +23292,15 @@ export class SfIEvents extends LitElement {
23099
23292
 
23100
23293
  }
23101
23294
 
23295
+ renderWithFeatures = async(startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00") => {
23296
+ this.events = []
23297
+ console.log('rendering and fetching', startDate, endDate, searchString, list, month)
23298
+ if(this.selectedFeatures.indexOf('compliances') >= 0){
23299
+ this.fetchAndYearlyRenderUserCalendar_2(startDate, endDate, searchString, list, month)
23300
+ }else if(this.selectedFeatures.indexOf('notices') >= 0){
23301
+ this.fetchAndRenderNotices(startDate, endDate, searchString, list, month);
23302
+ }
23303
+ }
23102
23304
  fetchAndYearlyRenderUserCalendar_2 = async(startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00") => {
23103
23305
 
23104
23306
  let path = "", view = "";
@@ -23151,9 +23353,12 @@ export class SfIEvents extends LitElement {
23151
23353
  this.events = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
23152
23354
  await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
23153
23355
  this.lastupdated = new Date().toLocaleDateString('en-IN') + " - " + new Date().toLocaleTimeString('en-IN')
23356
+ console.log('rendering appropriate string', list);
23154
23357
  this.renderAppropriateStream(startDate, endDate, list == "no");
23155
23358
  this.fetchBulkReportingData();
23156
- this.fetchAndRenderNotices(startDate, endDate);
23359
+ if(this.selectedFeatures.indexOf('notices') >= 0){
23360
+ this.fetchAndRenderNotices(startDate, endDate);
23361
+ }
23157
23362
  // this.events = {}
23158
23363
  // this.events = {...JSON.parse(JSON.stringify(jsonRespose.data.events))};
23159
23364
 
@@ -24865,7 +25070,7 @@ export class SfIEvents extends LitElement {
24865
25070
  if(tempRole != "") {
24866
25071
  this._SfRoleTabContainer.innerHTML = '';
24867
25072
  }
24868
-
25073
+ this.selectedFeatures = this.getFeatures()
24869
25074
  //console.log('stream received', this.stream, this.TAB_STREAM, this.TAB_YEAR);
24870
25075
 
24871
25076
  if(this.stream == this.TAB_YEAR) {
package/src/util.ts CHANGED
@@ -422,8 +422,12 @@ function arrayToObject (csvArray:any) {
422
422
  return csvArray.filter((row:any)=>{
423
423
  console.log('csv object keys lngth', Object.keys(row).length)
424
424
  return Object.keys(row).length > 1
425
- }).map((row: { [x: string]: any; } ) =>{
426
- return headers.reduce((acc: any, currentHeader: any, i: string | number) => ((currentHeader.indexOf('cols_') >= 0 || currentHeader == '') ? acc : ((row[i] != '' && row[i] != null) ? { ...acc, ...{ [currentHeader]: JSON.parse(row[i] == "TRUE" ? "true" : row[i])}} : acc)), {})
425
+ }).map((row: { [x: string]: any; }, index: number ) =>{
426
+
427
+ return headers.reduce((acc: any, currentHeader: any, i: string | number) => {
428
+ console.log('parsing row', row[i], index);
429
+ return((currentHeader.indexOf('cols_') >= 0 || currentHeader == '') ? acc : ((row[i] != '' && row[i] != null) ? { ...acc, ...{ [currentHeader]: JSON.parse(row[i] == "TRUE" ? "true" : row[i])}} : acc))
430
+ }, {})
427
431
  })
428
432
  }
429
433
 
@@ -1,7 +1,7 @@
1
- /**
2
- * @license
3
- * Copyright 2022 Superflows.dev
4
- * SPDX-License-Identifier: MIT
5
- */
6
- export {};
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Superflows.dev
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+ export {};
7
7
  //# sourceMappingURL=sf-i-form_test.d.ts.map
@@ -1,18 +1,18 @@
1
- /**
2
- * @license
3
- * Copyright 2022 Superflows.dev
4
- * SPDX-License-Identifier: MIT
5
- */
6
- import { SfIEvents } from '../sf-i-events.js';
7
- // import { stub } from 'sinon';
8
- // import {fixture, assert} from '@open-wc/testing';
9
- import { assert } from '@open-wc/testing';
10
- // import {html} from 'lit/static-html.js';
11
- //const TIMEOUT = 2000;
12
- suite('sf-i-events > left menu', () => {
13
- test('is defined', () => {
14
- const el = document.createElement('sf-i-events');
15
- assert.instanceOf(el, SfIEvents);
16
- });
17
- });
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Superflows.dev
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+ import { SfIEvents } from '../sf-i-events.js';
7
+ // import { stub } from 'sinon';
8
+ // import {fixture, assert} from '@open-wc/testing';
9
+ import { assert } from '@open-wc/testing';
10
+ // import {html} from 'lit/static-html.js';
11
+ //const TIMEOUT = 2000;
12
+ suite('sf-i-events > left menu', () => {
13
+ test('is defined', () => {
14
+ const el = document.createElement('sf-i-events');
15
+ assert.instanceOf(el, SfIEvents);
16
+ });
17
+ });
18
18
  //# sourceMappingURL=sf-i-form_test.js.map