@sankhyalabs/sankhyablocks 1.3.6 → 1.3.9
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/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +119 -14
- package/dist/collection/components/snk-application/snk-application.js +172 -11
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +13 -7
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +28 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +23 -0
- package/dist/components/snk-application2.js +124 -15
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +119 -14
- package/dist/sankhyablocks/{p-89e9bc08.entry.js → p-44ea83e5.entry.js} +7 -5
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +13 -4
- package/dist/types/components.d.ts +10 -4
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +5 -1
- package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["snk-pesquisa.cjs",[[1,"snk-pesquisa",{"searchLoader":[16],"onSelectItem":[16],"argument":[1025]}]]],["snk-application.cjs",[[2,"snk-application",{"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["snk-pesquisa.cjs",[[1,"snk-pesquisa",{"searchLoader":[16],"onSelectItem":[16],"argument":[1025]}]]],["snk-application.cjs",[[2,"snk-application",{"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["snk-pesquisa.cjs",[[1,"snk-pesquisa",{"searchLoader":[16],"onSelectItem":[16],"argument":[1025]}]]],["snk-application.cjs",[[2,"snk-application",{"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
|
|
18
|
+
return index.bootstrapLazy([["snk-pesquisa.cjs",[[1,"snk-pesquisa",{"searchLoader":[16],"onSelectItem":[16],"argument":[1025]}]]],["snk-application.cjs",[[2,"snk-application",{"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
|
|
19
19
|
});
|
|
@@ -6757,19 +6757,22 @@ class DataUnitFetcher {
|
|
|
6757
6757
|
});
|
|
6758
6758
|
});
|
|
6759
6759
|
}
|
|
6760
|
-
loadData(dataUnit, page, sort,
|
|
6760
|
+
loadData(dataUnit, page, sort, filter) {
|
|
6761
6761
|
return new Promise((resolve, reject) => {
|
|
6762
|
-
const variables = { dataunit: dataUnit.name, sort,
|
|
6762
|
+
const variables = { dataunit: dataUnit.name, sort, filter };
|
|
6763
6763
|
if (page) {
|
|
6764
6764
|
variables.limit = page.limit;
|
|
6765
6765
|
variables.offset = page.offset;
|
|
6766
6766
|
}
|
|
6767
6767
|
if (!core.StringUtils.isEmpty(page === null || page === void 0 ? void 0 : page.quickFilter)) {
|
|
6768
|
-
variables.filter
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6768
|
+
if (variables.filter === undefined) {
|
|
6769
|
+
variables.filter = [];
|
|
6770
|
+
}
|
|
6771
|
+
variables.filter.push({
|
|
6772
|
+
name: "__ALL_SEARCHABLE_FIELDS__",
|
|
6773
|
+
expression: "__ALL_SEARCHABLE_FIELDS__",
|
|
6774
|
+
params: [{ name: "term", value: page.quickFilter }]
|
|
6775
|
+
});
|
|
6773
6776
|
}
|
|
6774
6777
|
DataFetcher.get()
|
|
6775
6778
|
.callGraphQL({
|
|
@@ -6859,6 +6862,9 @@ const formatValueToServer = (value) => {
|
|
|
6859
6862
|
if (value instanceof Date) {
|
|
6860
6863
|
return value.toString();
|
|
6861
6864
|
}
|
|
6865
|
+
if (typeof value === "string") {
|
|
6866
|
+
return value;
|
|
6867
|
+
}
|
|
6862
6868
|
//Any others objects
|
|
6863
6869
|
value = JSON.stringify(value);
|
|
6864
6870
|
}
|
|
@@ -6945,6 +6951,9 @@ class ResourceFetcher {
|
|
|
6945
6951
|
resource
|
|
6946
6952
|
}
|
|
6947
6953
|
}`);
|
|
6954
|
+
this.templateByQuery.set("saveResource", dist.gql `mutation($resource: ResourceToSave!) {
|
|
6955
|
+
$queryAlias$: saveResource(resource: $resource)
|
|
6956
|
+
}`);
|
|
6948
6957
|
}
|
|
6949
6958
|
loadResource(name) {
|
|
6950
6959
|
return new Promise((resolve, reject) => {
|
|
@@ -6961,6 +6970,26 @@ class ResourceFetcher {
|
|
|
6961
6970
|
});
|
|
6962
6971
|
});
|
|
6963
6972
|
}
|
|
6973
|
+
saveResource(resource, name) {
|
|
6974
|
+
return new Promise((resolve, reject) => {
|
|
6975
|
+
DataFetcher.get()
|
|
6976
|
+
.callGraphQL({
|
|
6977
|
+
values: {
|
|
6978
|
+
resource: {
|
|
6979
|
+
name: name,
|
|
6980
|
+
resource: JSON.stringify(resource)
|
|
6981
|
+
}
|
|
6982
|
+
},
|
|
6983
|
+
query: this.templateByQuery.get("saveResource")
|
|
6984
|
+
})
|
|
6985
|
+
.then((resp) => {
|
|
6986
|
+
resolve(resp);
|
|
6987
|
+
})
|
|
6988
|
+
.catch((error) => {
|
|
6989
|
+
reject(error);
|
|
6990
|
+
});
|
|
6991
|
+
});
|
|
6992
|
+
}
|
|
6964
6993
|
}
|
|
6965
6994
|
|
|
6966
6995
|
class FormConfigFetcher extends ResourceFetcher {
|
|
@@ -6988,6 +7017,35 @@ class FormConfigFetcher extends ResourceFetcher {
|
|
|
6988
7017
|
}
|
|
6989
7018
|
}
|
|
6990
7019
|
|
|
7020
|
+
class GridConfigFetcher extends ResourceFetcher {
|
|
7021
|
+
getConfig(resourceID) {
|
|
7022
|
+
const completePath = `cfg://grid/GrdCfgHtml5:${resourceID}`;
|
|
7023
|
+
return new Promise((resolve, reject) => {
|
|
7024
|
+
this.loadResource(completePath)
|
|
7025
|
+
.then(loadedResource => {
|
|
7026
|
+
if (loadedResource) {
|
|
7027
|
+
let config = JSON.parse(loadedResource);
|
|
7028
|
+
resolve(config);
|
|
7029
|
+
}
|
|
7030
|
+
}).catch((error) => {
|
|
7031
|
+
reject(error);
|
|
7032
|
+
});
|
|
7033
|
+
});
|
|
7034
|
+
}
|
|
7035
|
+
saveConfig(config, resourceID) {
|
|
7036
|
+
const completePath = `cfg://grid/GrdCfgHtml5:${resourceID}`;
|
|
7037
|
+
return new Promise((resolve, reject) => {
|
|
7038
|
+
this.saveResource(config, completePath)
|
|
7039
|
+
.then((resp) => {
|
|
7040
|
+
resolve(resp);
|
|
7041
|
+
})
|
|
7042
|
+
.catch((error) => {
|
|
7043
|
+
reject(error);
|
|
7044
|
+
});
|
|
7045
|
+
});
|
|
7046
|
+
}
|
|
7047
|
+
}
|
|
7048
|
+
|
|
6991
7049
|
class PesquisaFetcher {
|
|
6992
7050
|
constructor() {
|
|
6993
7051
|
this.templateByQuery = new Map();
|
|
@@ -7139,6 +7197,41 @@ const SnkApplication = class {
|
|
|
7139
7197
|
});
|
|
7140
7198
|
});
|
|
7141
7199
|
}
|
|
7200
|
+
async getConfig(key) {
|
|
7201
|
+
let payload = {
|
|
7202
|
+
"serviceName": "SystemUtilsSP.getConf",
|
|
7203
|
+
"requestBody": {
|
|
7204
|
+
"config": {
|
|
7205
|
+
"chave": key,
|
|
7206
|
+
"tipo": "T"
|
|
7207
|
+
}
|
|
7208
|
+
}
|
|
7209
|
+
};
|
|
7210
|
+
return new Promise((resolve, reject) => {
|
|
7211
|
+
DataFetcher.get()
|
|
7212
|
+
.callServiceBroker("SystemUtilsSP.getConf", JSON.stringify(payload))
|
|
7213
|
+
.then(result => { var _a; return resolve((_a = result.config) === null || _a === void 0 ? void 0 : _a.data); })
|
|
7214
|
+
.catch(error => reject(error));
|
|
7215
|
+
});
|
|
7216
|
+
}
|
|
7217
|
+
async saveConfig(key, data) {
|
|
7218
|
+
let payload = {
|
|
7219
|
+
"serviceName": "SystemUtilsSP.saveConf",
|
|
7220
|
+
"requestBody": {
|
|
7221
|
+
"config": {
|
|
7222
|
+
"chave": key,
|
|
7223
|
+
"tipo": "T",
|
|
7224
|
+
data
|
|
7225
|
+
}
|
|
7226
|
+
}
|
|
7227
|
+
};
|
|
7228
|
+
return new Promise((resolve, reject) => {
|
|
7229
|
+
DataFetcher.get()
|
|
7230
|
+
.callServiceBroker("SystemUtilsSP.saveConf", JSON.stringify(payload))
|
|
7231
|
+
.then(result => resolve(result))
|
|
7232
|
+
.catch(error => reject(error));
|
|
7233
|
+
});
|
|
7234
|
+
}
|
|
7142
7235
|
async getAttributeFromHTMLWrapper(attribName) {
|
|
7143
7236
|
return Promise.resolve(window[attribName]);
|
|
7144
7237
|
}
|
|
@@ -7155,21 +7248,27 @@ const SnkApplication = class {
|
|
|
7155
7248
|
async getResourceID() {
|
|
7156
7249
|
return Promise.resolve(this.resourceID);
|
|
7157
7250
|
}
|
|
7158
|
-
async alert(title, message, icon) {
|
|
7159
|
-
return utils.ApplicationUtils.alert(title, message, icon);
|
|
7251
|
+
async alert(title, message, icon, options) {
|
|
7252
|
+
return utils.ApplicationUtils.alert(title, message, icon, options);
|
|
7160
7253
|
}
|
|
7161
|
-
async error(title, message, icon) {
|
|
7162
|
-
return utils.ApplicationUtils.error(title, message, icon);
|
|
7254
|
+
async error(title, message, icon, options) {
|
|
7255
|
+
return utils.ApplicationUtils.error(title, message, icon, options);
|
|
7163
7256
|
}
|
|
7164
|
-
async confirm(title, message, icon, critical) {
|
|
7165
|
-
return utils.ApplicationUtils.confirm(title, message, icon, critical);
|
|
7257
|
+
async confirm(title, message, icon, critical, options) {
|
|
7258
|
+
return utils.ApplicationUtils.confirm(title, message, icon, critical, options);
|
|
7166
7259
|
}
|
|
7167
|
-
async info(message, options
|
|
7260
|
+
async info(message, options) {
|
|
7168
7261
|
return utils.ApplicationUtils.info(message, options);
|
|
7169
7262
|
}
|
|
7170
7263
|
async loadFormConfig(name) {
|
|
7171
7264
|
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
7172
7265
|
}
|
|
7266
|
+
async loadGridConfig() {
|
|
7267
|
+
return this.gridConfigFetcher.getConfig(this.resourceID);
|
|
7268
|
+
}
|
|
7269
|
+
async saveGridConfig(config) {
|
|
7270
|
+
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
7271
|
+
}
|
|
7173
7272
|
get urlParams() {
|
|
7174
7273
|
if (!this._urlParams) {
|
|
7175
7274
|
this._urlParams = UrlUtils.getQueryParams(location.search);
|
|
@@ -7188,6 +7287,12 @@ const SnkApplication = class {
|
|
|
7188
7287
|
}
|
|
7189
7288
|
return this._formConfigFetcher;
|
|
7190
7289
|
}
|
|
7290
|
+
get gridConfigFetcher() {
|
|
7291
|
+
if (!this._gridConfigFetcher) {
|
|
7292
|
+
this._gridConfigFetcher = new GridConfigFetcher();
|
|
7293
|
+
}
|
|
7294
|
+
return this._gridConfigFetcher;
|
|
7295
|
+
}
|
|
7191
7296
|
get pesquisaFetcher() {
|
|
7192
7297
|
if (!this._pesquisaFetcher) {
|
|
7193
7298
|
this._pesquisaFetcher = new PesquisaFetcher();
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Component, h, Method, Event } from "@stencil/core";
|
|
2
2
|
import { DataType } from "@sankhyalabs/core";
|
|
3
3
|
import DataUnitFetcher from "../../lib/http/data-fetcher/fetchers/dataunit-fetcher";
|
|
4
|
+
import { DataFetcher } from "../../lib/http/data-fetcher/DataFetcher";
|
|
4
5
|
import UrlUtils from "../../lib/utils/urlutils";
|
|
5
6
|
import Workspace from "../../lib/workspace/workspace";
|
|
6
7
|
import ParametersFetcher from "../../lib/http/data-fetcher/fetchers/parameters-fecher";
|
|
7
8
|
import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
|
8
9
|
import { FormConfigFetcher } from "../../lib/http/data-fetcher/fetchers/form-config-fetcher";
|
|
9
10
|
import { ApplicationContext } from "@sankhyalabs/core";
|
|
11
|
+
import GridConfigFetcher from "../../lib/http/data-fetcher/fetchers/grid-config-fetcher";
|
|
10
12
|
import { PesquisaFetcher } from "../../lib/http/data-fetcher/fetchers/pesquisa-fetcher";
|
|
11
13
|
import { DependencyType } from "@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";
|
|
12
14
|
export class SnkApplication {
|
|
@@ -73,6 +75,41 @@ export class SnkApplication {
|
|
|
73
75
|
});
|
|
74
76
|
});
|
|
75
77
|
}
|
|
78
|
+
async getConfig(key) {
|
|
79
|
+
let payload = {
|
|
80
|
+
"serviceName": "SystemUtilsSP.getConf",
|
|
81
|
+
"requestBody": {
|
|
82
|
+
"config": {
|
|
83
|
+
"chave": key,
|
|
84
|
+
"tipo": "T"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
return new Promise((resolve, reject) => {
|
|
89
|
+
DataFetcher.get()
|
|
90
|
+
.callServiceBroker("SystemUtilsSP.getConf", JSON.stringify(payload))
|
|
91
|
+
.then(result => { var _a; return resolve((_a = result.config) === null || _a === void 0 ? void 0 : _a.data); })
|
|
92
|
+
.catch(error => reject(error));
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
async saveConfig(key, data) {
|
|
96
|
+
let payload = {
|
|
97
|
+
"serviceName": "SystemUtilsSP.saveConf",
|
|
98
|
+
"requestBody": {
|
|
99
|
+
"config": {
|
|
100
|
+
"chave": key,
|
|
101
|
+
"tipo": "T",
|
|
102
|
+
data
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return new Promise((resolve, reject) => {
|
|
107
|
+
DataFetcher.get()
|
|
108
|
+
.callServiceBroker("SystemUtilsSP.saveConf", JSON.stringify(payload))
|
|
109
|
+
.then(result => resolve(result))
|
|
110
|
+
.catch(error => reject(error));
|
|
111
|
+
});
|
|
112
|
+
}
|
|
76
113
|
async getAttributeFromHTMLWrapper(attribName) {
|
|
77
114
|
return Promise.resolve(window[attribName]);
|
|
78
115
|
}
|
|
@@ -89,21 +126,27 @@ export class SnkApplication {
|
|
|
89
126
|
async getResourceID() {
|
|
90
127
|
return Promise.resolve(this.resourceID);
|
|
91
128
|
}
|
|
92
|
-
async alert(title, message, icon) {
|
|
93
|
-
return ApplicationUtils.alert(title, message, icon);
|
|
129
|
+
async alert(title, message, icon, options) {
|
|
130
|
+
return ApplicationUtils.alert(title, message, icon, options);
|
|
94
131
|
}
|
|
95
|
-
async error(title, message, icon) {
|
|
96
|
-
return ApplicationUtils.error(title, message, icon);
|
|
132
|
+
async error(title, message, icon, options) {
|
|
133
|
+
return ApplicationUtils.error(title, message, icon, options);
|
|
97
134
|
}
|
|
98
|
-
async confirm(title, message, icon, critical) {
|
|
99
|
-
return ApplicationUtils.confirm(title, message, icon, critical);
|
|
135
|
+
async confirm(title, message, icon, critical, options) {
|
|
136
|
+
return ApplicationUtils.confirm(title, message, icon, critical, options);
|
|
100
137
|
}
|
|
101
|
-
async info(message, options
|
|
138
|
+
async info(message, options) {
|
|
102
139
|
return ApplicationUtils.info(message, options);
|
|
103
140
|
}
|
|
104
141
|
async loadFormConfig(name) {
|
|
105
142
|
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
106
143
|
}
|
|
144
|
+
async loadGridConfig() {
|
|
145
|
+
return this.gridConfigFetcher.getConfig(this.resourceID);
|
|
146
|
+
}
|
|
147
|
+
async saveGridConfig(config) {
|
|
148
|
+
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
149
|
+
}
|
|
107
150
|
get urlParams() {
|
|
108
151
|
if (!this._urlParams) {
|
|
109
152
|
this._urlParams = UrlUtils.getQueryParams(location.search);
|
|
@@ -122,6 +165,12 @@ export class SnkApplication {
|
|
|
122
165
|
}
|
|
123
166
|
return this._formConfigFetcher;
|
|
124
167
|
}
|
|
168
|
+
get gridConfigFetcher() {
|
|
169
|
+
if (!this._gridConfigFetcher) {
|
|
170
|
+
this._gridConfigFetcher = new GridConfigFetcher();
|
|
171
|
+
}
|
|
172
|
+
return this._gridConfigFetcher;
|
|
173
|
+
}
|
|
125
174
|
get pesquisaFetcher() {
|
|
126
175
|
if (!this._pesquisaFetcher) {
|
|
127
176
|
this._pesquisaFetcher = new PesquisaFetcher();
|
|
@@ -381,6 +430,50 @@ export class SnkApplication {
|
|
|
381
430
|
"tags": []
|
|
382
431
|
}
|
|
383
432
|
},
|
|
433
|
+
"getConfig": {
|
|
434
|
+
"complexType": {
|
|
435
|
+
"signature": "(key: string) => Promise<any>",
|
|
436
|
+
"parameters": [{
|
|
437
|
+
"tags": [],
|
|
438
|
+
"text": ""
|
|
439
|
+
}],
|
|
440
|
+
"references": {
|
|
441
|
+
"Promise": {
|
|
442
|
+
"location": "global"
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
"return": "Promise<any>"
|
|
446
|
+
},
|
|
447
|
+
"docs": {
|
|
448
|
+
"text": "",
|
|
449
|
+
"tags": []
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"saveConfig": {
|
|
453
|
+
"complexType": {
|
|
454
|
+
"signature": "(key: string, data: Object) => Promise<any>",
|
|
455
|
+
"parameters": [{
|
|
456
|
+
"tags": [],
|
|
457
|
+
"text": ""
|
|
458
|
+
}, {
|
|
459
|
+
"tags": [],
|
|
460
|
+
"text": ""
|
|
461
|
+
}],
|
|
462
|
+
"references": {
|
|
463
|
+
"Promise": {
|
|
464
|
+
"location": "global"
|
|
465
|
+
},
|
|
466
|
+
"Object": {
|
|
467
|
+
"location": "global"
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
"return": "Promise<any>"
|
|
471
|
+
},
|
|
472
|
+
"docs": {
|
|
473
|
+
"text": "",
|
|
474
|
+
"tags": []
|
|
475
|
+
}
|
|
476
|
+
},
|
|
384
477
|
"getAttributeFromHTMLWrapper": {
|
|
385
478
|
"complexType": {
|
|
386
479
|
"signature": "(attribName: string) => Promise<string>",
|
|
@@ -466,7 +559,7 @@ export class SnkApplication {
|
|
|
466
559
|
},
|
|
467
560
|
"alert": {
|
|
468
561
|
"complexType": {
|
|
469
|
-
"signature": "(title: string, message: string, icon?: string) => Promise<boolean>",
|
|
562
|
+
"signature": "(title: string, message: string, icon?: string, options?: MessageOptions) => Promise<boolean>",
|
|
470
563
|
"parameters": [{
|
|
471
564
|
"tags": [],
|
|
472
565
|
"text": ""
|
|
@@ -476,10 +569,17 @@ export class SnkApplication {
|
|
|
476
569
|
}, {
|
|
477
570
|
"tags": [],
|
|
478
571
|
"text": ""
|
|
572
|
+
}, {
|
|
573
|
+
"tags": [],
|
|
574
|
+
"text": ""
|
|
479
575
|
}],
|
|
480
576
|
"references": {
|
|
481
577
|
"Promise": {
|
|
482
578
|
"location": "global"
|
|
579
|
+
},
|
|
580
|
+
"MessageOptions": {
|
|
581
|
+
"location": "import",
|
|
582
|
+
"path": "@sankhyalabs/ezui/dist/collection/utils"
|
|
483
583
|
}
|
|
484
584
|
},
|
|
485
585
|
"return": "Promise<boolean>"
|
|
@@ -491,7 +591,7 @@ export class SnkApplication {
|
|
|
491
591
|
},
|
|
492
592
|
"error": {
|
|
493
593
|
"complexType": {
|
|
494
|
-
"signature": "(title: string, message: string, icon?: string) => Promise<boolean>",
|
|
594
|
+
"signature": "(title: string, message: string, icon?: string, options?: MessageOptions) => Promise<boolean>",
|
|
495
595
|
"parameters": [{
|
|
496
596
|
"tags": [],
|
|
497
597
|
"text": ""
|
|
@@ -501,10 +601,17 @@ export class SnkApplication {
|
|
|
501
601
|
}, {
|
|
502
602
|
"tags": [],
|
|
503
603
|
"text": ""
|
|
604
|
+
}, {
|
|
605
|
+
"tags": [],
|
|
606
|
+
"text": ""
|
|
504
607
|
}],
|
|
505
608
|
"references": {
|
|
506
609
|
"Promise": {
|
|
507
610
|
"location": "global"
|
|
611
|
+
},
|
|
612
|
+
"MessageOptions": {
|
|
613
|
+
"location": "import",
|
|
614
|
+
"path": "@sankhyalabs/ezui/dist/collection/utils"
|
|
508
615
|
}
|
|
509
616
|
},
|
|
510
617
|
"return": "Promise<boolean>"
|
|
@@ -516,7 +623,7 @@ export class SnkApplication {
|
|
|
516
623
|
},
|
|
517
624
|
"confirm": {
|
|
518
625
|
"complexType": {
|
|
519
|
-
"signature": "(title: string, message: string, icon?: string, critical?: boolean) => Promise<boolean>",
|
|
626
|
+
"signature": "(title: string, message: string, icon?: string, critical?: boolean, options?: MessageOptions) => Promise<boolean>",
|
|
520
627
|
"parameters": [{
|
|
521
628
|
"tags": [],
|
|
522
629
|
"text": ""
|
|
@@ -529,10 +636,17 @@ export class SnkApplication {
|
|
|
529
636
|
}, {
|
|
530
637
|
"tags": [],
|
|
531
638
|
"text": ""
|
|
639
|
+
}, {
|
|
640
|
+
"tags": [],
|
|
641
|
+
"text": ""
|
|
532
642
|
}],
|
|
533
643
|
"references": {
|
|
534
644
|
"Promise": {
|
|
535
645
|
"location": "global"
|
|
646
|
+
},
|
|
647
|
+
"MessageOptions": {
|
|
648
|
+
"location": "import",
|
|
649
|
+
"path": "@sankhyalabs/ezui/dist/collection/utils"
|
|
536
650
|
}
|
|
537
651
|
},
|
|
538
652
|
"return": "Promise<boolean>"
|
|
@@ -544,7 +658,7 @@ export class SnkApplication {
|
|
|
544
658
|
},
|
|
545
659
|
"info": {
|
|
546
660
|
"complexType": {
|
|
547
|
-
"signature": "(message: string, options?:
|
|
661
|
+
"signature": "(message: string, options?: MessageOptions) => Promise<void>",
|
|
548
662
|
"parameters": [{
|
|
549
663
|
"tags": [],
|
|
550
664
|
"text": ""
|
|
@@ -555,6 +669,10 @@ export class SnkApplication {
|
|
|
555
669
|
"references": {
|
|
556
670
|
"Promise": {
|
|
557
671
|
"location": "global"
|
|
672
|
+
},
|
|
673
|
+
"MessageOptions": {
|
|
674
|
+
"location": "import",
|
|
675
|
+
"path": "@sankhyalabs/ezui/dist/collection/utils"
|
|
558
676
|
}
|
|
559
677
|
},
|
|
560
678
|
"return": "Promise<void>"
|
|
@@ -589,6 +707,49 @@ export class SnkApplication {
|
|
|
589
707
|
"text": "",
|
|
590
708
|
"tags": []
|
|
591
709
|
}
|
|
710
|
+
},
|
|
711
|
+
"loadGridConfig": {
|
|
712
|
+
"complexType": {
|
|
713
|
+
"signature": "() => Promise<EzGridConfig>",
|
|
714
|
+
"parameters": [],
|
|
715
|
+
"references": {
|
|
716
|
+
"Promise": {
|
|
717
|
+
"location": "global"
|
|
718
|
+
},
|
|
719
|
+
"EzGridConfig": {
|
|
720
|
+
"location": "import",
|
|
721
|
+
"path": "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController"
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
"return": "Promise<EzGridConfig>"
|
|
725
|
+
},
|
|
726
|
+
"docs": {
|
|
727
|
+
"text": "",
|
|
728
|
+
"tags": []
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
"saveGridConfig": {
|
|
732
|
+
"complexType": {
|
|
733
|
+
"signature": "(config: EzGridConfig) => Promise<boolean>",
|
|
734
|
+
"parameters": [{
|
|
735
|
+
"tags": [],
|
|
736
|
+
"text": ""
|
|
737
|
+
}],
|
|
738
|
+
"references": {
|
|
739
|
+
"Promise": {
|
|
740
|
+
"location": "global"
|
|
741
|
+
},
|
|
742
|
+
"EzGridConfig": {
|
|
743
|
+
"location": "import",
|
|
744
|
+
"path": "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController"
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
"return": "Promise<boolean>"
|
|
748
|
+
},
|
|
749
|
+
"docs": {
|
|
750
|
+
"text": "",
|
|
751
|
+
"tags": []
|
|
752
|
+
}
|
|
592
753
|
}
|
|
593
754
|
}; }
|
|
594
755
|
}
|
|
@@ -96,19 +96,22 @@ export default class DataUnitFetcher {
|
|
|
96
96
|
});
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
loadData(dataUnit, page, sort,
|
|
99
|
+
loadData(dataUnit, page, sort, filter) {
|
|
100
100
|
return new Promise((resolve, reject) => {
|
|
101
|
-
const variables = { dataunit: dataUnit.name, sort,
|
|
101
|
+
const variables = { dataunit: dataUnit.name, sort, filter };
|
|
102
102
|
if (page) {
|
|
103
103
|
variables.limit = page.limit;
|
|
104
104
|
variables.offset = page.offset;
|
|
105
105
|
}
|
|
106
106
|
if (!StringUtils.isEmpty(page === null || page === void 0 ? void 0 : page.quickFilter)) {
|
|
107
|
-
variables.filter
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
if (variables.filter === undefined) {
|
|
108
|
+
variables.filter = [];
|
|
109
|
+
}
|
|
110
|
+
variables.filter.push({
|
|
111
|
+
name: "__ALL_SEARCHABLE_FIELDS__",
|
|
112
|
+
expression: "__ALL_SEARCHABLE_FIELDS__",
|
|
113
|
+
params: [{ name: "term", value: page.quickFilter }]
|
|
114
|
+
});
|
|
112
115
|
}
|
|
113
116
|
DataFetcher.get()
|
|
114
117
|
.callGraphQL({
|
|
@@ -198,6 +201,9 @@ export const formatValueToServer = (value) => {
|
|
|
198
201
|
if (value instanceof Date) {
|
|
199
202
|
return value.toString();
|
|
200
203
|
}
|
|
204
|
+
if (typeof value === "string") {
|
|
205
|
+
return value;
|
|
206
|
+
}
|
|
201
207
|
//Any others objects
|
|
202
208
|
value = JSON.stringify(value);
|
|
203
209
|
}
|
|
@@ -1,2 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import { ResourceFetcher } from "./resource-fetcher";
|
|
2
|
+
export default class GridConfigFetcher extends ResourceFetcher {
|
|
3
|
+
getConfig(resourceID) {
|
|
4
|
+
const completePath = `cfg://grid/GrdCfgHtml5:${resourceID}`;
|
|
5
|
+
return new Promise((resolve, reject) => {
|
|
6
|
+
this.loadResource(completePath)
|
|
7
|
+
.then(loadedResource => {
|
|
8
|
+
if (loadedResource) {
|
|
9
|
+
let config = JSON.parse(loadedResource);
|
|
10
|
+
resolve(config);
|
|
11
|
+
}
|
|
12
|
+
}).catch((error) => {
|
|
13
|
+
reject(error);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
saveConfig(config, resourceID) {
|
|
18
|
+
const completePath = `cfg://grid/GrdCfgHtml5:${resourceID}`;
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
this.saveResource(config, completePath)
|
|
21
|
+
.then((resp) => {
|
|
22
|
+
resolve(resp);
|
|
23
|
+
})
|
|
24
|
+
.catch((error) => {
|
|
25
|
+
reject(error);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
2
29
|
}
|
|
@@ -11,6 +11,9 @@ export class ResourceFetcher {
|
|
|
11
11
|
resource
|
|
12
12
|
}
|
|
13
13
|
}`);
|
|
14
|
+
this.templateByQuery.set("saveResource", gql `mutation($resource: ResourceToSave!) {
|
|
15
|
+
$queryAlias$: saveResource(resource: $resource)
|
|
16
|
+
}`);
|
|
14
17
|
}
|
|
15
18
|
loadResource(name) {
|
|
16
19
|
return new Promise((resolve, reject) => {
|
|
@@ -27,4 +30,24 @@ export class ResourceFetcher {
|
|
|
27
30
|
});
|
|
28
31
|
});
|
|
29
32
|
}
|
|
33
|
+
saveResource(resource, name) {
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
DataFetcher.get()
|
|
36
|
+
.callGraphQL({
|
|
37
|
+
values: {
|
|
38
|
+
resource: {
|
|
39
|
+
name: name,
|
|
40
|
+
resource: JSON.stringify(resource)
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
query: this.templateByQuery.get("saveResource")
|
|
44
|
+
})
|
|
45
|
+
.then((resp) => {
|
|
46
|
+
resolve(resp);
|
|
47
|
+
})
|
|
48
|
+
.catch((error) => {
|
|
49
|
+
reject(error);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
30
53
|
}
|