@sankhyalabs/sankhyablocks 8.16.0-dev.41 → 8.16.0-dev.42
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/{ConfigStorage-ecc0ed20.js → ConfigStorage-f079f5fd.js} +2 -2
- package/dist/cjs/{ContinuousInsertUtils-37c7cbcf.js → ContinuousInsertUtils-64e47516.js} +4 -4
- package/dist/cjs/{DataFetcher-cadeef8e.js → DataFetcher-e059eb72.js} +7 -5
- package/dist/cjs/{SnkFormConfigManager-f1c92f79.js → SnkFormConfigManager-63369164.js} +2 -2
- package/dist/cjs/{auth-fetcher-d68841bc.js → auth-fetcher-4f853233.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-a36ae041.js → dataunit-fetcher-228016f4.js} +1 -1
- package/dist/cjs/{form-config-fetcher-ed497282.js → form-config-fetcher-39397ac5.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-490a86c3.js → pesquisa-fetcher-a9bfeb22.js} +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -5
- package/dist/cjs/snk-application.cjs.entry.js +101 -59
- package/dist/cjs/snk-attach.cjs.entry.js +5 -5
- package/dist/cjs/snk-config-options_3.cjs.entry.js +4 -4
- package/dist/cjs/snk-crud.cjs.entry.js +5 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- package/dist/cjs/{snk-data-unit-b460f1da.js → snk-data-unit-3d4d0e2a.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +6 -6
- package/dist/cjs/{snk-guides-viewer-de0a5c57.js → snk-guides-viewer-0419911a.js} +5 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -7
- package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +28 -0
- package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js +16 -0
- package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js +52 -0
- package/dist/collection/components/snk-application/snk-application.js +3 -53
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -6
- package/dist/components/DataFetcher.js +7 -5
- package/dist/components/snk-application2.js +95 -53
- package/dist/esm/{ConfigStorage-7b36d041.js → ConfigStorage-6514d66e.js} +2 -2
- package/dist/esm/{ContinuousInsertUtils-881c41a9.js → ContinuousInsertUtils-b62906f9.js} +4 -4
- package/dist/esm/{DataFetcher-a9c598f2.js → DataFetcher-5034df59.js} +7 -5
- package/dist/esm/{SnkFormConfigManager-f1a0fc92.js → SnkFormConfigManager-b409c745.js} +2 -2
- package/dist/esm/{auth-fetcher-749d880f.js → auth-fetcher-ca5d3a49.js} +1 -1
- package/dist/esm/{dataunit-fetcher-fd58c640.js → dataunit-fetcher-56cb648b.js} +1 -1
- package/dist/esm/{form-config-fetcher-adbe5d34.js → form-config-fetcher-a7d3e277.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-50fc7e6b.js → pesquisa-fetcher-6bc2e41a.js} +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +5 -5
- package/dist/esm/snk-application.entry.js +101 -59
- package/dist/esm/snk-attach.entry.js +5 -5
- package/dist/esm/snk-config-options_3.entry.js +4 -4
- package/dist/esm/snk-crud.entry.js +5 -5
- package/dist/esm/snk-data-exporter.entry.js +5 -5
- package/dist/esm/{snk-data-unit-590225b5.js → snk-data-unit-618e0b80.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +7 -7
- package/dist/esm/snk-filter-bar_4.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +6 -6
- package/dist/esm/{snk-guides-viewer-2f4dcdc5.js → snk-guides-viewer-18453d98.js} +5 -5
- package/dist/esm/snk-guides-viewer.entry.js +7 -7
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +7 -7
- package/dist/sankhyablocks/{p-f3434fc4.js → p-00278e07.js} +1 -1
- package/dist/sankhyablocks/{p-fadc8339.js → p-0e206e62.js} +1 -1
- package/dist/sankhyablocks/{p-242d010e.entry.js → p-0e250436.entry.js} +1 -1
- package/dist/sankhyablocks/{p-06421fdb.js → p-126c58ea.js} +1 -1
- package/dist/sankhyablocks/{p-6114ee36.entry.js → p-1dbd5c18.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7bd9683d.js → p-2aebe5b6.js} +1 -1
- package/dist/sankhyablocks/{p-fa6c5826.entry.js → p-30ebcbe0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8a9638ae.js → p-341465ce.js} +2 -2
- package/dist/sankhyablocks/{p-052213ba.entry.js → p-3858a2e4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-47bce500.js → p-47d24ac8.js} +1 -1
- package/dist/sankhyablocks/p-4fd06221.entry.js +1 -0
- package/dist/sankhyablocks/{p-275de842.entry.js → p-563b7c28.entry.js} +1 -1
- package/dist/sankhyablocks/{p-72c10005.entry.js → p-9c3138f5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4d9549cf.js → p-9ffd9fc7.js} +1 -1
- package/dist/sankhyablocks/{p-0b6cd238.entry.js → p-a2c790ac.entry.js} +1 -1
- package/dist/sankhyablocks/{p-fd13b4d2.js → p-a75e9dcc.js} +1 -1
- package/dist/sankhyablocks/{p-212213d9.entry.js → p-aa003d4e.entry.js} +1 -1
- package/dist/sankhyablocks/p-aaf94476.js +1 -0
- package/dist/sankhyablocks/{p-583517ba.entry.js → p-c1adf0dd.entry.js} +1 -1
- package/dist/sankhyablocks/p-da87e42c.entry.js +11 -0
- package/dist/sankhyablocks/{p-cfa1b199.js → p-e4391e16.js} +1 -1
- package/dist/sankhyablocks/{p-5e51e833.entry.js → p-f0aaad2b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-cefb0ee1.entry.js → p-f7d76646.entry.js} +1 -1
- package/dist/sankhyablocks/{p-fb34e0cf.entry.js → p-fca0e5cc.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/request-listener/DebouncedRequestListener.d.ts +11 -0
- package/dist/types/components/snk-application/request-listener/RequestListenerFactory.d.ts +12 -0
- package/dist/types/components/snk-application/request-listener/RequestListenerLoadingBar.d.ts +13 -0
- package/dist/types/components/snk-application/snk-application.d.ts +3 -12
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-ab1645fb.entry.js +0 -1
- package/dist/sankhyablocks/p-ca5ec380.js +0 -1
- package/dist/sankhyablocks/p-dbe6174a.entry.js +0 -11
@@ -5,13 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-f079f5fd.js');
|
9
9
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
10
10
|
const index$1 = require('./index-c5771aba.js');
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
12
12
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
13
|
-
require('./form-config-fetcher-
|
14
|
-
require('./DataFetcher-
|
13
|
+
require('./form-config-fetcher-39397ac5.js');
|
14
|
+
require('./DataFetcher-e059eb72.js');
|
15
15
|
require('./PrintUtils-bcaeb82f.js');
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
17
17
|
|
@@ -7,19 +7,19 @@ const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const constants = require('./constants-35ddd366.js');
|
9
9
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
10
|
-
require('./DataFetcher-
|
11
|
-
require('./pesquisa-fetcher-
|
12
|
-
const ContinuousInsertUtils = require('./ContinuousInsertUtils-
|
10
|
+
require('./DataFetcher-e059eb72.js');
|
11
|
+
require('./pesquisa-fetcher-a9bfeb22.js');
|
12
|
+
const ContinuousInsertUtils = require('./ContinuousInsertUtils-64e47516.js');
|
13
13
|
const index = require('./index-1dfc7a6e.js');
|
14
14
|
require('./ISave-e91b70a7.js');
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
17
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
17
|
+
const dataunitFetcher = require('./dataunit-fetcher-228016f4.js');
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
19
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
19
|
+
const formConfigFetcher = require('./form-config-fetcher-39397ac5.js');
|
20
20
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
21
|
-
const ConfigStorage = require('./ConfigStorage-
|
22
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
21
|
+
const ConfigStorage = require('./ConfigStorage-f079f5fd.js');
|
22
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-63369164.js');
|
23
23
|
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
24
24
|
const index$2 = require('./index-102ba62d.js');
|
25
25
|
require('./PrintUtils-bcaeb82f.js');
|
package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
class DebouncedRequestListener {
|
2
|
+
constructor() {
|
3
|
+
this._debounceTime = 1500;
|
4
|
+
this.requests = new Map();
|
5
|
+
this.requestsLoadingBar = [];
|
6
|
+
}
|
7
|
+
onRequestStart(param) {
|
8
|
+
if (param.url.includes("quietMode=true")) {
|
9
|
+
return;
|
10
|
+
}
|
11
|
+
this.requestsLoadingBar.push(param.requestId);
|
12
|
+
const timeout = setTimeout(() => {
|
13
|
+
this.ezLoadingBar.show();
|
14
|
+
}, this._debounceTime);
|
15
|
+
this.requests.set(param.requestId, timeout);
|
16
|
+
}
|
17
|
+
;
|
18
|
+
onRequestEnd(param) {
|
19
|
+
const timeoutId = this.requests.get(param.requestId);
|
20
|
+
clearTimeout(timeoutId);
|
21
|
+
if (this.requestsLoadingBar.includes(param.requestId)) {
|
22
|
+
this.requestsLoadingBar = this.requestsLoadingBar.filter(id => id !== param.requestId);
|
23
|
+
!this.requestsLoadingBar.length && this.ezLoadingBar.hide();
|
24
|
+
}
|
25
|
+
}
|
26
|
+
;
|
27
|
+
}
|
28
|
+
export default DebouncedRequestListener;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import DebouncedRequestListener from "./DebouncedRequestListener";
|
2
|
+
import RequestListenerLoadingBar from "./RequestListenerLoadingBar";
|
3
|
+
class RequestListenerFactory {
|
4
|
+
static create({ strategy }) {
|
5
|
+
switch (strategy) {
|
6
|
+
case 'request_name':
|
7
|
+
return new RequestListenerLoadingBar();
|
8
|
+
case 'request_time':
|
9
|
+
return new DebouncedRequestListener();
|
10
|
+
default:
|
11
|
+
throw new Error('Strategy not found');
|
12
|
+
}
|
13
|
+
;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
export default RequestListenerFactory;
|
package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
class RequestListenerLoadingBar {
|
2
|
+
constructor() {
|
3
|
+
this._debounceTime = 1000;
|
4
|
+
this._ignoredNameTypes = ["totals"];
|
5
|
+
this._countRequest = 0;
|
6
|
+
}
|
7
|
+
onRequestStart(param) {
|
8
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
9
|
+
return;
|
10
|
+
}
|
11
|
+
this._countRequest++;
|
12
|
+
this.ezLoadingBar.show();
|
13
|
+
if (this._timerLoading) {
|
14
|
+
clearTimeout(this._timerLoading);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
;
|
18
|
+
onRequestEnd(param) {
|
19
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
20
|
+
return;
|
21
|
+
}
|
22
|
+
this._countRequest--;
|
23
|
+
this._timerLoading = setTimeout(() => {
|
24
|
+
if (this._countRequest <= 0) {
|
25
|
+
this.ezLoadingBar.hide();
|
26
|
+
}
|
27
|
+
}, this._debounceTime);
|
28
|
+
}
|
29
|
+
;
|
30
|
+
isIgnoreLoadingOnRequest(param) {
|
31
|
+
if (param == undefined) {
|
32
|
+
return false;
|
33
|
+
}
|
34
|
+
if (param.url.includes("quietMode=true")) {
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
if (param.requestBody == undefined) {
|
38
|
+
return false;
|
39
|
+
}
|
40
|
+
if (param.requestBody.length == 1) {
|
41
|
+
const { name } = param.requestBody[0].variables;
|
42
|
+
if (name) {
|
43
|
+
const nameParts = name.split(":");
|
44
|
+
const nameType = nameParts[0];
|
45
|
+
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
return false;
|
49
|
+
}
|
50
|
+
;
|
51
|
+
}
|
52
|
+
export default RequestListenerLoadingBar;
|
@@ -15,6 +15,7 @@ import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
|
|
15
15
|
import UrlUtils from "../../lib/utils/urlutils";
|
16
16
|
import Workspace from "../../lib/workspace/workspace";
|
17
17
|
import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
|
18
|
+
import RequestListenerFactory from "./request-listener/RequestListenerFactory";
|
18
19
|
/**
|
19
20
|
* É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
|
20
21
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
@@ -28,7 +29,7 @@ export class SnkApplication {
|
|
28
29
|
this._waitingAppReady = new Array();
|
29
30
|
this._duCache = new Map();
|
30
31
|
this._duPromises = new Map();
|
31
|
-
this._requestListener =
|
32
|
+
this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
|
32
33
|
this._pendingActions = new Map;
|
33
34
|
this._loadPkParameter = null;
|
34
35
|
this._isLoadedByPk = false;
|
@@ -1004,7 +1005,7 @@ export class SnkApplication {
|
|
1004
1005
|
.unbind("F1");
|
1005
1006
|
}
|
1006
1007
|
render() {
|
1007
|
-
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.
|
1008
|
+
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
|
1008
1009
|
}
|
1009
1010
|
static get is() { return "snk-application"; }
|
1010
1011
|
static get encapsulation() { return "scoped"; }
|
@@ -2513,57 +2514,6 @@ export class SnkApplication {
|
|
2513
2514
|
}];
|
2514
2515
|
}
|
2515
2516
|
}
|
2516
|
-
class RequestListenerLoadingBar {
|
2517
|
-
constructor() {
|
2518
|
-
this._debounceTime = 1000;
|
2519
|
-
this._ignoredNameTypes = ["totals"];
|
2520
|
-
this._countRequest = 0;
|
2521
|
-
}
|
2522
|
-
onRequestStart(param) {
|
2523
|
-
if (this.isIgnoreLoadingOnRequest(param)) {
|
2524
|
-
return;
|
2525
|
-
}
|
2526
|
-
this._countRequest++;
|
2527
|
-
this.loadingBar.show();
|
2528
|
-
if (this._timerLoading) {
|
2529
|
-
clearTimeout(this._timerLoading);
|
2530
|
-
}
|
2531
|
-
}
|
2532
|
-
;
|
2533
|
-
onRequestEnd(param) {
|
2534
|
-
if (this.isIgnoreLoadingOnRequest(param)) {
|
2535
|
-
return;
|
2536
|
-
}
|
2537
|
-
this._countRequest--;
|
2538
|
-
this._timerLoading = setTimeout(() => {
|
2539
|
-
if (this._countRequest <= 0) {
|
2540
|
-
this.loadingBar.hide();
|
2541
|
-
}
|
2542
|
-
}, this._debounceTime);
|
2543
|
-
}
|
2544
|
-
;
|
2545
|
-
isIgnoreLoadingOnRequest(param) {
|
2546
|
-
if (param == undefined) {
|
2547
|
-
return false;
|
2548
|
-
}
|
2549
|
-
if (param.url.includes("quietMode=true")) {
|
2550
|
-
return true;
|
2551
|
-
}
|
2552
|
-
if (param.requestBody == undefined) {
|
2553
|
-
return false;
|
2554
|
-
}
|
2555
|
-
if (param.requestBody.length == 1) {
|
2556
|
-
const { name } = param.requestBody[0].variables;
|
2557
|
-
if (name) {
|
2558
|
-
const nameParts = name.split(":");
|
2559
|
-
const nameType = nameParts[0];
|
2560
|
-
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
2561
|
-
}
|
2562
|
-
}
|
2563
|
-
return false;
|
2564
|
-
}
|
2565
|
-
;
|
2566
|
-
}
|
2567
2517
|
class PendingPromise {
|
2568
2518
|
constructor(resolve, reject) {
|
2569
2519
|
this.resolve = resolve;
|
@@ -6,7 +6,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
6
6
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
7
7
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
8
8
|
};
|
9
|
-
import { ApplicationContext, ErrorException,
|
9
|
+
import { ApplicationContext, ErrorException, ObjectUtils, ServiceCanceledException, StringUtils, WarningException } from '@sankhyalabs/core';
|
10
10
|
import { batchRequests } from 'graphql-request';
|
11
11
|
import UrlUtils from "../../../lib/utils/urlutils";
|
12
12
|
import { PrintUtils } from '../../utils/PrintUtils';
|
@@ -266,7 +266,8 @@ export class DataFetcher {
|
|
266
266
|
}
|
267
267
|
payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
|
268
268
|
}
|
269
|
-
|
269
|
+
const requestId = StringUtils.generateUUID();
|
270
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload, requestId }));
|
270
271
|
http.open("POST", url, true);
|
271
272
|
http.withCredentials = true;
|
272
273
|
http.send(ObjectUtils.objectToString(payloadJson));
|
@@ -306,7 +307,7 @@ export class DataFetcher {
|
|
306
307
|
else if (http.readyState == 4 && http.status != 200) {
|
307
308
|
reject(new ErrorException(`Erro ao executar serviço: ${serviceName}`, http.responseText));
|
308
309
|
}
|
309
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
310
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload, requestId }));
|
310
311
|
};
|
311
312
|
});
|
312
313
|
}
|
@@ -411,7 +412,8 @@ export class DataFetcher {
|
|
411
412
|
const errorsResponse = [];
|
412
413
|
const responseExtensions = [];
|
413
414
|
const url = this.buildGraphQlURL(quietMode);
|
414
|
-
|
415
|
+
const requestId = StringUtils.generateUUID();
|
416
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request, requestId }));
|
415
417
|
try {
|
416
418
|
const response = await batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
417
419
|
response.forEach((resItem, index) => {
|
@@ -445,11 +447,11 @@ export class DataFetcher {
|
|
445
447
|
});
|
446
448
|
}
|
447
449
|
else {
|
448
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
450
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
|
449
451
|
throw new ErrorException("Falha de comunicação", err.message);
|
450
452
|
}
|
451
453
|
}
|
452
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
454
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
|
453
455
|
return { data: dataResponse, errors: errorsResponse, extensions: responseExtensions };
|
454
456
|
}
|
455
457
|
isHttpError(err) {
|
@@ -6777,7 +6777,8 @@ class DataFetcher {
|
|
6777
6777
|
}
|
6778
6778
|
payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
|
6779
6779
|
}
|
6780
|
-
|
6780
|
+
const requestId = StringUtils.generateUUID();
|
6781
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload, requestId }));
|
6781
6782
|
http.open("POST", url, true);
|
6782
6783
|
http.withCredentials = true;
|
6783
6784
|
http.send(ObjectUtils.objectToString(payloadJson));
|
@@ -6817,7 +6818,7 @@ class DataFetcher {
|
|
6817
6818
|
else if (http.readyState == 4 && http.status != 200) {
|
6818
6819
|
reject(new ErrorException(`Erro ao executar serviço: ${serviceName}`, http.responseText));
|
6819
6820
|
}
|
6820
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
6821
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload, requestId }));
|
6821
6822
|
};
|
6822
6823
|
});
|
6823
6824
|
}
|
@@ -6922,7 +6923,8 @@ class DataFetcher {
|
|
6922
6923
|
const errorsResponse = [];
|
6923
6924
|
const responseExtensions = [];
|
6924
6925
|
const url = this.buildGraphQlURL(quietMode);
|
6925
|
-
|
6926
|
+
const requestId = StringUtils.generateUUID();
|
6927
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request, requestId }));
|
6926
6928
|
try {
|
6927
6929
|
const response = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
6928
6930
|
response.forEach((resItem, index) => {
|
@@ -6956,11 +6958,11 @@ class DataFetcher {
|
|
6956
6958
|
});
|
6957
6959
|
}
|
6958
6960
|
else {
|
6959
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
6961
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
|
6960
6962
|
throw new ErrorException("Falha de comunicação", err.message);
|
6961
6963
|
}
|
6962
6964
|
}
|
6963
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
6965
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
|
6964
6966
|
return { data: dataResponse, errors: errorsResponse, extensions: responseExtensions };
|
6965
6967
|
}
|
6966
6968
|
isHttpError(err) {
|
@@ -274,6 +274,99 @@ class SnkErrorHandler {
|
|
274
274
|
}
|
275
275
|
}
|
276
276
|
|
277
|
+
class DebouncedRequestListener {
|
278
|
+
constructor() {
|
279
|
+
this._debounceTime = 1500;
|
280
|
+
this.requests = new Map();
|
281
|
+
this.requestsLoadingBar = [];
|
282
|
+
}
|
283
|
+
onRequestStart(param) {
|
284
|
+
if (param.url.includes("quietMode=true")) {
|
285
|
+
return;
|
286
|
+
}
|
287
|
+
this.requestsLoadingBar.push(param.requestId);
|
288
|
+
const timeout = setTimeout(() => {
|
289
|
+
this.ezLoadingBar.show();
|
290
|
+
}, this._debounceTime);
|
291
|
+
this.requests.set(param.requestId, timeout);
|
292
|
+
}
|
293
|
+
;
|
294
|
+
onRequestEnd(param) {
|
295
|
+
const timeoutId = this.requests.get(param.requestId);
|
296
|
+
clearTimeout(timeoutId);
|
297
|
+
if (this.requestsLoadingBar.includes(param.requestId)) {
|
298
|
+
this.requestsLoadingBar = this.requestsLoadingBar.filter(id => id !== param.requestId);
|
299
|
+
!this.requestsLoadingBar.length && this.ezLoadingBar.hide();
|
300
|
+
}
|
301
|
+
}
|
302
|
+
;
|
303
|
+
}
|
304
|
+
|
305
|
+
class RequestListenerLoadingBar {
|
306
|
+
constructor() {
|
307
|
+
this._debounceTime = 1000;
|
308
|
+
this._ignoredNameTypes = ["totals"];
|
309
|
+
this._countRequest = 0;
|
310
|
+
}
|
311
|
+
onRequestStart(param) {
|
312
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
313
|
+
return;
|
314
|
+
}
|
315
|
+
this._countRequest++;
|
316
|
+
this.ezLoadingBar.show();
|
317
|
+
if (this._timerLoading) {
|
318
|
+
clearTimeout(this._timerLoading);
|
319
|
+
}
|
320
|
+
}
|
321
|
+
;
|
322
|
+
onRequestEnd(param) {
|
323
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
324
|
+
return;
|
325
|
+
}
|
326
|
+
this._countRequest--;
|
327
|
+
this._timerLoading = setTimeout(() => {
|
328
|
+
if (this._countRequest <= 0) {
|
329
|
+
this.ezLoadingBar.hide();
|
330
|
+
}
|
331
|
+
}, this._debounceTime);
|
332
|
+
}
|
333
|
+
;
|
334
|
+
isIgnoreLoadingOnRequest(param) {
|
335
|
+
if (param == undefined) {
|
336
|
+
return false;
|
337
|
+
}
|
338
|
+
if (param.url.includes("quietMode=true")) {
|
339
|
+
return true;
|
340
|
+
}
|
341
|
+
if (param.requestBody == undefined) {
|
342
|
+
return false;
|
343
|
+
}
|
344
|
+
if (param.requestBody.length == 1) {
|
345
|
+
const { name } = param.requestBody[0].variables;
|
346
|
+
if (name) {
|
347
|
+
const nameParts = name.split(":");
|
348
|
+
const nameType = nameParts[0];
|
349
|
+
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
350
|
+
}
|
351
|
+
}
|
352
|
+
return false;
|
353
|
+
}
|
354
|
+
;
|
355
|
+
}
|
356
|
+
|
357
|
+
class RequestListenerFactory {
|
358
|
+
static create({ strategy }) {
|
359
|
+
switch (strategy) {
|
360
|
+
case 'request_name':
|
361
|
+
return new RequestListenerLoadingBar();
|
362
|
+
case 'request_time':
|
363
|
+
return new DebouncedRequestListener();
|
364
|
+
default:
|
365
|
+
throw new Error('Strategy not found');
|
366
|
+
}
|
367
|
+
}
|
368
|
+
}
|
369
|
+
|
277
370
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
278
371
|
|
279
372
|
const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
@@ -288,7 +381,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
288
381
|
this._waitingAppReady = new Array();
|
289
382
|
this._duCache = new Map();
|
290
383
|
this._duPromises = new Map();
|
291
|
-
this._requestListener =
|
384
|
+
this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
|
292
385
|
this._pendingActions = new Map;
|
293
386
|
this._loadPkParameter = null;
|
294
387
|
this._isLoadedByPk = false;
|
@@ -1262,7 +1355,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
1262
1355
|
.unbind("F1");
|
1263
1356
|
}
|
1264
1357
|
render() {
|
1265
|
-
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.
|
1358
|
+
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
|
1266
1359
|
}
|
1267
1360
|
get _element() { return this; }
|
1268
1361
|
static get watchers() { return {
|
@@ -1326,57 +1419,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
1326
1419
|
"whenApplicationReady": [64],
|
1327
1420
|
"setSearchFilterContext": [64]
|
1328
1421
|
}]);
|
1329
|
-
class RequestListenerLoadingBar {
|
1330
|
-
constructor() {
|
1331
|
-
this._debounceTime = 1000;
|
1332
|
-
this._ignoredNameTypes = ["totals"];
|
1333
|
-
this._countRequest = 0;
|
1334
|
-
}
|
1335
|
-
onRequestStart(param) {
|
1336
|
-
if (this.isIgnoreLoadingOnRequest(param)) {
|
1337
|
-
return;
|
1338
|
-
}
|
1339
|
-
this._countRequest++;
|
1340
|
-
this.loadingBar.show();
|
1341
|
-
if (this._timerLoading) {
|
1342
|
-
clearTimeout(this._timerLoading);
|
1343
|
-
}
|
1344
|
-
}
|
1345
|
-
;
|
1346
|
-
onRequestEnd(param) {
|
1347
|
-
if (this.isIgnoreLoadingOnRequest(param)) {
|
1348
|
-
return;
|
1349
|
-
}
|
1350
|
-
this._countRequest--;
|
1351
|
-
this._timerLoading = setTimeout(() => {
|
1352
|
-
if (this._countRequest <= 0) {
|
1353
|
-
this.loadingBar.hide();
|
1354
|
-
}
|
1355
|
-
}, this._debounceTime);
|
1356
|
-
}
|
1357
|
-
;
|
1358
|
-
isIgnoreLoadingOnRequest(param) {
|
1359
|
-
if (param == undefined) {
|
1360
|
-
return false;
|
1361
|
-
}
|
1362
|
-
if (param.url.includes("quietMode=true")) {
|
1363
|
-
return true;
|
1364
|
-
}
|
1365
|
-
if (param.requestBody == undefined) {
|
1366
|
-
return false;
|
1367
|
-
}
|
1368
|
-
if (param.requestBody.length == 1) {
|
1369
|
-
const { name } = param.requestBody[0].variables;
|
1370
|
-
if (name) {
|
1371
|
-
const nameParts = name.split(":");
|
1372
|
-
const nameType = nameParts[0];
|
1373
|
-
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
1374
|
-
}
|
1375
|
-
}
|
1376
|
-
return false;
|
1377
|
-
}
|
1378
|
-
;
|
1379
|
-
}
|
1380
1422
|
class PendingPromise {
|
1381
1423
|
constructor(resolve, reject) {
|
1382
1424
|
this.resolve = resolve;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-
|
1
|
+
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-a7d3e277.js';
|
2
2
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
3
3
|
import { ObjectUtils } from '@sankhyalabs/core';
|
4
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
4
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-5034df59.js';
|
5
5
|
|
6
6
|
class GridConfigFetcher extends ResourceFetcher {
|
7
7
|
constructor() {
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import { D as DataFetcher } from './DataFetcher-
|
2
|
-
import './pesquisa-fetcher-
|
1
|
+
import { D as DataFetcher } from './DataFetcher-5034df59.js';
|
2
|
+
import './pesquisa-fetcher-6bc2e41a.js';
|
3
3
|
import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, StringUtils, NumberUtils, DataType } from '@sankhyalabs/core';
|
4
4
|
import './index-3aa4977a.js';
|
5
5
|
import './ISave-d8c8bc59.js';
|
6
6
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
7
7
|
import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
8
|
-
import { P as PreloadManager } from './dataunit-fetcher-
|
8
|
+
import { P as PreloadManager } from './dataunit-fetcher-56cb648b.js';
|
9
9
|
import './filter-item-type.enum-d45e026f.js';
|
10
|
-
import './form-config-fetcher-
|
10
|
+
import './form-config-fetcher-a7d3e277.js';
|
11
11
|
import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
12
12
|
import { h } from './index-a7d3d3f1.js';
|
13
13
|
|
@@ -6777,7 +6777,8 @@ class DataFetcher {
|
|
6777
6777
|
}
|
6778
6778
|
payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
|
6779
6779
|
}
|
6780
|
-
|
6780
|
+
const requestId = StringUtils.generateUUID();
|
6781
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload, requestId }));
|
6781
6782
|
http.open("POST", url, true);
|
6782
6783
|
http.withCredentials = true;
|
6783
6784
|
http.send(ObjectUtils.objectToString(payloadJson));
|
@@ -6817,7 +6818,7 @@ class DataFetcher {
|
|
6817
6818
|
else if (http.readyState == 4 && http.status != 200) {
|
6818
6819
|
reject(new ErrorException(`Erro ao executar serviço: ${serviceName}`, http.responseText));
|
6819
6820
|
}
|
6820
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
6821
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload, requestId }));
|
6821
6822
|
};
|
6822
6823
|
});
|
6823
6824
|
}
|
@@ -6922,7 +6923,8 @@ class DataFetcher {
|
|
6922
6923
|
const errorsResponse = [];
|
6923
6924
|
const responseExtensions = [];
|
6924
6925
|
const url = this.buildGraphQlURL(quietMode);
|
6925
|
-
|
6926
|
+
const requestId = StringUtils.generateUUID();
|
6927
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request, requestId }));
|
6926
6928
|
try {
|
6927
6929
|
const response = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
6928
6930
|
response.forEach((resItem, index) => {
|
@@ -6956,11 +6958,11 @@ class DataFetcher {
|
|
6956
6958
|
});
|
6957
6959
|
}
|
6958
6960
|
else {
|
6959
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
6961
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
|
6960
6962
|
throw new ErrorException("Falha de comunicação", err.message);
|
6961
6963
|
}
|
6962
6964
|
}
|
6963
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
6965
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
|
6964
6966
|
return { data: dataResponse, errors: errorsResponse, extensions: responseExtensions };
|
6965
6967
|
}
|
6966
6968
|
isHttpError(err) {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-6514d66e.js';
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
3
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
3
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-a7d3e277.js';
|
4
4
|
import { b as TAB_NAMES } from './constants-7302ee87.js';
|
5
5
|
|
6
6
|
class SnkFormConfigManager {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ObjectUtils } from '@sankhyalabs/core';
|
2
|
-
import { R as ResourceFetcher } from './form-config-fetcher-
|
2
|
+
import { R as ResourceFetcher } from './form-config-fetcher-a7d3e277.js';
|
3
3
|
|
4
4
|
class AuthFetcher extends ResourceFetcher {
|
5
5
|
getData(resourceID) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ObjectUtils, DataUnit, DataType, DateUtils, StringUtils, ChangeOperation, ApplicationContext, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
|
2
|
-
import { D as DataFetcher, d as dist } from './DataFetcher-
|
2
|
+
import { D as DataFetcher, d as dist } from './DataFetcher-5034df59.js';
|
3
3
|
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
4
4
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
5
5
|
import { ColumnFilterManager } from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
@@ -1,20 +1,20 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-a7d3d3f1.js';
|
2
2
|
import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { D as DataFetcher } from './DataFetcher-
|
3
|
+
import { D as DataFetcher } from './DataFetcher-5034df59.js';
|
4
4
|
import { P as ParamType } from './ParamType-d5152b06.js';
|
5
|
-
import './pesquisa-fetcher-
|
5
|
+
import './pesquisa-fetcher-6bc2e41a.js';
|
6
6
|
import './index-3aa4977a.js';
|
7
7
|
import './ISave-d8c8bc59.js';
|
8
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
|
-
import './dataunit-fetcher-
|
10
|
+
import './dataunit-fetcher-56cb648b.js';
|
11
11
|
import './filter-item-type.enum-d45e026f.js';
|
12
|
-
import './form-config-fetcher-
|
12
|
+
import './form-config-fetcher-a7d3e277.js';
|
13
13
|
import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
|
14
14
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
15
15
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
16
16
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
|
17
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
17
|
+
import { C as ConfigStorage } from './ConfigStorage-6514d66e.js';
|
18
18
|
import { O as ORDER_VALUES } from './constants-7302ee87.js';
|
19
19
|
import './PrintUtils-3e4ff0f5.js';
|
20
20
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|