@fluxhub/fluxhub-lib 18.0.50 → 18.0.51

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.
@@ -9680,9 +9680,18 @@ class FHGridComponent {
9680
9680
  if (p.filter != '' && (b_init || this.include_always == ''))
9681
9681
  p.filter += ' and ';
9682
9682
  p.filter += ' (';
9683
- p.filter += this.calcola_filtro(params.request.filterModel[key].condition1, '', key, false);
9684
- p.filter += ' ' + obj_filtro_test.operator + ' ';
9685
- p.filter += this.calcola_filtro(params.request.filterModel[key].condition2, '', key, false);
9683
+ // ag-grid >= 29 manda "conditions", le versioni precedenti condition1/condition2
9684
+ const conds = (obj_filtro_test.conditions ?? [
9685
+ obj_filtro_test.condition1,
9686
+ obj_filtro_test.condition2,
9687
+ ]).filter((c) => c != null);
9688
+ const flt_conds = conds
9689
+ .map((c) => this.calcola_filtro(c, '', key, false))
9690
+ .filter((s) => s.trim() != '');
9691
+ p.filter +=
9692
+ flt_conds.length > 0
9693
+ ? flt_conds.join(' ' + obj_filtro_test.operator + ' ')
9694
+ : '1=1';
9686
9695
  p.filter += ')';
9687
9696
  }
9688
9697
  b_init = true;
@@ -27351,9 +27360,18 @@ class FHGridInternalComponent {
27351
27360
  if (p.filter != '' && (b_init || this.include_always == ''))
27352
27361
  p.filter += ' and ';
27353
27362
  p.filter += ' (';
27354
- p.filter += this.calcola_filtro(params.request.filterModel[key].condition1, '', key, false);
27355
- p.filter += ' ' + obj_filtro_test.operator + ' ';
27356
- p.filter += this.calcola_filtro(params.request.filterModel[key].condition2, '', key, false);
27363
+ // ag-grid >= 29 manda "conditions", le versioni precedenti condition1/condition2
27364
+ const conds = (obj_filtro_test.conditions ?? [
27365
+ obj_filtro_test.condition1,
27366
+ obj_filtro_test.condition2,
27367
+ ]).filter((c) => c != null);
27368
+ const flt_conds = conds
27369
+ .map((c) => this.calcola_filtro(c, '', key, false))
27370
+ .filter((s) => s.trim() != '');
27371
+ p.filter +=
27372
+ flt_conds.length > 0
27373
+ ? flt_conds.join(' ' + obj_filtro_test.operator + ' ')
27374
+ : '1=1';
27357
27375
  p.filter += ')';
27358
27376
  }
27359
27377
  b_init = true;