blixify-ui-web 0.3.76 → 0.3.78
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/auth/bareSignIn/index.d.ts +2 -2
- package/lib/components/auth/bareSignIn/index.d.ts.map +1 -1
- package/lib/components/auth/bareSignIn/index.js +9 -1
- package/lib/components/auth/bareSignIn/index.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +14 -2
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts +17 -2
- package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
- package/lib/components/data/listModule.d.ts +3 -1
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +311 -183
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/data/utils.d.ts.map +1 -1
- package/lib/components/data/utils.js +12 -0
- package/lib/components/data/utils.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts +1 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js +3 -2
- package/lib/components/input/textInput/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -74,12 +74,108 @@ var select_1 = require("../input/select");
|
|
|
74
74
|
var textInput_1 = require("../input/textInput");
|
|
75
75
|
var blobModule_1 = require("./blobModule");
|
|
76
76
|
var moduleUtils_1 = require("./moduleUtils");
|
|
77
|
+
var readQuery_1 = require("./readQuery");
|
|
77
78
|
var readQueryHoc_1 = require("./readQueryHoc");
|
|
78
79
|
var utils_1 = require("./utils");
|
|
80
|
+
var Parser = require("expr-eval").Parser;
|
|
81
|
+
var parser = new Parser();
|
|
79
82
|
//=====================================================================================
|
|
80
83
|
//SECTION: List Feature used across Data Components
|
|
81
84
|
//=====================================================================================
|
|
82
|
-
var
|
|
85
|
+
var handleProcessShowReferences = function (eachData, eachNewData, modelSchema, devSettings, dbModule, schemaReference) { return __awaiter(void 0, void 0, void 0, function () {
|
|
86
|
+
var server, filterShowReferenceStructure, _loop_1, _i, filterShowReferenceStructure_1, eachStructure;
|
|
87
|
+
var _a, _b, _c, _d, _e;
|
|
88
|
+
return __generator(this, function (_f) {
|
|
89
|
+
switch (_f.label) {
|
|
90
|
+
case 0:
|
|
91
|
+
server = devSettings.server;
|
|
92
|
+
filterShowReferenceStructure = modelSchema.filter(function (eachStructure) { return eachStructure.type === "showReference"; });
|
|
93
|
+
_loop_1 = function (eachStructure) {
|
|
94
|
+
var showReferenceRQ, getValue_1, query, res, showReferenceDataList_1, showReferenceStructure, err_1;
|
|
95
|
+
return __generator(this, function (_g) {
|
|
96
|
+
switch (_g.label) {
|
|
97
|
+
case 0:
|
|
98
|
+
_g.trys.push([0, 4, , 5]);
|
|
99
|
+
showReferenceRQ = new readQuery_1.ReadQuery({
|
|
100
|
+
dbModule: dbModule,
|
|
101
|
+
dbType: server,
|
|
102
|
+
dbCollection: (_a = eachStructure.referenceSpaceId) !== null && _a !== void 0 ? _a : "",
|
|
103
|
+
dbEndpoint: devSettings.dbEndpoint,
|
|
104
|
+
dbAPIToken: devSettings.dbAPIToken,
|
|
105
|
+
dbUserToken: devSettings.dbUserToken,
|
|
106
|
+
});
|
|
107
|
+
getValue_1 = function (eachCond) {
|
|
108
|
+
var _a, _b, _c, _d;
|
|
109
|
+
return (_c = (_a = eachCond === null || eachCond === void 0 ? void 0 : eachCond.value) !== null && _a !== void 0 ? _a : eachNewData === null || eachNewData === void 0 ? void 0 : eachNewData[(_b = eachCond.fromColumnId) !== null && _b !== void 0 ? _b : "_id"]) !== null && _c !== void 0 ? _c : eachData[(_d = eachCond.fromColumnId) !== null && _d !== void 0 ? _d : "_id"];
|
|
110
|
+
};
|
|
111
|
+
query = (_c = (_b = eachStructure.condition) === null || _b === void 0 ? void 0 : _b.map(function (eachCond) {
|
|
112
|
+
var _a, _b;
|
|
113
|
+
var baseQuery = {
|
|
114
|
+
type: eachCond.condition,
|
|
115
|
+
queryId: (_a = eachCond.toColumnId) !== null && _a !== void 0 ? _a : "_id",
|
|
116
|
+
};
|
|
117
|
+
var value = getValue_1(eachCond);
|
|
118
|
+
if (eachCond.condition === "><") {
|
|
119
|
+
if (Array.isArray(value)) {
|
|
120
|
+
return __assign(__assign({}, baseQuery), { value: value });
|
|
121
|
+
}
|
|
122
|
+
var startOfDay = (0, moment_1.default)(value).startOf("day").toISOString();
|
|
123
|
+
var endOfDay = (0, moment_1.default)(value).endOf("day").toISOString();
|
|
124
|
+
return __assign(__assign({}, baseQuery), { value: (_b = eachCond.value) !== null && _b !== void 0 ? _b : [startOfDay, endOfDay] });
|
|
125
|
+
}
|
|
126
|
+
if (eachCond.condition === "in") {
|
|
127
|
+
return __assign(__assign({}, baseQuery), { value: Array.isArray(value) ? value : [value] });
|
|
128
|
+
}
|
|
129
|
+
return __assign(__assign({}, baseQuery), { value: value });
|
|
130
|
+
})) !== null && _c !== void 0 ? _c : [];
|
|
131
|
+
return [4 /*yield*/, showReferenceRQ.call({
|
|
132
|
+
type: "list",
|
|
133
|
+
query: query,
|
|
134
|
+
})];
|
|
135
|
+
case 1:
|
|
136
|
+
res = _g.sent();
|
|
137
|
+
return [4 /*yield*/, (0, exports.handleListDataBasedOnModel)(res === null || res === void 0 ? void 0 : res.data, devSettings, dbModule, (_d = schemaReference === null || schemaReference === void 0 ? void 0 : schemaReference[eachStructure.id]) !== null && _d !== void 0 ? _d : [], function () { })];
|
|
138
|
+
case 2:
|
|
139
|
+
showReferenceDataList_1 = _g.sent();
|
|
140
|
+
showReferenceStructure = (_e = schemaReference === null || schemaReference === void 0 ? void 0 : schemaReference[eachStructure.id]) !== null && _e !== void 0 ? _e : [];
|
|
141
|
+
return [4 /*yield*/, Promise.all(showReferenceStructure.map(function (eachReferenceStructure) { return __awaiter(void 0, void 0, void 0, function () {
|
|
142
|
+
var value;
|
|
143
|
+
return __generator(this, function (_a) {
|
|
144
|
+
value = showReferenceDataList_1.map(function (eachData) {
|
|
145
|
+
return eachData === null || eachData === void 0 ? void 0 : eachData[eachReferenceStructure.id];
|
|
146
|
+
});
|
|
147
|
+
eachData["".concat(eachStructure.id, "_").concat(eachReferenceStructure.id)] =
|
|
148
|
+
value;
|
|
149
|
+
return [2 /*return*/];
|
|
150
|
+
});
|
|
151
|
+
}); }))];
|
|
152
|
+
case 3:
|
|
153
|
+
_g.sent();
|
|
154
|
+
return [3 /*break*/, 5];
|
|
155
|
+
case 4:
|
|
156
|
+
err_1 = _g.sent();
|
|
157
|
+
return [3 /*break*/, 5];
|
|
158
|
+
case 5: return [2 /*return*/];
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
_i = 0, filterShowReferenceStructure_1 = filterShowReferenceStructure;
|
|
163
|
+
_f.label = 1;
|
|
164
|
+
case 1:
|
|
165
|
+
if (!(_i < filterShowReferenceStructure_1.length)) return [3 /*break*/, 4];
|
|
166
|
+
eachStructure = filterShowReferenceStructure_1[_i];
|
|
167
|
+
return [5 /*yield**/, _loop_1(eachStructure)];
|
|
168
|
+
case 2:
|
|
169
|
+
_f.sent();
|
|
170
|
+
_f.label = 3;
|
|
171
|
+
case 3:
|
|
172
|
+
_i++;
|
|
173
|
+
return [3 /*break*/, 1];
|
|
174
|
+
case 4: return [2 /*return*/, eachData];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}); };
|
|
178
|
+
var handleListDataBasedOnModel = function (data, devSettings, dbModule, modelSchema, handleNavigate, isTableView, setActivityModal, setActivityId, activityLog, addActionBtns, schemaReference) { return __awaiter(void 0, void 0, void 0, function () {
|
|
83
179
|
var server, imageEndpoint, bucketName, organisationMembers, serverId, dataList, referenceDetails;
|
|
84
180
|
return __generator(this, function (_a) {
|
|
85
181
|
switch (_a.label) {
|
|
@@ -90,189 +186,221 @@ var handleListDataBasedOnModel = function (data, devSettings, dbModule, modelSch
|
|
|
90
186
|
return [4 /*yield*/, (0, moduleUtils_1.handleListReferenceDetails)(data, modelSchema, dbModule, devSettings)];
|
|
91
187
|
case 1:
|
|
92
188
|
referenceDetails = _a.sent();
|
|
93
|
-
data.map(function (eachDataAttribute) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
189
|
+
return [4 /*yield*/, Promise.all(data.map(function (eachDataAttribute) { return __awaiter(void 0, void 0, void 0, function () {
|
|
190
|
+
var eachData, eachNewData, eachDataId, isTag, _loop_2, _i, _a, _b, eachKey, eachValue;
|
|
191
|
+
var _c, _d, _e, _f, _g, _h;
|
|
192
|
+
return __generator(this, function (_j) {
|
|
193
|
+
switch (_j.label) {
|
|
194
|
+
case 0:
|
|
195
|
+
eachData = {};
|
|
196
|
+
eachNewData = JSON.parse(JSON.stringify(eachDataAttribute), utils_1.jsonReviver);
|
|
197
|
+
eachDataId = (_c = eachNewData["id"]) !== null && _c !== void 0 ? _c : eachNewData["_id"];
|
|
198
|
+
isTag = false;
|
|
199
|
+
_loop_2 = function (eachKey, eachValue) {
|
|
200
|
+
var model = modelSchema.find(function (eachAttribute) { return eachAttribute.id === eachKey; });
|
|
201
|
+
var isDraft = isTableView ? eachNewData["baseDraft"] : false;
|
|
202
|
+
switch (model === null || model === void 0 ? void 0 : model.type) {
|
|
203
|
+
case "string":
|
|
204
|
+
case "textArea":
|
|
205
|
+
case "contact":
|
|
206
|
+
case "email":
|
|
207
|
+
if (eachKey === "id" || eachKey === "_id") {
|
|
208
|
+
eachData[eachKey] = eachValue;
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
eachData[eachKey] =
|
|
212
|
+
typeof eachValue === "string"
|
|
213
|
+
? eachValue.length > 60
|
|
214
|
+
? eachValue.substring(0, 60) + "..."
|
|
215
|
+
: eachValue
|
|
216
|
+
: eachValue;
|
|
217
|
+
}
|
|
218
|
+
break;
|
|
219
|
+
case "date":
|
|
220
|
+
if (typeof eachValue === "object" && eachValue instanceof Date) {
|
|
221
|
+
eachData[eachKey] =
|
|
222
|
+
(0, moment_1.default)(eachValue).format("YYYY-MM-DD hh:mm A");
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
eachData[eachKey] =
|
|
226
|
+
typeof eachValue === "object"
|
|
227
|
+
? (0, moment_1.default)((eachValue === null || eachValue === void 0 ? void 0 : eachValue["_seconds"]) * 1000).format("YYYY-MM-DD hh:mm A")
|
|
228
|
+
: eachValue;
|
|
229
|
+
}
|
|
230
|
+
break;
|
|
231
|
+
case "number":
|
|
232
|
+
case "boolean":
|
|
233
|
+
case "address":
|
|
234
|
+
case "object":
|
|
235
|
+
case "multipleList":
|
|
236
|
+
case "referenceSelection":
|
|
237
|
+
eachData[eachKey] = eachValue;
|
|
238
|
+
break;
|
|
239
|
+
case "list":
|
|
240
|
+
var colourPresent = "";
|
|
241
|
+
if (model.listSelectionColour &&
|
|
242
|
+
((_d = model === null || model === void 0 ? void 0 : model.listSelectionColour) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
243
|
+
var colourIndex = (_e = model.listSelection) === null || _e === void 0 ? void 0 : _e.indexOf(eachValue);
|
|
244
|
+
var selectedColour = model.listSelectionColour[colourIndex];
|
|
245
|
+
if (selectedColour)
|
|
246
|
+
colourPresent = selectedColour;
|
|
247
|
+
}
|
|
248
|
+
if (colourPresent)
|
|
249
|
+
eachData[eachKey] = (react_1.default.createElement(tag_1.Tag, { size: "small", tagText: eachValue, color: colourPresent }));
|
|
250
|
+
else
|
|
251
|
+
eachData[eachKey] = eachValue;
|
|
252
|
+
break;
|
|
253
|
+
case "image":
|
|
254
|
+
var url = (0, blobModule_1.renderImageUrlFromPath)(imageEndpoint, model.imageCollectionName, eachDataId, model.imageFileName, eachValue, bucketName);
|
|
255
|
+
if (eachValue) {
|
|
256
|
+
eachData[eachKey] = (react_1.default.createElement("img", { src: url, alt: "".concat(eachValue), className: "w-10 h-10 object-contain" }));
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
eachData[eachKey] = " - ";
|
|
260
|
+
}
|
|
261
|
+
break;
|
|
262
|
+
case "multipleImage":
|
|
263
|
+
if (eachValue && Array.isArray(eachValue) && eachValue.length > 0) {
|
|
264
|
+
var imgList_1 = [];
|
|
265
|
+
eachValue.map(function (eachImg) {
|
|
266
|
+
var _a;
|
|
267
|
+
var url = (0, blobModule_1.renderImageUrlFromPath)(imageEndpoint, model.imageCollectionName, eachDataId, eachImg.fileName, (_a = eachImg.token) !== null && _a !== void 0 ? _a : "", bucketName);
|
|
268
|
+
imgList_1.push(react_1.default.createElement("img", { src: url, alt: "".concat(eachImg), className: "w-10 h-10 object-contain" }));
|
|
269
|
+
return null;
|
|
270
|
+
});
|
|
271
|
+
eachData[eachKey] = (react_1.default.createElement("div", { className: "flex gap-x-2 w-max flex-wrap" }, imgList_1.map(function (eachImgElemnt) { return eachImgElemnt; })));
|
|
272
|
+
}
|
|
273
|
+
else
|
|
274
|
+
eachData[eachKey] = " - ";
|
|
275
|
+
break;
|
|
276
|
+
case "reference":
|
|
277
|
+
var currentReferenceData = (_f = referenceDetails === null || referenceDetails === void 0 ? void 0 : referenceDetails[eachKey]) === null || _f === void 0 ? void 0 : _f.find(function (eachDetail) {
|
|
278
|
+
return eachDetail[serverId] === eachValue;
|
|
279
|
+
});
|
|
280
|
+
if (currentReferenceData) {
|
|
281
|
+
eachData[eachKey] =
|
|
282
|
+
(_g = currentReferenceData[model.referenceLabel]) !== null && _g !== void 0 ? _g : (0, moduleUtils_1.renderReferenceStringAttribute)(currentReferenceData);
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
eachData[eachKey] = " - ";
|
|
286
|
+
}
|
|
287
|
+
break;
|
|
288
|
+
case "listReference":
|
|
289
|
+
var referenceListLabel_1 = [];
|
|
290
|
+
if (Array.isArray(eachValue)) {
|
|
291
|
+
eachValue.map(function (value) {
|
|
292
|
+
var _a;
|
|
293
|
+
if (referenceDetails === null || referenceDetails === void 0 ? void 0 : referenceDetails[eachKey]) {
|
|
294
|
+
var currentReferenceDetails = referenceDetails[eachKey].find(function (eachDetail) {
|
|
295
|
+
return eachDetail[serverId] === value;
|
|
296
|
+
});
|
|
297
|
+
if (currentReferenceDetails) {
|
|
298
|
+
referenceListLabel_1.push((_a = currentReferenceDetails[model.referenceLabel]) !== null && _a !== void 0 ? _a : (0, moduleUtils_1.renderReferenceStringAttribute)(currentReferenceDetails));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return null;
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
if (referenceListLabel_1.length === 0) {
|
|
305
|
+
referenceListLabel_1.push(" - ");
|
|
306
|
+
}
|
|
307
|
+
eachData[eachKey] = referenceListLabel_1;
|
|
308
|
+
break;
|
|
309
|
+
case "person":
|
|
310
|
+
case "listPerson":
|
|
311
|
+
var personData_1 = [];
|
|
312
|
+
if (organisationMembers) {
|
|
313
|
+
if (Array.isArray(eachValue)) {
|
|
314
|
+
personData_1 = organisationMembers.filter(function (orgMember) {
|
|
315
|
+
return eachValue.includes(orgMember.key);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
else if (eachValue) {
|
|
319
|
+
personData_1 = organisationMembers.filter(function (orgMember) { return eachValue === orgMember.key; });
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
var personValue = " - ";
|
|
323
|
+
if (personData_1.length > 0) {
|
|
324
|
+
var name_1 = "";
|
|
325
|
+
personData_1.map(function (eachPerson, index) {
|
|
326
|
+
name_1 +=
|
|
327
|
+
eachPerson.label + (index + 1 < personData_1.length ? "," : "");
|
|
328
|
+
return null;
|
|
329
|
+
});
|
|
330
|
+
personValue = (react_1.default.createElement("div", { className: "flex flex-row" },
|
|
331
|
+
personData_1.map(function (eachPerson, index) { return (react_1.default.createElement("img", { key: eachPerson.key + index, src: eachPerson.image, className: "rounded-full w-6 h-6 ".concat(index > 0 ? "-ml-3" : ""), alt: "" })); }),
|
|
332
|
+
react_1.default.createElement("p", { className: "ml-2" }, name_1)));
|
|
333
|
+
}
|
|
334
|
+
eachData[eachKey] = personValue;
|
|
335
|
+
break;
|
|
336
|
+
case "markdown":
|
|
337
|
+
var markdownValue = (react_1.default.createElement("div", null,
|
|
338
|
+
react_1.default.createElement(react_md_editor_1.default.Markdown, { source: (_h = eachValue) !== null && _h !== void 0 ? _h : "", wrapperElement: { "data-color-mode": "light" }, className: "no-tailwind", style: {
|
|
339
|
+
fontSize: 14,
|
|
340
|
+
lineHeight: 1.25,
|
|
341
|
+
wordBreak: "break-word",
|
|
342
|
+
backgroundColor: "transparent",
|
|
343
|
+
},
|
|
344
|
+
// INFO : Disble header link
|
|
345
|
+
rehypeRewrite: function (node, _index, parent) {
|
|
346
|
+
if (node.tagName === "a" &&
|
|
347
|
+
parent &&
|
|
348
|
+
/^h(1|2|3|4|5|6)/.test(parent.tagName)) {
|
|
349
|
+
parent.children = parent.children.slice(1);
|
|
350
|
+
}
|
|
351
|
+
} })));
|
|
352
|
+
eachData[eachKey] = markdownValue;
|
|
353
|
+
break;
|
|
354
|
+
default:
|
|
355
|
+
if (eachKey === "id" || eachKey === "_id") {
|
|
356
|
+
eachData[eachKey] = eachValue;
|
|
357
|
+
}
|
|
358
|
+
break;
|
|
200
359
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (organisationMembers) {
|
|
213
|
-
if (Array.isArray(eachValue)) {
|
|
214
|
-
personData_1 = organisationMembers.filter(function (orgMember) {
|
|
215
|
-
return eachValue.includes(orgMember.key);
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
else if (eachValue) {
|
|
219
|
-
personData_1 = organisationMembers.filter(function (orgMember) { return eachValue === orgMember.key; });
|
|
360
|
+
//TODO : Change draft position
|
|
361
|
+
if (isDraft && !isTag && eachKey !== "_id" && eachKey !== "id") {
|
|
362
|
+
eachData[eachKey] = (react_1.default.createElement("div", { className: "flex flex-row justify-start items-center" },
|
|
363
|
+
react_1.default.createElement(tag_1.Tag, { size: "small", tagText: "Draft" }),
|
|
364
|
+
eachData[eachKey]));
|
|
365
|
+
isTag = true;
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
for (_i = 0, _a = Object.entries(eachNewData); _i < _a.length; _i++) {
|
|
369
|
+
_b = _a[_i], eachKey = _b[0], eachValue = _b[1];
|
|
370
|
+
_loop_2(eachKey, eachValue);
|
|
220
371
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
372
|
+
return [4 /*yield*/, handleProcessShowReferences(eachData, eachNewData, modelSchema, devSettings, dbModule, schemaReference)];
|
|
373
|
+
case 1:
|
|
374
|
+
eachData = _j.sent();
|
|
375
|
+
modelSchema.map(function (eachModel) {
|
|
376
|
+
switch (eachModel.type) {
|
|
377
|
+
case "math":
|
|
378
|
+
try {
|
|
379
|
+
var expr = parser.parse(eachModel.mathExpression);
|
|
380
|
+
var variableKeys_1 = {};
|
|
381
|
+
var exprVariables = expr.variables();
|
|
382
|
+
exprVariables === null || exprVariables === void 0 ? void 0 : exprVariables.map(function (eachVariable) {
|
|
383
|
+
variableKeys_1[eachVariable] = eachDataAttribute[eachVariable];
|
|
384
|
+
return null;
|
|
385
|
+
});
|
|
386
|
+
eachData[eachModel.id] = expr.evaluate(variableKeys_1);
|
|
387
|
+
}
|
|
388
|
+
catch (err) {
|
|
389
|
+
eachData[eachModel.id] = "Error";
|
|
390
|
+
}
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
228
393
|
return null;
|
|
229
394
|
});
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
fontSize: 14,
|
|
240
|
-
lineHeight: 1.25,
|
|
241
|
-
wordBreak: "break-word",
|
|
242
|
-
backgroundColor: "transparent",
|
|
243
|
-
},
|
|
244
|
-
// INFO : Disble header link
|
|
245
|
-
rehypeRewrite: function (node, _index, parent) {
|
|
246
|
-
if (node.tagName === "a" &&
|
|
247
|
-
parent &&
|
|
248
|
-
/^h(1|2|3|4|5|6)/.test(parent.tagName)) {
|
|
249
|
-
parent.children = parent.children.slice(1);
|
|
250
|
-
}
|
|
251
|
-
} })));
|
|
252
|
-
eachData[eachKey] = markdownValue;
|
|
253
|
-
break;
|
|
254
|
-
default:
|
|
255
|
-
if (eachKey === "id" || eachKey === "_id") {
|
|
256
|
-
eachData[eachKey] = eachValue;
|
|
257
|
-
}
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
if (isDraft && !isTag && eachKey !== "_id" && eachKey !== "id") {
|
|
261
|
-
eachData[eachKey] = (react_1.default.createElement("div", { className: "flex flex-row justify-start items-center" },
|
|
262
|
-
react_1.default.createElement(tag_1.Tag, { size: "small", tagText: "Draft" }),
|
|
263
|
-
eachData[eachKey]));
|
|
264
|
-
isTag = true;
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
for (var _i = 0, _g = Object.entries(eachNewData); _i < _g.length; _i++) {
|
|
268
|
-
var _h = _g[_i], eachKey = _h[0], eachValue = _h[1];
|
|
269
|
-
_loop_1(eachKey, eachValue);
|
|
270
|
-
}
|
|
271
|
-
(0, exports.handleDataEditButton)(eachData, handleNavigate, addActionBtns, setActivityModal, setActivityId, activityLog);
|
|
272
|
-
dataList.push(server === "mongoServer"
|
|
273
|
-
? __assign(__assign({}, eachData), { id: eachData["_id"] }) : __assign({}, eachData));
|
|
274
|
-
return null;
|
|
275
|
-
});
|
|
395
|
+
(0, exports.handleDataEditButton)(eachData, handleNavigate, addActionBtns, setActivityModal, setActivityId, activityLog);
|
|
396
|
+
dataList.push(server === "mongoServer"
|
|
397
|
+
? __assign(__assign({}, eachData), { id: eachData["_id"] }) : __assign({}, eachData));
|
|
398
|
+
return [2 /*return*/, null];
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
}); }))];
|
|
402
|
+
case 2:
|
|
403
|
+
_a.sent();
|
|
276
404
|
return [2 /*return*/, dataList];
|
|
277
405
|
}
|
|
278
406
|
});
|
|
@@ -589,7 +717,7 @@ var renderSelectedRefreshTab = function (localURLEndpoint, type, collectionId, d
|
|
|
589
717
|
};
|
|
590
718
|
exports.renderSelectedRefreshTab = renderSelectedRefreshTab;
|
|
591
719
|
var handleExportPDF = function (csvDownloadLink, printOnly) { return __awaiter(void 0, void 0, void 0, function () {
|
|
592
|
-
var response, csvData, fileName_1,
|
|
720
|
+
var response, csvData, fileName_1, err_2;
|
|
593
721
|
var _a;
|
|
594
722
|
return __generator(this, function (_b) {
|
|
595
723
|
switch (_b.label) {
|
|
@@ -642,8 +770,8 @@ var handleExportPDF = function (csvDownloadLink, printOnly) { return __awaiter(v
|
|
|
642
770
|
});
|
|
643
771
|
return [3 /*break*/, 4];
|
|
644
772
|
case 3:
|
|
645
|
-
|
|
646
|
-
throw
|
|
773
|
+
err_2 = _b.sent();
|
|
774
|
+
throw err_2;
|
|
647
775
|
case 4: return [2 /*return*/];
|
|
648
776
|
}
|
|
649
777
|
});
|