sf-i-reporting 1.0.96 → 1.0.98
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/package.json +2 -2
- package/sf-i-reporting.d.ts +1 -0
- package/sf-i-reporting.d.ts.map +1 -1
- package/sf-i-reporting.js +64 -37
- package/sf-i-reporting.js.map +1 -1
- package/src/sf-i-reporting.ts +60 -27
- package/src/util.ts +5 -1
- package/util.d.ts +2 -0
- package/util.d.ts.map +1 -1
- package/util.js +4 -1
- package/util.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sf-i-reporting",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.98",
|
|
5
5
|
"description": "Superflows Reporting Component",
|
|
6
6
|
"main": "sf-i-reporting.js",
|
|
7
7
|
"module": "sf-i-reporting.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"sf-i-elastic-text": "^1.0.17",
|
|
59
59
|
"sf-i-form": "^1.0.184",
|
|
60
60
|
"sf-i-select": "^1.0.93",
|
|
61
|
-
"sf-i-uploader": "^1.0.
|
|
61
|
+
"sf-i-uploader": "^1.0.118",
|
|
62
62
|
"sinon": "^15.0.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
package/sf-i-reporting.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ export declare class SfIReporting extends LitElement {
|
|
|
88
88
|
deleteClick: () => void;
|
|
89
89
|
deleteCancelClick: () => void;
|
|
90
90
|
deleteConfirmClick: () => void;
|
|
91
|
+
getSchema: () => any;
|
|
91
92
|
getBricksValues: (element: DataObject, selectedValues?: string[]) => any[][];
|
|
92
93
|
initListeners: () => void;
|
|
93
94
|
initListListeners: () => void;
|
package/sf-i-reporting.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sf-i-reporting.d.ts","sourceRoot":"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C,GAAG,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,IAAI;IAMnG,iBAAiB;IAIjB,MAAM;CAyKhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|
package/sf-i-reporting.js
CHANGED
|
@@ -183,7 +183,7 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
183
183
|
: subString) + "…";
|
|
184
184
|
};
|
|
185
185
|
this.selectedValues = () => {
|
|
186
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
186
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
187
187
|
let valueObj = {};
|
|
188
188
|
let reportingArr = [];
|
|
189
189
|
for (let element of this.dataModel) {
|
|
@@ -287,12 +287,11 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
287
287
|
else if (element.type == "sf-checklist") {
|
|
288
288
|
let checklist = this._SfReportingContainer.querySelector('#' + element.id);
|
|
289
289
|
console.log('checklist selected values');
|
|
290
|
-
if (this.mode == "admin" && this.flow != "reporting") {
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
290
|
+
// if (this.mode == "admin" && this.flow != "reporting") {
|
|
291
|
+
// valueObj[element.id] = checklist.listelements ?? "";
|
|
292
|
+
// } else {
|
|
293
|
+
valueObj[element.id] = (_q = checklist.selectedValues()) !== null && _q !== void 0 ? _q : "";
|
|
294
|
+
// }
|
|
296
295
|
console.log('checklist selected values', valueObj[element.id]);
|
|
297
296
|
}
|
|
298
297
|
else {
|
|
@@ -364,6 +363,23 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
364
363
|
this.deleteConfirmClick = () => {
|
|
365
364
|
this.submitDelete();
|
|
366
365
|
};
|
|
366
|
+
this.getSchema = () => {
|
|
367
|
+
let schema = this.getConfigJson();
|
|
368
|
+
for (let element of this.dataModel) {
|
|
369
|
+
if (element.type == 'sf-checklist') {
|
|
370
|
+
console.log('schema element', element);
|
|
371
|
+
for (let [i, schemaElement] of schema.entries()) {
|
|
372
|
+
if (schemaElement.id == element.id) {
|
|
373
|
+
schemaElement.elementsjson = element.elementsjson;
|
|
374
|
+
schema[i] = schemaElement;
|
|
375
|
+
console.log('schema schemaelement', schemaElement, schema[i]);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
console.log('returning Schema', schema);
|
|
381
|
+
return schema;
|
|
382
|
+
};
|
|
367
383
|
this.getBricksValues = (element, selectedValues = []) => {
|
|
368
384
|
let names = [];
|
|
369
385
|
let ids = [];
|
|
@@ -618,12 +634,12 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
618
634
|
</div>
|
|
619
635
|
</div>`;
|
|
620
636
|
}
|
|
621
|
-
if (this.showterminate == "true") {
|
|
637
|
+
if (this.showterminate == "true" || this.flow != "reporting") {
|
|
622
638
|
html += `
|
|
623
639
|
<div part="terminate-container" class="d-flex flex-col flex-grow">
|
|
624
640
|
|
|
625
641
|
<div class="d-flex" part=${this.terminated ? "terminate-container-terminated" : "terminate-container-active"} id="terminate-container">
|
|
626
|
-
<input type="checkbox" id="input-terminate-checkbox" class="input-terminate-checkbox" part="input-terminate-checkbox" ${this.terminated ? "checked" : ""}>
|
|
642
|
+
<input type="checkbox" id="input-terminate-checkbox" class="input-terminate-checkbox" part="input-terminate-checkbox" ${this.terminated ? "checked" : ""} ${(this.editdisable == "true" || this.flow != "reporting") ? "disabled" : ""}>
|
|
627
643
|
<label id="input-terminate-checkbox-label" for="input-terminate-checkbox" part="textarea-label">Terminate</label>
|
|
628
644
|
</div>
|
|
629
645
|
</div>`;
|
|
@@ -816,23 +832,33 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
816
832
|
console.log('rendering sf-checklist', element.id, JSON.stringify(element.value));
|
|
817
833
|
await customElements.whenDefined('sf-checklist');
|
|
818
834
|
let checklist = this._SfReportingContainer.querySelector('#' + element.id);
|
|
819
|
-
if (this.mode == 'admin' && this.flow != "reporting") {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
835
|
+
// if (this.mode == 'admin' && this.flow != "reporting") {
|
|
836
|
+
// // if(this.flow == "edit"){
|
|
837
|
+
// // checklist.listelements = element.elementsjson != '' ? JSON.parse(element.elementsjson) : []
|
|
838
|
+
// let tempSelection: {[key:string]:boolean} = {}
|
|
839
|
+
// console.log('checklist edit', element.elementsjson);
|
|
840
|
+
// for(let itemname of element.elementsjson != '' ? JSON.parse(element.elementsjson) : []){
|
|
841
|
+
// tempSelection[itemname] = false
|
|
842
|
+
// }
|
|
843
|
+
// checklist.listselection = tempSelection
|
|
844
|
+
// console.log('checklist edit', element.value, tempSelection);
|
|
845
|
+
// // }else{
|
|
846
|
+
// // checklist.listelements = element.elementsjson != '' ? JSON.parse(element.elementsjson) : []
|
|
847
|
+
// // }
|
|
848
|
+
// } else {
|
|
849
|
+
// checklist.listelements = element.elementsjson != '' ? JSON.parse(element.elementsjson) : (element.value != '' ? element.value : [])
|
|
850
|
+
let tempSelection = {};
|
|
851
|
+
for (let itemname of element.elementsjson != '' ? JSON.parse(element.elementsjson) : (element.value != '' ? element.value : [])) {
|
|
852
|
+
tempSelection[itemname] = false;
|
|
853
|
+
}
|
|
854
|
+
console.log('checklist reporting', element.value, tempSelection);
|
|
855
|
+
checklist.listselection = Util.isPlainObject(element.value) ? element.value : tempSelection;
|
|
856
|
+
// }
|
|
831
857
|
checklist.readonly = (this.mode == "view" || this.flow == "details");
|
|
832
858
|
checklist.mode = (this.mode == "view" || this.flow == "details") ? "view" : this.mode;
|
|
833
859
|
// console.log('sf-checklist', checklist.listelements, checklist.readonly, this.mode, this.flow);
|
|
834
860
|
setTimeout(() => {
|
|
835
|
-
console.log('sf-checklist', checklist.listelements, checklist.listselection, element.
|
|
861
|
+
console.log('sf-checklist', checklist.listelements, checklist.listselection, element.elementsjson, this.mode, this.flow, checklist.mode);
|
|
836
862
|
checklist.loadMode();
|
|
837
863
|
}, 200);
|
|
838
864
|
}
|
|
@@ -1190,12 +1216,11 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
1190
1216
|
}
|
|
1191
1217
|
}
|
|
1192
1218
|
else if (element.type == "sf-checklist") {
|
|
1193
|
-
if (this.mode == 'admin') {
|
|
1194
|
-
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
}
|
|
1219
|
+
// if (this.mode == 'admin' && this.flow == "edit") {
|
|
1220
|
+
// this.dataModel[i].elementsjson = (this.getPrepopulateJson()[element.id] != null ? JSON.stringify(this.getPrepopulateJson()[element.id]) : '')
|
|
1221
|
+
// } else {
|
|
1222
|
+
this.dataModel[i].value = (_j = this.getPrepopulateJson()[element.id]) !== null && _j !== void 0 ? _j : [];
|
|
1223
|
+
// }
|
|
1199
1224
|
}
|
|
1200
1225
|
else if (element.type == "sf-i-select") {
|
|
1201
1226
|
this.dataModel[i].value = [this.getPrepopulateJson()[element.id + 'name'] + ';' + this.getPrepopulateJson()[element.id + 'id']];
|
|
@@ -1721,10 +1746,11 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
1721
1746
|
if (this.mode == 'admin') {
|
|
1722
1747
|
this.dataModel[i].elementsjson = JSON.stringify(target.listelements);
|
|
1723
1748
|
}
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1749
|
+
// console.log('target json', this.dataModel[i].elementsjson)
|
|
1750
|
+
// } else if (Object.keys(target.selectedValues()).length > 0) {
|
|
1751
|
+
this.dataModel[i].value = target.selectedValues();
|
|
1752
|
+
console.log('eval checklist value', JSON.stringify(this.dataModel[i].value), JSON.stringify(target.selectedValues()));
|
|
1753
|
+
// }
|
|
1728
1754
|
}
|
|
1729
1755
|
}
|
|
1730
1756
|
else {
|
|
@@ -1906,7 +1932,7 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
1906
1932
|
elementHtml += `<div part="date-container" class="d-flex flex-col flex-grow">
|
|
1907
1933
|
<label id="${dataObj.id}-label" part="date-label">${elementLabel}</label>
|
|
1908
1934
|
<div part="td-body-2"><sf-i-elastic-text text="${dataObj.hint}" minLength="50"></sf-i-elastic-text></div>
|
|
1909
|
-
<input class="reporting-date" id="${dataObj.id}" part="input-date" type="date" ${this.mode == "view" || this.flow == "details" ? "readonly" : ""} value="${dataObj.value}"/>
|
|
1935
|
+
<input class="reporting-date" id="${dataObj.id}" part="input-date" type="date" ${this.mode == "view" || this.flow == "details" ? "readonly" : ""} value="${dataObj.value}" ${this.editdisable == "true" ? "disabled" : ""}/>
|
|
1910
1936
|
</div>`;
|
|
1911
1937
|
}
|
|
1912
1938
|
else if (dataObj.type == "sf-i-form") {
|
|
@@ -2295,7 +2321,7 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
2295
2321
|
}
|
|
2296
2322
|
};
|
|
2297
2323
|
this.fetchDetails = async () => {
|
|
2298
|
-
var _a;
|
|
2324
|
+
var _a, _b;
|
|
2299
2325
|
let url = "https://" + this.apiId + "/details";
|
|
2300
2326
|
let body = { projectid: this.projectid, objectid: this.selectedItem.id };
|
|
2301
2327
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
@@ -2307,6 +2333,7 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
2307
2333
|
console.log('details response', jsonRespose);
|
|
2308
2334
|
let resultObject = jsonRespose.object;
|
|
2309
2335
|
this.published = (_a = resultObject.published) !== null && _a !== void 0 ? _a : false;
|
|
2336
|
+
this.terminated = (_b = resultObject.terminated) !== null && _b !== void 0 ? _b : false;
|
|
2310
2337
|
this.configjson = resultObject.schema;
|
|
2311
2338
|
this.prepopulateValJson = resultObject.object;
|
|
2312
2339
|
this.populateDataModel();
|
|
@@ -2320,7 +2347,7 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
2320
2347
|
this.submitNew = async (obj = this.selectedValues()) => {
|
|
2321
2348
|
console.log('adding', obj);
|
|
2322
2349
|
let url = "https://" + this.apiId + "/add";
|
|
2323
|
-
let body = { projectid: this.projectid, object: obj, schema: this.
|
|
2350
|
+
let body = { projectid: this.projectid, object: obj, schema: this.getSchema(), published: this.published };
|
|
2324
2351
|
console.log('adding', body, url);
|
|
2325
2352
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
2326
2353
|
const xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
|
|
@@ -2341,10 +2368,10 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
2341
2368
|
};
|
|
2342
2369
|
this.submitEdit = async () => {
|
|
2343
2370
|
let url = "https://" + this.apiId + "/update";
|
|
2344
|
-
let body = { projectid: this.projectid, objectid: this.selectedItem.id, object: this.selectedValues(), schema: this.
|
|
2371
|
+
let body = { projectid: this.projectid, objectid: this.selectedItem.id, object: this.selectedValues(), schema: this.getSchema(), published: this.published };
|
|
2345
2372
|
if (Object.keys(this.reopenedItem).length > 0) {
|
|
2346
2373
|
url = "https://" + this.apiId + "/reopen";
|
|
2347
|
-
body = { projectid: this.projectid, object: this.selectedValues(), schema: this.
|
|
2374
|
+
body = { projectid: this.projectid, object: this.selectedValues(), schema: this.getSchema(), objectid: this.reopenedItem.id, published: this.published };
|
|
2348
2375
|
}
|
|
2349
2376
|
console.log('updating', body, url);
|
|
2350
2377
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|