blixify-ui-web 0.1.84 → 0.1.85
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/lib/components/data/dataTemplate/index.d.ts +1 -0
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +84 -52
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts +3 -3
- package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
- package/lib/components/data/utils.d.ts.map +1 -1
- package/lib/components/data/utils.js +4 -0
- package/lib/components/data/utils.js.map +1 -1
- package/lib/components/input/address/index.d.ts.map +1 -1
- package/lib/components/input/address/index.js +4 -1
- package/lib/components/input/address/index.js.map +1 -1
- package/lib/components/input/datePicker/index.d.ts.map +1 -1
- package/lib/components/input/datePicker/index.js +3 -1
- package/lib/components/input/datePicker/index.js.map +1 -1
- package/lib/components/input/select/index.d.ts +1 -1
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +3 -1
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js +3 -1
- package/lib/components/input/textInput/index.js.map +1 -1
- package/lib/components/input/uploadInput/index.d.ts.map +1 -1
- package/lib/components/input/uploadInput/index.js +11 -11
- package/lib/components/input/uploadInput/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":";AAuCA,OAAO,EAAQ,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAUvD,OAAO,EAAmB,aAAa,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,UAAU,KAAM,SAAQ,SAAS;IAC/B,GAAG,CAAC,EAAE;QACJ,KAAK,CAA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CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,CAAC;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,eAAe,EAAE,CAAC;IACnC,YAAY,CAAC,EAAE;QACb,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;QAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;KACzB,EAAE,CAAC;IACJ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAwDD,eAAO,MAAM,aAAa,aAKzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAK5B,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,eAwmGxC"}
|
|
@@ -269,7 +269,7 @@ function DataTemplate(props) {
|
|
|
269
269
|
if (!(queryInput.queryId === eachModel.id)) return [3 /*break*/, 3];
|
|
270
270
|
if (!(eachModel.type === "reference" ||
|
|
271
271
|
eachModel.type === "listReference")) return [3 /*break*/, 2];
|
|
272
|
-
referenceRQ = new readQuery_1.ReadQuery(dbModule, props.server, (_a = eachModel.referenceSpaceId) !== null && _a !== void 0 ? _a : "", props.dbEndpoint);
|
|
272
|
+
referenceRQ = new readQuery_1.ReadQuery(dbModule, props.server, (_a = eachModel.referenceSpaceId) !== null && _a !== void 0 ? _a : "", props.dbEndpoint, props.dbAPIToken);
|
|
273
273
|
query = [];
|
|
274
274
|
if (exportReferenceSearch) {
|
|
275
275
|
query.push({
|
|
@@ -328,6 +328,7 @@ function DataTemplate(props) {
|
|
|
328
328
|
exportReferenceSearch,
|
|
329
329
|
dbModule,
|
|
330
330
|
props.dbEndpoint,
|
|
331
|
+
props.dbAPIToken,
|
|
331
332
|
props.model,
|
|
332
333
|
props.server,
|
|
333
334
|
serverId,
|
|
@@ -344,7 +345,7 @@ function DataTemplate(props) {
|
|
|
344
345
|
case 0:
|
|
345
346
|
_c.trys.push([0, 6, , 7]);
|
|
346
347
|
optionList_1 = [];
|
|
347
|
-
referenceRQ_1 = new readQuery_1.ReadQuery(dbModule, props.server, (_a = eachModel.referenceSpaceId) !== null && _a !== void 0 ? _a : "", props.dbEndpoint);
|
|
348
|
+
referenceRQ_1 = new readQuery_1.ReadQuery(dbModule, props.server, (_a = eachModel.referenceSpaceId) !== null && _a !== void 0 ? _a : "", props.dbEndpoint, props.dbAPIToken);
|
|
348
349
|
return [4 /*yield*/, referenceRQ_1.call({
|
|
349
350
|
type: "list",
|
|
350
351
|
limit: 10,
|
|
@@ -715,11 +716,10 @@ function DataTemplate(props) {
|
|
|
715
716
|
switch (_a.label) {
|
|
716
717
|
case 0:
|
|
717
718
|
clonedSelectedData = handleClonedDataAttribute(selectedData, props.model, true);
|
|
718
|
-
//INFO: Parse & Upload Data "Image & File attributes"
|
|
719
719
|
return [4 /*yield*/, handleParseImageField(id, clonedSelectedData, props.model)];
|
|
720
720
|
case 1:
|
|
721
721
|
//INFO: Parse & Upload Data "Image & File attributes"
|
|
722
|
-
_a.sent();
|
|
722
|
+
clonedSelectedData = _a.sent();
|
|
723
723
|
objectAttribute = props.model.filter(function (eachAttribute) {
|
|
724
724
|
return eachAttribute.type === "object";
|
|
725
725
|
});
|
|
@@ -729,7 +729,7 @@ function DataTemplate(props) {
|
|
|
729
729
|
switch (_b.label) {
|
|
730
730
|
case 0: return [4 /*yield*/, handleParseImageField(id, clonedSelectedData, (_a = eachObject.objectData) !== null && _a !== void 0 ? _a : [], eachObject.id)];
|
|
731
731
|
case 1:
|
|
732
|
-
_b.sent();
|
|
732
|
+
clonedSelectedData = _b.sent();
|
|
733
733
|
return [2 /*return*/, null];
|
|
734
734
|
}
|
|
735
735
|
});
|
|
@@ -745,7 +745,7 @@ function DataTemplate(props) {
|
|
|
745
745
|
switch (_b.label) {
|
|
746
746
|
case 0: return [4 /*yield*/, handleParseImageField(id, clonedSelectedData, (_a = eachObject.objectData) !== null && _a !== void 0 ? _a : [], eachObject.id, true)];
|
|
747
747
|
case 1:
|
|
748
|
-
_b.sent();
|
|
748
|
+
clonedSelectedData = _b.sent();
|
|
749
749
|
return [2 /*return*/, null];
|
|
750
750
|
}
|
|
751
751
|
});
|
|
@@ -781,7 +781,7 @@ function DataTemplate(props) {
|
|
|
781
781
|
case 0:
|
|
782
782
|
_d.trys.push([0, 6, , 7]);
|
|
783
783
|
if (!(typeof selectedField === "string")) return [3 /*break*/, 1];
|
|
784
|
-
return [2 /*return
|
|
784
|
+
return [2 /*return*/, selectedField];
|
|
785
785
|
case 1:
|
|
786
786
|
if (!(multiple &&
|
|
787
787
|
selectedField["upload"] &&
|
|
@@ -830,8 +830,9 @@ function DataTemplate(props) {
|
|
|
830
830
|
return [4 /*yield*/, handleUploadAxios((_b = eachImage.imageEndpoint) !== null && _b !== void 0 ? _b : "", imageParentId, imageCollectionName, (_c = eachImage.imageFileName) !== null && _c !== void 0 ? _c : "", selectedField)];
|
|
831
831
|
case 4:
|
|
832
832
|
responseData = _d.sent();
|
|
833
|
-
if (responseData.data)
|
|
834
|
-
|
|
833
|
+
if (responseData.data) {
|
|
834
|
+
return [2 /*return*/, responseData.data.data];
|
|
835
|
+
}
|
|
835
836
|
_d.label = 5;
|
|
836
837
|
case 5: return [3 /*break*/, 7];
|
|
837
838
|
case 6:
|
|
@@ -871,32 +872,52 @@ function DataTemplate(props) {
|
|
|
871
872
|
return eachAttribute.type === "image" || eachAttribute.type === "file";
|
|
872
873
|
});
|
|
873
874
|
return [4 /*yield*/, Promise.all(imageAttribute.map(function (eachImage) { return __awaiter(_this, void 0, void 0, function () {
|
|
874
|
-
var
|
|
875
|
-
|
|
876
|
-
|
|
875
|
+
var _a, _b, _c, _d;
|
|
876
|
+
var _this = this;
|
|
877
|
+
return __generator(this, function (_e) {
|
|
878
|
+
switch (_e.label) {
|
|
877
879
|
case 0:
|
|
878
880
|
if (!listObject) return [3 /*break*/, 3];
|
|
879
881
|
if (!objectId)
|
|
880
882
|
return [2 /*return*/];
|
|
881
883
|
if (!Array.isArray(selectedData[objectId])) return [3 /*break*/, 2];
|
|
882
|
-
return [4 /*yield*/, Promise.all(selectedData[objectId].map(function (eachListItem, index) {
|
|
883
|
-
var _a;
|
|
884
|
-
var
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
884
|
+
return [4 /*yield*/, Promise.all(selectedData[objectId].map(function (eachListItem, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
885
|
+
var selectedObjectId, _a, _b;
|
|
886
|
+
var _c;
|
|
887
|
+
return __generator(this, function (_d) {
|
|
888
|
+
switch (_d.label) {
|
|
889
|
+
case 0:
|
|
890
|
+
selectedObjectId = (_c = eachListItem.id) !== null && _c !== void 0 ? _c : (0, uuid_1.v4)();
|
|
891
|
+
_a = selectedData[objectId][index];
|
|
892
|
+
_b = eachImage.id;
|
|
893
|
+
return [4 /*yield*/, uploadAsset_1(eachImage, selectedData[objectId][index][eachImage.id], selectedObjectId)];
|
|
894
|
+
case 1:
|
|
895
|
+
_a[_b] =
|
|
896
|
+
_d.sent();
|
|
897
|
+
return [2 /*return*/, null];
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
}); }))];
|
|
889
901
|
case 1:
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
case 2: return [3 /*break*/,
|
|
902
|
+
_e.sent();
|
|
903
|
+
_e.label = 2;
|
|
904
|
+
case 2: return [3 /*break*/, 7];
|
|
893
905
|
case 3:
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
uploadAsset_1(eachImage,
|
|
898
|
-
|
|
899
|
-
|
|
906
|
+
if (!objectId) return [3 /*break*/, 5];
|
|
907
|
+
_a = selectedData[objectId];
|
|
908
|
+
_b = eachImage.id;
|
|
909
|
+
return [4 /*yield*/, uploadAsset_1(eachImage, selectedData[objectId][eachImage.id])];
|
|
910
|
+
case 4:
|
|
911
|
+
_a[_b] = _e.sent();
|
|
912
|
+
return [3 /*break*/, 7];
|
|
913
|
+
case 5:
|
|
914
|
+
_c = selectedData;
|
|
915
|
+
_d = eachImage.id;
|
|
916
|
+
return [4 /*yield*/, uploadAsset_1(eachImage, selectedData[eachImage.id])];
|
|
917
|
+
case 6:
|
|
918
|
+
_c[_d] = _e.sent();
|
|
919
|
+
_e.label = 7;
|
|
920
|
+
case 7: return [2 /*return*/, null];
|
|
900
921
|
}
|
|
901
922
|
});
|
|
902
923
|
}); }))];
|
|
@@ -1009,9 +1030,12 @@ function DataTemplate(props) {
|
|
|
1009
1030
|
err_8 = _a.sent();
|
|
1010
1031
|
return [3 /*break*/, 6];
|
|
1011
1032
|
case 6:
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1033
|
+
setTimeout(function () {
|
|
1034
|
+
setLoading(false);
|
|
1035
|
+
setModalVisible(false);
|
|
1036
|
+
setDeleteModal(false);
|
|
1037
|
+
window.location.reload();
|
|
1038
|
+
}, 500);
|
|
1015
1039
|
return [2 /*return*/];
|
|
1016
1040
|
}
|
|
1017
1041
|
});
|
|
@@ -1470,6 +1494,7 @@ function DataTemplate(props) {
|
|
|
1470
1494
|
case 5: return [3 /*break*/, 7];
|
|
1471
1495
|
case 6:
|
|
1472
1496
|
err_11 = _h.sent();
|
|
1497
|
+
setLoading(false);
|
|
1473
1498
|
setNotification({
|
|
1474
1499
|
type: false,
|
|
1475
1500
|
title: "Import Error",
|
|
@@ -1852,7 +1877,7 @@ function DataTemplate(props) {
|
|
|
1852
1877
|
//INFO - Default Model Contain Id While Object Type Don't have
|
|
1853
1878
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1854
1879
|
var clonedSelectedData = handleClonedDataAttribute(data, model);
|
|
1855
|
-
var label = eachAttribute.name
|
|
1880
|
+
var label = eachAttribute.name;
|
|
1856
1881
|
var disabled = props.type === "read"
|
|
1857
1882
|
? true
|
|
1858
1883
|
: props.type === "update" && props.id === "new"
|
|
@@ -1860,7 +1885,7 @@ function DataTemplate(props) {
|
|
|
1860
1885
|
: eachAttribute.disabled;
|
|
1861
1886
|
switch (eachAttribute.type) {
|
|
1862
1887
|
case "address":
|
|
1863
|
-
inputList.push(react_1.default.createElement(address_1.Address, { id: eachAttribute.id, label: label, value: (_a = clonedSelectedData[eachAttribute.id]) !== null && _a !== void 0 ? _a : {
|
|
1888
|
+
inputList.push(react_1.default.createElement(address_1.Address, { id: eachAttribute.id, optional: eachAttribute.optional, label: label, value: (_a = clonedSelectedData[eachAttribute.id]) !== null && _a !== void 0 ? _a : {
|
|
1864
1889
|
lat: 0,
|
|
1865
1890
|
lng: 0,
|
|
1866
1891
|
name: "",
|
|
@@ -1900,13 +1925,13 @@ function DataTemplate(props) {
|
|
|
1900
1925
|
}
|
|
1901
1926
|
});
|
|
1902
1927
|
}
|
|
1903
|
-
inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: (_d = clonedSelectedData[eachAttribute.id]) !== null && _d !== void 0 ? _d : (eachAttribute.type === "list" ? "" : []), label: label, options: optionList_2, onChange: function (value) {
|
|
1928
|
+
inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, optional: eachAttribute.optional, value: (_d = clonedSelectedData[eachAttribute.id]) !== null && _d !== void 0 ? _d : (eachAttribute.type === "list" ? "" : []), label: label, options: optionList_2, onChange: function (value) {
|
|
1904
1929
|
handleOnChangeSelect(eachAttribute.id, value);
|
|
1905
1930
|
}, disabled: disabled }));
|
|
1906
1931
|
break;
|
|
1907
1932
|
case "boolean":
|
|
1908
1933
|
var value = (_e = clonedSelectedData[eachAttribute.id]) === null || _e === void 0 ? void 0 : _e.toString();
|
|
1909
|
-
inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: value, label: label, options: [
|
|
1934
|
+
inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: value, label: label, optional: eachAttribute.optional, options: [
|
|
1910
1935
|
{
|
|
1911
1936
|
key: "true",
|
|
1912
1937
|
label: "True",
|
|
@@ -1926,15 +1951,11 @@ function DataTemplate(props) {
|
|
|
1926
1951
|
if (hasImageToken) {
|
|
1927
1952
|
url = isObject
|
|
1928
1953
|
? isObjectList
|
|
1929
|
-
? (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName +
|
|
1930
|
-
"%2F" +
|
|
1931
|
-
props.id +
|
|
1932
|
-
"%2F" +
|
|
1933
|
-
selectedObjectId, selectedObjectStructureId, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id])
|
|
1954
|
+
? (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName + "%2F" + props.id, selectedObjectStructureId + "%2F" + selectedObjectId, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id])
|
|
1934
1955
|
: (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName + "%2F" + props.id, selectedObjectStructureId, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id])
|
|
1935
1956
|
: (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName, props.id, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id]);
|
|
1936
1957
|
}
|
|
1937
|
-
inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (_f = props.lib) === null || _f === void 0 ? void 0 : _f.axios }, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, hidePreview: eachAttribute.type === "image" ? false : true, file: (_g = url !== null && url !== void 0 ? url : clonedSelectedData[eachAttribute.id]) !== null && _g !== void 0 ? _g : "", accept: eachAttribute.type === "image" ? ".png,.jpg,.jpe,.tiff" : ".pdf", fileDescription: eachAttribute.type === "image" ? undefined : "PDF up to 30MB", maxFileSize: props.maxFileSize, onChange: handleOnChangeFile, disabled: disabled }));
|
|
1958
|
+
inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (_f = props.lib) === null || _f === void 0 ? void 0 : _f.axios }, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, optional: eachAttribute.optional, hidePreview: eachAttribute.type === "image" ? false : true, file: (_g = url !== null && url !== void 0 ? url : clonedSelectedData[eachAttribute.id]) !== null && _g !== void 0 ? _g : "", accept: eachAttribute.type === "image" ? ".png,.jpg,.jpe,.tiff" : ".pdf", fileDescription: eachAttribute.type === "image" ? undefined : "PDF up to 30MB", maxFileSize: props.maxFileSize, onChange: handleOnChangeFile, disabled: disabled }));
|
|
1938
1959
|
break;
|
|
1939
1960
|
case "multipleFile":
|
|
1940
1961
|
case "multipleImage":
|
|
@@ -1944,7 +1965,7 @@ function DataTemplate(props) {
|
|
|
1944
1965
|
fileName: (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName, props.id, eachImage.fileName, eachImage.token),
|
|
1945
1966
|
};
|
|
1946
1967
|
});
|
|
1947
|
-
inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { type: "multi", files: __assign(__assign({}, clonedSelectedData[eachAttribute.id]), { data: multipleDataUrl }), ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, hidePreview: eachAttribute.type === "multipleImage" ? false : true, accept: eachAttribute.type === "multipleImage"
|
|
1968
|
+
inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { type: "multi", files: __assign(__assign({}, clonedSelectedData[eachAttribute.id]), { data: multipleDataUrl }), optional: eachAttribute.optional, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, hidePreview: eachAttribute.type === "multipleImage" ? false : true, accept: eachAttribute.type === "multipleImage"
|
|
1948
1969
|
? ".png,.jpg,.jpe,.tiff"
|
|
1949
1970
|
: ".pdf", fileDescription: eachAttribute.type === "multipleImage"
|
|
1950
1971
|
? undefined
|
|
@@ -1956,12 +1977,12 @@ function DataTemplate(props) {
|
|
|
1956
1977
|
}, disabled: disabled }));
|
|
1957
1978
|
break;
|
|
1958
1979
|
case "number":
|
|
1959
|
-
inputList.push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: "number", value: (_j = clonedSelectedData[eachAttribute.id]) !== null && _j !== void 0 ? _j : "", placeholder: label, label: label, onChange: handleOnChangeText, disabled: disabled }));
|
|
1980
|
+
inputList.push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: "number", value: (_j = clonedSelectedData[eachAttribute.id]) !== null && _j !== void 0 ? _j : "", placeholder: label, label: label, optional: eachAttribute.optional, onChange: handleOnChangeText, disabled: disabled }));
|
|
1960
1981
|
break;
|
|
1961
1982
|
case "reference":
|
|
1962
1983
|
case "listReference":
|
|
1963
1984
|
inputList.push(react_1.default.createElement(react_1.default.Fragment, null,
|
|
1964
|
-
react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: (_k = clonedSelectedData[eachAttribute.id]) !== null && _k !== void 0 ? _k : (eachAttribute.type === "reference" ? "" : []), label: label, options: isObject
|
|
1985
|
+
react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: (_k = clonedSelectedData[eachAttribute.id]) !== null && _k !== void 0 ? _k : (eachAttribute.type === "reference" ? "" : []), label: label, optional: eachAttribute.optional, options: isObject
|
|
1965
1986
|
? referencesOptions[selectedObjectStructureId + "." + eachAttribute.id]
|
|
1966
1987
|
: (_l = referencesOptions[eachAttribute.id]) !== null && _l !== void 0 ? _l : [], onChange: function (value) {
|
|
1967
1988
|
handleOnChangeSelect(eachAttribute.id, value);
|
|
@@ -1986,10 +2007,19 @@ function DataTemplate(props) {
|
|
|
1986
2007
|
}); }, disabled: disabled })));
|
|
1987
2008
|
break;
|
|
1988
2009
|
case "string":
|
|
1989
|
-
|
|
2010
|
+
case "contact":
|
|
2011
|
+
case "email":
|
|
2012
|
+
var textType = "text";
|
|
2013
|
+
if (eachAttribute.type === "contact") {
|
|
2014
|
+
textType = "mobile";
|
|
2015
|
+
}
|
|
2016
|
+
else if (eachAttribute.type === "email") {
|
|
2017
|
+
textType = "email";
|
|
2018
|
+
}
|
|
2019
|
+
inputList.push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: textType, value: (_m = clonedSelectedData[eachAttribute.id]) !== null && _m !== void 0 ? _m : "", placeholder: label, label: label, optional: eachAttribute.optional, onChange: handleOnChangeText, disabled: disabled }));
|
|
1990
2020
|
break;
|
|
1991
2021
|
case "date":
|
|
1992
|
-
inputList.push(react_1.default.createElement(datePicker_1.InputDatePicker, { title: label, id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], onChange: handleOnChangeDate, value: clonedSelectedData[eachAttribute.id], disabled: disabled }));
|
|
2022
|
+
inputList.push(react_1.default.createElement(datePicker_1.InputDatePicker, { title: label, id: eachAttribute.id, optional: eachAttribute.optional, ref: eachAttribute.optional ? null : formInputRef[index], onChange: handleOnChangeDate, value: clonedSelectedData[eachAttribute.id], disabled: disabled }));
|
|
1993
2023
|
break;
|
|
1994
2024
|
}
|
|
1995
2025
|
});
|
|
@@ -2040,6 +2070,8 @@ function DataTemplate(props) {
|
|
|
2040
2070
|
});
|
|
2041
2071
|
switch (model === null || model === void 0 ? void 0 : model.type) {
|
|
2042
2072
|
case "string":
|
|
2073
|
+
case "contact":
|
|
2074
|
+
case "email":
|
|
2043
2075
|
isTitle
|
|
2044
2076
|
? (eachNewList["title"] =
|
|
2045
2077
|
typeof eachValue === "string" ? eachValue : "")
|
|
@@ -2049,11 +2081,7 @@ function DataTemplate(props) {
|
|
|
2049
2081
|
case "image":
|
|
2050
2082
|
var url = void 0;
|
|
2051
2083
|
if (typeof eachValue === "string") {
|
|
2052
|
-
url = (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, model.imageCollectionName +
|
|
2053
|
-
"%2F" +
|
|
2054
|
-
props.id +
|
|
2055
|
-
"%2F" +
|
|
2056
|
-
eachObject.id, eachListObject.id, model.imageFileName, eachValue);
|
|
2084
|
+
url = (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, model.imageCollectionName + "%2F" + props.id, eachListObject.id + "%2F" + eachObject.id, model.imageFileName, eachValue);
|
|
2057
2085
|
}
|
|
2058
2086
|
else if (eachValue instanceof File) {
|
|
2059
2087
|
url = URL.createObjectURL(eachValue);
|
|
@@ -2155,6 +2183,7 @@ function DataTemplate(props) {
|
|
|
2155
2183
|
dbType: props.server,
|
|
2156
2184
|
dbCollection: props.collectionId,
|
|
2157
2185
|
dbEndpoint: props.dbEndpoint,
|
|
2186
|
+
dbAPIToken: props.dbAPIToken,
|
|
2158
2187
|
}, cond: {
|
|
2159
2188
|
type: "get",
|
|
2160
2189
|
id: props.id,
|
|
@@ -2183,6 +2212,7 @@ function DataTemplate(props) {
|
|
|
2183
2212
|
dbType: props.server,
|
|
2184
2213
|
dbCollection: props.collectionId,
|
|
2185
2214
|
dbEndpoint: props.dbEndpoint,
|
|
2215
|
+
dbAPIToken: props.dbAPIToken,
|
|
2186
2216
|
}, cond: {
|
|
2187
2217
|
type: "get",
|
|
2188
2218
|
id: props.id,
|
|
@@ -2216,6 +2246,7 @@ function DataTemplate(props) {
|
|
|
2216
2246
|
dbType: props.server,
|
|
2217
2247
|
dbCollection: props.collectionId,
|
|
2218
2248
|
dbEndpoint: props.dbEndpoint,
|
|
2249
|
+
dbAPIToken: props.dbAPIToken,
|
|
2219
2250
|
}, cond: {
|
|
2220
2251
|
type: "list",
|
|
2221
2252
|
query: renderSearchFilterConditions(),
|
|
@@ -2327,6 +2358,7 @@ function DataTemplate(props) {
|
|
|
2327
2358
|
dbType: props.server,
|
|
2328
2359
|
dbCollection: (_b = eachSettings.spaceId) !== null && _b !== void 0 ? _b : "",
|
|
2329
2360
|
dbEndpoint: props.dbEndpoint,
|
|
2361
|
+
dbAPIToken: props.dbAPIToken,
|
|
2330
2362
|
}, cond: {
|
|
2331
2363
|
type: "list",
|
|
2332
2364
|
limit: limit,
|
|
@@ -2390,7 +2422,7 @@ function DataTemplate(props) {
|
|
|
2390
2422
|
});
|
|
2391
2423
|
if (viewType === "general") {
|
|
2392
2424
|
if (dataType === "list") {
|
|
2393
|
-
return (react_1.default.createElement(table_1.Table, { paginationType: props.server === "mongoServer" ? "page" : "cursor", data: tableData, size: size, limit: limit, cursor: cursor, loading: tableLoading, checkbox: true, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement(textButton_1.TextButton, { text: "Delete", onClick: function () {
|
|
2425
|
+
return (react_1.default.createElement(table_1.Table, { paginationType: props.server === "mongoServer" ? "page" : "cursor", data: tableData, size: size, limit: limit, cursor: cursor, loading: tableLoading, checkbox: true, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Delete", onClick: function () {
|
|
2394
2426
|
setDeleteModal(true);
|
|
2395
2427
|
} }), handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex, onClickRow: function (id) {
|
|
2396
2428
|
handleNavigate("".concat(props.localURLEndpoint, "?data=").concat(id, "&type=read&collection=").concat(props.collectionId, "&view=general"));
|