@fluxhub/fluxhub-lib 22.0.8 → 22.0.10

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.
@@ -10475,6 +10475,18 @@ class FHGridComponent {
10475
10475
  toolbar_custom_commands = [];
10476
10476
  exec_params = [];
10477
10477
  command = new EventEmitter();
10478
+ /** Ultima riga cliccata salvata in localStorage; null se manca o non e' JSON valido (es. 'undefined' scritto dalle versioni precedenti). */
10479
+ read_last_row() {
10480
+ const raw = localStorage.getItem(this.grid_customer_preference_key + '_LAST_ROW');
10481
+ if (raw == null || raw === 'undefined')
10482
+ return null;
10483
+ try {
10484
+ return JSON.parse(raw);
10485
+ }
10486
+ catch {
10487
+ return null;
10488
+ }
10489
+ }
10478
10490
  check_width() {
10479
10491
  if (!this.autosize_at_ini)
10480
10492
  return;
@@ -10846,7 +10858,7 @@ class FHGridComponent {
10846
10858
  node.setSelected(true);
10847
10859
  localStorage.removeItem(this.grid_customer_preference_key + '_POS2');
10848
10860
  if (localStorage.getItem(this.grid_customer_preference_key + '_LAST_ROW') != null)
10849
- this.sRow = JSON.parse(localStorage.getItem(this.grid_customer_preference_key + '_LAST_ROW') || '{}');
10861
+ this.sRow = this.read_last_row();
10850
10862
  else
10851
10863
  this.sRow = null;
10852
10864
  localStorage.removeItem(this.grid_customer_preference_key + '_LAST_ROW');
@@ -10917,13 +10929,15 @@ class FHGridComponent {
10917
10929
  this.check_end(type == 'pdf' ? '.pdf' : '.xlsx');
10918
10930
  });
10919
10931
  }
10920
- check_end(format) {
10932
+ // uiid e finestra dell'export che ha avviato il controllo: con un secondo export
10933
+ // partito nel frattempo (doppio clic) this.uiid_stampa/dialogRef_W sono gia' dell'altro
10934
+ check_end(format, uiid = this.uiid_stampa, dialogRef = this.dialogRef_W) {
10921
10935
  let p = new FSInput();
10922
10936
  p.p1 =
10923
10937
  this.m_appService.LOCAL_PATH +
10924
10938
  'grid_reports' +
10925
10939
  (this.m_appService.LOCAL_PATH.indexOf('/') >= 0 ? '/' : '\\') +
10926
- this.uiid_stampa +
10940
+ uiid +
10927
10941
  '_' +
10928
10942
  this.m_appService.user +
10929
10943
  format;
@@ -10932,20 +10946,20 @@ class FHGridComponent {
10932
10946
  if (data != null)
10933
10947
  if (data.msg == 'N') {
10934
10948
  setTimeout(() => {
10935
- this.check_end(format);
10949
+ this.check_end(format, uiid, dialogRef);
10936
10950
  }, 1000);
10937
10951
  }
10938
10952
  else {
10939
10953
  setTimeout(() => {
10940
- this.dialogRef_W.componentInstance.update_progess(100);
10954
+ dialogRef?.componentInstance?.update_progess(100);
10941
10955
  });
10942
10956
  setTimeout(() => {
10943
10957
  this.downloadFile(this.m_appService.COMPANY_SITE_ROOT +
10944
10958
  '/grid_reports/' +
10945
- this.uiid_stampa +
10959
+ uiid +
10946
10960
  '_' +
10947
10961
  this.m_appService.user +
10948
- format, this.uiid_stampa + '_' + this.m_appService.user + format);
10962
+ format, uiid + '_' + this.m_appService.user + format);
10949
10963
  }, 2000);
10950
10964
  }
10951
10965
  });
@@ -11860,7 +11874,11 @@ class FHGridComponent {
11860
11874
  // this.m_appService.getState().grid_obj[this.grid_customer_preference_key+'_NODE']=this.gridApi.getSelectedRows[0];
11861
11875
  }
11862
11876
  this.sRow = $event.data;
11863
- localStorage.setItem(this.grid_customer_preference_key + '_LAST_ROW', JSON.stringify(this.sRow));
11877
+ // riga senza dati (gruppo, riga di caricamento): niente LAST_ROW, altrimenti si salva la stringa 'undefined'
11878
+ if (this.sRow != null)
11879
+ localStorage.setItem(this.grid_customer_preference_key + '_LAST_ROW', JSON.stringify(this.sRow));
11880
+ else
11881
+ localStorage.removeItem(this.grid_customer_preference_key + '_LAST_ROW');
11864
11882
  this.clicked.emit($event.data);
11865
11883
  var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
11866
11884
  if (iOS) {