@fluxhub/fluxhub-lib 18.0.33 → 18.0.34

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.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, InjectionToken, inject, forwardRef, EventEmitter, Component, Input, ViewChild, Output, Inject, Pipe, Directive, HostListener, ViewContainerRef, Optional, HostBinding, NgModule } from '@angular/core';
2
+ import { InjectionToken, Injectable, inject, forwardRef, EventEmitter, Component, Input, ViewChild, Output, Inject, Pipe, Directive, HostListener, ViewContainerRef, Optional, HostBinding, NgModule } from '@angular/core';
3
3
  import * as i1$1 from '@angular/common/http';
4
- import { HttpHeaders, HttpErrorResponse } from '@angular/common/http';
4
+ import { HttpErrorResponse, HttpHeaders } from '@angular/common/http';
5
5
  import { map, catchError, flatMap, debounceTime, switchMap, filter, take, tap } from 'rxjs/operators';
6
6
  import * as i3 from 'ngx-toastr';
7
7
  import * as i3$1 from '@angular/router';
@@ -100,6 +100,89 @@ class QParam {
100
100
  names = new Array();
101
101
  }
102
102
 
103
+ /** Fornito dal portale: `{ provide: FH_ERROR_REPORTER, useValue: (r) => ... }` */
104
+ const FH_ERROR_REPORTER = new InjectionToken('FH_ERROR_REPORTER');
105
+ /** Header con cui il server dichiara di aver gia' registrato l'errore. */
106
+ const FH_EVENT_ID_HEADER = 'X-FH-Event-Id';
107
+ /** Header con la pagina del portale, letto dal server per arricchire i suoi eventi. */
108
+ const FH_ROUTE_HEADER = 'X-FH-Route';
109
+ /** Pagina corrente: i portali usano l'hash routing (/#/home), altrimenti il path. */
110
+ function fhCurrentRoute() {
111
+ try {
112
+ const h = window.location.hash || '';
113
+ const r = h.startsWith('#') ? h.substring(1) : window.location.pathname;
114
+ // Va in un header HTTP: solo ASCII stampabile, il resto codificato.
115
+ return (r.split('?')[0] || '/')
116
+ .substring(0, 200)
117
+ .replace(/[^\x20-\x7E]/g, (c) => encodeURIComponent(c));
118
+ }
119
+ catch {
120
+ return '';
121
+ }
122
+ }
123
+ function fhEndpointOf(url) {
124
+ if (!url)
125
+ return '';
126
+ try {
127
+ // Solo l'ultimo segmento (/doquery, /dogridn): il prefisso del reverse proxy
128
+ // (/fh3/...) cambia da portale a portale e il backend non lo vede.
129
+ const segs = new URL(url, window.location.href).pathname.split('/').filter((x) => x);
130
+ return '/' + (segs[segs.length - 1] || '');
131
+ }
132
+ catch {
133
+ return url;
134
+ }
135
+ }
136
+ /** Invoca il reporter senza mai far fallire la chiamata dati per colpa sua. */
137
+ function fhReport(reporter, r) {
138
+ if (!reporter || !r)
139
+ return;
140
+ try {
141
+ reporter(r);
142
+ }
143
+ catch {
144
+ // il monitoraggio non deve mai rompere il portale
145
+ }
146
+ }
147
+ /** Report per un errore di trasporto, o null se non va segnalato. */
148
+ function fhHttpErrorReport(err, base) {
149
+ if (!(err instanceof HttpErrorResponse))
150
+ return null;
151
+ // 401 lo gestisce l'interceptor (refresh token); 0 e' rete assente o richiesta
152
+ // interrotta dal cambio pagina: rumore. Si segnalano gli errori del server.
153
+ if (err.status < 500)
154
+ return null;
155
+ return {
156
+ ...base,
157
+ kind: 'http',
158
+ status: err.status,
159
+ message: `${err.status} ${err.statusText || ''}`.trim(),
160
+ serverEventId: fhEventId(err.headers),
161
+ };
162
+ }
163
+ function fhEventId(h) {
164
+ try {
165
+ return h?.get(FH_EVENT_ID_HEADER) || null;
166
+ }
167
+ catch {
168
+ return null;
169
+ }
170
+ }
171
+ /**
172
+ * Errore rilanciato dai servizi dati dopo un KO gia' mostrato a video (toast) e, per
173
+ * query e griglie, gia' segnalato: serve solo a interrompere la catena del chiamante.
174
+ * Se il chiamante non lo gestisce arriverebbe a Rustrak come "Error: No error message",
175
+ * doppione del KO: il portale lo riconosce con fhIsHandled() e lo scarta.
176
+ */
177
+ function fhHandledError() {
178
+ const e = new Error();
179
+ e.fhHandled = true;
180
+ return e;
181
+ }
182
+ function fhIsHandled(err) {
183
+ return !!err?.fhHandled;
184
+ }
185
+
103
186
  class QGResult {
104
187
  result_msg = '';
105
188
  msg = '';
@@ -1231,7 +1314,7 @@ class AuthenticationService {
1231
1314
  if (displayError) {
1232
1315
  this.toastr.error(err.message);
1233
1316
  }
1234
- throw new Error();
1317
+ throw fhHandledError();
1235
1318
  }
1236
1319
  return res || new QGResult();
1237
1320
  }), catchError((err) => {
@@ -1276,7 +1359,7 @@ class AuthenticationService {
1276
1359
  if (displayError) {
1277
1360
  this.toastr.error(err.message);
1278
1361
  }
1279
- throw new Error();
1362
+ throw fhHandledError();
1280
1363
  }
1281
1364
  return res || new QGResult();
1282
1365
  }), catchError((err) => {
@@ -1320,7 +1403,7 @@ class AuthenticationService {
1320
1403
  if (displayError) {
1321
1404
  this.toastr.error(err.message);
1322
1405
  }
1323
- throw new Error();
1406
+ throw fhHandledError();
1324
1407
  }
1325
1408
  return res || new QGResult();
1326
1409
  }), catchError((err) => {
@@ -1355,7 +1438,7 @@ class AuthenticationService {
1355
1438
  if (displayError) {
1356
1439
  this.toastr.error(err.message);
1357
1440
  }
1358
- throw new Error();
1441
+ throw fhHandledError();
1359
1442
  }
1360
1443
  return res || new QGResult();
1361
1444
  }), catchError((err) => {
@@ -1390,7 +1473,7 @@ class AuthenticationService {
1390
1473
  if (displayError) {
1391
1474
  this.toastr.error(err.message);
1392
1475
  }
1393
- throw new Error();
1476
+ throw fhHandledError();
1394
1477
  }
1395
1478
  return res || new QGResult();
1396
1479
  }), catchError((err) => {
@@ -1429,7 +1512,7 @@ class AuthenticationService {
1429
1512
  if (displayError) {
1430
1513
  this.toastr.error(err.message);
1431
1514
  }
1432
- throw new Error();
1515
+ throw fhHandledError();
1433
1516
  }
1434
1517
  return res || new QGResult();
1435
1518
  }), catchError((err) => {
@@ -1463,7 +1546,7 @@ class AuthenticationService {
1463
1546
  if (displayError) {
1464
1547
  this.toastr.error(err.message);
1465
1548
  }
1466
- throw new Error();
1549
+ throw fhHandledError();
1467
1550
  }
1468
1551
  return res || new QGResult();
1469
1552
  }), catchError((err) => {
@@ -1501,7 +1584,7 @@ class AuthenticationService {
1501
1584
  if (displayError) {
1502
1585
  this.toastr.error(err.message);
1503
1586
  }
1504
- throw new Error();
1587
+ throw fhHandledError();
1505
1588
  }
1506
1589
  return res || new QGResult();
1507
1590
  }), catchError((err) => {
@@ -1544,75 +1627,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1544
1627
  }]
1545
1628
  }], ctorParameters: () => [{ type: i3.ToastrService }, { type: i1$1.HttpClient }, { type: i3$1.Router }, { type: AppService }, { type: UtilityService }] });
1546
1629
 
1547
- /** Fornito dal portale: `{ provide: FH_ERROR_REPORTER, useValue: (r) => ... }` */
1548
- const FH_ERROR_REPORTER = new InjectionToken('FH_ERROR_REPORTER');
1549
- /** Header con cui il server dichiara di aver gia' registrato l'errore. */
1550
- const FH_EVENT_ID_HEADER = 'X-FH-Event-Id';
1551
- /** Header con la pagina del portale, letto dal server per arricchire i suoi eventi. */
1552
- const FH_ROUTE_HEADER = 'X-FH-Route';
1553
- /** Pagina corrente: i portali usano l'hash routing (/#/home), altrimenti il path. */
1554
- function fhCurrentRoute() {
1555
- try {
1556
- const h = window.location.hash || '';
1557
- const r = h.startsWith('#') ? h.substring(1) : window.location.pathname;
1558
- // Va in un header HTTP: solo ASCII stampabile, il resto codificato.
1559
- return (r.split('?')[0] || '/')
1560
- .substring(0, 200)
1561
- .replace(/[^\x20-\x7E]/g, (c) => encodeURIComponent(c));
1562
- }
1563
- catch {
1564
- return '';
1565
- }
1566
- }
1567
- function fhEndpointOf(url) {
1568
- if (!url)
1569
- return '';
1570
- try {
1571
- // Solo l'ultimo segmento (/doquery, /dogridn): il prefisso del reverse proxy
1572
- // (/fh3/...) cambia da portale a portale e il backend non lo vede.
1573
- const segs = new URL(url, window.location.href).pathname.split('/').filter((x) => x);
1574
- return '/' + (segs[segs.length - 1] || '');
1575
- }
1576
- catch {
1577
- return url;
1578
- }
1579
- }
1580
- /** Invoca il reporter senza mai far fallire la chiamata dati per colpa sua. */
1581
- function fhReport(reporter, r) {
1582
- if (!reporter || !r)
1583
- return;
1584
- try {
1585
- reporter(r);
1586
- }
1587
- catch {
1588
- // il monitoraggio non deve mai rompere il portale
1589
- }
1590
- }
1591
- /** Report per un errore di trasporto, o null se non va segnalato. */
1592
- function fhHttpErrorReport(err, base) {
1593
- if (!(err instanceof HttpErrorResponse))
1594
- return null;
1595
- // 401 lo gestisce l'interceptor (refresh token); 0 e' rete assente o richiesta
1596
- // interrotta dal cambio pagina: rumore. Si segnalano gli errori del server.
1597
- if (err.status < 500)
1598
- return null;
1599
- return {
1600
- ...base,
1601
- kind: 'http',
1602
- status: err.status,
1603
- message: `${err.status} ${err.statusText || ''}`.trim(),
1604
- serverEventId: fhEventId(err.headers),
1605
- };
1606
- }
1607
- function fhEventId(h) {
1608
- try {
1609
- return h?.get(FH_EVENT_ID_HEADER) || null;
1610
- }
1611
- catch {
1612
- return null;
1613
- }
1614
- }
1615
-
1616
1630
  class QueryService {
1617
1631
  http;
1618
1632
  toastr;
@@ -1739,7 +1753,7 @@ class QueryService {
1739
1753
  if (err.message.indexOf('ORA-50012') == -1)
1740
1754
  this.toastr.error(queryp.sql + ' ' + err.message);
1741
1755
  }
1742
- throw new Error();
1756
+ throw fhHandledError();
1743
1757
  }
1744
1758
  if (this.app_s.COMPANY_KEY == 'COCIF_')
1745
1759
  if (!!res)
@@ -1968,7 +1982,7 @@ class OdbcService {
1968
1982
  if (displayError) {
1969
1983
  this.toastr.error(queryp.sql + ' ' + err.message);
1970
1984
  }
1971
- throw new Error();
1985
+ throw fhHandledError();
1972
1986
  }
1973
1987
  return res || new QGResult();
1974
1988
  }), catchError((err) => {
@@ -7343,7 +7357,7 @@ class GridService {
7343
7357
  if (displayError) {
7344
7358
  this.toastr.error(err.message);
7345
7359
  }
7346
- throw new Error();
7360
+ throw fhHandledError();
7347
7361
  }
7348
7362
  if (this.app_s.COMPANY_KEY == 'COCIF_')
7349
7363
  if (!!res)
@@ -7415,7 +7429,7 @@ class FileService {
7415
7429
  if (displayError) {
7416
7430
  this.toastr.error(err.message);
7417
7431
  }
7418
- throw new Error();
7432
+ throw fhHandledError();
7419
7433
  }
7420
7434
  return res || new QGResult();
7421
7435
  }), catchError((err) => {
@@ -9328,7 +9342,7 @@ class FHGridComponent {
9328
9342
  if (obj_filtro.dateTo != null && obj_filtro.dateFrom != null) {
9329
9343
  if (obj_filtro.dateFrom >= obj_filtro.dateTo) {
9330
9344
  this._toast.error('Data inizio range deve essere maggiore di data fine range');
9331
- return;
9345
+ return filter_v; // filtro invariato: undefined finirebbe concatenato nel WHERE
9332
9346
  }
9333
9347
  b_filter = true;
9334
9348
  if (add_end)
@@ -17049,7 +17063,7 @@ class WkfService {
17049
17063
  if (displayError) {
17050
17064
  this.toastr.error(err.message);
17051
17065
  }
17052
- throw new Error();
17066
+ throw fhHandledError();
17053
17067
  }
17054
17068
  if (this.app_s.COMPANY_KEY == 'COCIF_')
17055
17069
  if (!!res)
@@ -17212,7 +17226,10 @@ class FHNotesPanelComponent {
17212
17226
  this.App +
17213
17227
  '|' +
17214
17228
  this.K;
17215
- this.m_file.doQuery(p, false).subscribe();
17229
+ this.m_file.doQuery(p, false).subscribe({
17230
+ // hook facoltativo: il portale puo' non avere l'utility, il commento e' gia' salvato
17231
+ error: () => { },
17232
+ });
17216
17233
  ok_op = true;
17217
17234
  this.b_edit = false;
17218
17235
  this.refresh_list();
@@ -17245,7 +17262,10 @@ class FHNotesPanelComponent {
17245
17262
  this.K +
17246
17263
  '|' +
17247
17264
  this.edit_id;
17248
- this.m_file.doQuery(p, false).subscribe();
17265
+ this.m_file.doQuery(p, false).subscribe({
17266
+ // hook facoltativo: il portale puo' non avere l'utility, il commento e' gia' salvato
17267
+ error: () => { },
17268
+ });
17249
17269
  ok_op = true;
17250
17270
  this.b_edit = false;
17251
17271
  this.refresh_list();
@@ -26810,7 +26830,7 @@ class FHGridInternalComponent {
26810
26830
  if (obj_filtro.dateTo != null && obj_filtro.dateFrom != null) {
26811
26831
  if (obj_filtro.dateFrom >= obj_filtro.dateTo) {
26812
26832
  this._toast.error('Data inizio range deve essere maggiore di data fine range');
26813
- return;
26833
+ return filter_v; // filtro invariato: undefined finirebbe concatenato nel WHERE
26814
26834
  }
26815
26835
  b_filter = true;
26816
26836
  if (add_end)
@@ -30293,7 +30313,7 @@ class AppMakerService {
30293
30313
  if (displayError) {
30294
30314
  this.toastr.error(err.message);
30295
30315
  }
30296
- throw new Error();
30316
+ throw fhHandledError();
30297
30317
  }
30298
30318
  return r || new QGResult();
30299
30319
  }), catchError((err) => {
@@ -30851,7 +30871,10 @@ class win_commenti {
30851
30871
  this.m_appService.getState().wkf_doc_info.uiid_app +
30852
30872
  '|' +
30853
30873
  this.m_appService.getState().wkf_doc_info.uiid_doc;
30854
- this.m_file.doQuery(p, false).subscribe();
30874
+ this.m_file.doQuery(p, false).subscribe({
30875
+ // hook facoltativo: il portale puo' non avere l'utility, il commento e' gia' salvato
30876
+ error: () => { },
30877
+ });
30855
30878
  ok_op = true;
30856
30879
  this.b_edit = false;
30857
30880
  if (sdest != '')
@@ -30889,7 +30912,10 @@ class win_commenti {
30889
30912
  this.m_appService.getState().wkf_doc_info.uiid_doc +
30890
30913
  '|' +
30891
30914
  this.edit_id;
30892
- this.m_file.doQuery(p, false).subscribe();
30915
+ this.m_file.doQuery(p, false).subscribe({
30916
+ // hook facoltativo: il portale puo' non avere l'utility, il commento e' gia' salvato
30917
+ error: () => { },
30918
+ });
30893
30919
  ok_op = true;
30894
30920
  this.b_edit = false;
30895
30921
  if (sdest != '')
@@ -34789,7 +34815,10 @@ class win_commenti_v2 {
34789
34815
  this.m_appService.getState().wkf_doc_info.uiid_app +
34790
34816
  '|' +
34791
34817
  this.m_appService.getState().wkf_doc_info.uiid_doc;
34792
- this.m_file.doQuery(p, false).subscribe();
34818
+ this.m_file.doQuery(p, false).subscribe({
34819
+ // hook facoltativo: il portale puo' non avere l'utility, il commento e' gia' salvato
34820
+ error: () => { },
34821
+ });
34793
34822
  ok_op = true;
34794
34823
  this.b_edit = false;
34795
34824
  if (sdest != '')
@@ -34829,7 +34858,10 @@ class win_commenti_v2 {
34829
34858
  this.m_appService.getState().wkf_doc_info.uiid_doc +
34830
34859
  '|' +
34831
34860
  this.edit_id;
34832
- this.m_file.doQuery(p, false).subscribe();
34861
+ this.m_file.doQuery(p, false).subscribe({
34862
+ // hook facoltativo: il portale puo' non avere l'utility, il commento e' gia' salvato
34863
+ error: () => { },
34864
+ });
34833
34865
  ok_op = true;
34834
34866
  this.b_edit = false;
34835
34867
  if (sdest != '')
@@ -46345,5 +46377,5 @@ const KNOWN_EXT = "3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT
46345
46377
  * Generated bundle index. Do not edit.
46346
46378
  */
46347
46379
 
46348
- export { AppMakerService, AppService, ApprovaGridComponent, AuthHttpRequestInterceptor, AuthenticationService, CheckboxEditorComponent, ComboBoxEditor, CurrencyComponent, FHAutoCompleteComponent, FHCheckBox, FHColorPickerComponent, FHComboboxComponent, FHComboboxComponentFilter, FHConfirmValues, FHCurrencyFormatterDirective, FHCurrencyPipe, FHDatePickerComponent, FHDateRangePickerComponent, FHFieldPickListComponent, FHFormBuilderComponent, FHFormExecuterComponent, FHFormToolBarComponent, FHGridComponent, FHGridComponentN, FHGridJSONComponent, FHGridToolBarComponent, FHGuard, FHHelpButtonComponent, FHHomeDocsComponent, FHHomeLauncherComponent, FHHomeStatsComponent, FHHomeTodoComponent, FHImagePreview, FHListComponent, FHLogPanelComponent, FHMultiComboboxComponent, FHNotesPanelComponent, FHNumericFieldComponent, FHPickFieldComponent, FHRichTextComponent, FHRoleManager, FHTableManager, FHTextAreaComponent, FHTextInputComponent, FHTimePickerComponent, FHUploadComponent, FHUploadPanelComponent, FHUploadPanelS3Component, FHUploadS3Component, FHUserFieldComponent, FHUsersPickerComponent, FH_ERROR_REPORTER, FH_EVENT_ID_HEADER, FH_ROUTE_HEADER, FSInput, FSResult, FileService, FluxhublibModule, GridService, LocalDBService, NumericEditorComponent, OdbcService, OfficeAutomatorService, OfficeOperation, OfficeResult, QGParam, QGResult, QParam, QResult, QueryService, ReplaceLineBreaks, SafePipe, TextAreaEditor, UtilityService, WkfService, dati_aggiuntivi, dati_aggiuntivi_v2, fh_win_app_logs, fh_win_ask_big_text, fh_win_ask_buttons, fh_win_ask_number, fh_win_ask_richtext, fh_win_ask_text, fh_win_auto_complete, fh_win_combo, fh_win_confirm, fh_win_error, fh_win_grid_selection, fh_win_list, fh_win_mappa, fh_win_output, fh_win_picklist, fh_win_select_by_grid, fh_win_show_email, fh_win_show_email_s3, fh_win_show_image, fh_win_show_log, fh_win_show_log_dett, fh_win_time_slider, fh_win_upload, fh_win_uploads, fh_win_user_info, fh_win_user_picker, fh_win_wait, win_insert_commento, win_salva_annulla, wkf_header_bar, wkf_header_bar_v2, wkfapp, wkfapp_v2 };
46380
+ export { AppMakerService, AppService, ApprovaGridComponent, AuthHttpRequestInterceptor, AuthenticationService, CheckboxEditorComponent, ComboBoxEditor, CurrencyComponent, FHAutoCompleteComponent, FHCheckBox, FHColorPickerComponent, FHComboboxComponent, FHComboboxComponentFilter, FHConfirmValues, FHCurrencyFormatterDirective, FHCurrencyPipe, FHDatePickerComponent, FHDateRangePickerComponent, FHFieldPickListComponent, FHFormBuilderComponent, FHFormExecuterComponent, FHFormToolBarComponent, FHGridComponent, FHGridComponentN, FHGridJSONComponent, FHGridToolBarComponent, FHGuard, FHHelpButtonComponent, FHHomeDocsComponent, FHHomeLauncherComponent, FHHomeStatsComponent, FHHomeTodoComponent, FHImagePreview, FHListComponent, FHLogPanelComponent, FHMultiComboboxComponent, FHNotesPanelComponent, FHNumericFieldComponent, FHPickFieldComponent, FHRichTextComponent, FHRoleManager, FHTableManager, FHTextAreaComponent, FHTextInputComponent, FHTimePickerComponent, FHUploadComponent, FHUploadPanelComponent, FHUploadPanelS3Component, FHUploadS3Component, FHUserFieldComponent, FHUsersPickerComponent, FH_ERROR_REPORTER, FH_EVENT_ID_HEADER, FH_ROUTE_HEADER, FSInput, FSResult, FileService, FluxhublibModule, GridService, LocalDBService, NumericEditorComponent, OdbcService, OfficeAutomatorService, OfficeOperation, OfficeResult, QGParam, QGResult, QParam, QResult, QueryService, ReplaceLineBreaks, SafePipe, TextAreaEditor, UtilityService, WkfService, dati_aggiuntivi, dati_aggiuntivi_v2, fhHandledError, fhIsHandled, fh_win_app_logs, fh_win_ask_big_text, fh_win_ask_buttons, fh_win_ask_number, fh_win_ask_richtext, fh_win_ask_text, fh_win_auto_complete, fh_win_combo, fh_win_confirm, fh_win_error, fh_win_grid_selection, fh_win_list, fh_win_mappa, fh_win_output, fh_win_picklist, fh_win_select_by_grid, fh_win_show_email, fh_win_show_email_s3, fh_win_show_image, fh_win_show_log, fh_win_show_log_dett, fh_win_time_slider, fh_win_upload, fh_win_uploads, fh_win_user_info, fh_win_user_picker, fh_win_wait, win_insert_commento, win_salva_annulla, wkf_header_bar, wkf_header_bar_v2, wkfapp, wkfapp_v2 };
46349
46381
  //# sourceMappingURL=fluxhub-fluxhub-lib.mjs.map