@sankhyalabs/sankhyablocks 0.0.0-feat-dev-KB-14960.2 → 0.0.0-feat-dev-KB-2213.0
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-2f4b9934.js → ConfigStorage-bbffce76.js} +16 -3
- package/dist/cjs/{DataFetcher-adb2beb4.js → DataFetcher-0cc561bc.js} +10 -20
- package/dist/cjs/{SnkFormConfigManager-2c711d00.js → SnkFormConfigManager-c49af777.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-d0abb63d.js → SnkMessageBuilder-dbc8d14e.js} +11 -1
- package/dist/cjs/{SnkMultiSelectionListDataSource-8aae47a4.js → SnkMultiSelectionListDataSource-804ff4c7.js} +0 -11
- package/dist/cjs/{auth-fetcher-e1d8c26b.js → auth-fetcher-fff2319e.js} +1 -1
- package/dist/cjs/dataunit-fetcher-16b32d96.js +356 -0
- package/dist/cjs/{form-config-fetcher-ad090dd1.js → form-config-fetcher-35752aad.js} +1 -1
- package/dist/cjs/index-f9e81701.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-64473c9f.js → pesquisa-fetcher-415eab63.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +3 -4
- package/dist/cjs/snk-application.cjs.entry.js +102 -24
- package/dist/cjs/snk-attach.cjs.entry.js +4 -5
- package/dist/cjs/snk-configurator.cjs.entry.js +16 -1
- package/dist/cjs/snk-crud.cjs.entry.js +5 -7
- package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +20 -0
- package/dist/cjs/snk-data-exporter.cjs.entry.js +7 -5
- package/dist/cjs/{snk-data-unit-7cc1846d.js → snk-data-unit-3e4d0c09.js} +1 -4
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +7 -9
- 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 +7 -11
- package/dist/cjs/{snk-guides-viewer-20d219c5.js → snk-guides-viewer-36b39c9c.js} +4 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +6 -8
- package/dist/cjs/snk-taskbar.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/snk-application/snk-application.js +132 -20
- package/dist/collection/components/snk-attach/snk-attach.css +6 -0
- package/dist/collection/components/snk-attach/snk-attach.js +2 -2
- package/dist/collection/components/snk-configurator/snk-configurator.js +33 -1
- package/dist/collection/components/snk-crud/snk-crud.js +1 -1
- package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css +3 -0
- package/dist/collection/components/{snk-taskbar/snk-taskbar-custom-elements.js → snk-custom-slot-elements/snk-custom-slot-elements.js} +10 -10
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +0 -10
- package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js +0 -11
- package/dist/collection/components/snk-grid/snk-grid.js +7 -9
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +8 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +0 -4
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +10 -20
- package/dist/collection/lib/http/data-fetcher/fetchers/{data-unit/dataunit-fetcher.js → dataunit-fetcher.js} +100 -48
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +3 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js +3 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +14 -1
- package/dist/collection/lib/index.js +1 -1
- package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
- package/dist/collection/lib/message/resources/snk-application.msg.js +9 -0
- package/dist/collection/lib/workspace/workspace.js +8 -0
- package/dist/components/ConfigStorage.js +14 -1
- package/dist/components/DataFetcher.js +10 -20
- package/dist/components/SnkMessageBuilder.js +11 -1
- package/dist/components/SnkMultiSelectionListDataSource.js +0 -11
- package/dist/components/dataunit-fetcher.js +100 -750
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{esm/pesquisa-fetcher-87ae964a.js → components/pesquisa-fetcher.js} +1 -1
- package/dist/components/snk-actions-button2.js +1 -1
- package/dist/components/snk-application2.js +98 -17
- package/dist/components/snk-attach2.js +2 -2
- package/dist/components/snk-configurator2.js +18 -2
- package/dist/components/snk-crud.js +2 -2
- package/dist/components/snk-custom-slot-elements.d.ts +11 -0
- package/dist/components/snk-custom-slot-elements.js +35 -0
- package/dist/components/snk-data-exporter2.js +5 -3
- package/dist/components/snk-data-unit2.js +0 -3
- package/dist/components/snk-detail-view2.js +1 -1
- package/dist/components/snk-grid2.js +3 -4
- package/dist/components/snk-simple-crud2.js +3 -3
- package/dist/components/snk-taskbar2.js +1 -1
- package/dist/esm/{ConfigStorage-e6764b0c.js → ConfigStorage-80ca14d5.js} +16 -3
- package/dist/esm/{DataFetcher-942f617d.js → DataFetcher-044e3988.js} +10 -20
- package/dist/esm/{SnkFormConfigManager-677b123e.js → SnkFormConfigManager-1a8b3a44.js} +2 -2
- package/dist/esm/{SnkMessageBuilder-68c1c25a.js → SnkMessageBuilder-7ac66e9c.js} +11 -1
- package/dist/esm/{SnkMultiSelectionListDataSource-1871aa5f.js → SnkMultiSelectionListDataSource-892f37f9.js} +0 -11
- package/dist/esm/{auth-fetcher-08a26786.js → auth-fetcher-1b378f8e.js} +1 -1
- package/dist/esm/dataunit-fetcher-e0361781.js +354 -0
- package/dist/esm/{form-config-fetcher-cfd32134.js → form-config-fetcher-c702e9e3.js} +1 -1
- package/dist/esm/index-a7d3d3f1.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-fetcher-d1b4e5a2.js +165 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +3 -4
- package/dist/esm/snk-application.entry.js +102 -24
- package/dist/esm/snk-attach.entry.js +4 -5
- package/dist/esm/snk-configurator.entry.js +17 -2
- package/dist/esm/snk-crud.entry.js +5 -7
- package/dist/esm/snk-custom-slot-elements.entry.js +16 -0
- package/dist/esm/snk-data-exporter.entry.js +8 -6
- package/dist/esm/{snk-data-unit-1715d2f1.js → snk-data-unit-5eb68408.js} +1 -4
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +7 -9
- 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 +7 -11
- package/dist/esm/{snk-guides-viewer-dcbfd2a6.js → snk-guides-viewer-767ad354.js} +4 -5
- package/dist/esm/snk-guides-viewer.entry.js +6 -8
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +6 -8
- package/dist/esm/snk-taskbar.entry.js +1 -1
- package/dist/sankhyablocks/{p-e1cb1f0b.js → p-0123f169.js} +1 -1
- package/dist/sankhyablocks/p-15578509.entry.js +1 -0
- package/dist/sankhyablocks/p-1f32ad9c.entry.js +1 -0
- package/dist/sankhyablocks/{p-4da393be.js → p-2043a64f.js} +1 -1
- package/dist/sankhyablocks/p-251985c1.entry.js +1 -0
- package/dist/sankhyablocks/{p-6eecdca7.entry.js → p-3c1759ba.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1c44a9c9.entry.js → p-3ef37b31.entry.js} +1 -1
- package/dist/sankhyablocks/p-473c7df4.js +1 -0
- package/dist/sankhyablocks/p-69754d94.entry.js +1 -0
- package/dist/sankhyablocks/{p-a6febf2b.entry.js → p-727b8cbe.entry.js} +1 -1
- package/dist/sankhyablocks/p-73d3daa8.entry.js +1 -0
- package/dist/sankhyablocks/{p-706bbc00.js → p-76926391.js} +1 -1
- package/dist/sankhyablocks/p-77aebc26.js +1 -0
- package/dist/sankhyablocks/{p-7cf5a03a.entry.js → p-845c7480.entry.js} +1 -1
- package/dist/sankhyablocks/p-867e9b79.js +1 -0
- package/dist/sankhyablocks/p-8d1602f2.entry.js +1 -0
- package/dist/sankhyablocks/{p-21b7a2ad.entry.js → p-90c07587.entry.js} +1 -1
- package/dist/sankhyablocks/p-98ae8ddc.entry.js +1 -0
- package/dist/sankhyablocks/p-9af040ba.entry.js +1 -0
- package/dist/sankhyablocks/p-9de24cf3.entry.js +1 -0
- package/dist/sankhyablocks/{p-0a8051a0.js → p-a2c7c45f.js} +6 -6
- package/dist/sankhyablocks/{p-ee43700b.js → p-af86752b.js} +1 -1
- package/dist/sankhyablocks/p-b6d54b6c.entry.js +1 -0
- package/dist/sankhyablocks/p-d1cc9007.entry.js +1 -0
- package/dist/sankhyablocks/{p-648a7c72.entry.js → p-d4fb9642.entry.js} +1 -1
- package/dist/sankhyablocks/p-d5b11196.js +76 -0
- package/dist/sankhyablocks/p-dacb4c4c.entry.js +11 -0
- package/dist/sankhyablocks/{p-e15011a6.entry.js → p-e46dd27b.entry.js} +1 -1
- package/dist/sankhyablocks/p-f1f7b545.js +1 -0
- package/dist/sankhyablocks/p-fa9d3f73.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +26 -5
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +6 -0
- package/dist/types/components/snk-custom-slot-elements/snk-custom-slot-elements.d.ts +7 -0
- package/dist/types/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.d.ts +0 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +2 -2
- package/dist/types/components.d.ts +39 -26
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +2 -2
- package/dist/types/lib/http/data-fetcher/fetchers/{data-unit/dataunit-fetcher.d.ts → dataunit-fetcher.d.ts} +3 -5
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +1 -1
- package/dist/types/lib/index.d.ts +1 -1
- package/dist/types/lib/message/resources/snk-application.msg.d.ts +2 -0
- package/dist/types/lib/workspace/workspace.d.ts +2 -0
- package/package.json +5 -5
- package/react/components.d.ts +1 -1
- package/react/components.js +1 -1
- package/react/components.js.map +1 -1
- package/dist/cjs/dataunit-fetcher-70d1c070.js +0 -846
- package/dist/cjs/snk-taskbar-custom-elements.cjs.entry.js +0 -20
- package/dist/collection/components/snk-data-unit/snk-data-unit.css +0 -6
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +0 -119
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +0 -59
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +0 -169
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js +0 -68
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +0 -135
- package/dist/components/snk-taskbar-custom-elements.d.ts +0 -11
- package/dist/components/snk-taskbar-custom-elements.js +0 -35
- package/dist/esm/dataunit-fetcher-7d7726bb.js +0 -843
- package/dist/esm/snk-taskbar-custom-elements.entry.js +0 -16
- package/dist/sankhyablocks/p-177fa5be.entry.js +0 -1
- package/dist/sankhyablocks/p-324ce41e.entry.js +0 -1
- package/dist/sankhyablocks/p-34604220.entry.js +0 -1
- package/dist/sankhyablocks/p-505b29cb.entry.js +0 -1
- package/dist/sankhyablocks/p-6765e2a4.js +0 -76
- package/dist/sankhyablocks/p-6982fb80.entry.js +0 -11
- package/dist/sankhyablocks/p-75df7885.entry.js +0 -1
- package/dist/sankhyablocks/p-88ede1c0.js +0 -1
- package/dist/sankhyablocks/p-935f3865.entry.js +0 -1
- package/dist/sankhyablocks/p-9a270401.entry.js +0 -1
- package/dist/sankhyablocks/p-ac6768e8.js +0 -1
- package/dist/sankhyablocks/p-ae6aff81.js +0 -1
- package/dist/sankhyablocks/p-d61c6a82.js +0 -1
- package/dist/sankhyablocks/p-ddaf32de.entry.js +0 -1
- package/dist/sankhyablocks/p-e66e2631.entry.js +0 -1
- package/dist/sankhyablocks/p-e84fd2e5.js +0 -1
- package/dist/sankhyablocks/p-fe5d2b2e.entry.js +0 -1
- package/dist/sankhyablocks/p-ff712e39.entry.js +0 -1
- package/dist/types/components/snk-taskbar/snk-taskbar-custom-elements.d.ts +0 -7
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +0 -14
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +0 -19
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +0 -23
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.d.ts +0 -6
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.d.ts +0 -7
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.d.ts +0 -9
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.d.ts +0 -4
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.d.ts +0 -6
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.d.ts +0 -9
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +0 -15
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
3
|
+
const formConfigFetcher = require('./form-config-fetcher-35752aad.js');
|
|
4
4
|
const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
|
|
5
|
-
const
|
|
5
|
+
const core = require('@sankhyalabs/core');
|
|
6
|
+
const DataFetcher = require('./DataFetcher-0cc561bc.js');
|
|
6
7
|
|
|
7
8
|
class GridConfigFetcher extends formConfigFetcher.ResourceFetcher {
|
|
8
9
|
constructor() {
|
|
@@ -139,7 +140,19 @@ class FilterBarConfigFetcher extends formConfigFetcher.ResourceFetcher {
|
|
|
139
140
|
var _a, _b;
|
|
140
141
|
if (item.type === filterItemType_enum.FilterItemType.MULTI_LIST) {
|
|
141
142
|
const multiListValue = item.value;
|
|
142
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Existe um bug no HTML5 onde ele salva a configuração do filtro na FilterBar como objeto em vez de array
|
|
145
|
+
* Esse cenário ocorre quando há apenas um item na configuração do filtro
|
|
146
|
+
*/
|
|
147
|
+
let multilistValueArray = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
|
|
148
|
+
// Precisamos verificar se o objeto existe ou está unfefined
|
|
149
|
+
multilistValueArray = multilistValueArray !== null && multilistValueArray !== void 0 ? multilistValueArray : [];
|
|
150
|
+
multilistValueArray = Array.isArray(multilistValueArray) ? multilistValueArray : [multilistValueArray];
|
|
151
|
+
// Existem cenários onde o HTML5 não salva o Id do filtro, apenas seu label e value
|
|
152
|
+
multilistValueArray = multilistValueArray.map(itemRaw => {
|
|
153
|
+
return Object.assign(Object.assign({}, itemRaw), { id: itemRaw.id ? itemRaw.id : itemRaw.value });
|
|
154
|
+
});
|
|
155
|
+
item.value = core.ObjectUtils.copy(multilistValueArray);
|
|
143
156
|
}
|
|
144
157
|
return item;
|
|
145
158
|
});
|
|
@@ -6524,7 +6524,6 @@ var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
|
|
|
6524
6524
|
};
|
|
6525
6525
|
class DataFetcher {
|
|
6526
6526
|
constructor() {
|
|
6527
|
-
this.GRAPHQL_PATH = `/${window.MGE_MODULE_NAME || 'mgefin-bff'}/graphql`;
|
|
6528
6527
|
this.ready = true;
|
|
6529
6528
|
this.watingRequestsById = new Map();
|
|
6530
6529
|
}
|
|
@@ -6544,6 +6543,7 @@ class DataFetcher {
|
|
|
6544
6543
|
}
|
|
6545
6544
|
}
|
|
6546
6545
|
this.instance.application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
6546
|
+
this.instance.graphqlPath = `/${this.instance.application.getModuleName()}/graphql`;
|
|
6547
6547
|
return this.instance;
|
|
6548
6548
|
}
|
|
6549
6549
|
static addRequestListener(listener) {
|
|
@@ -6595,7 +6595,7 @@ class DataFetcher {
|
|
|
6595
6595
|
}
|
|
6596
6596
|
return new core.ErrorException(title, statusMessage, tsErrorCode);
|
|
6597
6597
|
}
|
|
6598
|
-
async callGraphQL(req
|
|
6598
|
+
async callGraphQL(req) {
|
|
6599
6599
|
var _a;
|
|
6600
6600
|
if (this.ready) {
|
|
6601
6601
|
this.pause();
|
|
@@ -6613,7 +6613,7 @@ class DataFetcher {
|
|
|
6613
6613
|
if (this.ready) {
|
|
6614
6614
|
return new Promise(async (resolve, reject) => {
|
|
6615
6615
|
let query = this.getQueryTemplate(req);
|
|
6616
|
-
const res = await this.fecthGrapql([{ document: query, variables: req.values }]
|
|
6616
|
+
const res = await this.fecthGrapql([{ document: query, variables: req.values }]);
|
|
6617
6617
|
if (res.errors.length > 0) {
|
|
6618
6618
|
if (!this.proccesGraphQLClientEvents(res === null || res === void 0 ? void 0 : res.extensions, req, resolve, reject)) {
|
|
6619
6619
|
const error = this.processGraphQlErrorInfo(res.errors);
|
|
@@ -6628,7 +6628,7 @@ class DataFetcher {
|
|
|
6628
6628
|
}
|
|
6629
6629
|
else {
|
|
6630
6630
|
if (!this.watingRequestsById.has(reqKey)) {
|
|
6631
|
-
this.watingRequestsById.set(reqKey, new WaitingRequest(req
|
|
6631
|
+
this.watingRequestsById.set(reqKey, new WaitingRequest(req));
|
|
6632
6632
|
}
|
|
6633
6633
|
return (_a = this.watingRequestsById.get(reqKey)) === null || _a === void 0 ? void 0 : _a.promise;
|
|
6634
6634
|
}
|
|
@@ -6844,16 +6844,14 @@ class DataFetcher {
|
|
|
6844
6844
|
}
|
|
6845
6845
|
async executePendingRequest(watingRequestsById) {
|
|
6846
6846
|
const requestsBatch = [];
|
|
6847
|
-
let quietMode = true;
|
|
6848
6847
|
watingRequestsById.forEach(async (waitingReq) => {
|
|
6849
6848
|
let query = this.getQueryTemplate(waitingReq.request);
|
|
6850
6849
|
requestsBatch.push({ document: query, variables: Object.assign({}, waitingReq.request.values) });
|
|
6851
|
-
quietMode = quietMode && waitingReq.quietMode;
|
|
6852
6850
|
});
|
|
6853
6851
|
let res = undefined;
|
|
6854
6852
|
let dataResponse = [];
|
|
6855
6853
|
let errorsResponse = [];
|
|
6856
|
-
res = await this.fecthGrapql(requestsBatch
|
|
6854
|
+
res = await this.fecthGrapql(requestsBatch);
|
|
6857
6855
|
dataResponse = res.data;
|
|
6858
6856
|
errorsResponse = res.errors;
|
|
6859
6857
|
//Reject promises with errors from query
|
|
@@ -6871,18 +6869,14 @@ class DataFetcher {
|
|
|
6871
6869
|
});
|
|
6872
6870
|
});
|
|
6873
6871
|
}
|
|
6874
|
-
async fecthGrapql(request
|
|
6872
|
+
async fecthGrapql(request) {
|
|
6875
6873
|
let res = undefined;
|
|
6876
6874
|
let dataResponse = [];
|
|
6877
6875
|
let errorsResponse = [];
|
|
6878
|
-
let url = `${this.resolveURL() + this.
|
|
6876
|
+
let url = `${this.resolveURL() + this.graphqlPath}`;
|
|
6879
6877
|
const responseExtensions = [];
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
url += `?mgeSession=${mgeSession}`;
|
|
6883
|
-
}
|
|
6884
|
-
if (quietMode) {
|
|
6885
|
-
url += `${url.indexOf("?") > -1 ? "&" : "?"}quietMode=true`;
|
|
6878
|
+
if (window['mgeSession']) {
|
|
6879
|
+
url += `?mgeSession=${window['mgeSession']}`;
|
|
6886
6880
|
}
|
|
6887
6881
|
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
|
|
6888
6882
|
try {
|
|
@@ -6968,7 +6962,7 @@ DataFetcher.SERVICE_BROKER_STATUS = {
|
|
|
6968
6962
|
};
|
|
6969
6963
|
DataFetcher.clientEventsByID = new Map();
|
|
6970
6964
|
class WaitingRequest {
|
|
6971
|
-
constructor(req
|
|
6965
|
+
constructor(req) {
|
|
6972
6966
|
this._resolve = () => { };
|
|
6973
6967
|
this._reject = () => { };
|
|
6974
6968
|
this._request = undefined;
|
|
@@ -6977,7 +6971,6 @@ class WaitingRequest {
|
|
|
6977
6971
|
this._resolve = resolve;
|
|
6978
6972
|
this._reject = reject;
|
|
6979
6973
|
});
|
|
6980
|
-
this._quietMode = quietMode;
|
|
6981
6974
|
}
|
|
6982
6975
|
get resolve() {
|
|
6983
6976
|
return this._resolve;
|
|
@@ -6991,9 +6984,6 @@ class WaitingRequest {
|
|
|
6991
6984
|
get request() {
|
|
6992
6985
|
return this._request;
|
|
6993
6986
|
}
|
|
6994
|
-
get quietMode() {
|
|
6995
|
-
return this._quietMode;
|
|
6996
|
-
}
|
|
6997
6987
|
}
|
|
6998
6988
|
|
|
6999
6989
|
exports.DataFetcher = DataFetcher;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
3
|
+
const ConfigStorage = require('./ConfigStorage-bbffce76.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
|
5
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
5
|
+
const formConfigFetcher = require('./form-config-fetcher-35752aad.js');
|
|
6
6
|
|
|
7
7
|
class SnkFormConfigManager {
|
|
8
8
|
constructor(configName, resourceID, onConfigChange) {
|
|
@@ -174,6 +174,15 @@ const fileViewerMessages = {
|
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
|
|
177
|
+
const snkAttachMessages$1 = {
|
|
178
|
+
newVersionPopup: {
|
|
179
|
+
title: "Boas vindas à nova interface da tela {{screenName}}",
|
|
180
|
+
info: "Com uma jornada mais moderna, simples e intuitiva, a performance aprimorada da nova interface impulsionará a sua produtividade.",
|
|
181
|
+
okButton: "Quero experimentar!",
|
|
182
|
+
cancelButton: "Voltar à interface anterior",
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
177
186
|
const snkConfigOptionsMessages = {
|
|
178
187
|
label: {
|
|
179
188
|
nameField: "Nome do Campo *",
|
|
@@ -507,6 +516,7 @@ const snkPrintSelectorMessages = {
|
|
|
507
516
|
class SnkMessageBuilder {
|
|
508
517
|
constructor(domainName) {
|
|
509
518
|
this._defaults = {
|
|
519
|
+
snkApplication: snkAttachMessages$1,
|
|
510
520
|
snkDataUnit: snkDataUnitMessages,
|
|
511
521
|
snkFormConfig: snkFormConfigMessages,
|
|
512
522
|
snkConfigOptions: snkConfigOptionsMessages,
|
|
@@ -529,7 +539,7 @@ class SnkMessageBuilder {
|
|
|
529
539
|
snkPersonalizedFilter: snkPersonalizedFilterMessages,
|
|
530
540
|
snkEntityList: snkEntityListMessages,
|
|
531
541
|
snkActionsButton: snkActionsButtonMessages,
|
|
532
|
-
snkPrintSelector: snkPrintSelectorMessages
|
|
542
|
+
snkPrintSelector: snkPrintSelectorMessages,
|
|
533
543
|
};
|
|
534
544
|
this._currentOperation = exports.OperationMap.CLEAN;
|
|
535
545
|
this._domainName = domainName;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const core = require('@sankhyalabs/core');
|
|
4
|
-
const dataunitFetcher = require('./dataunit-fetcher-70d1c070.js');
|
|
5
4
|
|
|
6
5
|
class SnkMultiSelectionListDataSource {
|
|
7
6
|
setDataUnit(dataUnit) {
|
|
@@ -17,16 +16,6 @@ class SnkMultiSelectionListDataSource {
|
|
|
17
16
|
}
|
|
18
17
|
return String(this._dataUnit.getFormattedValue(fieldName, value));
|
|
19
18
|
}
|
|
20
|
-
async getStaticOptions(fieldName) {
|
|
21
|
-
if (fieldName == undefined) {
|
|
22
|
-
return Promise.resolve(undefined);
|
|
23
|
-
}
|
|
24
|
-
const result = await dataunitFetcher.PreloadManager.getDistinct(this._dataUnit, fieldName);
|
|
25
|
-
if (result == undefined) {
|
|
26
|
-
return Promise.resolve(undefined);
|
|
27
|
-
}
|
|
28
|
-
return Promise.resolve(Array.from(result.entries()).map(([label, value]) => ({ label: String(label), value, check: true })));
|
|
29
|
-
}
|
|
30
19
|
fetchData(filterTerm, fieldName) {
|
|
31
20
|
return new Promise(resolve => {
|
|
32
21
|
this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const core = require('@sankhyalabs/core');
|
|
4
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
4
|
+
const formConfigFetcher = require('./form-config-fetcher-35752aad.js');
|
|
5
5
|
|
|
6
6
|
class AuthFetcher extends formConfigFetcher.ResourceFetcher {
|
|
7
7
|
getData(resourceID) {
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const core = require('@sankhyalabs/core');
|
|
4
|
+
const DataFetcher = require('./DataFetcher-0cc561bc.js');
|
|
5
|
+
const constants = require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
6
|
+
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
7
|
+
|
|
8
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
9
|
+
var t = {};
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
13
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
14
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
15
|
+
t[p[i]] = s[p[i]];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
class DataUnitFetcher {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.templateByQuery = new Map();
|
|
22
|
+
this._loadDataTimeout = {};
|
|
23
|
+
this.buldTemplates();
|
|
24
|
+
}
|
|
25
|
+
buldTemplates() {
|
|
26
|
+
this.templateByQuery.set("fetchDataUnit", DataFetcher.dist.gql `query($name: String!) {
|
|
27
|
+
$queryAlias$: fetchDataUnit(name: $name){
|
|
28
|
+
name
|
|
29
|
+
fields{
|
|
30
|
+
name
|
|
31
|
+
defaultValue
|
|
32
|
+
label
|
|
33
|
+
visible
|
|
34
|
+
readOnly
|
|
35
|
+
required
|
|
36
|
+
dataType
|
|
37
|
+
userInterface
|
|
38
|
+
calculated
|
|
39
|
+
group
|
|
40
|
+
order
|
|
41
|
+
properties{
|
|
42
|
+
name
|
|
43
|
+
value
|
|
44
|
+
}
|
|
45
|
+
dependencies{
|
|
46
|
+
masterFields
|
|
47
|
+
type
|
|
48
|
+
expression
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
children{
|
|
52
|
+
name
|
|
53
|
+
label
|
|
54
|
+
links{
|
|
55
|
+
source
|
|
56
|
+
target
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}`);
|
|
61
|
+
this.templateByQuery.set("fetchData", DataFetcher.dist.gql `query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!] $parentRecordId: String) {
|
|
62
|
+
$queryAlias$: fetchDataUnit(name: $dataunit){
|
|
63
|
+
data(limit: $limit offset: $offset filters: $filters sort: $sort parentRecordId: $parentRecordId){
|
|
64
|
+
limit
|
|
65
|
+
offset
|
|
66
|
+
total
|
|
67
|
+
hasMore
|
|
68
|
+
records{
|
|
69
|
+
id
|
|
70
|
+
label
|
|
71
|
+
fields {
|
|
72
|
+
name
|
|
73
|
+
value
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}`);
|
|
79
|
+
this.templateByQuery.set("saveData", DataFetcher.dist.gql `mutation($changes: [InputBatchChange!]!) {
|
|
80
|
+
$queryAlias$: batchOperationDataUnit(changes: $changes){
|
|
81
|
+
oldId
|
|
82
|
+
id
|
|
83
|
+
label
|
|
84
|
+
ownerDataUnitName
|
|
85
|
+
fields {
|
|
86
|
+
name
|
|
87
|
+
value
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}`);
|
|
91
|
+
this.templateByQuery.set("fetchDataRecord", DataFetcher.dist.gql `query($dataunit: String! $recordID: [String!]) {
|
|
92
|
+
$queryAlias$: fetchDataUnit(name: $dataunit){
|
|
93
|
+
record(id: $recordID){
|
|
94
|
+
id
|
|
95
|
+
label
|
|
96
|
+
fields {
|
|
97
|
+
name
|
|
98
|
+
value
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}`);
|
|
103
|
+
this.templateByQuery.set("fetchDistinctColumn", DataFetcher.dist.gql `query($dataUnit: String!, $fieldName: String!, $argument: String, $filters: [InputFilter], $parentRecordId: String) {
|
|
104
|
+
$queryAlias$: selectDistinct(dataUnit: $dataUnit, fieldName: $fieldName, argument: $argument, filters: $filters, parentRecordId: $parentRecordId)
|
|
105
|
+
}`);
|
|
106
|
+
}
|
|
107
|
+
getDataUnit(entityName, resourceID, parentDataUnit, configName) {
|
|
108
|
+
const duName = `dd://${entityName}/${resourceID}${configName ? "/" + configName : ""}`;
|
|
109
|
+
const dataUnit = parentDataUnit != undefined ? parentDataUnit.getChildDataunit(duName) : new core.DataUnit(duName);
|
|
110
|
+
dataUnit.metadataLoader = (dataUnit) => this.loadMetadata(dataUnit);
|
|
111
|
+
dataUnit.dataLoader = (dataUnit, request) => this.loadData(dataUnit, request);
|
|
112
|
+
dataUnit.saveLoader = (_dataUnit, changes) => this.saveData(dataUnit, changes);
|
|
113
|
+
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
|
114
|
+
dataUnit.recordLoader = (dataUnit, recordIds) => this.loadRecord(dataUnit, recordIds);
|
|
115
|
+
return dataUnit;
|
|
116
|
+
}
|
|
117
|
+
loadMetadata(dataUnit) {
|
|
118
|
+
return new Promise((resolve, reject) => {
|
|
119
|
+
DataFetcher.DataFetcher.get()
|
|
120
|
+
.callGraphQL({
|
|
121
|
+
values: { name: dataUnit.name },
|
|
122
|
+
query: this.templateByQuery.get("fetchDataUnit"),
|
|
123
|
+
})
|
|
124
|
+
.then((resp) => {
|
|
125
|
+
var _a;
|
|
126
|
+
const metadata = {
|
|
127
|
+
name: resp.name,
|
|
128
|
+
label: resp.name,
|
|
129
|
+
children: [...resp.children],
|
|
130
|
+
fields: []
|
|
131
|
+
};
|
|
132
|
+
(_a = resp.fields) === null || _a === void 0 ? void 0 : _a.forEach((source) => {
|
|
133
|
+
let properties = undefined;
|
|
134
|
+
if (Array.isArray(source.properties)) {
|
|
135
|
+
properties = {};
|
|
136
|
+
if (source.calculated) {
|
|
137
|
+
properties.gridHeaderTooltip = "Campos calculados não podem ser ordenados";
|
|
138
|
+
}
|
|
139
|
+
source.properties.forEach((prop) => (properties[prop.name] = prop.value));
|
|
140
|
+
}
|
|
141
|
+
metadata.fields.push(Object.assign(Object.assign({}, source), { properties }));
|
|
142
|
+
});
|
|
143
|
+
metadata.fields.sort((a, b) => a.order - b.order);
|
|
144
|
+
resolve(metadata);
|
|
145
|
+
})
|
|
146
|
+
.catch((error) => {
|
|
147
|
+
reject(error);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
async loadData(dataUnit, request) {
|
|
152
|
+
try {
|
|
153
|
+
const duName = dataUnit.name;
|
|
154
|
+
if (this._loadDataTimeout[duName]) {
|
|
155
|
+
clearTimeout(this._loadDataTimeout[duName]);
|
|
156
|
+
delete this._loadDataTimeout[duName];
|
|
157
|
+
}
|
|
158
|
+
const result = await this.doLoadData(dataUnit, request);
|
|
159
|
+
delete this._loadDataTimeout[duName];
|
|
160
|
+
await new Promise(resolve => {
|
|
161
|
+
this._loadDataTimeout[duName] = setTimeout(resolve, 200);
|
|
162
|
+
});
|
|
163
|
+
return Promise.resolve(result);
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
return Promise.reject(error);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
loadSelectDistinct(dataUnit, fieldName, argument) {
|
|
170
|
+
const { parentRecordId, filters } = dataUnit.getLastLoadRequest() || {};
|
|
171
|
+
const filteredFilters = filters.filter(f => f.name !== `${constants.DISTINCT_FILTER_NAME_PREFIX}${fieldName}`);
|
|
172
|
+
const values = {
|
|
173
|
+
dataUnit: dataUnit.name,
|
|
174
|
+
argument,
|
|
175
|
+
fieldName,
|
|
176
|
+
parentRecordId,
|
|
177
|
+
filters: filteredFilters
|
|
178
|
+
};
|
|
179
|
+
return new Promise((resolve, reject) => {
|
|
180
|
+
DataFetcher.DataFetcher.get()
|
|
181
|
+
.callGraphQL({
|
|
182
|
+
values,
|
|
183
|
+
query: this.templateByQuery.get("fetchDistinctColumn"),
|
|
184
|
+
})
|
|
185
|
+
.then((result) => {
|
|
186
|
+
resolve(result);
|
|
187
|
+
})
|
|
188
|
+
.catch((error) => {
|
|
189
|
+
reject(error);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
doLoadData(dataUnit, request) {
|
|
194
|
+
return new Promise((resolve, reject) => {
|
|
195
|
+
var _a;
|
|
196
|
+
const { sort, filters, limit, offset, quickFilter } = request;
|
|
197
|
+
const variables = { dataunit: dataUnit.name, sort, filters };
|
|
198
|
+
variables.limit = limit;
|
|
199
|
+
variables.offset = offset;
|
|
200
|
+
variables.parentRecordId = request.parentRecordId;
|
|
201
|
+
if (!core.StringUtils.isEmpty(quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.term)) {
|
|
202
|
+
if (variables.filter === undefined) {
|
|
203
|
+
variables.filter = [];
|
|
204
|
+
}
|
|
205
|
+
const quickFilterCriteria = {
|
|
206
|
+
name: "__QUICK_FILTER__",
|
|
207
|
+
expression: "__QUICK_FILTER__",
|
|
208
|
+
params: [{ name: "term", dataType: core.DataType.TEXT, value: quickFilter.term }]
|
|
209
|
+
};
|
|
210
|
+
if (((_a = quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.fields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
211
|
+
quickFilterCriteria.params.push({ name: "fields", dataType: core.DataType.OBJECT, value: quickFilter.fields });
|
|
212
|
+
}
|
|
213
|
+
variables.filter.push(quickFilterCriteria);
|
|
214
|
+
}
|
|
215
|
+
DataFetcher.DataFetcher.get()
|
|
216
|
+
.callGraphQL({
|
|
217
|
+
values: variables,
|
|
218
|
+
query: this.templateByQuery.get("fetchData"),
|
|
219
|
+
})
|
|
220
|
+
.then((resp) => {
|
|
221
|
+
const { limit, offset, total, hasMore, records } = resp.data;
|
|
222
|
+
let paginationInfo;
|
|
223
|
+
if (limit) {
|
|
224
|
+
const firstRecord = total == 0 ? 0 : offset + 1;
|
|
225
|
+
const lastRecord = offset + Math.min(records.length, limit);
|
|
226
|
+
const currentPage = offset / limit;
|
|
227
|
+
paginationInfo = {
|
|
228
|
+
firstRecord,
|
|
229
|
+
lastRecord,
|
|
230
|
+
total,
|
|
231
|
+
currentPage,
|
|
232
|
+
hasMore
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
const processedRecords = [];
|
|
236
|
+
records.forEach((responseRecord) => {
|
|
237
|
+
const duRecord = { __record__id__: responseRecord.id, __record__label__: responseRecord.label };
|
|
238
|
+
responseRecord.fields.forEach(({ name, value }) => {
|
|
239
|
+
duRecord[name] = dataUnit.valueFromString(name, value);
|
|
240
|
+
});
|
|
241
|
+
processedRecords.push(duRecord);
|
|
242
|
+
});
|
|
243
|
+
resolve({
|
|
244
|
+
paginationInfo,
|
|
245
|
+
records: processedRecords
|
|
246
|
+
});
|
|
247
|
+
})
|
|
248
|
+
.catch((error) => {
|
|
249
|
+
reject(error);
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
saveData(dataUnit, duChanges) {
|
|
254
|
+
const changes = duChanges.map((change) => {
|
|
255
|
+
const { dataUnit: changeDU, record, updatingFields, operation } = change;
|
|
256
|
+
const dataUnitInstance = core.DataUnitStorage.get(changeDU);
|
|
257
|
+
let parsedUpdatingFields;
|
|
258
|
+
if (updatingFields) {
|
|
259
|
+
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
|
260
|
+
const descriptor = dataUnitInstance.getField(fieldName);
|
|
261
|
+
const dataType = descriptor ? descriptor.dataType : core.DataType.TEXT;
|
|
262
|
+
return { fieldName, dataType, value: dataUnitInstance.valueToString(fieldName, value) };
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
const reqChange = { dataUnit: changeDU, fields: parsedUpdatingFields, operation, recordId: record.__record__id__ };
|
|
266
|
+
if (change.sourceId) {
|
|
267
|
+
reqChange.sourceId = change.sourceId;
|
|
268
|
+
}
|
|
269
|
+
if (record.__parent__record__id__) {
|
|
270
|
+
reqChange.parentRecordId = record.__parent__record__id__;
|
|
271
|
+
}
|
|
272
|
+
return reqChange;
|
|
273
|
+
});
|
|
274
|
+
return new Promise((resolve, reject) => {
|
|
275
|
+
const changesFormatted = changes.map((_a) => {
|
|
276
|
+
var rest = __rest(_a, []);
|
|
277
|
+
return rest;
|
|
278
|
+
});
|
|
279
|
+
DataFetcher.DataFetcher.get()
|
|
280
|
+
.callGraphQL({
|
|
281
|
+
values: { changes: changesFormatted },
|
|
282
|
+
query: this.templateByQuery.get("saveData"),
|
|
283
|
+
})
|
|
284
|
+
.then((resp) => {
|
|
285
|
+
const dataUnitRecords = [];
|
|
286
|
+
resp === null || resp === void 0 ? void 0 : resp.forEach((responseRecord) => {
|
|
287
|
+
const duRecord = {
|
|
288
|
+
__record__id__: responseRecord.id,
|
|
289
|
+
__record__label__: responseRecord.label,
|
|
290
|
+
__owner__dataunit__name__: responseRecord.ownerDataUnitName,
|
|
291
|
+
};
|
|
292
|
+
const dataUnitInstance = core.DataUnitStorage.get(duRecord.__owner__dataunit__name__) || dataUnit;
|
|
293
|
+
if (responseRecord.oldId) {
|
|
294
|
+
duRecord.__old__id__ = responseRecord.oldId;
|
|
295
|
+
}
|
|
296
|
+
responseRecord.fields.forEach(({ name, value }) => {
|
|
297
|
+
var _a;
|
|
298
|
+
duRecord[name] = ((_a = dataUnitInstance === null || dataUnitInstance === void 0 ? void 0 : dataUnitInstance.valueFromString) === null || _a === void 0 ? void 0 : _a.call(dataUnitInstance, name, value)) || value;
|
|
299
|
+
});
|
|
300
|
+
dataUnitRecords.push(duRecord);
|
|
301
|
+
});
|
|
302
|
+
resolve(dataUnitRecords);
|
|
303
|
+
})
|
|
304
|
+
.catch((error) => {
|
|
305
|
+
reject(error);
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
getTransientInfo(dataUnit, recordID) {
|
|
310
|
+
const { records } = dataUnit.getSelectionInfo();
|
|
311
|
+
return Object.entries(records.filter(record => record.__record__id__ == recordID)[0]).filter(([key]) => key.startsWith(UnitMetadata.DataUnitTransient.DATA_UNIT_TRANSIENT_PREFIX_NAME)).map(([name, value]) => ({ fieldName: name, value, dataType: core.DataType.TEXT }));
|
|
312
|
+
}
|
|
313
|
+
removeRecords(dataUnit, recordIds) {
|
|
314
|
+
const changes = recordIds.map((recordId) => {
|
|
315
|
+
return { dataUnit: dataUnit.name, operation: core.ChangeOperation.DELETE, recordId, fields: this.getTransientInfo(dataUnit, recordId) };
|
|
316
|
+
});
|
|
317
|
+
return new Promise((resolve, reject) => {
|
|
318
|
+
DataFetcher.DataFetcher.get()
|
|
319
|
+
.callGraphQL({
|
|
320
|
+
values: { changes: changes },
|
|
321
|
+
query: this.templateByQuery.get("saveData"),
|
|
322
|
+
})
|
|
323
|
+
.then((_resp) => {
|
|
324
|
+
resolve(recordIds);
|
|
325
|
+
})
|
|
326
|
+
.catch((error) => {
|
|
327
|
+
reject(error);
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
loadRecord(dataUnit, recordIds) {
|
|
332
|
+
return new Promise((resolve, reject) => {
|
|
333
|
+
DataFetcher.DataFetcher.get()
|
|
334
|
+
.callGraphQL({
|
|
335
|
+
values: { recordID: recordIds, dataunit: dataUnit.name },
|
|
336
|
+
query: this.templateByQuery.get("fetchDataRecord"),
|
|
337
|
+
})
|
|
338
|
+
.then((response) => {
|
|
339
|
+
const dataUnitRecords = [];
|
|
340
|
+
response.record.forEach(responseRecord => {
|
|
341
|
+
const duRecord = { __record__id__: responseRecord.id, __record__label__: responseRecord.label };
|
|
342
|
+
responseRecord.fields.forEach(({ name, value }) => {
|
|
343
|
+
duRecord[name] = dataUnit.valueFromString(name, value);
|
|
344
|
+
});
|
|
345
|
+
dataUnitRecords.push(duRecord);
|
|
346
|
+
});
|
|
347
|
+
resolve(dataUnitRecords);
|
|
348
|
+
})
|
|
349
|
+
.catch((error) => {
|
|
350
|
+
reject(error);
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
exports.DataUnitFetcher = DataUnitFetcher;
|
|
@@ -2148,6 +2148,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2148
2148
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2149
2149
|
/* webpackMode: "lazy" */
|
|
2150
2150
|
'./snk-client-confirm.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2151
|
+
case 'snk-custom-slot-elements.cjs':
|
|
2152
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2153
|
+
/* webpackMode: "lazy" */
|
|
2154
|
+
'./snk-custom-slot-elements.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2151
2155
|
case 'snk-entity-list.cjs':
|
|
2152
2156
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2153
2157
|
/* webpackMode: "lazy" */
|
|
@@ -2184,10 +2188,6 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2184
2188
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2185
2189
|
/* webpackMode: "lazy" */
|
|
2186
2190
|
'./snk-print-selector.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2187
|
-
case 'snk-taskbar-custom-elements.cjs':
|
|
2188
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2189
|
-
/* webpackMode: "lazy" */
|
|
2190
|
-
'./snk-taskbar-custom-elements.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2191
2191
|
case 'teste-pesquisa.cjs':
|
|
2192
2192
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2193
2193
|
/* webpackMode: "lazy" */
|