@fluxhub/fluxhub-lib 11.0.37 → 11.0.38

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.
@@ -6413,7 +6413,9 @@ class FHGridComponent {
6413
6413
  this.curr_config = "-1";
6414
6414
  this.init_end = new EventEmitter();
6415
6415
  this.off_set = 0;
6416
- this.type_fixed_filter = 'and';
6416
+ this.include_always = '';
6417
+ this.first_ref = true;
6418
+ this.b_restored = false;
6417
6419
  this.str_curr_q_p = "";
6418
6420
  this.dataSource = {
6419
6421
  //rowCount: ???, - not setting the row count, infinite paging will be used
@@ -6469,49 +6471,57 @@ class FHGridComponent {
6469
6471
  p.filter = this.filters;
6470
6472
  if (this.fix_flt != "") {
6471
6473
  if (p.filter != "")
6472
- p.filter = p.filter + " " + this.type_fixed_filter + " ";
6473
- console.log("🚀 ~ file: fhgrid.ts ~ line 737 ~ FHGridComponent ~ type_fixed_filter", this.type_fixed_filter);
6474
+ p.filter = p.filter + " and ";
6474
6475
  p.filter = p.filter + " (" + this.fix_flt + " )";
6475
6476
  }
6476
6477
  if (this.ric_libera == '' || !this.over_fulltext)
6477
6478
  if (this.fix_flt_temp != "") {
6478
6479
  if (p.filter != "")
6479
- p.filter = p.filter + " " + this.type_fixed_filter + " ";
6480
- console.log("🚀 ~ file: fhgrid.ts ~ line 743 ~ FHGridComponent ~ this.type_fixed_filter", this.type_fixed_filter);
6480
+ p.filter = p.filter + " and ";
6481
6481
  p.filter = p.filter + " (" + this.fix_flt_temp + " )";
6482
6482
  }
6483
6483
  // console.log('Filter model');
6484
6484
  //console.log(params.filterModel);
6485
- let b_init = false;
6486
6485
  let p_fi = p.filter;
6486
+ let b_init = false;
6487
6487
  if (params.filterModel != null) {
6488
6488
  // console.log('Filtri');
6489
6489
  for (let key in params.filterModel) {
6490
6490
  if (!b_init) {
6491
- if (p.filter != "")
6492
- p.filter = p.filter + " " + this.type_fixed_filter + " ";
6491
+ if (this.include_always != '') {
6492
+ p.filter = p.filter + " (" + this.include_always + ' or ';
6493
+ }
6493
6494
  }
6495
+ b_init = true;
6494
6496
  // console.log(key);
6495
6497
  // if (p.hasOwnProperty(key)) {
6496
6498
  // console.log( params.filterModel[key]);
6497
6499
  let obj_filtro_test = params.filterModel[key];
6498
6500
  console.log(params.filterModel[key], key);
6499
6501
  if (obj_filtro_test.operator == null) {
6500
- p.filter += this.calcola_filtro(params.filterModel[key], "", key, false);
6502
+ if (p.filter == "")
6503
+ p.filter += this.calcola_filtro(params.filterModel[key], "", key, false);
6504
+ else
6505
+ p.filter += this.calcola_filtro(params.filterModel[key], "", key, true);
6501
6506
  }
6502
6507
  else {
6503
- if (b_init)
6504
- if (p.filter != "")
6505
- p.filter += " and ";
6508
+ if (p.filter != "")
6509
+ p.filter += " and ";
6506
6510
  p.filter += " (";
6507
6511
  p.filter += this.calcola_filtro(params.filterModel[key].condition1, "", key, false);
6508
6512
  p.filter += " " + obj_filtro_test.operator + " ";
6509
6513
  p.filter += this.calcola_filtro(params.filterModel[key].condition2, "", key, false);
6510
6514
  p.filter += ")";
6511
6515
  }
6512
- b_init = true;
6516
+ // }
6513
6517
  }
6514
6518
  }
6519
+ if (b_init) {
6520
+ if (this.include_always != '') {
6521
+ p.filter = p.filter + " )";
6522
+ }
6523
+ }
6524
+ b_init = true;
6515
6525
  p.filter = p.filter.split('{{user}}').join(this.m_appService.user);
6516
6526
  if (this.ric_libera != '')
6517
6527
  this.last_riclib = true;
@@ -7302,6 +7312,7 @@ class FHGridComponent {
7302
7312
  if (model != null)
7303
7313
  num_all = model.length;
7304
7314
  }
7315
+ console.log('KEY!!!! ', key);
7305
7316
  if (key != 'pers_int') {
7306
7317
  if (sq != "") {
7307
7318
  if (obj_filtro.values.length != num_all) {
@@ -7674,8 +7685,8 @@ class FHGridComponent {
7674
7685
  }
7675
7686
  }
7676
7687
  this.res_columns();
7677
- // if (localStorage.getItem(this.grid_key + "_POS") != null)
7678
- // this.b_restored = true;
7688
+ if (localStorage.getItem(this.grid_key + "_POS") != null)
7689
+ this.b_restored = true;
7679
7690
  if (localStorage.getItem(this.grid_key + "_FILTER_UP") != null)
7680
7691
  if (localStorage.getItem(this.grid_key + "_FILTER_UP") != "") {
7681
7692
  this.ric_libera = localStorage.getItem(this.grid_key + "_FILTER_UP");
@@ -8222,7 +8233,7 @@ FHGridComponent.propDecorators = {
8222
8233
  toggle_mantieni: [{ type: ViewChild, args: ["toggle_mantieni",] }],
8223
8234
  init_end: [{ type: Output }],
8224
8235
  off_set: [{ type: Input }],
8225
- type_fixed_filter: [{ type: Input }],
8236
+ include_always: [{ type: Input }],
8226
8237
  onResize: [{ type: HostListener, args: ["window:resize", ["event"],] }]
8227
8238
  };
8228
8239