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