@sankhyalabs/sankhyablocks 8.8.0-rc.2 → 8.8.0-rc.4
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.
- package/dist/cjs/{ConfigStorage-a97ca159.js → ConfigStorage-bdb539ce.js} +2 -2
- package/dist/cjs/{DataFetcher-2a99283c.js → DataFetcher-016f1661.js} +30 -30
- package/dist/cjs/{SnkFormConfigManager-f641f502.js → SnkFormConfigManager-c9d38de1.js} +2 -2
- package/dist/cjs/{SnkMultiSelectionListDataSource-4e3de426.js → SnkMultiSelectionListDataSource-9fd9c742.js} +1 -1
- package/dist/cjs/{auth-fetcher-78231356.js → auth-fetcher-73ee0989.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-a4e8352b.js → dataunit-fetcher-1433ce24.js} +1 -1
- package/dist/cjs/{form-config-fetcher-a322a522.js → form-config-fetcher-5e5ec5be.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-7ef61508.js → pesquisa-fetcher-63a8c652.js} +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +91 -86
- package/dist/cjs/snk-application.cjs.entry.js +6 -6
- package/dist/cjs/snk-attach.cjs.entry.js +2 -2
- package/dist/cjs/snk-crud.cjs.entry.js +5 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
- package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +5 -5
- package/dist/cjs/{snk-guides-viewer-c540f4c5.js → snk-guides-viewer-0f03d633.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 +5 -5
- package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js +2 -2
- package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js +2 -2
- package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js +2 -2
- package/dist/collection/components/snk-actions-button/clientEvent/index.js +81 -76
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +31 -32
- package/dist/components/DataFetcher.js +30 -30
- package/dist/components/snk-actions-button2.js +87 -82
- package/dist/esm/{ConfigStorage-26f89143.js → ConfigStorage-9840d004.js} +2 -2
- package/dist/esm/{DataFetcher-90e91631.js → DataFetcher-07935045.js} +30 -30
- package/dist/esm/{SnkFormConfigManager-18948123.js → SnkFormConfigManager-a7c4ac16.js} +2 -2
- package/dist/esm/{SnkMultiSelectionListDataSource-36887f31.js → SnkMultiSelectionListDataSource-447cd9e8.js} +1 -1
- package/dist/esm/{auth-fetcher-a8c8ee7e.js → auth-fetcher-1afab780.js} +1 -1
- package/dist/esm/{dataunit-fetcher-c22b889c.js → dataunit-fetcher-0162ce17.js} +1 -1
- package/dist/esm/{form-config-fetcher-7c3b6273.js → form-config-fetcher-5b886892.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-90d6853b.js → pesquisa-fetcher-7c46996d.js} +1 -1
- package/dist/esm/snk-actions-button.entry.js +91 -86
- package/dist/esm/snk-application.entry.js +6 -6
- package/dist/esm/snk-attach.entry.js +2 -2
- package/dist/esm/snk-crud.entry.js +5 -5
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +7 -7
- package/dist/esm/snk-filter-bar.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +2 -2
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +5 -5
- package/dist/esm/{snk-guides-viewer-e87b77d5.js → snk-guides-viewer-64c24a05.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 +5 -5
- package/dist/sankhyablocks/{p-d47bbee3.js → p-0f2b03e5.js} +1 -1
- package/dist/sankhyablocks/{p-a046a2e1.js → p-1161cb2d.js} +1 -1
- package/dist/sankhyablocks/{p-d563e451.entry.js → p-1b985000.entry.js} +1 -1
- package/dist/sankhyablocks/{p-5dd52ec5.entry.js → p-43f36d85.entry.js} +1 -1
- package/dist/sankhyablocks/{p-eab2c97d.entry.js → p-441cce40.entry.js} +1 -1
- package/dist/sankhyablocks/{p-5d51bff4.js → p-4f7b9c50.js} +1 -1
- package/dist/sankhyablocks/p-503c9774.entry.js +1 -0
- package/dist/sankhyablocks/{p-57550ddc.entry.js → p-54efcc8d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e74e2153.entry.js → p-562896d0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-42de2707.entry.js → p-5bd7932e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d07651cc.entry.js → p-7cbbb6e3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-bcc2b79d.js → p-85635c64.js} +1 -1
- package/dist/sankhyablocks/{p-8652f90b.entry.js → p-9246d7df.entry.js} +1 -1
- package/dist/sankhyablocks/p-96dd0c41.js +1 -0
- package/dist/sankhyablocks/{p-a221bc67.js → p-a84035fa.js} +1 -1
- package/dist/sankhyablocks/{p-ebfa6460.entry.js → p-afdb6ddc.entry.js} +1 -1
- package/dist/sankhyablocks/{p-910af03c.js → p-b19c272c.js} +1 -1
- package/dist/sankhyablocks/{p-b7798801.entry.js → p-cc232268.entry.js} +1 -1
- package/dist/sankhyablocks/p-de1196c8.js +1 -0
- package/dist/sankhyablocks/{p-68fbd480.entry.js → p-de9eb242.entry.js} +1 -1
- package/dist/sankhyablocks/{p-5356efdd.entry.js → p-e350860d.entry.js} +1 -1
- package/dist/sankhyablocks/p-e5e06439.entry.js +1 -0
- package/dist/sankhyablocks/{p-240f5892.js → p-efb2e247.js} +1 -1
- package/dist/sankhyablocks/{p-b3cd0dd1.entry.js → p-f5dbb069.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/clientEvent/index.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +5 -2
- package/package.json +1 -1
- package/dist/sankhyablocks/p-182246c9.entry.js +0 -1
- package/dist/sankhyablocks/p-6541f0df.js +0 -1
- package/dist/sankhyablocks/p-992a9d0f.js +0 -1
- package/dist/sankhyablocks/p-9e705c91.entry.js +0 -1
@@ -22,13 +22,13 @@ class JavaExecutor {
|
|
22
22
|
resolve({ execSource, callback: this.callExecJava });
|
23
23
|
});
|
24
24
|
}
|
25
|
-
callExecJava(execSource) {
|
25
|
+
async callExecJava(execSource) {
|
26
26
|
const request = {
|
27
27
|
requestBody: {
|
28
28
|
javaCall: execSource
|
29
29
|
}
|
30
30
|
};
|
31
|
-
DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_JAVA, JSON.stringify(request));
|
31
|
+
await DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_JAVA, JSON.stringify(request));
|
32
32
|
}
|
33
33
|
}
|
34
34
|
|
@@ -44,11 +44,11 @@ class JavascriptExecutor {
|
|
44
44
|
resolve({ execSource, callback: this.callExecScript });
|
45
45
|
});
|
46
46
|
}
|
47
|
-
callExecScript(execSource) {
|
47
|
+
async callExecScript(execSource) {
|
48
48
|
const request = {
|
49
49
|
runScript: execSource
|
50
50
|
};
|
51
|
-
DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_SCRIPT, request);
|
51
|
+
await DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_SCRIPT, request);
|
52
52
|
}
|
53
53
|
}
|
54
54
|
|
@@ -110,13 +110,13 @@ class ProcedureExecutor {
|
|
110
110
|
resolve({ execSource, callback: this.callExecProcedure });
|
111
111
|
});
|
112
112
|
}
|
113
|
-
callExecProcedure(execSource) {
|
113
|
+
async callExecProcedure(execSource) {
|
114
114
|
const request = {
|
115
115
|
requestBody: {
|
116
116
|
stpCall: execSource
|
117
117
|
}
|
118
118
|
};
|
119
|
-
DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_STP, JSON.stringify(request));
|
119
|
+
await DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_STP, JSON.stringify(request));
|
120
120
|
}
|
121
121
|
}
|
122
122
|
|
@@ -506,86 +506,91 @@ class Actions {
|
|
506
506
|
const CONFIRMACAO = "__CONFIRMACAO__";
|
507
507
|
const ESCOLHA_SIM_NAO = "__ESCOLHA_SIMNAO__";
|
508
508
|
class ClientEventConfirm {
|
509
|
-
clientConfirm(clientEvent, recaller) {
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
if (!recaller.requestBody.params) {
|
529
|
-
recaller.requestBody.params = {
|
530
|
-
param: []
|
509
|
+
async clientConfirm(clientEvent, recaller) {
|
510
|
+
return new Promise((resolve) => {
|
511
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
512
|
+
let actionType = "";
|
513
|
+
if (clientEvent.content.event.hasOwnProperty('stpCall')) {
|
514
|
+
recaller.requestBody = clientEvent.content.event.stpCall;
|
515
|
+
actionType = ActionsType.PROCEDURE;
|
516
|
+
}
|
517
|
+
else if (clientEvent.content.event.hasOwnProperty('runScript')) {
|
518
|
+
recaller.requestBody = clientEvent.content.event.runScript;
|
519
|
+
actionType = ActionsType.JAVASCRIPT;
|
520
|
+
}
|
521
|
+
else if (clientEvent.content.event.hasOwnProperty('javaCall')) {
|
522
|
+
recaller.requestBody = clientEvent.content.event.javaCall;
|
523
|
+
actionType = ActionsType.JAVA;
|
524
|
+
}
|
525
|
+
let param = {
|
526
|
+
type: 'S',
|
527
|
+
sequence: clientEvent.content.event.sequence
|
531
528
|
};
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
529
|
+
if (!recaller.requestBody.params) {
|
530
|
+
recaller.requestBody.params = {
|
531
|
+
param: []
|
532
|
+
};
|
536
533
|
}
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
requestBody:
|
549
|
-
|
550
|
-
|
534
|
+
else {
|
535
|
+
if (!Array.isArray(recaller.requestBody.params.param)) {
|
536
|
+
recaller.requestBody.params.param = [recaller.requestBody.params.param];
|
537
|
+
}
|
538
|
+
}
|
539
|
+
recaller.requestBody.params.param.push(param);
|
540
|
+
const title = clientEvent.content.event.title.$;
|
541
|
+
const message = clientEvent.content.event.message.$;
|
542
|
+
let requestBody;
|
543
|
+
switch (actionType) {
|
544
|
+
case ActionsType.JAVASCRIPT:
|
545
|
+
requestBody = { runScript: recaller.requestBody };
|
546
|
+
break;
|
547
|
+
case ActionsType.PROCEDURE:
|
548
|
+
requestBody = {
|
549
|
+
requestBody: {
|
550
|
+
stpCall: recaller.requestBody
|
551
|
+
}
|
552
|
+
};
|
553
|
+
break;
|
554
|
+
case ActionsType.JAVA:
|
555
|
+
requestBody = {
|
556
|
+
requestBody: {
|
557
|
+
javaCall: recaller.requestBody
|
558
|
+
}
|
559
|
+
};
|
560
|
+
break;
|
561
|
+
}
|
562
|
+
if (clientEvent.content.event.showNoOption == 'S') {
|
563
|
+
param.paramName = ESCOLHA_SIM_NAO;
|
564
|
+
const form = document.createElement("snk-client-confirm");
|
565
|
+
window.document.body.appendChild(form);
|
566
|
+
form.titleMessage = title;
|
567
|
+
form.message = message;
|
568
|
+
form.accept = async () => {
|
569
|
+
param.$ = 'S';
|
570
|
+
await recaller.reCall(requestBody);
|
571
|
+
resolve();
|
551
572
|
};
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
javaCall: recaller.requestBody
|
557
|
-
}
|
573
|
+
form.cancel = async () => {
|
574
|
+
param.$ = 'N';
|
575
|
+
await recaller.reCall(requestBody);
|
576
|
+
resolve();
|
558
577
|
};
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
form.openPopup();
|
576
|
-
}
|
577
|
-
else {
|
578
|
-
application.confirm(title, message, null, 'warn', {
|
579
|
-
labelCancel: "Cancelar",
|
580
|
-
labelConfirm: "Sim"
|
581
|
-
}).then((confirmResult) => {
|
582
|
-
if (confirmResult) {
|
583
|
-
param.paramName = CONFIRMACAO;
|
584
|
-
param.$ = 'S';
|
585
|
-
recaller.reCall(requestBody);
|
586
|
-
}
|
587
|
-
});
|
588
|
-
}
|
578
|
+
form.openPopup();
|
579
|
+
}
|
580
|
+
else {
|
581
|
+
application.confirm(title, message, null, 'warn', {
|
582
|
+
labelCancel: "Cancelar",
|
583
|
+
labelConfirm: "Sim"
|
584
|
+
}).then(async (confirmResult) => {
|
585
|
+
if (confirmResult) {
|
586
|
+
param.paramName = CONFIRMACAO;
|
587
|
+
param.$ = 'S';
|
588
|
+
await recaller.reCall(requestBody);
|
589
|
+
resolve();
|
590
|
+
}
|
591
|
+
});
|
592
|
+
}
|
593
|
+
});
|
589
594
|
}
|
590
595
|
}
|
591
596
|
|
@@ -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-5b886892.js';
|
2
2
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.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-07935045.js';
|
5
5
|
|
6
6
|
class GridConfigFetcher extends ResourceFetcher {
|
7
7
|
constructor() {
|
@@ -6616,16 +6616,16 @@ class DataFetcher {
|
|
6616
6616
|
if (this.ready) {
|
6617
6617
|
return new Promise(async (resolve, reject) => {
|
6618
6618
|
let query = this.getQueryTemplate(req);
|
6619
|
-
const res = await this.
|
6619
|
+
const res = await this.fecthGraphQL([{ document: query, variables: req.values }], quietMode);
|
6620
6620
|
if (res.errors.length > 0) {
|
6621
|
-
if (!this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject)) {
|
6621
|
+
if (!(await this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject))) {
|
6622
6622
|
const error = this.processGraphQlErrorInfo(res.errors);
|
6623
6623
|
reject(error);
|
6624
6624
|
}
|
6625
6625
|
}
|
6626
6626
|
else {
|
6627
6627
|
resolve(res.data[0][reqKey]);
|
6628
|
-
this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject);
|
6628
|
+
await this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject);
|
6629
6629
|
}
|
6630
6630
|
});
|
6631
6631
|
}
|
@@ -6639,7 +6639,7 @@ class DataFetcher {
|
|
6639
6639
|
resolveURL() {
|
6640
6640
|
return UrlUtils.getUrlBase();
|
6641
6641
|
}
|
6642
|
-
proccesGraphQLClientEvents(extensions, originalRequest, resolve, reject) {
|
6642
|
+
async proccesGraphQLClientEvents(extensions, originalRequest, resolve, reject) {
|
6643
6643
|
if (extensions == undefined) {
|
6644
6644
|
return false;
|
6645
6645
|
}
|
@@ -6654,8 +6654,8 @@ class DataFetcher {
|
|
6654
6654
|
throw new WarningException("ClientEvent não registrado", `Ocorreu o client event ${id} porém não há client event registrado na aplicação.`);
|
6655
6655
|
}
|
6656
6656
|
const handlers = DataFetcher.clientEventsByID.get(id);
|
6657
|
-
handlers.forEach(handler => {
|
6658
|
-
handler({ id, content: JSON.parse(clientEvents[id]) }, new GraphQLRecaller(originalRequest, resolve, reject));
|
6657
|
+
handlers.forEach(async (handler) => {
|
6658
|
+
await handler({ id, content: JSON.parse(clientEvents[id]) }, new GraphQLRecaller(originalRequest, resolve, reject));
|
6659
6659
|
});
|
6660
6660
|
}
|
6661
6661
|
return Object.keys(clientEvents).length > 0;
|
@@ -6848,17 +6848,13 @@ class DataFetcher {
|
|
6848
6848
|
async executePendingRequest(watingRequestsById) {
|
6849
6849
|
const requestsBatch = [];
|
6850
6850
|
let quietMode = true;
|
6851
|
-
watingRequestsById.forEach(
|
6852
|
-
|
6851
|
+
watingRequestsById.forEach((waitingReq) => {
|
6852
|
+
const query = this.getQueryTemplate(waitingReq.request);
|
6853
6853
|
requestsBatch.push({ document: query, variables: Object.assign({}, waitingReq.request.values) });
|
6854
6854
|
quietMode = quietMode && waitingReq.quietMode;
|
6855
6855
|
});
|
6856
|
-
|
6857
|
-
|
6858
|
-
let errorsResponse = [];
|
6859
|
-
res = await this.fecthGrapql(requestsBatch, quietMode);
|
6860
|
-
dataResponse = res.data;
|
6861
|
-
errorsResponse = res.errors;
|
6856
|
+
const response = await this.fecthGraphQL(requestsBatch, quietMode);
|
6857
|
+
const { data: dataResponse, errors: errorsResponse, extensions } = response;
|
6862
6858
|
//Reject promises with errors from query
|
6863
6859
|
errorsResponse.forEach((errorResponse) => {
|
6864
6860
|
Object.entries(errorResponse).forEach(([_key, val]) => {
|
@@ -6868,29 +6864,33 @@ class DataFetcher {
|
|
6868
6864
|
});
|
6869
6865
|
//Resolve promises with data from query
|
6870
6866
|
dataResponse.forEach((data) => {
|
6871
|
-
Object.entries(data).forEach(([key, val]) => {
|
6872
|
-
|
6873
|
-
|
6867
|
+
Object.entries(data).forEach(async ([key, val]) => {
|
6868
|
+
const waitingRequest = watingRequestsById.get(key);
|
6869
|
+
await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
|
6870
|
+
((waitingRequest === null || waitingRequest === void 0 ? void 0 : waitingRequest.resolve) || Promise.resolve)(val);
|
6874
6871
|
});
|
6875
6872
|
});
|
6876
6873
|
}
|
6877
|
-
|
6878
|
-
let res = undefined;
|
6879
|
-
let dataResponse = [];
|
6880
|
-
let errorsResponse = [];
|
6881
|
-
let url = `${this.resolveURL() + DataFetcher.getGraphQLPath()}`;
|
6882
|
-
const responseExtensions = [];
|
6874
|
+
buildGraphQlURL(quietMode) {
|
6883
6875
|
const mgeSession = window["mgeSession"];
|
6884
|
-
|
6876
|
+
let url = `${this.resolveURL() + DataFetcher.getGraphQLPath()}`;
|
6877
|
+
if (mgeSession) {
|
6885
6878
|
url += `?mgeSession=${mgeSession}`;
|
6886
6879
|
}
|
6887
6880
|
if (quietMode) {
|
6888
6881
|
url += `${url.indexOf("?") > -1 ? "&" : "?"}quietMode=true`;
|
6889
6882
|
}
|
6890
|
-
|
6883
|
+
return url;
|
6884
|
+
}
|
6885
|
+
async fecthGraphQL(request, quietMode) {
|
6886
|
+
const dataResponse = [];
|
6887
|
+
const errorsResponse = [];
|
6888
|
+
const responseExtensions = [];
|
6889
|
+
const url = this.buildGraphQlURL(quietMode);
|
6890
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request }));
|
6891
6891
|
try {
|
6892
|
-
|
6893
|
-
|
6892
|
+
const response = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
6893
|
+
response.forEach((resItem, index) => {
|
6894
6894
|
var _a;
|
6895
6895
|
if (((_a = resItem === null || resItem === void 0 ? void 0 : resItem.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
6896
6896
|
errorsResponse.push(resItem.errors.map((item) => this.normalizeErrorResponse(item, request, index)));
|
@@ -6905,7 +6905,7 @@ class DataFetcher {
|
|
6905
6905
|
}
|
6906
6906
|
catch (err) {
|
6907
6907
|
if (!this.isHttpError(err)) {
|
6908
|
-
res = err.response;
|
6908
|
+
const res = err.response;
|
6909
6909
|
const req = err.request;
|
6910
6910
|
Object.entries(res).forEach(([key, val]) => {
|
6911
6911
|
if (val.errors) {
|
@@ -6921,11 +6921,11 @@ class DataFetcher {
|
|
6921
6921
|
});
|
6922
6922
|
}
|
6923
6923
|
else {
|
6924
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url
|
6924
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
6925
6925
|
throw new ErrorException("Falha de comunicação", err.message);
|
6926
6926
|
}
|
6927
6927
|
}
|
6928
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url
|
6928
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
6929
6929
|
return { data: dataResponse, errors: errorsResponse, extensions: responseExtensions };
|
6930
6930
|
}
|
6931
6931
|
isHttpError(err) {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-9840d004.js';
|
2
2
|
import { ObjectUtils } from '@sankhyalabs/core';
|
3
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
3
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-5b886892.js';
|
4
4
|
|
5
5
|
class SnkFormConfigManager {
|
6
6
|
constructor(configName, resourceID, onConfigChange) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { UserInterface, DateUtils } from '@sankhyalabs/core';
|
2
|
-
import { P as PreloadManager } from './dataunit-fetcher-
|
2
|
+
import { P as PreloadManager } from './dataunit-fetcher-0162ce17.js';
|
3
3
|
|
4
4
|
class SnkMultiSelectionListDataSource {
|
5
5
|
setDataUnit(dataUnit) {
|
@@ -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-5b886892.js';
|
3
3
|
|
4
4
|
class AuthFetcher extends ResourceFetcher {
|
5
5
|
getData(resourceID) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { FieldComparator, SortMode, DataUnit, defaultDataLoader, DataType, DateUtils, StringUtils, ChangeOperation, 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-07935045.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 { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } 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-07935045.js';
|
4
4
|
import { P as ParamType } from './ParamType-d5152b06.js';
|
5
|
-
import './pesquisa-fetcher-
|
5
|
+
import './pesquisa-fetcher-7c46996d.js';
|
6
6
|
import './index-1564817d.js';
|
7
7
|
import './ISave-4412b20c.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-0162ce17.js';
|
11
11
|
import './filter-item-type.enum-5028ed3f.js';
|
12
|
-
import './form-config-fetcher-
|
12
|
+
import './form-config-fetcher-5b886892.js';
|
13
13
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
14
14
|
import './_commonjsHelpers-9943807e.js';
|
15
15
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -26,13 +26,13 @@ class JavaExecutor {
|
|
26
26
|
resolve({ execSource, callback: this.callExecJava });
|
27
27
|
});
|
28
28
|
}
|
29
|
-
callExecJava(execSource) {
|
29
|
+
async callExecJava(execSource) {
|
30
30
|
const request = {
|
31
31
|
requestBody: {
|
32
32
|
javaCall: execSource
|
33
33
|
}
|
34
34
|
};
|
35
|
-
DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_JAVA, JSON.stringify(request));
|
35
|
+
await DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_JAVA, JSON.stringify(request));
|
36
36
|
}
|
37
37
|
}
|
38
38
|
|
@@ -48,11 +48,11 @@ class JavascriptExecutor {
|
|
48
48
|
resolve({ execSource, callback: this.callExecScript });
|
49
49
|
});
|
50
50
|
}
|
51
|
-
callExecScript(execSource) {
|
51
|
+
async callExecScript(execSource) {
|
52
52
|
const request = {
|
53
53
|
runScript: execSource
|
54
54
|
};
|
55
|
-
DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_SCRIPT, request);
|
55
|
+
await DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_SCRIPT, request);
|
56
56
|
}
|
57
57
|
}
|
58
58
|
|
@@ -114,13 +114,13 @@ class ProcedureExecutor {
|
|
114
114
|
resolve({ execSource, callback: this.callExecProcedure });
|
115
115
|
});
|
116
116
|
}
|
117
|
-
callExecProcedure(execSource) {
|
117
|
+
async callExecProcedure(execSource) {
|
118
118
|
const request = {
|
119
119
|
requestBody: {
|
120
120
|
stpCall: execSource
|
121
121
|
}
|
122
122
|
};
|
123
|
-
DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_STP, JSON.stringify(request));
|
123
|
+
await DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_STP, JSON.stringify(request));
|
124
124
|
}
|
125
125
|
}
|
126
126
|
|
@@ -503,86 +503,91 @@ class Actions {
|
|
503
503
|
const CONFIRMACAO = "__CONFIRMACAO__";
|
504
504
|
const ESCOLHA_SIM_NAO = "__ESCOLHA_SIMNAO__";
|
505
505
|
class ClientEventConfirm {
|
506
|
-
clientConfirm(clientEvent, recaller) {
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
if (!recaller.requestBody.params) {
|
526
|
-
recaller.requestBody.params = {
|
527
|
-
param: []
|
506
|
+
async clientConfirm(clientEvent, recaller) {
|
507
|
+
return new Promise((resolve) => {
|
508
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
509
|
+
let actionType = "";
|
510
|
+
if (clientEvent.content.event.hasOwnProperty('stpCall')) {
|
511
|
+
recaller.requestBody = clientEvent.content.event.stpCall;
|
512
|
+
actionType = ActionsType.PROCEDURE;
|
513
|
+
}
|
514
|
+
else if (clientEvent.content.event.hasOwnProperty('runScript')) {
|
515
|
+
recaller.requestBody = clientEvent.content.event.runScript;
|
516
|
+
actionType = ActionsType.JAVASCRIPT;
|
517
|
+
}
|
518
|
+
else if (clientEvent.content.event.hasOwnProperty('javaCall')) {
|
519
|
+
recaller.requestBody = clientEvent.content.event.javaCall;
|
520
|
+
actionType = ActionsType.JAVA;
|
521
|
+
}
|
522
|
+
let param = {
|
523
|
+
type: 'S',
|
524
|
+
sequence: clientEvent.content.event.sequence
|
528
525
|
};
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
526
|
+
if (!recaller.requestBody.params) {
|
527
|
+
recaller.requestBody.params = {
|
528
|
+
param: []
|
529
|
+
};
|
533
530
|
}
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
requestBody:
|
546
|
-
|
547
|
-
|
531
|
+
else {
|
532
|
+
if (!Array.isArray(recaller.requestBody.params.param)) {
|
533
|
+
recaller.requestBody.params.param = [recaller.requestBody.params.param];
|
534
|
+
}
|
535
|
+
}
|
536
|
+
recaller.requestBody.params.param.push(param);
|
537
|
+
const title = clientEvent.content.event.title.$;
|
538
|
+
const message = clientEvent.content.event.message.$;
|
539
|
+
let requestBody;
|
540
|
+
switch (actionType) {
|
541
|
+
case ActionsType.JAVASCRIPT:
|
542
|
+
requestBody = { runScript: recaller.requestBody };
|
543
|
+
break;
|
544
|
+
case ActionsType.PROCEDURE:
|
545
|
+
requestBody = {
|
546
|
+
requestBody: {
|
547
|
+
stpCall: recaller.requestBody
|
548
|
+
}
|
549
|
+
};
|
550
|
+
break;
|
551
|
+
case ActionsType.JAVA:
|
552
|
+
requestBody = {
|
553
|
+
requestBody: {
|
554
|
+
javaCall: recaller.requestBody
|
555
|
+
}
|
556
|
+
};
|
557
|
+
break;
|
558
|
+
}
|
559
|
+
if (clientEvent.content.event.showNoOption == 'S') {
|
560
|
+
param.paramName = ESCOLHA_SIM_NAO;
|
561
|
+
const form = document.createElement("snk-client-confirm");
|
562
|
+
window.document.body.appendChild(form);
|
563
|
+
form.titleMessage = title;
|
564
|
+
form.message = message;
|
565
|
+
form.accept = async () => {
|
566
|
+
param.$ = 'S';
|
567
|
+
await recaller.reCall(requestBody);
|
568
|
+
resolve();
|
548
569
|
};
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
javaCall: recaller.requestBody
|
554
|
-
}
|
570
|
+
form.cancel = async () => {
|
571
|
+
param.$ = 'N';
|
572
|
+
await recaller.reCall(requestBody);
|
573
|
+
resolve();
|
555
574
|
};
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
form.openPopup();
|
573
|
-
}
|
574
|
-
else {
|
575
|
-
application.confirm(title, message, null, 'warn', {
|
576
|
-
labelCancel: "Cancelar",
|
577
|
-
labelConfirm: "Sim"
|
578
|
-
}).then((confirmResult) => {
|
579
|
-
if (confirmResult) {
|
580
|
-
param.paramName = CONFIRMACAO;
|
581
|
-
param.$ = 'S';
|
582
|
-
recaller.reCall(requestBody);
|
583
|
-
}
|
584
|
-
});
|
585
|
-
}
|
575
|
+
form.openPopup();
|
576
|
+
}
|
577
|
+
else {
|
578
|
+
application.confirm(title, message, null, 'warn', {
|
579
|
+
labelCancel: "Cancelar",
|
580
|
+
labelConfirm: "Sim"
|
581
|
+
}).then(async (confirmResult) => {
|
582
|
+
if (confirmResult) {
|
583
|
+
param.paramName = CONFIRMACAO;
|
584
|
+
param.$ = 'S';
|
585
|
+
await recaller.reCall(requestBody);
|
586
|
+
resolve();
|
587
|
+
}
|
588
|
+
});
|
589
|
+
}
|
590
|
+
});
|
586
591
|
}
|
587
592
|
}
|
588
593
|
|