blixify-ui-web 0.4.34 → 0.4.35
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 +241 -375
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/spaceModel.d.ts +2 -0
- package/lib/components/data/dataTemplate/spaceModel.d.ts.map +1 -1
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +28 -21
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/input/address/index.d.ts.map +1 -1
- package/lib/components/input/address/index.js +5 -4
- package/lib/components/input/address/index.js.map +1 -1
- package/lib/components/input/uploadInput/index.js +1 -1
- package/lib/components/input/uploadInput/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -140,7 +140,7 @@ var pagination_1 = require("./pagination");
|
|
|
140
140
|
var referenceModal_1 = require("./referenceModal");
|
|
141
141
|
var settingsModal_1 = require("./settingsModal");
|
|
142
142
|
exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
143
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20;
|
|
143
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21;
|
|
144
144
|
var formRef = (0, react_1.createRef)();
|
|
145
145
|
var objectFormRef = (0, react_1.createRef)();
|
|
146
146
|
var listAddressFromRef = (0, react_1.createRef)();
|
|
@@ -155,133 +155,135 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
155
155
|
var typingTimeout = (0, react_1.useRef)();
|
|
156
156
|
// const oldCollectionId: any = useRef();
|
|
157
157
|
var mapViewRef = (0, react_1.useRef)();
|
|
158
|
-
var
|
|
159
|
-
var
|
|
158
|
+
var _22 = (0, react_1.useState)(false), loading = _22[0], setLoading = _22[1];
|
|
159
|
+
var _23 = (0, react_1.useState)(), notification = _23[0], setNotification = _23[1];
|
|
160
160
|
//INFO : Used by List
|
|
161
|
-
var
|
|
162
|
-
var
|
|
163
|
-
var
|
|
164
|
-
var
|
|
165
|
-
var
|
|
166
|
-
var
|
|
167
|
-
var
|
|
161
|
+
var _24 = (0, react_1.useState)({}), filterSearch = _24[0], setFilterSearch = _24[1];
|
|
162
|
+
var _25 = (0, react_1.useState)({}), filterSearchParams = _25[0], setFilterSearchParams = _25[1];
|
|
163
|
+
var _26 = (0, react_1.useState)({}), filterSelection = _26[0], setFilterSelection = _26[1];
|
|
164
|
+
var _27 = (0, react_1.useState)({}), filterReference = _27[0], setFilterReference = _27[1];
|
|
165
|
+
var _28 = (0, react_1.useState)({}), filterReferenceSearch = _28[0], setFilterReferenceSearch = _28[1];
|
|
166
|
+
var _29 = (0, react_1.useState)({}), filterReferenceList = _29[0], setFilterReferenceList = _29[1];
|
|
167
|
+
var _30 = (0, react_1.useState)({
|
|
168
168
|
startDate: undefined,
|
|
169
169
|
endDate: undefined,
|
|
170
|
-
}), filterReferenceDate =
|
|
171
|
-
var
|
|
172
|
-
var
|
|
173
|
-
var
|
|
174
|
-
var
|
|
175
|
-
var
|
|
176
|
-
var
|
|
177
|
-
var
|
|
178
|
-
var
|
|
179
|
-
var
|
|
180
|
-
var
|
|
181
|
-
var
|
|
182
|
-
var
|
|
170
|
+
}), filterReferenceDate = _30[0], setFilterReferenceDate = _30[1];
|
|
171
|
+
var _31 = (0, react_1.useState)(true), tableLoading = _31[0], setTableLoading = _31[1];
|
|
172
|
+
var _32 = (0, react_1.useState)(""), cursor = _32[0], setCursor = _32[1];
|
|
173
|
+
var _33 = (0, react_1.useState)(""), lastCursor = _33[0], setLastCursor = _33[1];
|
|
174
|
+
var _34 = (0, react_1.useState)([]), tableData = _34[0], setTableData = _34[1];
|
|
175
|
+
var _35 = (0, react_1.useState)([]), spaceTableData = _35[0], setSpaceTableData = _35[1];
|
|
176
|
+
var _36 = (0, react_1.useState)(0), size = _36[0], setSize = _36[1];
|
|
177
|
+
var _37 = (0, react_1.useState)((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.pageIndex) !== null && _b !== void 0 ? _b : 0), pageIndex = _37[0], setPageIndex = _37[1];
|
|
178
|
+
var _38 = (0, react_1.useState)([]), selectedIds = _38[0], setSelectedIds = _38[1];
|
|
179
|
+
var _39 = (0, react_1.useState)(false), selectAll = _39[0], setSelectAll = _39[1];
|
|
180
|
+
var _40 = (0, react_1.useState)(""), deletePasscode = _40[0], setDeletePasscode = _40[1];
|
|
181
|
+
var _41 = (0, react_1.useState)(""), deletePasscodeInput = _41[0], setDeletePasscodeInput = _41[1];
|
|
182
|
+
var _42 = (0, react_1.useState)(""), deleteFeedId = _42[0], setDeleteFeedId = _42[1];
|
|
183
183
|
var previousType = (0, react_1.useRef)();
|
|
184
184
|
var previousSelectedData = (0, react_1.useRef)();
|
|
185
185
|
//INFO : Used by List Organise
|
|
186
|
-
var
|
|
187
|
-
var
|
|
188
|
-
var
|
|
189
|
-
var
|
|
190
|
-
var
|
|
191
|
-
var
|
|
192
|
-
var
|
|
193
|
-
var
|
|
194
|
-
var
|
|
195
|
-
var
|
|
196
|
-
var
|
|
197
|
-
var
|
|
186
|
+
var _43 = (0, react_1.useState)(false), sortModal = _43[0], setSortModal = _43[1];
|
|
187
|
+
var _44 = (0, react_1.useState)(false), filterModal = _44[0], setFilterModal = _44[1];
|
|
188
|
+
var _45 = (0, react_1.useState)(false), addTabModal = _45[0], setAddTabModal = _45[1];
|
|
189
|
+
var _46 = (0, react_1.useState)(false), overviewModal = _46[0], setOverviewModal = _46[1];
|
|
190
|
+
var _47 = (0, react_1.useState)((_c = props.defaultTab) !== null && _c !== void 0 ? _c : ""), selectedTab = _47[0], setSelectedTab = _47[1];
|
|
191
|
+
var _48 = (0, react_1.useState)("dayGridMonth"), calendarView = _48[0], setCalendarView = _48[1];
|
|
192
|
+
var _49 = (0, react_1.useState)(new Date()), calendarTabMonth = _49[0], setCalendarTabMonth = _49[1];
|
|
193
|
+
var _50 = (0, react_1.useState)(true), kanbanDroppable = _50[0], setKanbanDroppable = _50[1];
|
|
194
|
+
var _51 = (0, react_1.useState)([]), kanbanOptions = _51[0], setKanbanOptions = _51[1];
|
|
195
|
+
var _52 = (0, react_1.useState)(false), queryForm = _52[0], setQueryForm = _52[1];
|
|
196
|
+
var _53 = (0, react_1.useState)(false), batchUpdateModal = _53[0], setBatchUpdateModal = _53[1];
|
|
197
|
+
var _54 = (0, react_1.useState)({
|
|
198
198
|
columnId: "",
|
|
199
199
|
columnData: {},
|
|
200
|
-
}), batchUpdateData =
|
|
200
|
+
}), batchUpdateData = _54[0], setBatchUpdateData = _54[1];
|
|
201
|
+
var _55 = (0, react_1.useState)((props === null || props === void 0 ? void 0 : props.model) || []), structure = _55[0], setStructure = _55[1];
|
|
202
|
+
var _56 = (0, react_1.useState)(((_d = props === null || props === void 0 ? void 0 : props.organise) === null || _d === void 0 ? void 0 : _d.additionalQuery) || []), additionalQuery = _56[0], setAdditionalQuery = _56[1];
|
|
201
203
|
//INFO : Used by Auth
|
|
202
|
-
var
|
|
204
|
+
var _57 = (0, react_1.useState)({
|
|
203
205
|
email: "",
|
|
204
206
|
google: "",
|
|
205
207
|
phone: "",
|
|
206
208
|
disabled: false,
|
|
207
|
-
}), authMethods =
|
|
208
|
-
var
|
|
209
|
+
}), authMethods = _57[0], setAuthMethods = _57[1];
|
|
210
|
+
var _58 = (0, react_1.useState)(""), selectedAuthMethod = _58[0], setSelectedAuthMethod = _58[1];
|
|
209
211
|
// INFO: Used by Activity Log
|
|
210
|
-
var
|
|
211
|
-
var
|
|
212
|
+
var _59 = (0, react_1.useState)(false), activityModal = _59[0], setActivityModal = _59[1];
|
|
213
|
+
var _60 = (0, react_1.useState)(""), activityId = _60[0], setActivityId = _60[1];
|
|
212
214
|
//INFO : Used by Export
|
|
213
|
-
var
|
|
214
|
-
var
|
|
215
|
-
var
|
|
216
|
-
var
|
|
217
|
-
var
|
|
218
|
-
var
|
|
219
|
-
var
|
|
220
|
-
var
|
|
221
|
-
var
|
|
222
|
-
var
|
|
223
|
-
var
|
|
224
|
-
var
|
|
225
|
-
var
|
|
215
|
+
var _61 = (0, react_1.useState)(null), csvFile = _61[0], setCSVFile = _61[1];
|
|
216
|
+
var _62 = (0, react_1.useState)([]), csvFileData = _62[0], setCSVFileData = _62[1];
|
|
217
|
+
var _63 = (0, react_1.useState)(0), stepCSVIndex = _63[0], setStepCSVIndex = _63[1];
|
|
218
|
+
var _64 = (0, react_1.useState)({}), listCSVMapAttribute = _64[0], setListCSVMapAttribute = _64[1];
|
|
219
|
+
var _65 = (0, react_1.useState)({}), listCSVObjAttribute = _65[0], setListCSVObjAttribute = _65[1];
|
|
220
|
+
var _66 = (0, react_1.useState)([]), csvAPIAttribute = _66[0], setCSVAPIAttribute = _66[1];
|
|
221
|
+
var _67 = (0, react_1.useState)(((_e = props.devSettings.currentUser) === null || _e === void 0 ? void 0 : _e.userEmail) || ""), exportCSVEmail = _67[0], setExportCSVEmail = _67[1];
|
|
222
|
+
var _68 = (0, react_1.useState)(((_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.exportSettings) === null || _g === void 0 ? void 0 : _g.defaultExportPDFName) || ""), exportPDFTitle = _68[0], setExportPDFTitle = _68[1];
|
|
223
|
+
var _69 = (0, react_1.useState)([]), exportSumAttributeIds = _69[0], setExportSumAttributeIds = _69[1];
|
|
224
|
+
var _70 = (0, react_1.useState)([]), importTableData = _70[0], setImportTableData = _70[1];
|
|
225
|
+
var _71 = (0, react_1.useState)([]), queryList = _71[0], setQueryList = _71[1];
|
|
226
|
+
var _72 = (0, react_1.useState)(-1), queryIndex = _72[0], setQueryIndex = _72[1];
|
|
227
|
+
var _73 = (0, react_1.useState)((_h = props.organise) === null || _h === void 0 ? void 0 : _h.groupBy), groupId = _73[0], setGroupId = _73[1];
|
|
226
228
|
//INFO : Used by Read
|
|
227
229
|
//INFO : Used by Update
|
|
228
|
-
var
|
|
229
|
-
var
|
|
230
|
-
var
|
|
231
|
-
var
|
|
232
|
-
var
|
|
233
|
-
var
|
|
234
|
-
var
|
|
235
|
-
var
|
|
236
|
-
var
|
|
237
|
-
var
|
|
238
|
-
var
|
|
239
|
-
var
|
|
230
|
+
var _74 = (0, react_1.useState)(false), modalVisible = _74[0], setModalVisible = _74[1];
|
|
231
|
+
var _75 = (0, react_1.useState)(false), deleteModal = _75[0], setDeleteModal = _75[1];
|
|
232
|
+
var _76 = (0, react_1.useState)(false), excelModal = _76[0], setExcelModal = _76[1];
|
|
233
|
+
var _77 = (0, react_1.useState)(false), exportExcel = _77[0], setExportExcel = _77[1];
|
|
234
|
+
var _78 = (0, react_1.useState)(""), exportType = _78[0], setExportType = _78[1];
|
|
235
|
+
var _79 = (0, react_1.useState)(false), exportQR = _79[0], setExportQR = _79[1];
|
|
236
|
+
var _80 = (0, react_1.useState)(false), signatureSigning = _80[0], setSignatureSigning = _80[1];
|
|
237
|
+
var _81 = (0, react_1.useState)({}), selectedData = _81[0], setSelectedData = _81[1];
|
|
238
|
+
var _82 = (0, react_1.useState)(""), selectedObjectStructureId = _82[0], setSelectedObjectStructureId = _82[1];
|
|
239
|
+
var _83 = (0, react_1.useState)(""), selectedObjectId = _83[0], setSelectedObjectId = _83[1];
|
|
240
|
+
var _84 = (0, react_1.useState)(""), selectedListAddressId = _84[0], setSelectedListAddressId = _84[1];
|
|
241
|
+
var _85 = (0, react_1.useState)({
|
|
240
242
|
lat: 0,
|
|
241
243
|
lng: 0,
|
|
242
244
|
name: "",
|
|
243
|
-
}), selectedListAddress =
|
|
244
|
-
var
|
|
245
|
-
var
|
|
246
|
-
var
|
|
247
|
-
var
|
|
248
|
-
var
|
|
249
|
-
var
|
|
250
|
-
var
|
|
245
|
+
}), selectedListAddress = _85[0], setSelectedListAddress = _85[1];
|
|
246
|
+
var _86 = (0, react_1.useState)({}), selectedObjectData = _86[0], setSelectedObjectData = _86[1];
|
|
247
|
+
var _87 = (0, react_1.useState)(false), referenceLoading = _87[0], setReferenceLoading = _87[1];
|
|
248
|
+
var _88 = (0, react_1.useState)({}), referencesOptions = _88[0], setReferencesOptions = _88[1];
|
|
249
|
+
var _89 = (0, react_1.useState)({}), referencesDetails = _89[0], setReferencesDetails = _89[1];
|
|
250
|
+
var _90 = (0, react_1.useState)({}), referenceDeleteTableData = _90[0], setReferenceDeleteTableData = _90[1];
|
|
251
|
+
var _91 = (0, react_1.useState)(0), referenceDeleteIndex = _91[0], setReferenceDeleteIndex = _91[1];
|
|
252
|
+
var _92 = (0, react_1.useState)({
|
|
251
253
|
id: "",
|
|
252
254
|
name: "",
|
|
253
255
|
type: "string",
|
|
254
|
-
}), referenceCreationModal =
|
|
255
|
-
var
|
|
256
|
+
}), referenceCreationModal = _92[0], setReferenceCreationModal = _92[1];
|
|
257
|
+
var _93 = (0, react_1.useState)({}), referenceModelSchema = _93[0], setReferenceSchema = _93[1];
|
|
256
258
|
// INFO ; Use to Trigger Update Prefill UI
|
|
257
|
-
var
|
|
259
|
+
var _94 = (0, react_1.useState)(false), prefillTrigger = _94[0], setPrefillTrigger = _94[1];
|
|
258
260
|
//INFO : Offline
|
|
259
|
-
var
|
|
260
|
-
var
|
|
261
|
+
var _95 = (0, react_1.useState)(0), offlineDataLength = _95[0], setOfflineDataLength = _95[1];
|
|
262
|
+
var _96 = (0, react_1.useState)(false), offlineModal = _96[0], setOfflineModal = _96[1];
|
|
261
263
|
var devSettings = props.devSettings;
|
|
262
264
|
var serverId = (0, utils_1.parseServerId)(devSettings.server);
|
|
263
|
-
var viewType = (
|
|
265
|
+
var viewType = (_k = (_j = props.organise) === null || _j === void 0 ? void 0 : _j.viewId) !== null && _k !== void 0 ? _k : "general";
|
|
264
266
|
var isFirebaseClient = devSettings.server === "firebase";
|
|
265
267
|
var isFirebase = isFirebaseClient || devSettings.server === "fbServer";
|
|
266
|
-
var dbModule = isFirebaseClient ? (
|
|
268
|
+
var dbModule = isFirebaseClient ? (_l = props.lib) === null || _l === void 0 ? void 0 : _l.firebase : (_m = props.lib) === null || _m === void 0 ? void 0 : _m.axios;
|
|
267
269
|
var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
|
|
268
270
|
var limit = props.limit ? props.limit : 10;
|
|
269
|
-
var isEditor = ((
|
|
270
|
-
var isOffline = (
|
|
271
|
-
var showId = (
|
|
272
|
-
var idField = (
|
|
273
|
-
var pipeline = (
|
|
274
|
-
var hasNavigation = ((
|
|
275
|
-
var formColumn = ((
|
|
271
|
+
var isEditor = ((_o = props.edit) === null || _o === void 0 ? void 0 : _o.allEditable) ? true : false;
|
|
272
|
+
var isOffline = (_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareOffline;
|
|
273
|
+
var showId = (_q = props.space) === null || _q === void 0 ? void 0 : _q.showId;
|
|
274
|
+
var idField = (_r = props.space) === null || _r === void 0 ? void 0 : _r.idField;
|
|
275
|
+
var pipeline = (_s = props === null || props === void 0 ? void 0 : props.space) === null || _s === void 0 ? void 0 : _s.pipeline;
|
|
276
|
+
var hasNavigation = ((_t = props.organise) === null || _t === void 0 ? void 0 : _t.handleNavigate) ? true : false;
|
|
277
|
+
var formColumn = ((_u = props.bareSettings) === null || _u === void 0 ? void 0 : _u.bareUpdateOneColumn)
|
|
276
278
|
? "grid-cols-2"
|
|
277
279
|
: "grid-cols-4";
|
|
278
|
-
var isActivityLog = (((
|
|
279
|
-
((
|
|
280
|
-
(((
|
|
281
|
-
((
|
|
280
|
+
var isActivityLog = (((_w = (_v = props.edit) === null || _v === void 0 ? void 0 : _v.activityLog) === null || _w === void 0 ? void 0 : _w.enableComments) &&
|
|
281
|
+
((_x = props.edit) === null || _x === void 0 ? void 0 : _x.activityLog.commentCollectionId)) ||
|
|
282
|
+
(((_z = (_y = props.edit) === null || _y === void 0 ? void 0 : _y.activityLog) === null || _z === void 0 ? void 0 : _z.enableLogs) &&
|
|
283
|
+
((_0 = props.edit) === null || _0 === void 0 ? void 0 : _0.activityLog.logsCollectionId));
|
|
282
284
|
//TODO : Code - Pass ...devSettings, search dbEndpoint:
|
|
283
285
|
var writeServerQuery = new writeQuery_1.WriteQuery({
|
|
284
|
-
dbModule: (
|
|
286
|
+
dbModule: (_1 = props.lib) === null || _1 === void 0 ? void 0 : _1.axios,
|
|
285
287
|
dbType: devSettings.server,
|
|
286
288
|
dbCollection: props.collectionId,
|
|
287
289
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -289,7 +291,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
289
291
|
dbUserToken: devSettings.dbUserToken,
|
|
290
292
|
});
|
|
291
293
|
var readServerQuery = new readQuery_1.ReadQuery({
|
|
292
|
-
dbModule: (
|
|
294
|
+
dbModule: (_2 = props.lib) === null || _2 === void 0 ? void 0 : _2.axios,
|
|
293
295
|
dbType: devSettings.server,
|
|
294
296
|
dbCollection: props.collectionId,
|
|
295
297
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -297,7 +299,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
297
299
|
dbUserToken: devSettings.dbUserToken,
|
|
298
300
|
});
|
|
299
301
|
var moreButtonPopUp = [
|
|
300
|
-
((
|
|
302
|
+
((_3 = props.edit) === null || _3 === void 0 ? void 0 : _3.allEditable) && !isFirebase
|
|
301
303
|
? {
|
|
302
304
|
text: "Import Excel",
|
|
303
305
|
onClick: function () {
|
|
@@ -306,7 +308,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
306
308
|
},
|
|
307
309
|
}
|
|
308
310
|
: null,
|
|
309
|
-
!((
|
|
311
|
+
!((_5 = (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.exportSettings) === null || _5 === void 0 ? void 0 : _5.hideExportCSV)
|
|
310
312
|
? {
|
|
311
313
|
text: "Export CSV",
|
|
312
314
|
onClick: function () {
|
|
@@ -316,7 +318,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
316
318
|
},
|
|
317
319
|
}
|
|
318
320
|
: null,
|
|
319
|
-
!((
|
|
321
|
+
!((_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.exportSettings) === null || _7 === void 0 ? void 0 : _7.hideExportExcel)
|
|
320
322
|
? {
|
|
321
323
|
text: "Export Excel",
|
|
322
324
|
onClick: function () {
|
|
@@ -326,7 +328,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
326
328
|
},
|
|
327
329
|
}
|
|
328
330
|
: null,
|
|
329
|
-
!((
|
|
331
|
+
!((_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.exportSettings) === null || _9 === void 0 ? void 0 : _9.hideExportPDF)
|
|
330
332
|
? {
|
|
331
333
|
text: "Export PDF",
|
|
332
334
|
onClick: function () {
|
|
@@ -336,7 +338,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
336
338
|
},
|
|
337
339
|
}
|
|
338
340
|
: null,
|
|
339
|
-
!((
|
|
341
|
+
!((_11 = (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.exportSettings) === null || _11 === void 0 ? void 0 : _11.hideExportQR)
|
|
340
342
|
? {
|
|
341
343
|
text: "Export QR",
|
|
342
344
|
onClick: function () {
|
|
@@ -346,7 +348,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
346
348
|
},
|
|
347
349
|
}
|
|
348
350
|
: null,
|
|
349
|
-
!((
|
|
351
|
+
!((_13 = (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.exportSettings) === null || _13 === void 0 ? void 0 : _13.hideExportPrint)
|
|
350
352
|
? {
|
|
351
353
|
text: "Print",
|
|
352
354
|
onClick: function () {
|
|
@@ -358,11 +360,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
358
360
|
}
|
|
359
361
|
: null,
|
|
360
362
|
].filter(Boolean);
|
|
361
|
-
if ((
|
|
363
|
+
if ((_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.moreSettings)
|
|
362
364
|
moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
|
|
363
365
|
var renderImpSearchFilterConditions = function () {
|
|
364
366
|
var _a;
|
|
365
|
-
return (0, listModule_1.renderSearchFilterConditions)(
|
|
367
|
+
return (0, listModule_1.renderSearchFilterConditions)(structure, devSettings, {
|
|
366
368
|
filterSearchParams: filterSearchParams,
|
|
367
369
|
filterSelection: filterSelection,
|
|
368
370
|
filterReferenceDate: filterReferenceDate,
|
|
@@ -414,8 +416,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
414
416
|
setSelectedIds([]);
|
|
415
417
|
// INFO - To Get Reference/ListReference/ObjReference Default Value
|
|
416
418
|
if (props.type === "update" && props.id === "new") {
|
|
417
|
-
var clonedData = (0, updateModule_1.handleClonedDataAttribute)({},
|
|
418
|
-
(0, updateModule_1.handleRetrieveReferenceOptions)(clonedData,
|
|
419
|
+
var clonedData = (0, updateModule_1.handleClonedDataAttribute)({}, structure, props.devSettings.server);
|
|
420
|
+
(0, updateModule_1.handleRetrieveReferenceOptions)(clonedData, structure, dbModule, devSettings, setReferencesOptions, setReferencesDetails);
|
|
419
421
|
}
|
|
420
422
|
if (props.id !== "new" && props.id !== "") {
|
|
421
423
|
setModalVisible(true);
|
|
@@ -446,26 +448,29 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
446
448
|
(0, react_1.useEffect)(function () {
|
|
447
449
|
var handleInitTab = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
448
450
|
var currentTab, kanbanSettings, kanbanTitle_1, kanbanRefRQ_1, kanbanRefOption_1, kanbanRefLabel_1, kanbanRefQuery;
|
|
449
|
-
var _a, _b, _c, _d, _e;
|
|
450
|
-
return __generator(this, function (
|
|
451
|
-
switch (
|
|
451
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
452
|
+
return __generator(this, function (_o) {
|
|
453
|
+
switch (_o.label) {
|
|
452
454
|
case 0:
|
|
453
|
-
if (!(props.type === "list")) return [3 /*break*/,
|
|
455
|
+
if (!(props.type === "list")) return [3 /*break*/, 5];
|
|
454
456
|
currentTab = (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, props.type, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.viewId);
|
|
457
|
+
setStructure((_c = props.model) !== null && _c !== void 0 ? _c : []);
|
|
458
|
+
setAdditionalQuery((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.additionalQuery) !== null && _e !== void 0 ? _e : []);
|
|
459
|
+
setGroupId((_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.groupBy) !== null && _g !== void 0 ? _g : "");
|
|
455
460
|
setSelectedTab(currentTab);
|
|
456
461
|
if (!((currentTab === null || currentTab === void 0 ? void 0 : currentTab.viewType) === "calendar")) return [3 /*break*/, 1];
|
|
457
462
|
setFilterSearch({});
|
|
458
463
|
setFilterSearchParams({});
|
|
459
|
-
(
|
|
460
|
-
return [3 /*break*/,
|
|
464
|
+
(_h = listRQueryHocRef.current) === null || _h === void 0 ? void 0 : _h.handleRefresh();
|
|
465
|
+
return [3 /*break*/, 5];
|
|
461
466
|
case 1:
|
|
462
467
|
if (!((currentTab === null || currentTab === void 0 ? void 0 : currentTab.viewType) === "kanban")) return [3 /*break*/, 4];
|
|
463
468
|
kanbanSettings = currentTab === null || currentTab === void 0 ? void 0 : currentTab.kanbanSettings;
|
|
464
|
-
kanbanTitle_1 = (
|
|
469
|
+
kanbanTitle_1 = (_j = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _j !== void 0 ? _j : "";
|
|
465
470
|
kanbanRefRQ_1 = null;
|
|
466
471
|
kanbanRefOption_1 = [];
|
|
467
472
|
kanbanRefLabel_1 = "";
|
|
468
|
-
|
|
473
|
+
structure.map(function (eachModel) {
|
|
469
474
|
var _a, _b;
|
|
470
475
|
if (kanbanTitle_1 === eachModel.id) {
|
|
471
476
|
if (eachModel.type === "reference") {
|
|
@@ -486,10 +491,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
486
491
|
return [4 /*yield*/, kanbanRefRQ_1.call({
|
|
487
492
|
type: "list",
|
|
488
493
|
limit: limit,
|
|
489
|
-
query: ((
|
|
494
|
+
query: ((_k = currentTab === null || currentTab === void 0 ? void 0 : currentTab.kanbanSettings) === null || _k === void 0 ? void 0 : _k.query) || undefined,
|
|
490
495
|
})];
|
|
491
496
|
case 2:
|
|
492
|
-
kanbanRefQuery =
|
|
497
|
+
kanbanRefQuery = _o.sent();
|
|
493
498
|
if (kanbanRefQuery.data) {
|
|
494
499
|
kanbanRefQuery.data.map(function (eachData) {
|
|
495
500
|
kanbanRefOption_1.push({
|
|
@@ -499,11 +504,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
499
504
|
return null;
|
|
500
505
|
});
|
|
501
506
|
}
|
|
502
|
-
|
|
507
|
+
_o.label = 3;
|
|
503
508
|
case 3:
|
|
504
509
|
setKanbanOptions(kanbanRefOption_1);
|
|
505
|
-
|
|
506
|
-
case 4:
|
|
510
|
+
return [3 /*break*/, 5];
|
|
511
|
+
case 4:
|
|
512
|
+
if ((currentTab === null || currentTab === void 0 ? void 0 : currentTab.viewType) === "report") {
|
|
513
|
+
if (currentTab.structure)
|
|
514
|
+
setStructure((_l = currentTab.structure) !== null && _l !== void 0 ? _l : []);
|
|
515
|
+
if (currentTab.additionalQuery)
|
|
516
|
+
setAdditionalQuery((_m = currentTab.additionalQuery) !== null && _m !== void 0 ? _m : []);
|
|
517
|
+
if (currentTab.groupBy)
|
|
518
|
+
setGroupId(currentTab.groupBy);
|
|
519
|
+
}
|
|
520
|
+
_o.label = 5;
|
|
521
|
+
case 5: return [2 /*return*/];
|
|
507
522
|
}
|
|
508
523
|
});
|
|
509
524
|
}); };
|
|
@@ -512,8 +527,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
512
527
|
props.collectionId,
|
|
513
528
|
props.id,
|
|
514
529
|
props.localURLEndpoint,
|
|
515
|
-
(
|
|
516
|
-
(
|
|
530
|
+
(_15 = props.organise) === null || _15 === void 0 ? void 0 : _15.extendedTabs,
|
|
531
|
+
(_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.viewId,
|
|
517
532
|
props.type,
|
|
518
533
|
]);
|
|
519
534
|
(0, react_1.useEffect)(function () {
|
|
@@ -521,7 +536,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
521
536
|
if ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.exportSettings) === null || _b === void 0 ? void 0 : _b.sumColumnId) {
|
|
522
537
|
setExportSumAttributeIds((_e = (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.exportSettings) === null || _d === void 0 ? void 0 : _d.sumColumnId) !== null && _e !== void 0 ? _e : []);
|
|
523
538
|
}
|
|
524
|
-
}, (
|
|
539
|
+
}, (_18 = (_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.exportSettings) === null || _18 === void 0 ? void 0 : _18.sumColumnId);
|
|
525
540
|
(0, react_1.useEffect)(function () {
|
|
526
541
|
if (props.devSettings.schemaReference)
|
|
527
542
|
setReferenceSchema(props.devSettings.schemaReference);
|
|
@@ -781,7 +796,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
781
796
|
});
|
|
782
797
|
prettierDataList = dummyPrettierDataList_1;
|
|
783
798
|
return [3 /*break*/, 4];
|
|
784
|
-
case 2: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_c = props.lib) === null || _c === void 0 ? void 0 : _c.axios,
|
|
799
|
+
case 2: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_c = props.lib) === null || _c === void 0 ? void 0 : _c.axios, structure, (_d = props.organise) === null || _d === void 0 ? void 0 : _d.handleNavigate, ((_e = props.organise) === null || _e === void 0 ? void 0 : _e.viewId) === "general", setActivityModal, setActivityId, isActivityLog ? (_f = props.edit) === null || _f === void 0 ? void 0 : _f.activityLog : undefined, (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListActionBtns)];
|
|
785
800
|
case 3:
|
|
786
801
|
prettierDataList = _m.sent();
|
|
787
802
|
_m.label = 4;
|
|
@@ -1051,7 +1066,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1051
1066
|
//SECTION: Handle Object
|
|
1052
1067
|
//=====================================================================================
|
|
1053
1068
|
var handleRemoveObjectListData = function () {
|
|
1054
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
1069
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server);
|
|
1055
1070
|
if (selectedObjectId) {
|
|
1056
1071
|
var index = clonedSelectedData[selectedObjectStructureId].findIndex(function (eachData) { return eachData.id === selectedObjectId; });
|
|
1057
1072
|
if (index !== -1) {
|
|
@@ -1064,8 +1079,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1064
1079
|
};
|
|
1065
1080
|
var handleSubmitObjectDataType = function () {
|
|
1066
1081
|
var _a, _b;
|
|
1067
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
1068
|
-
var filterObjectModel =
|
|
1082
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, showId);
|
|
1083
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
1069
1084
|
return eachModel.id === selectedObjectStructureId;
|
|
1070
1085
|
});
|
|
1071
1086
|
var clonedSelectedObjectData = (0, updateModule_1.handleClonedDataAttribute)(selectedObjectData, (_a = filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.objectData) !== null && _a !== void 0 ? _a : [], props.devSettings.server, true, true);
|
|
@@ -1108,7 +1123,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1108
1123
|
//TODO: Bug - try to solve clicking List Object too fast
|
|
1109
1124
|
var handleSelectListObjectData = function (id, structureId, objectIndex) {
|
|
1110
1125
|
var _a;
|
|
1111
|
-
var filterObjectModel =
|
|
1126
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
1112
1127
|
return eachModel.id === structureId;
|
|
1113
1128
|
});
|
|
1114
1129
|
if ((filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.type) === "listObject") {
|
|
@@ -1195,12 +1210,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1195
1210
|
return __generator(this, function (_a) {
|
|
1196
1211
|
switch (_a.label) {
|
|
1197
1212
|
case 0:
|
|
1198
|
-
clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(data !== null && data !== void 0 ? data : selectedData,
|
|
1199
|
-
return [4 /*yield*/, handleParseImageField(id, clonedSelectedData,
|
|
1213
|
+
clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(data !== null && data !== void 0 ? data : selectedData, structure, props.devSettings.server, true, showId);
|
|
1214
|
+
return [4 /*yield*/, handleParseImageField(id, clonedSelectedData, structure)];
|
|
1200
1215
|
case 1:
|
|
1201
1216
|
//INFO: Parse & Upload Data "Image & File attributes"
|
|
1202
1217
|
clonedSelectedData = _a.sent();
|
|
1203
|
-
objectAttribute =
|
|
1218
|
+
objectAttribute = structure.filter(function (eachAttribute) {
|
|
1204
1219
|
return eachAttribute.type === "object";
|
|
1205
1220
|
});
|
|
1206
1221
|
return [4 /*yield*/, Promise.all(objectAttribute.map(function (eachObject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1216,7 +1231,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1216
1231
|
}); }))];
|
|
1217
1232
|
case 2:
|
|
1218
1233
|
_a.sent();
|
|
1219
|
-
listObjectAttribute =
|
|
1234
|
+
listObjectAttribute = structure.filter(function (eachAttribute) {
|
|
1220
1235
|
return eachAttribute.type === "listObject";
|
|
1221
1236
|
});
|
|
1222
1237
|
return [4 /*yield*/, Promise.all(listObjectAttribute.map(function (eachObject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -2024,7 +2039,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2024
2039
|
_a.trys.push([0, 7, , 8]);
|
|
2025
2040
|
setLoading(true);
|
|
2026
2041
|
setModalVisible(true);
|
|
2027
|
-
model_1 =
|
|
2042
|
+
model_1 = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
|
|
2028
2043
|
columnId_1 = batchUpdateData.columnId;
|
|
2029
2044
|
dataToSubmit_1 = batchUpdateData.columnData;
|
|
2030
2045
|
isFile = (model_1 === null || model_1 === void 0 ? void 0 : model_1.type) === "image" || (model_1 === null || model_1 === void 0 ? void 0 : model_1.type) === "file";
|
|
@@ -2245,7 +2260,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2245
2260
|
createSelectedData_1 = _j.sent();
|
|
2246
2261
|
_j.label = 3;
|
|
2247
2262
|
case 3:
|
|
2248
|
-
uniqueDataStructure =
|
|
2263
|
+
uniqueDataStructure = structure.filter(function (eachStructure) {
|
|
2249
2264
|
return eachStructure.unique;
|
|
2250
2265
|
});
|
|
2251
2266
|
uniqueColumnId = uniqueDataStructure.length > 0 ? uniqueDataStructure[0].id : undefined;
|
|
@@ -2268,7 +2283,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2268
2283
|
case 5:
|
|
2269
2284
|
offlineDataResp = _j.sent();
|
|
2270
2285
|
offlineData = (_e = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _e !== void 0 ? _e : [];
|
|
2271
|
-
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData,
|
|
2286
|
+
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData, structure);
|
|
2272
2287
|
offlineData.push(tempData);
|
|
2273
2288
|
return [4 /*yield*/, indexedDb_1.indexedDb.putValue("local", {
|
|
2274
2289
|
data: offlineData,
|
|
@@ -2300,7 +2315,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2300
2315
|
return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
|
|
2301
2316
|
case 14:
|
|
2302
2317
|
offlineDataResp = _j.sent();
|
|
2303
|
-
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData,
|
|
2318
|
+
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData, structure);
|
|
2304
2319
|
tempData[serverId] = selectedId_2;
|
|
2305
2320
|
selectedIndex_3 = -1;
|
|
2306
2321
|
offlineData = (_f = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _f !== void 0 ? _f : [];
|
|
@@ -2509,9 +2524,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2509
2524
|
}); };
|
|
2510
2525
|
var handleRetrieveSelectedData = function (responseData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2511
2526
|
var clonedReferencesOptions_1, dummyRespData, dummyReferenceModelSchema, newRespData, _a;
|
|
2512
|
-
var _b, _c, _d, _e, _f, _g
|
|
2513
|
-
return __generator(this, function (
|
|
2514
|
-
switch (
|
|
2527
|
+
var _b, _c, _d, _e, _f, _g;
|
|
2528
|
+
return __generator(this, function (_h) {
|
|
2529
|
+
switch (_h.label) {
|
|
2515
2530
|
case 0:
|
|
2516
2531
|
if (!responseData.data) return [3 /*break*/, 6];
|
|
2517
2532
|
if (!((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareOffline)) return [3 /*break*/, 2];
|
|
@@ -2519,7 +2534,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2519
2534
|
if ((_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareReadHandleData)
|
|
2520
2535
|
props.bareSettings.bareReadHandleData(responseData.data);
|
|
2521
2536
|
clonedReferencesOptions_1 = JSON.parse(JSON.stringify(referencesOptions));
|
|
2522
|
-
return [4 /*yield*/, Promise.all(
|
|
2537
|
+
return [4 /*yield*/, Promise.all(structure.map(function (eachModel) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2523
2538
|
var isObject, offlineDataResp, offlineData, prefix_1;
|
|
2524
2539
|
var _a, _b;
|
|
2525
2540
|
return __generator(this, function (_c) {
|
|
@@ -2564,30 +2579,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2564
2579
|
});
|
|
2565
2580
|
}); }))];
|
|
2566
2581
|
case 1:
|
|
2567
|
-
|
|
2582
|
+
_h.sent();
|
|
2568
2583
|
setReferencesOptions(clonedReferencesOptions_1);
|
|
2569
2584
|
return [3 /*break*/, 6];
|
|
2570
2585
|
case 2:
|
|
2571
2586
|
dummyRespData = JSON.parse(JSON.stringify(responseData.data), utils_1.jsonReviver);
|
|
2572
2587
|
dummyReferenceModelSchema = JSON.parse(JSON.stringify(referenceModelSchema));
|
|
2573
2588
|
if (!(props.type === "read")) return [3 /*break*/, 4];
|
|
2574
|
-
return [4 /*yield*/, (0, readModule_1.handleRetrieveDeepModel)(dummyRespData,
|
|
2575
|
-
assetParentId: (
|
|
2576
|
-
bucketName: (
|
|
2577
|
-
}, dummyReferenceModelSchema, setReferenceSchema, (
|
|
2589
|
+
return [4 /*yield*/, (0, readModule_1.handleRetrieveDeepModel)(dummyRespData, structure !== null && structure !== void 0 ? structure : [], dbModule, devSettings, {
|
|
2590
|
+
assetParentId: (_d = props.id) !== null && _d !== void 0 ? _d : "",
|
|
2591
|
+
bucketName: (_e = devSettings.bucketName) !== null && _e !== void 0 ? _e : "",
|
|
2592
|
+
}, dummyReferenceModelSchema, setReferenceSchema, (_f = props.organise) === null || _f === void 0 ? void 0 : _f.handleCustomDownloadFile)];
|
|
2578
2593
|
case 3:
|
|
2579
|
-
_a =
|
|
2594
|
+
_a = _h.sent();
|
|
2580
2595
|
return [3 /*break*/, 5];
|
|
2581
2596
|
case 4:
|
|
2582
2597
|
_a = dummyRespData;
|
|
2583
|
-
|
|
2598
|
+
_h.label = 5;
|
|
2584
2599
|
case 5:
|
|
2585
2600
|
newRespData = _a;
|
|
2586
2601
|
setSelectedData(newRespData);
|
|
2587
|
-
if ((
|
|
2602
|
+
if ((_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareReadHandleData)
|
|
2588
2603
|
props.bareSettings.bareReadHandleData(newRespData);
|
|
2589
|
-
(0, updateModule_1.handleRetrieveReferenceOptions)(newRespData,
|
|
2590
|
-
|
|
2604
|
+
(0, updateModule_1.handleRetrieveReferenceOptions)(newRespData, structure, dbModule, devSettings, setReferencesOptions, setReferencesDetails);
|
|
2605
|
+
_h.label = 6;
|
|
2591
2606
|
case 6:
|
|
2592
2607
|
setModalVisible(false);
|
|
2593
2608
|
setLoading(false);
|
|
@@ -2598,7 +2613,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2598
2613
|
var handleOnChangeData = function () {
|
|
2599
2614
|
var _a;
|
|
2600
2615
|
if (modalVisible && selectedObjectStructureId) {
|
|
2601
|
-
var filterObjectModel =
|
|
2616
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
2602
2617
|
return eachModel.id === selectedObjectStructureId;
|
|
2603
2618
|
});
|
|
2604
2619
|
return {
|
|
@@ -2609,13 +2624,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2609
2624
|
else if (batchUpdateModal && batchUpdateData.columnId) {
|
|
2610
2625
|
return {
|
|
2611
2626
|
data: batchUpdateData.columnData,
|
|
2612
|
-
model:
|
|
2627
|
+
model: structure,
|
|
2613
2628
|
};
|
|
2614
2629
|
}
|
|
2615
2630
|
else {
|
|
2616
2631
|
return {
|
|
2617
2632
|
data: selectedData,
|
|
2618
|
-
model:
|
|
2633
|
+
model: structure,
|
|
2619
2634
|
};
|
|
2620
2635
|
}
|
|
2621
2636
|
};
|
|
@@ -2625,7 +2640,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2625
2640
|
setSelectedObjectData(data);
|
|
2626
2641
|
}
|
|
2627
2642
|
else if (batchUpdateModal && batchUpdateData.columnId) {
|
|
2628
|
-
var selectedModel =
|
|
2643
|
+
var selectedModel = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
|
|
2629
2644
|
if (selectedModel) {
|
|
2630
2645
|
//INFO: [UPDATE] Update data via batch modal
|
|
2631
2646
|
var clonedData = JSON.parse(JSON.stringify(data));
|
|
@@ -2721,7 +2736,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2721
2736
|
var clonedData = (0, updateModule_1.handleClonedDataAttribute)(data, model, props.devSettings.server, false, showId ? true : false);
|
|
2722
2737
|
if ((Array.isArray(value) && value.includes("creation")) ||
|
|
2723
2738
|
value === "creation") {
|
|
2724
|
-
var currentSchema =
|
|
2739
|
+
var currentSchema = structure.filter(function (dsValue) {
|
|
2725
2740
|
return dsValue.id === id;
|
|
2726
2741
|
});
|
|
2727
2742
|
if (currentSchema.length > 0)
|
|
@@ -2764,7 +2779,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2764
2779
|
var eachKey = eachRow[0];
|
|
2765
2780
|
if (!eachKey)
|
|
2766
2781
|
return null;
|
|
2767
|
-
|
|
2782
|
+
structure.map(function (eachModel) {
|
|
2768
2783
|
if (eachKey.toLowerCase().includes(eachModel.id.toLowerCase()) &&
|
|
2769
2784
|
eachModel.id !== "_id" &&
|
|
2770
2785
|
eachModel.id !== "id" &&
|
|
@@ -2814,7 +2829,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2814
2829
|
csvList_1 = [];
|
|
2815
2830
|
_loop_2 = function (eachKey, eachValue) {
|
|
2816
2831
|
if (eachKey && eachValue && typeof eachValue === "string") {
|
|
2817
|
-
var selectedModel =
|
|
2832
|
+
var selectedModel = structure.find(function (eachModel) {
|
|
2818
2833
|
return eachModel.id === eachValue;
|
|
2819
2834
|
});
|
|
2820
2835
|
if ((selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "object" ||
|
|
@@ -2875,7 +2890,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2875
2890
|
}
|
|
2876
2891
|
valid_1 = true;
|
|
2877
2892
|
errorValue_1 = "";
|
|
2878
|
-
return [4 /*yield*/, Promise.all(
|
|
2893
|
+
return [4 /*yield*/, Promise.all(structure.map(function (eachEachModel) {
|
|
2879
2894
|
if (eachEachModel.id === "_id" || eachEachModel.id === "id") {
|
|
2880
2895
|
return "";
|
|
2881
2896
|
}
|
|
@@ -2959,11 +2974,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2959
2974
|
}); };
|
|
2960
2975
|
var handleExportCSVData = function (downloadLinkOnly, printOnly) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2961
2976
|
var exportQueryList, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg, err_20;
|
|
2962
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
2963
|
-
return __generator(this, function (
|
|
2964
|
-
switch (
|
|
2977
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
2978
|
+
return __generator(this, function (_1) {
|
|
2979
|
+
switch (_1.label) {
|
|
2965
2980
|
case 0:
|
|
2966
|
-
|
|
2981
|
+
_1.trys.push([0, 5, , 6]);
|
|
2967
2982
|
setLoading(true);
|
|
2968
2983
|
exportQueryList = JSON.parse(JSON.stringify(queryList));
|
|
2969
2984
|
if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareCSVExportSettings) {
|
|
@@ -2996,21 +3011,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2996
3011
|
excludeReferenceId: (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.exportSettings) === null || _e === void 0 ? void 0 : _e.excludeReferenceId,
|
|
2997
3012
|
excludeSecondaryLabel: (_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.exportSettings) === null || _g === void 0 ? void 0 : _g.excludeSecondaryLabel,
|
|
2998
3013
|
csvHeaderUseName: (_j = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.exportSettings) === null || _j === void 0 ? void 0 : _j.csvHeaderUseName,
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3014
|
+
dateFormatString: (_l = (_k = props.organise) === null || _k === void 0 ? void 0 : _k.exportSettings) === null || _l === void 0 ? void 0 : _l.dateFormatString,
|
|
3015
|
+
excludeDataId: (_o = (_m = props.organise) === null || _m === void 0 ? void 0 : _m.exportSettings) === null || _o === void 0 ? void 0 : _o.excludeDataId,
|
|
3016
|
+
columnIds: (_q = (_p = props.organise) === null || _p === void 0 ? void 0 : _p.exportSettings) === null || _q === void 0 ? void 0 : _q.columnIds,
|
|
3017
|
+
sort: (_s = (_r = props.organise) === null || _r === void 0 ? void 0 : _r.exportSettings) === null || _s === void 0 ? void 0 : _s.sort,
|
|
3002
3018
|
groupBy: groupId,
|
|
3003
3019
|
sumAttributeId: exportSumAttributeIds,
|
|
3004
3020
|
};
|
|
3005
|
-
return [4 /*yield*/, ((
|
|
3021
|
+
return [4 /*yield*/, ((_t = props.lib) === null || _t === void 0 ? void 0 : _t.axios({
|
|
3006
3022
|
url: apiEndpoint,
|
|
3007
3023
|
method: "post",
|
|
3008
3024
|
data: { data: reqData },
|
|
3009
3025
|
}))];
|
|
3010
3026
|
case 1:
|
|
3011
|
-
res =
|
|
3012
|
-
if (!(downloadLinkOnly && ((
|
|
3013
|
-
dataList = (
|
|
3027
|
+
res = _1.sent();
|
|
3028
|
+
if (!(downloadLinkOnly && ((_u = res === null || res === void 0 ? void 0 : res.data) === null || _u === void 0 ? void 0 : _u.dataList))) return [3 /*break*/, 4];
|
|
3029
|
+
dataList = (_v = res === null || res === void 0 ? void 0 : res.data) === null || _v === void 0 ? void 0 : _v.dataList;
|
|
3014
3030
|
if (!(dataList && typeof dataList === "object")) return [3 /*break*/, 4];
|
|
3015
3031
|
csvDownloadLink = Object.values(dataList)[0];
|
|
3016
3032
|
if (!(exportType === "csv" ||
|
|
@@ -3022,10 +3038,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3022
3038
|
if (!(exportType === "pdf" ||
|
|
3023
3039
|
printOnly ||
|
|
3024
3040
|
exportType === "print")) return [3 /*break*/, 4];
|
|
3025
|
-
return [4 /*yield*/, (0, listModule_1.handleExportPDF)(csvDownloadLink, exportPDFTitle, printOnly, (
|
|
3041
|
+
return [4 /*yield*/, (0, listModule_1.handleExportPDF)(csvDownloadLink, exportPDFTitle, printOnly, (_y = (_x = (_w = props.organise) === null || _w === void 0 ? void 0 : _w.exportSettings) === null || _x === void 0 ? void 0 : _x.generateBy) !== null && _y !== void 0 ? _y : "Admin")];
|
|
3026
3042
|
case 3:
|
|
3027
|
-
|
|
3028
|
-
|
|
3043
|
+
_1.sent();
|
|
3044
|
+
_1.label = 4;
|
|
3029
3045
|
case 4:
|
|
3030
3046
|
notificaitonMsg = "A download link will be sent to your email. This may take a while if the data is huge, contact our team if you do not receive any email after 10 minutes (Check your Junk Email too).";
|
|
3031
3047
|
if (downloadLinkOnly)
|
|
@@ -3039,10 +3055,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3039
3055
|
}
|
|
3040
3056
|
setLoading(false);
|
|
3041
3057
|
handlePopUpModal(false);
|
|
3042
|
-
setExportCSVEmail((
|
|
3058
|
+
setExportCSVEmail((_0 = (_z = props.devSettings.currentUser) === null || _z === void 0 ? void 0 : _z.userEmail) !== null && _0 !== void 0 ? _0 : "");
|
|
3043
3059
|
return [3 /*break*/, 6];
|
|
3044
3060
|
case 5:
|
|
3045
|
-
err_20 =
|
|
3061
|
+
err_20 = _1.sent();
|
|
3046
3062
|
setNotification({
|
|
3047
3063
|
type: true,
|
|
3048
3064
|
title: "Export Failed",
|
|
@@ -3179,7 +3195,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3179
3195
|
return (react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios }, label: "Please insert a csv file", fileDescription: "CSV file thats doesn't exceeds 30MB and row not more than 100 data", accept: ".csv", hidePreview: true, onChange: handleOnChangeCSV }));
|
|
3180
3196
|
case 1:
|
|
3181
3197
|
var filterOptions_1 = [];
|
|
3182
|
-
|
|
3198
|
+
structure.map(function (eachData) {
|
|
3183
3199
|
var eachDataJSON = JSON.parse(JSON.stringify(eachData));
|
|
3184
3200
|
if (eachData.id !== "_id" && eachData.id !== "id") {
|
|
3185
3201
|
filterOptions_1.push({
|
|
@@ -3194,7 +3210,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3194
3210
|
if (!eachKey)
|
|
3195
3211
|
return null;
|
|
3196
3212
|
var clonedListValue = JSON.parse(JSON.stringify(listCSVMapAttribute));
|
|
3197
|
-
var selectedObjectModel =
|
|
3213
|
+
var selectedObjectModel = structure.find(function (eachModel) {
|
|
3198
3214
|
return ((eachModel.id === clonedListValue[index] &&
|
|
3199
3215
|
eachModel.type === "listObject") ||
|
|
3200
3216
|
(eachModel.id === clonedListValue[index] &&
|
|
@@ -3272,7 +3288,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3272
3288
|
var renderTableHeader = function () {
|
|
3273
3289
|
var _a;
|
|
3274
3290
|
var tableHeader = [];
|
|
3275
|
-
|
|
3291
|
+
structure.map(function (eachAttribute) {
|
|
3276
3292
|
if (eachAttribute.id === "baseUpdatedAt" ||
|
|
3277
3293
|
eachAttribute.id === "baseDraft" ||
|
|
3278
3294
|
eachAttribute.type === "listObject" ||
|
|
@@ -3299,7 +3315,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3299
3315
|
return pageIndex === 0 ? undefined : pageIndex * limit;
|
|
3300
3316
|
}
|
|
3301
3317
|
else {
|
|
3302
|
-
var selectedModel =
|
|
3318
|
+
var selectedModel = structure.find(function (eachModel) { var _a, _b; return eachModel.id === ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.sort) === null || _b === void 0 ? void 0 : _b.sortId); });
|
|
3303
3319
|
var cursor_1 = lastCursor;
|
|
3304
3320
|
switch (selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) {
|
|
3305
3321
|
case "date":
|
|
@@ -3361,7 +3377,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3361
3377
|
var _a;
|
|
3362
3378
|
event.preventDefault();
|
|
3363
3379
|
event.stopPropagation();
|
|
3364
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
3380
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server);
|
|
3365
3381
|
(_a = clonedSelectedData[fieldsId]) === null || _a === void 0 ? void 0 : _a.splice(index, 1);
|
|
3366
3382
|
setSelectedData(clonedSelectedData);
|
|
3367
3383
|
} })) }));
|
|
@@ -3371,8 +3387,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3371
3387
|
};
|
|
3372
3388
|
var renderListAddress = function (type) {
|
|
3373
3389
|
var listElement = [];
|
|
3374
|
-
var isListAddress =
|
|
3375
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
3390
|
+
var isListAddress = structure.filter(function (eachAttribute) { return eachAttribute.type === "listAddress"; });
|
|
3391
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, showId ? true : false);
|
|
3376
3392
|
isListAddress.map(function (eachListAdressFields) {
|
|
3377
3393
|
var header = [
|
|
3378
3394
|
{
|
|
@@ -3427,10 +3443,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3427
3443
|
};
|
|
3428
3444
|
var renderListObject = function (type) {
|
|
3429
3445
|
var listElement = [];
|
|
3430
|
-
var isListObject =
|
|
3446
|
+
var isListObject = structure.filter(function (eachAttribute) { return eachAttribute.type === "listObject"; });
|
|
3431
3447
|
var list = {};
|
|
3432
3448
|
var listObjTableData = {};
|
|
3433
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
3449
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, showId ? true : false);
|
|
3434
3450
|
isListObject.map(function (eachListObject) {
|
|
3435
3451
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3436
3452
|
if (props.onComplete &&
|
|
@@ -3687,8 +3703,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3687
3703
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
3688
3704
|
};
|
|
3689
3705
|
var renderSearchContent = function (addQuery) {
|
|
3690
|
-
var _a, _b
|
|
3691
|
-
var filterComponent = (0, listModule_1.renderSearchFilterComponents)(
|
|
3706
|
+
var _a, _b;
|
|
3707
|
+
var filterComponent = (0, listModule_1.renderSearchFilterComponents)(structure, devSettings, limit, dbModule, {
|
|
3692
3708
|
filterSearch: filterSearch,
|
|
3693
3709
|
filterSelection: filterSelection,
|
|
3694
3710
|
filterReferenceDate: filterReferenceDate,
|
|
@@ -3704,7 +3720,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3704
3720
|
handleClearDataByFilter: handleClearDataByFilter,
|
|
3705
3721
|
handleRangeFilterOnChange: handleRangeFilterOnChange,
|
|
3706
3722
|
handleFilterDataSelected: handleFilterDataSelected,
|
|
3707
|
-
}, __assign(__assign({}, props.organise), { additionalQuery: addQuery !== null && addQuery !== void 0 ? addQuery :
|
|
3723
|
+
}, __assign(__assign({}, props.organise), { additionalQuery: addQuery !== null && addQuery !== void 0 ? addQuery : additionalQuery, hideSearch: addQuery ? true : (_a = props.organise) === null || _a === void 0 ? void 0 : _a.hideSearch }), selectedTab, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListFilterAddComponent);
|
|
3708
3724
|
return filterComponent;
|
|
3709
3725
|
};
|
|
3710
3726
|
var renderAuthContent = function () {
|
|
@@ -3837,7 +3853,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3837
3853
|
});
|
|
3838
3854
|
var filterModel_1 = [];
|
|
3839
3855
|
var disabledOnEnter_1 = (_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.disabledOnEnter) !== null && _r !== void 0 ? _r : false;
|
|
3840
|
-
|
|
3856
|
+
structure.map(function (eachModel) {
|
|
3841
3857
|
var _a;
|
|
3842
3858
|
var present = false;
|
|
3843
3859
|
if (eachModel.type === "markdown" ||
|
|
@@ -3860,7 +3876,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3860
3876
|
return null;
|
|
3861
3877
|
});
|
|
3862
3878
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
3863
|
-
props.id && props.id !== "new" &&
|
|
3879
|
+
props.id && props.id !== "new" && structure.length > 1 && (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: readQueryHocRef, database: {
|
|
3864
3880
|
dbModule: dbModule,
|
|
3865
3881
|
dbType: devSettings.server,
|
|
3866
3882
|
dbCollection: (_t = (_s = props === null || props === void 0 ? void 0 : props.space) === null || _s === void 0 ? void 0 : _s.pipelineDefaultSpaceId) !== null && _t !== void 0 ? _t : props.collectionId,
|
|
@@ -3949,8 +3965,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3949
3965
|
((_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.filterComponentNewRow) && (react_1.default.createElement("div", { className: "flex flex-wrap items-center justify-center my-6 gap-3" },
|
|
3950
3966
|
((_12 = props === null || props === void 0 ? void 0 : props.organise) === null || _12 === void 0 ? void 0 : _12.showGroupByFeature) && (react_1.default.createElement(select_1.Select, { label: "Group", options: (_18 = (_15 = (_14 = (_13 = props === null || props === void 0 ? void 0 : props.organise) === null || _13 === void 0 ? void 0 : _13.renderGroupByOptions) === null || _14 === void 0 ? void 0 : _14.call(_13)) !== null && _15 !== void 0 ? _15 : (_17 = (_16 = props === null || props === void 0 ? void 0 : props.organise) === null || _16 === void 0 ? void 0 : _16.renderReferenceLabelOptions) === null || _17 === void 0 ? void 0 : _17.call(_16, props.collectionId, true)) !== null && _18 !== void 0 ? _18 : [], value: groupId !== null && groupId !== void 0 ? groupId : "", onChange: function (value) { return setGroupId(value); } })),
|
|
3951
3967
|
filterComponent.map(function (item, index) {
|
|
3952
|
-
var
|
|
3953
|
-
var filter = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) === null || _b === void 0 ? void 0 : _b[index];
|
|
3968
|
+
var filter = additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery[index];
|
|
3954
3969
|
return (react_1.default.createElement("div", { key: index, className: (filter === null || filter === void 0 ? void 0 : filter.type) === "range"
|
|
3955
3970
|
? "flex-grow sm:basis-full md:basis-1/2 lg:basis-1/3"
|
|
3956
3971
|
: "flex-grow sm:flex-shrink-0 sm:basis-1/2 md:basis-1/4 lg:basis-1/6" }, item));
|
|
@@ -4014,7 +4029,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4014
4029
|
var renderGridAndListData = function (imageTag, type, kanbanGroupId) {
|
|
4015
4030
|
var gridData = [];
|
|
4016
4031
|
var titleKey = "";
|
|
4017
|
-
var titleModel =
|
|
4032
|
+
var titleModel = structure.find(function (eachModel) {
|
|
4018
4033
|
return !eachModel.hide && eachModel.id !== "_id" && eachModel.id !== "id";
|
|
4019
4034
|
});
|
|
4020
4035
|
if (titleModel)
|
|
@@ -4032,7 +4047,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4032
4047
|
var listDescArray = [];
|
|
4033
4048
|
Object.entries(eachData).forEach(function (value) {
|
|
4034
4049
|
var eachKey = value[0], eachValue = value[1];
|
|
4035
|
-
var selectedModel =
|
|
4050
|
+
var selectedModel = structure.find(function (eachModel) { return eachModel.id === eachKey; });
|
|
4036
4051
|
var modelInStructure;
|
|
4037
4052
|
var structurePresent = false;
|
|
4038
4053
|
if (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.structure) {
|
|
@@ -4150,7 +4165,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4150
4165
|
if (((_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) &&
|
|
4151
4166
|
((_b = props.organise.extendedTabs) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
4152
4167
|
(_c = props.organise) === null || _c === void 0 ? void 0 : _c.extendedTabs.map(function (eachTab) {
|
|
4153
|
-
var _a, _b, _c, _d;
|
|
4168
|
+
var _a, _b, _c, _d, _e;
|
|
4154
4169
|
var hrefPoint = "".concat(props.localURLEndpoint, "?type=").concat(props.type, "&collection=").concat(props.collectionId);
|
|
4155
4170
|
if (props.id)
|
|
4156
4171
|
hrefPoint += "&data=".concat(props.id);
|
|
@@ -4172,11 +4187,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4172
4187
|
else
|
|
4173
4188
|
tabData["viewImage"] = eachTab.viewImage;
|
|
4174
4189
|
if (eachTab.type === props.type) {
|
|
4175
|
-
tabs.push(__assign(__assign({}, tabData),
|
|
4190
|
+
tabs.push(__assign(__assign({}, tabData), (!((_e = props.edit) === null || _e === void 0 ? void 0 : _e.disabledTabsDeleteBtn) && {
|
|
4191
|
+
del: (react_1.default.createElement(outline_1.XMarkIcon, { className: "h-4 w-4 ml-2 text-red-600 hover:text-red-400", onClick: function (e) {
|
|
4176
4192
|
e.stopPropagation();
|
|
4177
4193
|
e.preventDefault();
|
|
4178
4194
|
handleDeleteTab(tabData.id);
|
|
4179
|
-
} }))
|
|
4195
|
+
} })),
|
|
4196
|
+
})));
|
|
4180
4197
|
}
|
|
4181
4198
|
return null;
|
|
4182
4199
|
});
|
|
@@ -4192,10 +4209,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4192
4209
|
};
|
|
4193
4210
|
var renderAddMathColumn = function (id, onClose) {
|
|
4194
4211
|
var _a, _b, _c;
|
|
4195
|
-
return (react_1.default.createElement(settingsModal_1.ExpressionModal, { selectedId: id, model:
|
|
4212
|
+
return (react_1.default.createElement(settingsModal_1.ExpressionModal, { selectedId: id, model: structure, renderReferenceLabelOptions: (_a = props.organise) === null || _a === void 0 ? void 0 : _a.renderReferenceLabelOptions, renderReferenceSpaceOptions: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.renderReferenceSpaceOptions, onAddModelSchema: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onAddColumns, onClose: onClose }));
|
|
4196
4213
|
};
|
|
4197
4214
|
var renderGroupTable = function (multipleSelect) {
|
|
4198
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
4215
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
4199
4216
|
if (groupId) {
|
|
4200
4217
|
var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
|
|
4201
4218
|
var key = (eachData === null || eachData === void 0 ? void 0 : eachData[groupId]) && (eachData === null || eachData === void 0 ? void 0 : eachData[groupId]) !== " - "
|
|
@@ -4210,7 +4227,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4210
4227
|
}
|
|
4211
4228
|
else {
|
|
4212
4229
|
return Object.entries(groupedSpaceTableData).map(function (_a) {
|
|
4213
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y
|
|
4230
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
4214
4231
|
var eachKey = _a[0], eachValue = _a[1];
|
|
4215
4232
|
var dataList = eachValue;
|
|
4216
4233
|
var ids = (dataList === null || dataList === void 0 ? void 0 : dataList.map(function (eachData) { return eachData._id; })) || [];
|
|
@@ -4257,7 +4274,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4257
4274
|
sortOptions: (_t = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.renderReferenceLabelOptions) === null || _t === void 0 ? void 0 : _t.call(_s),
|
|
4258
4275
|
onSortColumn: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.onChangeSort,
|
|
4259
4276
|
onDragColumn: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.onChangeDrag,
|
|
4260
|
-
filterOptions:
|
|
4277
|
+
filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
|
|
4261
4278
|
var _a;
|
|
4262
4279
|
return {
|
|
4263
4280
|
key: eachQuery.value,
|
|
@@ -4265,16 +4282,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4265
4282
|
};
|
|
4266
4283
|
}),
|
|
4267
4284
|
renderFilterElements: function (id) {
|
|
4268
|
-
var
|
|
4269
|
-
var selectedQuery = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) === null || _b === void 0 ? void 0 : _b.filter(function (eachQuery) {
|
|
4285
|
+
var selectedQuery = additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.filter(function (eachQuery) {
|
|
4270
4286
|
return eachQuery.value === id;
|
|
4271
4287
|
});
|
|
4272
|
-
var selectedModelList =
|
|
4288
|
+
var selectedModelList = structure.filter(function (eachModel) { return eachModel.id === id; });
|
|
4273
4289
|
var newQuery = (0, listModule_1.renderSearchAdditionalQueries)(selectedModelList, selectedQuery);
|
|
4274
4290
|
return renderSearchContent(newQuery);
|
|
4275
4291
|
},
|
|
4276
4292
|
}, editable: {
|
|
4277
|
-
active: ((
|
|
4293
|
+
active: ((_w = props.edit) === null || _w === void 0 ? void 0 : _w.listEditable) && !props.edit.disabledUpdate
|
|
4278
4294
|
? true
|
|
4279
4295
|
: false,
|
|
4280
4296
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -4288,7 +4304,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4288
4304
|
});
|
|
4289
4305
|
}); },
|
|
4290
4306
|
}, addable: {
|
|
4291
|
-
active: ((
|
|
4307
|
+
active: ((_x = props.edit) === null || _x === void 0 ? void 0 : _x.listAddable) ? true : false,
|
|
4292
4308
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4293
4309
|
return __generator(this, function (_a) {
|
|
4294
4310
|
switch (_a.label) {
|
|
@@ -4299,7 +4315,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4299
4315
|
}
|
|
4300
4316
|
});
|
|
4301
4317
|
}); },
|
|
4302
|
-
}, darkMode: (
|
|
4318
|
+
}, darkMode: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.darkMode, hidePagination: true })));
|
|
4303
4319
|
});
|
|
4304
4320
|
}
|
|
4305
4321
|
}
|
|
@@ -4342,7 +4358,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4342
4358
|
sortOptions: (_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.renderReferenceLabelOptions) === null || _r === void 0 ? void 0 : _r.call(_q),
|
|
4343
4359
|
onSortColumn: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.onChangeSort,
|
|
4344
4360
|
onDragColumn: (_t = props.organise) === null || _t === void 0 ? void 0 : _t.onChangeDrag,
|
|
4345
|
-
filterOptions:
|
|
4361
|
+
filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
|
|
4346
4362
|
var _a;
|
|
4347
4363
|
return {
|
|
4348
4364
|
key: eachQuery.value,
|
|
@@ -4350,16 +4366,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4350
4366
|
};
|
|
4351
4367
|
}),
|
|
4352
4368
|
renderFilterElements: function (id) {
|
|
4353
|
-
var
|
|
4354
|
-
var selectedQuery = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) === null || _b === void 0 ? void 0 : _b.filter(function (eachQuery) {
|
|
4369
|
+
var selectedQuery = additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.filter(function (eachQuery) {
|
|
4355
4370
|
return eachQuery.value === id;
|
|
4356
4371
|
});
|
|
4357
|
-
var selectedModelList =
|
|
4372
|
+
var selectedModelList = structure.filter(function (eachModel) { return eachModel.id === id; });
|
|
4358
4373
|
var newQuery = (0, listModule_1.renderSearchAdditionalQueries)(selectedModelList, selectedQuery);
|
|
4359
4374
|
return renderSearchContent(newQuery);
|
|
4360
4375
|
},
|
|
4361
4376
|
}, editable: {
|
|
4362
|
-
active: ((
|
|
4377
|
+
active: ((_u = props.edit) === null || _u === void 0 ? void 0 : _u.listEditable) && !props.edit.disabledUpdate
|
|
4363
4378
|
? true
|
|
4364
4379
|
: false,
|
|
4365
4380
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -4373,7 +4388,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4373
4388
|
});
|
|
4374
4389
|
}); },
|
|
4375
4390
|
}, addable: {
|
|
4376
|
-
active: ((
|
|
4391
|
+
active: ((_v = props.edit) === null || _v === void 0 ? void 0 : _v.listAddable) ? true : false,
|
|
4377
4392
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4378
4393
|
return __generator(this, function (_a) {
|
|
4379
4394
|
switch (_a.label) {
|
|
@@ -4384,7 +4399,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4384
4399
|
}
|
|
4385
4400
|
});
|
|
4386
4401
|
}); },
|
|
4387
|
-
}, darkMode: (
|
|
4402
|
+
}, darkMode: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.darkMode, hidePagination: (_x = props.organise) === null || _x === void 0 ? void 0 : _x.hidePagination }));
|
|
4388
4403
|
}
|
|
4389
4404
|
};
|
|
4390
4405
|
var renderTabContent = function (tabs, dataType, viewType) {
|
|
@@ -4398,13 +4413,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4398
4413
|
}
|
|
4399
4414
|
});
|
|
4400
4415
|
var multipleSelect = isEditor && !((_a = props.organise) === null || _a === void 0 ? void 0 : _a.disableMulti) ? true : false;
|
|
4401
|
-
if (viewType === "general") {
|
|
4416
|
+
if (viewType === "general" || (selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.viewType) === "report") {
|
|
4402
4417
|
if (dataType === "list") {
|
|
4403
4418
|
return react_1.default.createElement(react_1.default.Fragment, null, renderGroupTable(multipleSelect));
|
|
4404
4419
|
}
|
|
4405
4420
|
else if (dataType === "read") {
|
|
4406
4421
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
4407
|
-
react_1.default.createElement(detailList_1.DetailList, { model:
|
|
4422
|
+
react_1.default.createElement(detailList_1.DetailList, { model: structure, referenceModel: referenceModelSchema, className: "mt-5 bg-white rounded-md", title: "General Details", list: renderDetailListData(structure), handleReferenceLink: !schemaPresent && ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareReadReferenceView)
|
|
4408
4423
|
? props.bareSettings.bareReadReferenceView
|
|
4409
4424
|
: undefined, splitView: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.splitView }),
|
|
4410
4425
|
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(dataType)),
|
|
@@ -4711,7 +4726,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4711
4726
|
var nullColumn_1 = false;
|
|
4712
4727
|
var groupBy_1 = [];
|
|
4713
4728
|
var groupLabel_1 = [];
|
|
4714
|
-
|
|
4729
|
+
structure.map(function (eachModel) {
|
|
4715
4730
|
var _a, _b, _c;
|
|
4716
4731
|
if (kanbanTitle_2 === eachModel.id) {
|
|
4717
4732
|
if (eachModel.type === "list") {
|
|
@@ -4749,155 +4764,6 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4749
4764
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
4750
4765
|
} }));
|
|
4751
4766
|
}
|
|
4752
|
-
// else if (selectedTabData.viewType === "report") {
|
|
4753
|
-
// return (
|
|
4754
|
-
// <Table
|
|
4755
|
-
// showId={showId}
|
|
4756
|
-
// paginationType={isFirebase ? "cursor" : "page"}
|
|
4757
|
-
// data={tableData}
|
|
4758
|
-
// spaceData={spaceTableData}
|
|
4759
|
-
// size={size}
|
|
4760
|
-
// limit={limit}
|
|
4761
|
-
// cursor={cursor}
|
|
4762
|
-
// loading={tableLoading}
|
|
4763
|
-
// checkbox={multipleSelect}
|
|
4764
|
-
// selectAll={selectAll}
|
|
4765
|
-
// selectedIds={selectedIds}
|
|
4766
|
-
// selectAllText={selectAll ? "from filter" : ""}
|
|
4767
|
-
// multiActionButton={
|
|
4768
|
-
// <div className="flex flex-row space-x-3">
|
|
4769
|
-
// {selectedIds.length > 0 &&
|
|
4770
|
-
// !props.edit?.disabledUpdate &&
|
|
4771
|
-
// !props.bareSettings?.bareHideTableExtraMultipleAction && (
|
|
4772
|
-
// <>
|
|
4773
|
-
// <TextButton
|
|
4774
|
-
// className="text-sm"
|
|
4775
|
-
// text="Change to Draft"
|
|
4776
|
-
// disable={loading}
|
|
4777
|
-
// onClick={() => {
|
|
4778
|
-
// handleBatchDraftData();
|
|
4779
|
-
// }}
|
|
4780
|
-
// />
|
|
4781
|
-
// <TextButton
|
|
4782
|
-
// className="text-sm"
|
|
4783
|
-
// text="Clone Items"
|
|
4784
|
-
// disable={loading}
|
|
4785
|
-
// onClick={() => {
|
|
4786
|
-
// handleCloneSelectedData();
|
|
4787
|
-
// }}
|
|
4788
|
-
// />
|
|
4789
|
-
// </>
|
|
4790
|
-
// )}
|
|
4791
|
-
// {props.edit?.deleteBtn && (
|
|
4792
|
-
// <TextButton
|
|
4793
|
-
// className="text-sm text-red-500 hover:text-red-600"
|
|
4794
|
-
// text="Delete"
|
|
4795
|
-
// onClick={() => {
|
|
4796
|
-
// handleGenerateDeletePasscode();
|
|
4797
|
-
// setDeleteModal(true);
|
|
4798
|
-
// }}
|
|
4799
|
-
// />
|
|
4800
|
-
// )}
|
|
4801
|
-
// {!isFirebase && !props.edit?.disableBatchUpdate && (
|
|
4802
|
-
// <TextButton
|
|
4803
|
-
// className="text-sm"
|
|
4804
|
-
// text="Update"
|
|
4805
|
-
// onClick={() => {
|
|
4806
|
-
// setBatchUpdateModal(true);
|
|
4807
|
-
// }}
|
|
4808
|
-
// />
|
|
4809
|
-
// )}
|
|
4810
|
-
// {props.bareSettings?.bareListMultipleSelectAddtionalActions &&
|
|
4811
|
-
// props.bareSettings?.bareListMultipleSelectAddtionalActions?.map(
|
|
4812
|
-
// (eachButton) => {
|
|
4813
|
-
// return (
|
|
4814
|
-
// <TextButton
|
|
4815
|
-
// className={`text-sm ${eachButton.className}`}
|
|
4816
|
-
// text={eachButton.text}
|
|
4817
|
-
// onClick={() => {
|
|
4818
|
-
// eachButton.onClick?.(
|
|
4819
|
-
// selectedIds,
|
|
4820
|
-
// selectAll,
|
|
4821
|
-
// renderImpSearchFilterConditions() ?? []
|
|
4822
|
-
// );
|
|
4823
|
-
// }}
|
|
4824
|
-
// />
|
|
4825
|
-
// );
|
|
4826
|
-
// }
|
|
4827
|
-
// )}
|
|
4828
|
-
// </div>
|
|
4829
|
-
// }
|
|
4830
|
-
// handleSelectAll={handleSelectAllPages}
|
|
4831
|
-
// handleSelectedIds={handleSelectIds}
|
|
4832
|
-
// header={renderTableHeader()}
|
|
4833
|
-
// pageIndex={pageIndex}
|
|
4834
|
-
// onClickRow={(id: string) => {
|
|
4835
|
-
// props.organise?.handleNavigate?.("read", id, "general");
|
|
4836
|
-
// }}
|
|
4837
|
-
// linkType={props.linkType}
|
|
4838
|
-
// custom={props.custom}
|
|
4839
|
-
// newTabUrl={`${props.localURLEndpoint}?data=`}
|
|
4840
|
-
// addNewTabUrl={`&type=read&collection=${props.collectionId}&view=general`}
|
|
4841
|
-
// handleUpdatePageIndex={handlePagination}
|
|
4842
|
-
// className="mt-5"
|
|
4843
|
-
// lib={{ axios: props.lib?.axios }}
|
|
4844
|
-
// devSettings={props.devSettings}
|
|
4845
|
-
// bareSettings={props.bareSettings}
|
|
4846
|
-
// fixedPagination={props.organise?.fixedPagination}
|
|
4847
|
-
// advSettings={{
|
|
4848
|
-
// addColumnEnabled: true,
|
|
4849
|
-
// renderAddColumnElements: renderAddMathColumn,
|
|
4850
|
-
// dragEnabled: props.organise?.advDragEnabled,
|
|
4851
|
-
// sortEnabled: props.organise?.advSortEnabled,
|
|
4852
|
-
// filterEnabled: props.organise?.advFilterEnabled,
|
|
4853
|
-
// sortId: props.organise?.sort,
|
|
4854
|
-
// sortOptions: props.organise?.renderReferenceLabelOptions?.(),
|
|
4855
|
-
// onSortColumn: props.organise?.onChangeSort,
|
|
4856
|
-
// onDragColumn: props.organise?.onChangeDrag,
|
|
4857
|
-
// filterOptions: props.organise?.additionalQuery?.map(
|
|
4858
|
-
// (eachQuery) => {
|
|
4859
|
-
// return {
|
|
4860
|
-
// key: eachQuery.value,
|
|
4861
|
-
// label: eachQuery.label ?? "",
|
|
4862
|
-
// };
|
|
4863
|
-
// }
|
|
4864
|
-
// ),
|
|
4865
|
-
// renderFilterElements: (id: string) => {
|
|
4866
|
-
// const selectedQuery = props.organise?.additionalQuery?.filter(
|
|
4867
|
-
// (eachQuery) => {
|
|
4868
|
-
// return eachQuery.value === id;
|
|
4869
|
-
// }
|
|
4870
|
-
// );
|
|
4871
|
-
// const selectedModelList = props.model.filter(
|
|
4872
|
-
// (eachModel) => eachModel.id === id
|
|
4873
|
-
// );
|
|
4874
|
-
// const newQuery = renderSearchAdditionalQueries(
|
|
4875
|
-
// selectedModelList,
|
|
4876
|
-
// selectedQuery
|
|
4877
|
-
// );
|
|
4878
|
-
// return renderSearchContent(newQuery);
|
|
4879
|
-
// },
|
|
4880
|
-
// }}
|
|
4881
|
-
// editable={{
|
|
4882
|
-
// active:
|
|
4883
|
-
// props.edit?.listEditable && !props.edit.disabledUpdate
|
|
4884
|
-
// ? true
|
|
4885
|
-
// : false,
|
|
4886
|
-
// onUpdateData: async (rowId, columnId, data) => {
|
|
4887
|
-
// await handleSubmitData("update", rowId, columnId, data);
|
|
4888
|
-
// },
|
|
4889
|
-
// }}
|
|
4890
|
-
// addable={{
|
|
4891
|
-
// active: props.edit?.listAddable ? true : false,
|
|
4892
|
-
// onAddData: async (data) => {
|
|
4893
|
-
// await handleSubmitData("create", "", "", data);
|
|
4894
|
-
// },
|
|
4895
|
-
// }}
|
|
4896
|
-
// darkMode={props.organise?.darkMode}
|
|
4897
|
-
// hidePagination={props.organise?.hidePagination}
|
|
4898
|
-
// />
|
|
4899
|
-
// );
|
|
4900
|
-
// }
|
|
4901
4767
|
else if (selectedTabData.renderComp) {
|
|
4902
4768
|
return react_1.default.createElement(react_1.default.Fragment, null, selectedTabData.renderComp());
|
|
4903
4769
|
}
|
|
@@ -4927,7 +4793,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4927
4793
|
return null;
|
|
4928
4794
|
};
|
|
4929
4795
|
var renderModalContent = function () {
|
|
4930
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2
|
|
4796
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
4931
4797
|
if (loading) {
|
|
4932
4798
|
return (react_1.default.createElement("div", { className: "mt-5" },
|
|
4933
4799
|
react_1.default.createElement(loading_1.Loading, null),
|
|
@@ -4961,7 +4827,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4961
4827
|
}
|
|
4962
4828
|
else if (exportExcel || exportQR) {
|
|
4963
4829
|
var showEmail = exportType !== "pdf" && !((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.exportSettings) === null || _b === void 0 ? void 0 : _b.disableEmail);
|
|
4964
|
-
return (react_1.default.createElement(react_1.default.Fragment, null, queryForm ? (react_1.default.createElement(queryForm_1.QueryForm, { dbModule: (_c = props.lib) === null || _c === void 0 ? void 0 : _c.axios, model:
|
|
4830
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, queryForm ? (react_1.default.createElement(queryForm_1.QueryForm, { dbModule: (_c = props.lib) === null || _c === void 0 ? void 0 : _c.axios, model: structure, updateQuery: queryIndex >= 0 ? queryList[queryIndex] : undefined, devSettings: props.devSettings, handleCloseForm: function () {
|
|
4965
4831
|
handleViewQuery(-1);
|
|
4966
4832
|
}, handleQueryOnComplete: function (queryData) {
|
|
4967
4833
|
handlePushQueryList(queryData, queryIndex);
|
|
@@ -5011,17 +4877,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5011
4877
|
} }));
|
|
5012
4878
|
}
|
|
5013
4879
|
else if (overviewModal) {
|
|
5014
|
-
return (react_1.default.createElement(settingsModal_1.OverviewModal, { model:
|
|
4880
|
+
return (react_1.default.createElement(settingsModal_1.OverviewModal, { model: structure, referenceSchema: referenceModelSchema, setReferenceSchema: setReferenceSchema, onChangeHide: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.onChangeHide, onClose: function () {
|
|
5015
4881
|
handlePopUpModal(false);
|
|
5016
4882
|
} }));
|
|
5017
4883
|
}
|
|
5018
4884
|
else if (filterModal) {
|
|
5019
|
-
return (react_1.default.createElement(settingsModal_1.FilterModal, { server: props.devSettings.server, filter:
|
|
4885
|
+
return (react_1.default.createElement(settingsModal_1.FilterModal, { server: props.devSettings.server, filter: additionalQuery, onChangeFilter: (_t = props.organise) === null || _t === void 0 ? void 0 : _t.onChangeFilter, renderReferenceLabelOptions: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.renderReferenceLabelOptions, renderReferenceSpaceOptions: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.renderReferenceSpaceOptions, setNotification: setNotification, onClose: function () {
|
|
5020
4886
|
handlePopUpModal(false);
|
|
5021
4887
|
} }));
|
|
5022
4888
|
}
|
|
5023
4889
|
else if (addTabModal) {
|
|
5024
|
-
return (react_1.default.createElement(settingsModal_1.TabModal, { type: props.type, tabs: (
|
|
4890
|
+
return (react_1.default.createElement(settingsModal_1.TabModal, { type: props.type, tabs: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.extendedTabs, onChangeTabs: (_x = props.organise) === null || _x === void 0 ? void 0 : _x.onChangeTabs, model: structure, renderReferenceLabelOptions: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.renderReferenceLabelOptions, onClose: function () {
|
|
5025
4891
|
handlePopUpModal(false);
|
|
5026
4892
|
} }));
|
|
5027
4893
|
}
|
|
@@ -5041,7 +4907,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5041
4907
|
else if (selectedListAddressId) {
|
|
5042
4908
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5043
4909
|
react_1.default.createElement(form_1.Form, { className: "grid grid-cols-1 gap-6 pb-20 mt-6", ref: listAddressFromRef, refList: [listAddressInputRef], handleComplete: function () {
|
|
5044
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
4910
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server);
|
|
5045
4911
|
var listAddressValue = clonedSelectedData[selectedListAddressId];
|
|
5046
4912
|
if (listAddressValue)
|
|
5047
4913
|
clonedSelectedData[selectedListAddressId] = __spreadArray(__spreadArray([], listAddressValue, true), [
|
|
@@ -5078,7 +4944,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5078
4944
|
}); } }))));
|
|
5079
4945
|
}
|
|
5080
4946
|
else {
|
|
5081
|
-
var filterObjectModel =
|
|
4947
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
5082
4948
|
return eachModel.id === selectedObjectStructureId;
|
|
5083
4949
|
});
|
|
5084
4950
|
if (filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.objectData) {
|
|
@@ -5091,16 +4957,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5091
4957
|
disabledOnEnter_2 = true;
|
|
5092
4958
|
return null;
|
|
5093
4959
|
});
|
|
5094
|
-
if ((
|
|
4960
|
+
if ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareListObjectHandleData) {
|
|
5095
4961
|
var listObjectViewType = props.type === "read"
|
|
5096
4962
|
? "read"
|
|
5097
4963
|
: selectedObjectId
|
|
5098
4964
|
? "update"
|
|
5099
4965
|
: "new";
|
|
5100
|
-
(
|
|
4966
|
+
(_1 = (_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareListObjectHandleData) === null || _1 === void 0 ? void 0 : _1.call(_0, listObjectViewType, selectedObjectData);
|
|
5101
4967
|
}
|
|
5102
4968
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5103
|
-
react_1.default.createElement(form_1.Form, { className: "grid ".concat(formColumn, " gap-6 pb-32 mt-6 sm:pb-36"), ref: objectFormRef, refList: objectFormInputRefs, handleComplete: handleSubmitObjectDataType, disabledOnEnter: disabledOnEnter_2 }, renderDataTemplateFormContent(selectedObjectData, (
|
|
4969
|
+
react_1.default.createElement(form_1.Form, { className: "grid ".concat(formColumn, " gap-6 pb-32 mt-6 sm:pb-36"), ref: objectFormRef, refList: objectFormInputRefs, handleComplete: handleSubmitObjectDataType, disabledOnEnter: disabledOnEnter_2 }, renderDataTemplateFormContent(selectedObjectData, (_2 = filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.objectData) !== null && _2 !== void 0 ? _2 : [], objectFormInputRefs, true, filterObjectModel.type === "listObject", undefined, filterObjectModel.type === "listObject"
|
|
5104
4970
|
? selectedData
|
|
5105
4971
|
: undefined)),
|
|
5106
4972
|
react_1.default.createElement("div", { className: "flex justify-end pt-8" },
|
|
@@ -5206,7 +5072,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5206
5072
|
var renderBatchUpdateModalContent = function () {
|
|
5207
5073
|
var _a;
|
|
5208
5074
|
if (batchUpdateModal) {
|
|
5209
|
-
var columnIdOptions =
|
|
5075
|
+
var columnIdOptions = structure
|
|
5210
5076
|
.filter(function (eachModel) {
|
|
5211
5077
|
return eachModel.id !== "id" &&
|
|
5212
5078
|
!eachModel.unique &&
|
|
@@ -5220,7 +5086,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5220
5086
|
disabled: true,
|
|
5221
5087
|
type: "string",
|
|
5222
5088
|
};
|
|
5223
|
-
var modelFound =
|
|
5089
|
+
var modelFound = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
|
|
5224
5090
|
var model = modelFound !== null && modelFound !== void 0 ? modelFound : defaultModel;
|
|
5225
5091
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5226
5092
|
react_1.default.createElement(form_1.Form, { ref: batchUpdateFormRef, refList: [batchUpdateColumnIdRef, batchUpdateInputRef], handleComplete: handleBatchUpdateData },
|
|
@@ -5228,7 +5094,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5228
5094
|
var _a;
|
|
5229
5095
|
var _b;
|
|
5230
5096
|
var columnDataValue = undefined;
|
|
5231
|
-
var selectedModel =
|
|
5097
|
+
var selectedModel = structure.find(function (eachAttribute) { return eachAttribute.id === value; });
|
|
5232
5098
|
if (selectedModel) {
|
|
5233
5099
|
if (selectedModel.type === "list") {
|
|
5234
5100
|
var isOptional = (_b = selectedModel.optional) !== null && _b !== void 0 ? _b : false;
|
|
@@ -5314,7 +5180,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5314
5180
|
};
|
|
5315
5181
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5316
5182
|
renderNotification("root"),
|
|
5317
|
-
((
|
|
5183
|
+
((_20 = (_19 = props.renderSettings) === null || _19 === void 0 ? void 0 : _19.renderLoadingUI) === null || _20 === void 0 ? void 0 : _20.call(_19)) && loading ? ((_21 = props.renderSettings) === null || _21 === void 0 ? void 0 : _21.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
|
|
5318
5184
|
var _a, _b;
|
|
5319
5185
|
if (loading)
|
|
5320
5186
|
return;
|