blixify-ui-web 1.2.99 → 1.2.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +300 -241
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/permissions.d.ts +19 -0
- package/lib/components/data/dataTemplate/permissions.d.ts.map +1 -0
- package/lib/components/data/dataTemplate/permissions.js +26 -0
- package/lib/components/data/dataTemplate/permissions.js.map +1 -0
- package/lib/components/design/pricing/index.js +10 -10
- package/lib/components/design/pricing/index.js.map +1 -1
- package/lib/components/display/mapView/index.d.ts.map +1 -1
- package/lib/components/display/mapView/index.js +4 -4
- package/lib/components/display/mapView/index.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js +4 -4
- package/lib/components/input/textInput/index.js.map +1 -1
- package/lib/components/navigation/bars/index.d.ts +36 -2
- package/lib/components/navigation/bars/index.d.ts.map +1 -1
- package/lib/components/navigation/bars/index.js +121 -64
- package/lib/components/navigation/bars/index.js.map +1 -1
- package/lib/components/navigation/leftNav/index.d.ts +34 -1
- package/lib/components/navigation/leftNav/index.d.ts.map +1 -1
- package/lib/components/navigation/leftNav/index.js +104 -8
- package/lib/components/navigation/leftNav/index.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +1 -1
|
@@ -160,6 +160,7 @@ var referenceModal_1 = require("./referenceModal");
|
|
|
160
160
|
var settingsModal_1 = require("./settingsModal");
|
|
161
161
|
var flexFilter_1 = require("../flexFilter");
|
|
162
162
|
var viewStatePersistence_1 = require("./viewStatePersistence");
|
|
163
|
+
var permissions_1 = require("./permissions");
|
|
163
164
|
// INFO: builds the notification message for a failed write. Callers must gate on
|
|
164
165
|
// `err.response` alone, never on a specific status — a catch that only handles 400 shows
|
|
165
166
|
// the user nothing at all for any other status, so a write silently disappears. A 5xx is
|
|
@@ -619,6 +620,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
619
620
|
setPersistedSort(value);
|
|
620
621
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSort) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
|
621
622
|
};
|
|
623
|
+
var _180 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _180.canUpdateRecord, canInlineUpdate = _180.canInlineUpdate, canSubmitUpdate = _180.canSubmitUpdate, canBatchUpdate = _180.canBatchUpdate, canDeleteRecord = _180.canDeleteRecord;
|
|
622
624
|
var isEditor = ((_12 = props.edit) === null || _12 === void 0 ? void 0 : _12.allEditable) ? true : false;
|
|
623
625
|
var isOffline = (_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareOffline;
|
|
624
626
|
// INFO: when bareOfflineNetworkAware is true, the save path is also gated on
|
|
@@ -1420,6 +1422,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1420
1422
|
setLastCursor("");
|
|
1421
1423
|
setTableLoading(true);
|
|
1422
1424
|
handleSetListData([], []);
|
|
1425
|
+
/**
|
|
1426
|
+
* INFO: the list is fetched by ReadQueryHoc, which only refetches when its
|
|
1427
|
+
* cond JSON changes. A view switch frequently leaves cond identical — a
|
|
1428
|
+
* kanban tab grouped on a list column adds no query of its own, and the
|
|
1429
|
+
* page/cursor resets above are no-ops when the list was already on page one
|
|
1430
|
+
* — so nothing refetched, tableLoading was never cleared, and the view span
|
|
1431
|
+
* indefinitely on an empty dataset. Ask for the read explicitly.
|
|
1432
|
+
*
|
|
1433
|
+
* Deferred a tick so the resets above are applied first, and left to the
|
|
1434
|
+
* HOC's own inflight guard: an identical request already in flight collapses
|
|
1435
|
+
* into one call plus a single trailing refetch rather than two reads.
|
|
1436
|
+
*/
|
|
1437
|
+
var handleRefetchForView = setTimeout(function () {
|
|
1438
|
+
var _a;
|
|
1439
|
+
(_a = listRQueryHocRef.current) === null || _a === void 0 ? void 0 : _a.handleRefresh();
|
|
1440
|
+
}, 0);
|
|
1441
|
+
return function () { return clearTimeout(handleRefetchForView); };
|
|
1423
1442
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1424
1443
|
}, [viewType, resolvedType]);
|
|
1425
1444
|
(0, react_1.useEffect)(function () {
|
|
@@ -1791,21 +1810,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1791
1810
|
if (!isListView) return [3 /*break*/, 13];
|
|
1792
1811
|
prettifyRecords = function (records) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1793
1812
|
var resolved;
|
|
1794
|
-
var _a, _b, _c, _d
|
|
1795
|
-
return __generator(this, function (
|
|
1796
|
-
switch (
|
|
1813
|
+
var _a, _b, _c, _d;
|
|
1814
|
+
return __generator(this, function (_e) {
|
|
1815
|
+
switch (_e.label) {
|
|
1797
1816
|
case 0:
|
|
1798
1817
|
if (!isOffline) return [3 /*break*/, 2];
|
|
1799
1818
|
return [4 /*yield*/, handleResolveOfflineReferences(records)];
|
|
1800
1819
|
case 1:
|
|
1801
|
-
resolved =
|
|
1820
|
+
resolved = _e.sent();
|
|
1802
1821
|
return [2 /*return*/, resolved.map(function (eachData) {
|
|
1803
1822
|
var _a, _b;
|
|
1804
1823
|
var tempData = __assign({}, eachData);
|
|
1805
|
-
(0, listModule_1.handleDataEditButton)(tempData, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListActionBtns);
|
|
1824
|
+
(0, listModule_1.handleDataEditButton)(tempData, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListActionBtns, undefined, undefined, undefined, !canUpdateRecord);
|
|
1806
1825
|
return tempData;
|
|
1807
1826
|
})];
|
|
1808
|
-
case 2: return [2 /*return*/, (0, listModule_1.handleListDataBasedOnModel)(records, props.devSettings, (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios, structure, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_c = props.edit) === null || _c === void 0 ? void 0 : _c.activityLog : undefined, (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListActionBtns,
|
|
1827
|
+
case 2: return [2 /*return*/, (0, listModule_1.handleListDataBasedOnModel)(records, props.devSettings, (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios, structure, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_c = props.edit) === null || _c === void 0 ? void 0 : _c.activityLog : undefined, (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListActionBtns, !canUpdateRecord, undefined, handleSeedListReferenceOptions)];
|
|
1809
1828
|
}
|
|
1810
1829
|
});
|
|
1811
1830
|
}); };
|
|
@@ -2258,15 +2277,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2258
2277
|
};
|
|
2259
2278
|
var handleGetListData = function (responseData, type, rowId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2260
2279
|
var dataList, prettierDataList, clonedTableData, clonedSpaceTableData, dummyPrettierDataList_1, resolvedData, selectedIndex_1, isScrollMode, newTableData, newPrettierTableData, isExists, cursorResp, lastDataId, err_1;
|
|
2261
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
2262
|
-
return __generator(this, function (
|
|
2263
|
-
switch (
|
|
2280
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2281
|
+
return __generator(this, function (_l) {
|
|
2282
|
+
switch (_l.label) {
|
|
2264
2283
|
case 0:
|
|
2265
2284
|
dataList = [];
|
|
2266
2285
|
prettierDataList = [];
|
|
2267
|
-
|
|
2286
|
+
_l.label = 1;
|
|
2268
2287
|
case 1:
|
|
2269
|
-
|
|
2288
|
+
_l.trys.push([1, 7, , 8]);
|
|
2270
2289
|
clonedTableData = __spreadArray([], tableData, true);
|
|
2271
2290
|
clonedSpaceTableData = __spreadArray([], spaceTableData, true);
|
|
2272
2291
|
if (!(responseData === null || responseData === void 0 ? void 0 : responseData.data)) return [3 /*break*/, 6];
|
|
@@ -2274,19 +2293,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2274
2293
|
dummyPrettierDataList_1 = [];
|
|
2275
2294
|
return [4 /*yield*/, handleResolveOfflineReferences(responseData.data)];
|
|
2276
2295
|
case 2:
|
|
2277
|
-
resolvedData =
|
|
2296
|
+
resolvedData = _l.sent();
|
|
2278
2297
|
resolvedData.map(function (eachData) {
|
|
2279
2298
|
var _a, _b;
|
|
2280
2299
|
var tempData = eachData;
|
|
2281
|
-
(0, listModule_1.handleDataEditButton)(tempData, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListActionBtns);
|
|
2300
|
+
(0, listModule_1.handleDataEditButton)(tempData, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListActionBtns, undefined, undefined, undefined, !canUpdateRecord);
|
|
2282
2301
|
dummyPrettierDataList_1.push(tempData);
|
|
2283
2302
|
return null;
|
|
2284
2303
|
});
|
|
2285
2304
|
prettierDataList = dummyPrettierDataList_1;
|
|
2286
2305
|
return [3 /*break*/, 5];
|
|
2287
|
-
case 3: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, structure, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_d = props.edit) === null || _d === void 0 ? void 0 : _d.activityLog : undefined, (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListActionBtns,
|
|
2306
|
+
case 3: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, structure, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_d = props.edit) === null || _d === void 0 ? void 0 : _d.activityLog : undefined, (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListActionBtns, !canUpdateRecord, undefined, handleSeedListReferenceOptions)];
|
|
2288
2307
|
case 4:
|
|
2289
|
-
prettierDataList =
|
|
2308
|
+
prettierDataList = _l.sent();
|
|
2290
2309
|
if (props.groupId) {
|
|
2291
2310
|
prettierDataList.forEach(function (item, idx) {
|
|
2292
2311
|
var _a, _b;
|
|
@@ -2295,9 +2314,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2295
2314
|
}
|
|
2296
2315
|
});
|
|
2297
2316
|
}
|
|
2298
|
-
|
|
2317
|
+
_l.label = 5;
|
|
2299
2318
|
case 5:
|
|
2300
|
-
(
|
|
2319
|
+
(_f = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _f === void 0 ? void 0 : _f.map(function (eachData, eachIndex) {
|
|
2301
2320
|
if (eachData["_id"]) {
|
|
2302
2321
|
eachData["id"] = eachData["_id"];
|
|
2303
2322
|
delete eachData["_id"];
|
|
@@ -2321,7 +2340,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2321
2340
|
return null;
|
|
2322
2341
|
});
|
|
2323
2342
|
dataList = responseData.data;
|
|
2324
|
-
|
|
2343
|
+
_l.label = 6;
|
|
2325
2344
|
case 6:
|
|
2326
2345
|
if (type === "update" || type === "create") {
|
|
2327
2346
|
try {
|
|
@@ -2333,12 +2352,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2333
2352
|
return null;
|
|
2334
2353
|
});
|
|
2335
2354
|
if (selectedIndex_1 > -1) {
|
|
2336
|
-
clonedTableData[selectedIndex_1] = (
|
|
2355
|
+
clonedTableData[selectedIndex_1] = (_g = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _g === void 0 ? void 0 : _g[0];
|
|
2337
2356
|
clonedSpaceTableData[selectedIndex_1] = prettierDataList === null || prettierDataList === void 0 ? void 0 : prettierDataList[0];
|
|
2338
2357
|
}
|
|
2339
2358
|
}
|
|
2340
2359
|
else {
|
|
2341
|
-
clonedTableData.push((
|
|
2360
|
+
clonedTableData.push((_h = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _h === void 0 ? void 0 : _h[0]);
|
|
2342
2361
|
clonedSpaceTableData.push(prettierDataList === null || prettierDataList === void 0 ? void 0 : prettierDataList[0]);
|
|
2343
2362
|
}
|
|
2344
2363
|
handleSetListData(clonedTableData, clonedSpaceTableData);
|
|
@@ -2349,7 +2368,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2349
2368
|
isScrollMode = renderCheckScrollMode();
|
|
2350
2369
|
if (!isScrollMode && !isFirebase) {
|
|
2351
2370
|
handleSetListData(dataList, prettierDataList);
|
|
2352
|
-
setSize((
|
|
2371
|
+
setSize((_j = responseData.count) !== null && _j !== void 0 ? _j : 0);
|
|
2353
2372
|
}
|
|
2354
2373
|
else {
|
|
2355
2374
|
newTableData = [];
|
|
@@ -2387,13 +2406,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2387
2406
|
}
|
|
2388
2407
|
setCursor(cursorResp);
|
|
2389
2408
|
if (isScrollMode && !isFirebase) {
|
|
2390
|
-
setSize((
|
|
2409
|
+
setSize((_k = responseData.count) !== null && _k !== void 0 ? _k : 0);
|
|
2391
2410
|
}
|
|
2392
2411
|
}
|
|
2393
2412
|
}
|
|
2394
2413
|
return [3 /*break*/, 8];
|
|
2395
2414
|
case 7:
|
|
2396
|
-
err_1 =
|
|
2415
|
+
err_1 = _l.sent();
|
|
2397
2416
|
return [3 /*break*/, 8];
|
|
2398
2417
|
case 8:
|
|
2399
2418
|
setTableLoading(false);
|
|
@@ -3981,7 +4000,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3981
4000
|
return __generator(this, function (_a) {
|
|
3982
4001
|
switch (_a.label) {
|
|
3983
4002
|
case 0:
|
|
3984
|
-
|
|
4003
|
+
if (!canBatchUpdate)
|
|
4004
|
+
return [2 /*return*/];
|
|
4005
|
+
_a.label = 1;
|
|
4006
|
+
case 1:
|
|
4007
|
+
_a.trys.push([1, 5, , 6]);
|
|
3985
4008
|
setLoading(true);
|
|
3986
4009
|
return [4 /*yield*/, readServerQuery.call({
|
|
3987
4010
|
type: "list",
|
|
@@ -3994,9 +4017,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3994
4017
|
],
|
|
3995
4018
|
stopLimit: true,
|
|
3996
4019
|
})];
|
|
3997
|
-
case
|
|
4020
|
+
case 2:
|
|
3998
4021
|
responseData = _a.sent();
|
|
3999
|
-
if (!(responseData === null || responseData === void 0 ? void 0 : responseData.data)) return [3 /*break*/,
|
|
4022
|
+
if (!(responseData === null || responseData === void 0 ? void 0 : responseData.data)) return [3 /*break*/, 4];
|
|
4000
4023
|
newDataList_1 = [];
|
|
4001
4024
|
responseData.data.map(function (eachData) {
|
|
4002
4025
|
var _a;
|
|
@@ -4007,16 +4030,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4007
4030
|
return [4 /*yield*/, writeServerQuery.call("batchCreate", {
|
|
4008
4031
|
data: newDataList_1,
|
|
4009
4032
|
})];
|
|
4010
|
-
case
|
|
4033
|
+
case 3:
|
|
4011
4034
|
res = _a.sent();
|
|
4012
4035
|
if (res)
|
|
4013
4036
|
handleRefresh(false, true);
|
|
4014
|
-
_a.label =
|
|
4015
|
-
case
|
|
4016
|
-
case 4:
|
|
4017
|
-
err_15 = _a.sent();
|
|
4018
|
-
return [3 /*break*/, 5];
|
|
4037
|
+
_a.label = 4;
|
|
4038
|
+
case 4: return [3 /*break*/, 6];
|
|
4019
4039
|
case 5:
|
|
4040
|
+
err_15 = _a.sent();
|
|
4041
|
+
return [3 /*break*/, 6];
|
|
4042
|
+
case 6:
|
|
4020
4043
|
setLoading(false);
|
|
4021
4044
|
return [2 /*return*/];
|
|
4022
4045
|
}
|
|
@@ -4027,7 +4050,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4027
4050
|
return __generator(this, function (_a) {
|
|
4028
4051
|
switch (_a.label) {
|
|
4029
4052
|
case 0:
|
|
4030
|
-
|
|
4053
|
+
if (!canBatchUpdate)
|
|
4054
|
+
return [2 /*return*/];
|
|
4055
|
+
_a.label = 1;
|
|
4056
|
+
case 1:
|
|
4057
|
+
_a.trys.push([1, 3, , 4]);
|
|
4031
4058
|
setLoading(true);
|
|
4032
4059
|
return [4 /*yield*/, writeServerQuery.call("batchUpdate", {
|
|
4033
4060
|
query: [
|
|
@@ -4041,15 +4068,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4041
4068
|
baseDraft: true,
|
|
4042
4069
|
},
|
|
4043
4070
|
})];
|
|
4044
|
-
case
|
|
4071
|
+
case 2:
|
|
4045
4072
|
res = _a.sent();
|
|
4046
4073
|
if (res)
|
|
4047
4074
|
handleRefresh(false, true);
|
|
4048
|
-
return [3 /*break*/,
|
|
4049
|
-
case 2:
|
|
4050
|
-
err_16 = _a.sent();
|
|
4051
|
-
return [3 /*break*/, 3];
|
|
4075
|
+
return [3 /*break*/, 4];
|
|
4052
4076
|
case 3:
|
|
4077
|
+
err_16 = _a.sent();
|
|
4078
|
+
return [3 /*break*/, 4];
|
|
4079
|
+
case 4:
|
|
4053
4080
|
setLoading(false);
|
|
4054
4081
|
return [2 /*return*/];
|
|
4055
4082
|
}
|
|
@@ -4060,14 +4087,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4060
4087
|
return __generator(this, function (_a) {
|
|
4061
4088
|
switch (_a.label) {
|
|
4062
4089
|
case 0:
|
|
4063
|
-
|
|
4090
|
+
if (!canBatchUpdate)
|
|
4091
|
+
return [2 /*return*/];
|
|
4092
|
+
_a.label = 1;
|
|
4093
|
+
case 1:
|
|
4094
|
+
_a.trys.push([1, 8, , 9]);
|
|
4064
4095
|
setLoading(true);
|
|
4065
4096
|
setModalVisible(true);
|
|
4066
4097
|
model_1 = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
|
|
4067
4098
|
columnId_1 = batchUpdateData.columnId;
|
|
4068
4099
|
dataToSubmit_1 = batchUpdateData.columnData;
|
|
4069
4100
|
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";
|
|
4070
|
-
if (!(isFile && dataToSubmit_1[columnId_1])) return [3 /*break*/,
|
|
4101
|
+
if (!(isFile && dataToSubmit_1[columnId_1])) return [3 /*break*/, 3];
|
|
4071
4102
|
return [4 /*yield*/, Promise.all(selectedIds.map(function (eachId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4072
4103
|
return __generator(this, function (_a) {
|
|
4073
4104
|
switch (_a.label) {
|
|
@@ -4076,16 +4107,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4076
4107
|
}
|
|
4077
4108
|
});
|
|
4078
4109
|
}); }))];
|
|
4079
|
-
case
|
|
4110
|
+
case 2:
|
|
4080
4111
|
res = _a.sent();
|
|
4081
4112
|
if (res) {
|
|
4082
4113
|
setLoading(false);
|
|
4083
4114
|
setModalVisible(false);
|
|
4084
4115
|
setBatchUpdateModal(false);
|
|
4085
4116
|
}
|
|
4086
|
-
return [3 /*break*/,
|
|
4087
|
-
case
|
|
4088
|
-
if (!(isFile && !dataToSubmit_1[columnId_1])) return [3 /*break*/,
|
|
4117
|
+
return [3 /*break*/, 7];
|
|
4118
|
+
case 3:
|
|
4119
|
+
if (!(isFile && !dataToSubmit_1[columnId_1])) return [3 /*break*/, 5];
|
|
4089
4120
|
return [4 /*yield*/, Promise.all(selectedIds.map(function (eachId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4090
4121
|
var _a, _b, _c;
|
|
4091
4122
|
return __generator(this, function (_d) {
|
|
@@ -4097,10 +4128,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4097
4128
|
}
|
|
4098
4129
|
});
|
|
4099
4130
|
}); }))];
|
|
4100
|
-
case 3:
|
|
4101
|
-
_a.sent();
|
|
4102
|
-
_a.label = 4;
|
|
4103
4131
|
case 4:
|
|
4132
|
+
_a.sent();
|
|
4133
|
+
_a.label = 5;
|
|
4134
|
+
case 5:
|
|
4104
4135
|
updateQuery = renderImpSearchFilterConditions();
|
|
4105
4136
|
selectAllQuery = updateQuery
|
|
4106
4137
|
? updateQuery
|
|
@@ -4130,14 +4161,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4130
4161
|
batchUpdateConfig["data"] = dataToSubmit_1;
|
|
4131
4162
|
}
|
|
4132
4163
|
return [4 /*yield*/, writeServerQuery.call("batchUpdate", batchUpdateConfig)];
|
|
4133
|
-
case
|
|
4164
|
+
case 6:
|
|
4134
4165
|
res = _a.sent();
|
|
4135
4166
|
if (res) {
|
|
4136
4167
|
handleRefresh(false, true);
|
|
4137
4168
|
}
|
|
4138
|
-
_a.label =
|
|
4139
|
-
case
|
|
4140
|
-
case
|
|
4169
|
+
_a.label = 7;
|
|
4170
|
+
case 7: return [3 /*break*/, 9];
|
|
4171
|
+
case 8:
|
|
4141
4172
|
err_17 = _a.sent();
|
|
4142
4173
|
if (err_17.response) {
|
|
4143
4174
|
setNotification({
|
|
@@ -4146,8 +4177,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4146
4177
|
msg: handleGetWriteErrorMessage(err_17.response),
|
|
4147
4178
|
});
|
|
4148
4179
|
}
|
|
4149
|
-
return [3 /*break*/,
|
|
4150
|
-
case
|
|
4180
|
+
return [3 /*break*/, 9];
|
|
4181
|
+
case 9:
|
|
4151
4182
|
setBatchUpdateData({ columnId: "", columnData: {} });
|
|
4152
4183
|
return [2 /*return*/];
|
|
4153
4184
|
}
|
|
@@ -4190,7 +4221,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4190
4221
|
updateDataRes = _g.sent();
|
|
4191
4222
|
updateDataList = (_b = updateDataRes === null || updateDataRes === void 0 ? void 0 : updateDataRes.data) !== null && _b !== void 0 ? _b : [];
|
|
4192
4223
|
_loop_1 = function (i) {
|
|
4193
|
-
var eachOfflineData, offlineDataId, storedBaseline, serverDoc,
|
|
4224
|
+
var eachOfflineData, offlineDataId, storedBaseline, serverDoc, isUpdate, preComplete, res, err_19;
|
|
4194
4225
|
var _h;
|
|
4195
4226
|
return __generator(this, function (_j) {
|
|
4196
4227
|
switch (_j.label) {
|
|
@@ -4229,6 +4260,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4229
4260
|
if (hasValue)
|
|
4230
4261
|
dirtyFieldsRef.current.add(key);
|
|
4231
4262
|
});
|
|
4263
|
+
isUpdate = !!serverDoc;
|
|
4232
4264
|
if (!((_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareUpdateHandlePreComplete)) return [3 /*break*/, 3];
|
|
4233
4265
|
return [4 /*yield*/, props.bareSettings.bareUpdateHandlePreComplete(eachOfflineData)];
|
|
4234
4266
|
case 2:
|
|
@@ -4236,9 +4268,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4236
4268
|
if (!preComplete)
|
|
4237
4269
|
return [2 /*return*/, "continue"]; // Skip this item
|
|
4238
4270
|
_j.label = 3;
|
|
4239
|
-
case 3:
|
|
4240
|
-
isUpdate = !!serverDoc;
|
|
4241
|
-
return [4 /*yield*/, handleSubmitData(undefined, undefined, undefined, eachOfflineData, offlineDataId, isUpdate)];
|
|
4271
|
+
case 3: return [4 /*yield*/, handleSubmitData(undefined, undefined, undefined, eachOfflineData, offlineDataId, isUpdate)];
|
|
4242
4272
|
case 4:
|
|
4243
4273
|
res = _j.sent();
|
|
4244
4274
|
if (!res) return [3 /*break*/, 8];
|
|
@@ -4339,6 +4369,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4339
4369
|
selectedId = offlineId;
|
|
4340
4370
|
id = offlineId;
|
|
4341
4371
|
}
|
|
4372
|
+
// INFO: an explicit list update is a reader-reachable write — an inline
|
|
4373
|
+
// cell or a dragged card — so it must carry the permission that drew that
|
|
4374
|
+
// control. A form or offline submit is the consumer's own call and is not
|
|
4375
|
+
// gated here; the consumer decides whether to render a write form at all.
|
|
4376
|
+
if (type === "update" && !canSubmitUpdate)
|
|
4377
|
+
return [2 /*return*/, ""];
|
|
4342
4378
|
if (!(isOffline &&
|
|
4343
4379
|
!(isOfflineNetworkListener && !isNetworkOffline) &&
|
|
4344
4380
|
!offlineId)) return [3 /*break*/, 2];
|
|
@@ -4995,16 +5031,28 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4995
5031
|
});
|
|
4996
5032
|
}); };
|
|
4997
5033
|
var handleUpdateKanbanChecked = function (id, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5034
|
+
var err_24;
|
|
4998
5035
|
var _a;
|
|
4999
5036
|
return __generator(this, function (_b) {
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5037
|
+
switch (_b.label) {
|
|
5038
|
+
case 0:
|
|
5039
|
+
if (!canInlineUpdate)
|
|
5040
|
+
return [2 /*return*/];
|
|
5041
|
+
_b.label = 1;
|
|
5042
|
+
case 1:
|
|
5043
|
+
_b.trys.push([1, 3, , 4]);
|
|
5044
|
+
return [4 /*yield*/, writeServerQuery.call("update", {
|
|
5045
|
+
id: id,
|
|
5046
|
+
data: (_a = {}, _a[columnId] = value, _a),
|
|
5047
|
+
})];
|
|
5048
|
+
case 2:
|
|
5049
|
+
_b.sent();
|
|
5050
|
+
return [3 /*break*/, 4];
|
|
5051
|
+
case 3:
|
|
5052
|
+
err_24 = _b.sent();
|
|
5053
|
+
return [3 /*break*/, 4];
|
|
5054
|
+
case 4: return [2 /*return*/];
|
|
5005
5055
|
}
|
|
5006
|
-
catch (err) { }
|
|
5007
|
-
return [2 /*return*/];
|
|
5008
5056
|
});
|
|
5009
5057
|
}); };
|
|
5010
5058
|
var handleRetrieveSelectedData = function (responseData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -5364,7 +5412,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5364
5412
|
handleUpdateChangeData(clonedData);
|
|
5365
5413
|
};
|
|
5366
5414
|
var handleOnChangeSelect = function (id, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5367
|
-
var _a, data, model, clonedData, refetchReference, currentSchema, allowedWatchedColumnTypes_1, watchedColumns, _i, watchedColumns_1, eachWatched, dependency, referenceRQ, valueRes,
|
|
5415
|
+
var _a, data, model, clonedData, refetchReference, currentSchema, allowedWatchedColumnTypes_1, watchedColumns, _i, watchedColumns_1, eachWatched, dependency, referenceRQ, valueRes, err_25;
|
|
5368
5416
|
return __generator(this, function (_b) {
|
|
5369
5417
|
switch (_b.label) {
|
|
5370
5418
|
case 0:
|
|
@@ -5427,7 +5475,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5427
5475
|
return [3 /*break*/, 3];
|
|
5428
5476
|
case 6: return [3 /*break*/, 8];
|
|
5429
5477
|
case 7:
|
|
5430
|
-
|
|
5478
|
+
err_25 = _b.sent();
|
|
5431
5479
|
return [3 /*break*/, 8];
|
|
5432
5480
|
case 8:
|
|
5433
5481
|
clonedData[id] = value;
|
|
@@ -5505,7 +5553,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5505
5553
|
}
|
|
5506
5554
|
};
|
|
5507
5555
|
var handleStepCSV = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
5508
|
-
var csvList_1, _loop_2, _i, _a, _b, eachKey, eachValue, valid_1, errorValue_1, excelFormData, updateFields, response, open_1,
|
|
5556
|
+
var csvList_1, _loop_2, _i, _a, _b, eachKey, eachValue, valid_1, errorValue_1, excelFormData, updateFields, response, open_1, err_26;
|
|
5509
5557
|
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
5510
5558
|
return __generator(this, function (_p) {
|
|
5511
5559
|
switch (_p.label) {
|
|
@@ -5652,12 +5700,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5652
5700
|
_p.label = 5;
|
|
5653
5701
|
case 5: return [3 /*break*/, 7];
|
|
5654
5702
|
case 6:
|
|
5655
|
-
|
|
5703
|
+
err_26 = _p.sent();
|
|
5656
5704
|
setLoading(false);
|
|
5657
5705
|
setNotification({
|
|
5658
5706
|
type: false,
|
|
5659
5707
|
title: "Import Error",
|
|
5660
|
-
msg:
|
|
5708
|
+
msg: err_26.message,
|
|
5661
5709
|
});
|
|
5662
5710
|
return [3 /*break*/, 7];
|
|
5663
5711
|
case 7: return [2 /*return*/];
|
|
@@ -5665,7 +5713,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5665
5713
|
});
|
|
5666
5714
|
}); };
|
|
5667
5715
|
var handleExportCSVData = function (downloadLinkOnly, printOnly) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5668
|
-
var exportQueryList, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg,
|
|
5716
|
+
var exportQueryList, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg, err_27;
|
|
5669
5717
|
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;
|
|
5670
5718
|
return __generator(this, function (_1) {
|
|
5671
5719
|
switch (_1.label) {
|
|
@@ -5739,7 +5787,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5739
5787
|
setExportCSVEmail((_0 = (_z = props.devSettings.currentUser) === null || _z === void 0 ? void 0 : _z.userEmail) !== null && _0 !== void 0 ? _0 : "");
|
|
5740
5788
|
return [3 /*break*/, 6];
|
|
5741
5789
|
case 5:
|
|
5742
|
-
|
|
5790
|
+
err_27 = _1.sent();
|
|
5743
5791
|
setNotification({
|
|
5744
5792
|
type: true,
|
|
5745
5793
|
title: "Export Failed",
|
|
@@ -5795,7 +5843,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5795
5843
|
});
|
|
5796
5844
|
}); };
|
|
5797
5845
|
var handleExportReadPDF = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
5798
|
-
var elementToExport, dimensionsConfig, headerConfig_1, isMobile, scale, html2canvasOptions, originalStyles, captureWidth, captureHeight, canvas, pageWidth, pageHeight, orientation_1, pdf, pixelsToMm, elementWidthMm, elementHeightMm, pageSize, margin, headerHeight, imageDataURL, imageWidth_1, imageHeight_1, hasImage, hasText, img_1,
|
|
5846
|
+
var elementToExport, dimensionsConfig, headerConfig_1, isMobile, scale, html2canvasOptions, originalStyles, captureWidth, captureHeight, canvas, pageWidth, pageHeight, orientation_1, pdf, pixelsToMm, elementWidthMm, elementHeightMm, pageSize, margin, headerHeight, imageDataURL, imageWidth_1, imageHeight_1, hasImage, hasText, img_1, err_28, textHeight, usableWidth, imgHeight, usableHeight, currentY, imgX, imgY, imgW, imgH, finalX, textY, textX, heightLeft, page, currentY, imgX, imgY, imgW, imgH, finalX, textY, textX, sourceY, sourceHeight, pageCanvas, ctx, pageData, pdfBlob, err_29;
|
|
5799
5847
|
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;
|
|
5800
5848
|
return __generator(this, function (_4) {
|
|
5801
5849
|
switch (_4.label) {
|
|
@@ -5966,8 +6014,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5966
6014
|
headerHeight = imageHeight_1 + 2;
|
|
5967
6015
|
return [3 /*break*/, 13];
|
|
5968
6016
|
case 12:
|
|
5969
|
-
|
|
5970
|
-
console.error("Failed to load PDF header image:",
|
|
6017
|
+
err_28 = _4.sent();
|
|
6018
|
+
console.error("Failed to load PDF header image:", err_28);
|
|
5971
6019
|
console.error("Image source:", headerConfig_1.image.src);
|
|
5972
6020
|
return [3 /*break*/, 13];
|
|
5973
6021
|
case 13:
|
|
@@ -6108,8 +6156,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6108
6156
|
}
|
|
6109
6157
|
return [3 /*break*/, 17];
|
|
6110
6158
|
case 15:
|
|
6111
|
-
|
|
6112
|
-
console.error("PDF export error:",
|
|
6159
|
+
err_29 = _4.sent();
|
|
6160
|
+
console.error("PDF export error:", err_29);
|
|
6113
6161
|
setNotification({
|
|
6114
6162
|
type: false,
|
|
6115
6163
|
title: "Error",
|
|
@@ -6202,7 +6250,6 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6202
6250
|
var handleDeleteModal = function () {
|
|
6203
6251
|
if ((selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) !== "feeds") {
|
|
6204
6252
|
if (resolvedType === "read" &&
|
|
6205
|
-
isEditor &&
|
|
6206
6253
|
props.id &&
|
|
6207
6254
|
props.id !== "new") {
|
|
6208
6255
|
setDeleteModal(true);
|
|
@@ -6451,7 +6498,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6451
6498
|
: "".concat(dividerColor, " ").concat(labelColor)), onClick: function () { return handleChangePageLimit(eachOption); } }, eachOption)); })))));
|
|
6452
6499
|
};
|
|
6453
6500
|
var renderTableHeader = function () {
|
|
6454
|
-
var _a
|
|
6501
|
+
var _a;
|
|
6455
6502
|
var tableHeader = [];
|
|
6456
6503
|
var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
|
|
6457
6504
|
structure.map(function (eachAttribute) {
|
|
@@ -6469,8 +6516,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6469
6516
|
tableHeader.push(__assign(__assign({}, eachAttribute), { key: eachAttribute.id, title: eachAttribute.name, width: eachAttribute.tableColWidth }));
|
|
6470
6517
|
return null;
|
|
6471
6518
|
});
|
|
6472
|
-
if (
|
|
6473
|
-
((
|
|
6519
|
+
if (canUpdateRecord ||
|
|
6520
|
+
((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListMultipleSelectAddtionalActions))
|
|
6474
6521
|
tableHeader.push({
|
|
6475
6522
|
key: "update",
|
|
6476
6523
|
title: "Update",
|
|
@@ -6819,7 +6866,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6819
6866
|
return "sticky ".concat(offset, " z-20 -mx-2 ").concat(layout, " rounded-2xl border ").concat(surface, " px-3 py-2 shadow-lg sm:mx-0 sm:px-4");
|
|
6820
6867
|
};
|
|
6821
6868
|
var renderStepBar = function (uniqueTabIds) {
|
|
6822
|
-
var _a, _b, _c, _d, _e, _f
|
|
6869
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6823
6870
|
var hasTabAlign = ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.tabAlign) || ((_b = props.space) === null || _b === void 0 ? void 0 : _b.tabAlign);
|
|
6824
6871
|
if (resolvedType !== "update")
|
|
6825
6872
|
return null;
|
|
@@ -6855,7 +6902,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6855
6902
|
var bareActionComponent = (_e = (_d = (_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareUpdateActionComponent) === null || _d === void 0 ? void 0 : _d.call(_c, selectedData, formRef)) !== null && _e !== void 0 ? _e : undefined;
|
|
6856
6903
|
var hasCustomActions = !!bareActionComponent && !handleIsEmptyElement(bareActionComponent);
|
|
6857
6904
|
var hasActions = bareActionComponent ? hasCustomActions : true;
|
|
6858
|
-
var showDelete =
|
|
6905
|
+
var showDelete = canDeleteRecord && props.id !== "new";
|
|
6859
6906
|
if (!isTabbed && !hasActions && !showDelete)
|
|
6860
6907
|
return null;
|
|
6861
6908
|
return (
|
|
@@ -6883,7 +6930,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6883
6930
|
: "bg-white border border-gray-300 hover:bg-gray-50", icon: react_1.default.createElement(HeroIcons.ChevronRightIcon, { className: "w-5 h-5 ".concat(isLast ? "text-gray-400" : "text-gray-700") }), disabled: isLast, onClick: function () { return handleMoveTab(1); } }))),
|
|
6884
6931
|
react_1.default.createElement("div", { className: "flex-1" }),
|
|
6885
6932
|
react_1.default.createElement("div", { className: "flex flex-row items-center gap-2" },
|
|
6886
|
-
|
|
6933
|
+
canDeleteRecord && props.id !== "new" && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
6887
6934
|
react_1.default.createElement("div", { className: "sm:hidden" },
|
|
6888
6935
|
react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-delete-icon", background: "bg-white border border-red-200 hover:bg-red-50", icon: react_1.default.createElement(HeroIcons.TrashIcon, { className: "w-5 h-5 text-red-600" }), onClick: function () {
|
|
6889
6936
|
setDeleteModal(true);
|
|
@@ -6893,7 +6940,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6893
6940
|
setDeleteModal(true);
|
|
6894
6941
|
} })))),
|
|
6895
6942
|
hasCustomActions && bareActionComponent,
|
|
6896
|
-
!bareActionComponent && ((
|
|
6943
|
+
!bareActionComponent && ((_f = props.edit) === null || _f === void 0 ? void 0 : _f.enableUpdateDraft) && (react_1.default.createElement(button_1.Button, { id: "dtw-step-save", text: "Save", type: "light", size: "small", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6897
6944
|
return __generator(this, function (_a) {
|
|
6898
6945
|
switch (_a.label) {
|
|
6899
6946
|
case 0: return [4 /*yield*/, handleFormSaveDraft()];
|
|
@@ -6917,14 +6964,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6917
6964
|
// INFO: the read view's floating bar — the same pill as the update form,
|
|
6918
6965
|
// carrying Update (or the caller's own component), Export PDF and Log
|
|
6919
6966
|
var renderReadBar = function () {
|
|
6920
|
-
var _a, _b, _c, _d, _e
|
|
6967
|
+
var _a, _b, _c, _d, _e;
|
|
6921
6968
|
if (resolvedType !== "read")
|
|
6922
6969
|
return null;
|
|
6923
6970
|
var bareActionComponent = (_c = (_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionComponent) === null || _b === void 0 ? void 0 : _b.call(_a, selectedData, formRef)) !== null && _c !== void 0 ? _c : undefined;
|
|
6924
6971
|
var hasCustomActions = !!bareActionComponent && !handleIsEmptyElement(bareActionComponent);
|
|
6925
|
-
var showUpdate = !bareActionComponent &&
|
|
6926
|
-
var showExport = !!((
|
|
6927
|
-
var showDelete =
|
|
6972
|
+
var showUpdate = !bareActionComponent && canUpdateRecord;
|
|
6973
|
+
var showExport = !!((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.exportSettings) === null || _e === void 0 ? void 0 : _e.enableExportReadPDF);
|
|
6974
|
+
var showDelete = canDeleteRecord && props.id !== "new";
|
|
6928
6975
|
if (!hasCustomActions &&
|
|
6929
6976
|
!showUpdate &&
|
|
6930
6977
|
!showExport &&
|
|
@@ -6932,7 +6979,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6932
6979
|
!showDelete)
|
|
6933
6980
|
return null;
|
|
6934
6981
|
return (react_1.default.createElement("div", { "data-testid": "dtw-read-bar", className: handleActionBarClassName(true) },
|
|
6935
|
-
|
|
6982
|
+
canDeleteRecord && props.id !== "new" && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
6936
6983
|
react_1.default.createElement("div", { className: "sm:hidden" },
|
|
6937
6984
|
react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-delete-icon", background: "bg-white border border-red-200 hover:bg-red-50", icon: react_1.default.createElement(HeroIcons.TrashIcon, { className: "w-5 h-5 text-red-600" }), onClick: function () {
|
|
6938
6985
|
setDeleteModal(true);
|
|
@@ -7804,11 +7851,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7804
7851
|
}, { signing: signatureSigning, setSigning: setSignatureSigning }, props.onComplete ? true : false, (_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareOffline, (_l = (_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareUpdateColumnType) !== null && _l !== void 0 ? _l : "two", (_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareUpdateIndividualComponent, (_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareUpdateMobileView);
|
|
7805
7852
|
};
|
|
7806
7853
|
var renderGridAndListData = function (imageTag, type, kanbanGroupId, useColumnName) {
|
|
7807
|
-
var _a, _b;
|
|
7808
7854
|
var gridData = [];
|
|
7809
7855
|
var isKanban = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "kanban";
|
|
7810
|
-
var isListEditable =
|
|
7811
|
-
var disableUpdate = (_b = props.edit) === null || _b === void 0 ? void 0 : _b.disabledUpdate;
|
|
7856
|
+
var isListEditable = canInlineUpdate;
|
|
7812
7857
|
var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
|
|
7813
7858
|
var titleKey = "";
|
|
7814
7859
|
// INFO: titleModel ignores user hides so the card title stays stable
|
|
@@ -7866,8 +7911,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7866
7911
|
if (isKanban &&
|
|
7867
7912
|
isListEditable &&
|
|
7868
7913
|
selectedModel.type === "boolean" &&
|
|
7869
|
-
selectedModel.enableCheckbox
|
|
7870
|
-
!disableUpdate) {
|
|
7914
|
+
selectedModel.enableCheckbox) {
|
|
7871
7915
|
return null;
|
|
7872
7916
|
}
|
|
7873
7917
|
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showBaseUpdatedAt) && eachKey === "baseUpdatedAt") {
|
|
@@ -7915,8 +7959,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7915
7959
|
});
|
|
7916
7960
|
if (booleanModels.length &&
|
|
7917
7961
|
isKanban &&
|
|
7918
|
-
isListEditable
|
|
7919
|
-
!disableUpdate) {
|
|
7962
|
+
isListEditable) {
|
|
7920
7963
|
booleanModels.map(function (eachModel) {
|
|
7921
7964
|
return listDescArray.push(react_1.default.createElement("div", { className: "flex space-x-1 items-center", key: "kanban-checkbox-".concat(eachModel.id) },
|
|
7922
7965
|
react_1.default.createElement("p", null,
|
|
@@ -8200,7 +8243,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8200
8243
|
return groups;
|
|
8201
8244
|
};
|
|
8202
8245
|
var renderGroupTable = function (multipleSelect) {
|
|
8203
|
-
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, _22, _23, _24, _25, _26, _27
|
|
8246
|
+
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, _22, _23, _24, _25, _26, _27;
|
|
8204
8247
|
if (groupId && !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)) {
|
|
8205
8248
|
var groupAttributeDS_1 = structure.find(function (eachDS) { return eachDS.id === groupId; });
|
|
8206
8249
|
var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
|
|
@@ -8228,7 +8271,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8228
8271
|
}
|
|
8229
8272
|
else {
|
|
8230
8273
|
return Object.entries(groupedSpaceTableData).map(function (_a) {
|
|
8231
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
|
8274
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
8232
8275
|
var eachKey = _a[0], eachValue = _a[1];
|
|
8233
8276
|
var dataList = eachValue;
|
|
8234
8277
|
var ids = (dataList === null || dataList === void 0 ? void 0 : dataList.map(function (eachData) { return eachData._id; })) || [];
|
|
@@ -8241,23 +8284,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8241
8284
|
eachKey),
|
|
8242
8285
|
react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], referencesOptions: listReferencesOptions, size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
8243
8286
|
selectedIds.length > 0 &&
|
|
8244
|
-
|
|
8245
|
-
!((
|
|
8287
|
+
canBatchUpdate &&
|
|
8288
|
+
!((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
8246
8289
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
|
|
8247
8290
|
handleBatchDraftData();
|
|
8248
8291
|
} }),
|
|
8249
8292
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
|
|
8250
8293
|
handleCloneSelectedData();
|
|
8251
8294
|
} }))),
|
|
8252
|
-
|
|
8295
|
+
canDeleteRecord && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
|
|
8253
8296
|
handleGenerateDeletePasscode();
|
|
8254
8297
|
setDeleteModal(true);
|
|
8255
8298
|
} })),
|
|
8256
|
-
!isFirebase &&
|
|
8299
|
+
!isFirebase && canBatchUpdate && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
|
|
8257
8300
|
setBatchUpdateModal(true);
|
|
8258
8301
|
} })),
|
|
8259
|
-
((
|
|
8260
|
-
((
|
|
8302
|
+
((_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListMultipleSelectAddtionalActions) &&
|
|
8303
|
+
((_h = (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListMultipleSelectAddtionalActions) === null || _h === void 0 ? void 0 : _h.map(function (eachButton) {
|
|
8261
8304
|
return (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm ".concat(eachButton.className), text: eachButton.text, onClick: function () {
|
|
8262
8305
|
var _a, _b;
|
|
8263
8306
|
(_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
|
|
@@ -8265,15 +8308,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8265
8308
|
}))), handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), onClickRow: function (id) {
|
|
8266
8309
|
var _a, _b;
|
|
8267
8310
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
8268
|
-
}, linkType: props.linkType, custom: props.custom, newTabUrl: (
|
|
8269
|
-
addColumnEnabled: (
|
|
8311
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_k = (_j = props.newTabUrl) === null || _j === void 0 ? void 0 : _j.default) !== null && _k !== void 0 ? _k : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_m = (_l = props.newTabUrl) === null || _l === void 0 ? void 0 : _l.addons) !== null && _m !== void 0 ? _m : "&type=read&collection=".concat(props.collectionId, "&view=general"), className: "mt-5", lib: { axios: (_o = props.lib) === null || _o === void 0 ? void 0 : _o.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_p = props.organise) === null || _p === void 0 ? void 0 : _p.fixedPagination, advSettings: {
|
|
8312
|
+
addColumnEnabled: (_q = props.organise) === null || _q === void 0 ? void 0 : _q.addColumnEnabled,
|
|
8270
8313
|
renderAddColumnElements: renderAddMathColumn,
|
|
8271
8314
|
dragEnabled: isViewSettingsEnabled,
|
|
8272
8315
|
sortEnabled: isViewSettingsEnabled,
|
|
8273
8316
|
// INFO: per-column header filter is replaced by the flex filters
|
|
8274
8317
|
filterEnabled: false,
|
|
8275
8318
|
sortId: activeSortId,
|
|
8276
|
-
sortOptions: (
|
|
8319
|
+
sortOptions: (_t = (_s = (_r = props.organise) === null || _r === void 0 ? void 0 : _r.renderReferenceLabelOptions) === null || _s === void 0 ? void 0 : _s.call(_r)) !== null && _t !== void 0 ? _t : (isViewSettingsEnabled
|
|
8277
8320
|
? getViewSettingsColumns().map(function (eachColumn) {
|
|
8278
8321
|
var _a;
|
|
8279
8322
|
return ({
|
|
@@ -8302,9 +8345,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8302
8345
|
return renderSearchContent(newQuery);
|
|
8303
8346
|
},
|
|
8304
8347
|
}, editable: {
|
|
8305
|
-
active:
|
|
8306
|
-
? true
|
|
8307
|
-
: false,
|
|
8348
|
+
active: canInlineUpdate ? true : false,
|
|
8308
8349
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8309
8350
|
return __generator(this, function (_a) {
|
|
8310
8351
|
switch (_a.label) {
|
|
@@ -8316,7 +8357,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8316
8357
|
});
|
|
8317
8358
|
}); },
|
|
8318
8359
|
}, onObjectEdit: handleObjectCellEdit, addable: {
|
|
8319
|
-
active: ((
|
|
8360
|
+
active: ((_u = props.edit) === null || _u === void 0 ? void 0 : _u.listAddable) ? true : false,
|
|
8320
8361
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8321
8362
|
return __generator(this, function (_a) {
|
|
8322
8363
|
switch (_a.label) {
|
|
@@ -8327,15 +8368,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8327
8368
|
}
|
|
8328
8369
|
});
|
|
8329
8370
|
}); },
|
|
8330
|
-
}, darkMode: (
|
|
8371
|
+
}, darkMode: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.darkMode, hidePagination: true, disableEllipsisOnLongWord: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.disableEllipsisOnLongWord })));
|
|
8331
8372
|
});
|
|
8332
8373
|
}
|
|
8333
8374
|
}
|
|
8334
8375
|
else {
|
|
8335
8376
|
// INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
|
|
8336
8377
|
if ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareNewDTW) {
|
|
8337
|
-
return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, groups: handleBuildNewTableGroups(), size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.disableSelectFullData) === null || _e === void 0 ? void 0 : _e.table, maxSelectedCount: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListMaxSelectedCount, mobileView: (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListMobileView, mobileTooltip: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (
|
|
8338
|
-
!((
|
|
8378
|
+
return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, groups: handleBuildNewTableGroups(), size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.disableSelectFullData) === null || _e === void 0 ? void 0 : _e.table, maxSelectedCount: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListMaxSelectedCount, mobileView: (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListMobileView, mobileTooltip: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (canBatchUpdate &&
|
|
8379
|
+
!((_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareHideTableExtraMultipleAction)
|
|
8339
8380
|
? [
|
|
8340
8381
|
{
|
|
8341
8382
|
id: "draft",
|
|
@@ -8350,7 +8391,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8350
8391
|
hide: selectedIds.length === 0,
|
|
8351
8392
|
},
|
|
8352
8393
|
]
|
|
8353
|
-
: []), true), (
|
|
8394
|
+
: []), true), (canDeleteRecord
|
|
8354
8395
|
? [
|
|
8355
8396
|
{
|
|
8356
8397
|
id: "delete",
|
|
@@ -8361,7 +8402,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8361
8402
|
},
|
|
8362
8403
|
},
|
|
8363
8404
|
]
|
|
8364
|
-
: []), true), (!isFirebase &&
|
|
8405
|
+
: []), true), (!isFirebase && canBatchUpdate
|
|
8365
8406
|
? [
|
|
8366
8407
|
{
|
|
8367
8408
|
id: "update",
|
|
@@ -8369,7 +8410,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8369
8410
|
onClick: function () { return setBatchUpdateModal(true); },
|
|
8370
8411
|
},
|
|
8371
8412
|
]
|
|
8372
|
-
: []), true), (((
|
|
8413
|
+
: []), true), (((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareListMultipleSelectAddtionalActions)
|
|
8373
8414
|
? props.bareSettings.bareListMultipleSelectAddtionalActions.map(function (eachButton) { return ({
|
|
8374
8415
|
id: "dt-list-multi-action-btn-" + eachButton.text,
|
|
8375
8416
|
btnText: eachButton.text,
|
|
@@ -8378,37 +8419,37 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8378
8419
|
return (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
|
|
8379
8420
|
},
|
|
8380
8421
|
}); })
|
|
8381
|
-
: []), true), multiActionFloatingOffset: (
|
|
8422
|
+
: []), true), multiActionFloatingOffset: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
|
|
8382
8423
|
var _a, _b;
|
|
8383
8424
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
8384
|
-
}, linkType: props.linkType, custom: props.custom, newTabUrl: (
|
|
8425
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_o = (_m = props.newTabUrl) === null || _m === void 0 ? void 0 : _m.default) !== null && _o !== void 0 ? _o : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_q = (_p = props.newTabUrl) === null || _p === void 0 ? void 0 : _p.addons) !== null && _q !== void 0 ? _q : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
8385
8426
|
handlePagination(value);
|
|
8386
|
-
}, className: "mt-5", devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (
|
|
8427
|
+
}, className: "mt-5", devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_r = props.organise) === null || _r === void 0 ? void 0 : _r.fixedPagination, advSettings: {
|
|
8387
8428
|
// INFO: bareAddColumns routes the + to the name/type popup; without
|
|
8388
8429
|
// it the flag behaves as it always did and opens the formula builder
|
|
8389
|
-
flat: (
|
|
8390
|
-
addColumnEnabled: ((
|
|
8391
|
-
((
|
|
8392
|
-
onAddColumn: ((
|
|
8430
|
+
flat: (_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareFlatTable,
|
|
8431
|
+
addColumnEnabled: ((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareAddColumns) ||
|
|
8432
|
+
((_u = props.organise) === null || _u === void 0 ? void 0 : _u.addColumnEnabled),
|
|
8433
|
+
onAddColumn: ((_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareAddColumns)
|
|
8393
8434
|
? handleAddPlainColumn
|
|
8394
8435
|
: undefined,
|
|
8395
|
-
onDeleteColumn: ((
|
|
8436
|
+
onDeleteColumn: ((_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareAddColumns)
|
|
8396
8437
|
? handleDeletePlainColumn
|
|
8397
8438
|
: undefined,
|
|
8398
|
-
renderAddColumnElements: ((
|
|
8439
|
+
renderAddColumnElements: ((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareAddColumns)
|
|
8399
8440
|
? undefined
|
|
8400
8441
|
: renderAddMathColumn,
|
|
8401
8442
|
// INFO: the popup's reference pickers read from the same providers
|
|
8402
8443
|
// the schema editor uses — without them a reference column would be
|
|
8403
8444
|
// created with no target and resolve nothing
|
|
8404
|
-
renderReferenceSpaceOptions: (
|
|
8405
|
-
renderReferenceLabelOptions: (
|
|
8445
|
+
renderReferenceSpaceOptions: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.renderReferenceSpaceOptions,
|
|
8446
|
+
renderReferenceLabelOptions: (_z = props.organise) === null || _z === void 0 ? void 0 : _z.renderReferenceLabelOptions,
|
|
8406
8447
|
dragEnabled: isViewSettingsEnabled,
|
|
8407
8448
|
sortEnabled: isViewSettingsEnabled,
|
|
8408
8449
|
// INFO: per-column header filter is replaced by the flex filters
|
|
8409
8450
|
filterEnabled: false,
|
|
8410
8451
|
sortId: activeSortId,
|
|
8411
|
-
sortOptions: (
|
|
8452
|
+
sortOptions: (_2 = (_1 = (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.renderReferenceLabelOptions) === null || _1 === void 0 ? void 0 : _1.call(_0)) !== null && _2 !== void 0 ? _2 : (isViewSettingsEnabled
|
|
8412
8453
|
? getViewSettingsColumns().map(function (eachColumn) {
|
|
8413
8454
|
var _a;
|
|
8414
8455
|
return ({
|
|
@@ -8440,9 +8481,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8440
8481
|
return renderSearchContent(newQuery);
|
|
8441
8482
|
},
|
|
8442
8483
|
}, editable: {
|
|
8443
|
-
active:
|
|
8444
|
-
? true
|
|
8445
|
-
: false,
|
|
8484
|
+
active: canInlineUpdate ? true : false,
|
|
8446
8485
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8447
8486
|
return __generator(this, function (_a) {
|
|
8448
8487
|
switch (_a.label) {
|
|
@@ -8454,7 +8493,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8454
8493
|
});
|
|
8455
8494
|
}); },
|
|
8456
8495
|
}, onObjectEdit: handleObjectCellEdit, addable: {
|
|
8457
|
-
active: ((
|
|
8496
|
+
active: ((_3 = props.edit) === null || _3 === void 0 ? void 0 : _3.listAddable) ? true : false,
|
|
8458
8497
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8459
8498
|
return __generator(this, function (_a) {
|
|
8460
8499
|
switch (_a.label) {
|
|
@@ -8465,27 +8504,27 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8465
8504
|
}
|
|
8466
8505
|
});
|
|
8467
8506
|
}); },
|
|
8468
|
-
}, darkMode: (
|
|
8507
|
+
}, darkMode: (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.darkMode, hidePagination: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableEllipsisOnLongWord, pinColumns: (_7 = props.bareSettings) === null || _7 === void 0 ? void 0 : _7.bareListTablePinColumns }));
|
|
8469
8508
|
}
|
|
8470
|
-
return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (
|
|
8509
|
+
return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.disableSelectFullData) === null || _9 === void 0 ? void 0 : _9.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
8471
8510
|
selectedIds.length > 0 &&
|
|
8472
|
-
|
|
8473
|
-
!((
|
|
8511
|
+
canBatchUpdate &&
|
|
8512
|
+
!((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
8474
8513
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
|
|
8475
8514
|
handleBatchDraftData();
|
|
8476
8515
|
} }),
|
|
8477
8516
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
|
|
8478
8517
|
handleCloneSelectedData();
|
|
8479
8518
|
} }))),
|
|
8480
|
-
|
|
8519
|
+
canDeleteRecord && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
|
|
8481
8520
|
handleGenerateDeletePasscode();
|
|
8482
8521
|
setDeleteModal(true);
|
|
8483
8522
|
} })),
|
|
8484
|
-
!isFirebase &&
|
|
8523
|
+
!isFirebase && canBatchUpdate && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
|
|
8485
8524
|
setBatchUpdateModal(true);
|
|
8486
8525
|
} })),
|
|
8487
|
-
((
|
|
8488
|
-
((
|
|
8526
|
+
((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareListMultipleSelectAddtionalActions) &&
|
|
8527
|
+
((_13 = (_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareListMultipleSelectAddtionalActions) === null || _13 === void 0 ? void 0 : _13.map(function (eachButton) {
|
|
8489
8528
|
return (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm ".concat(eachButton.className), text: eachButton.text, onClick: function () {
|
|
8490
8529
|
var _a, _b;
|
|
8491
8530
|
(_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
|
|
@@ -8493,17 +8532,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8493
8532
|
}))), handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
|
|
8494
8533
|
var _a, _b;
|
|
8495
8534
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
8496
|
-
}, linkType: props.linkType, custom: props.custom, newTabUrl: (
|
|
8535
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_15 = (_14 = props.newTabUrl) === null || _14 === void 0 ? void 0 : _14.default) !== null && _15 !== void 0 ? _15 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_17 = (_16 = props.newTabUrl) === null || _16 === void 0 ? void 0 : _16.addons) !== null && _17 !== void 0 ? _17 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
8497
8536
|
handlePagination(value);
|
|
8498
|
-
}, className: "mt-5", lib: { axios: (
|
|
8499
|
-
addColumnEnabled: (
|
|
8537
|
+
}, className: "mt-5", lib: { axios: (_18 = props.lib) === null || _18 === void 0 ? void 0 : _18.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.fixedPagination, advSettings: {
|
|
8538
|
+
addColumnEnabled: (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.addColumnEnabled,
|
|
8500
8539
|
renderAddColumnElements: renderAddMathColumn,
|
|
8501
8540
|
dragEnabled: isViewSettingsEnabled,
|
|
8502
8541
|
sortEnabled: isViewSettingsEnabled,
|
|
8503
8542
|
// INFO: per-column header filter is replaced by the flex filters
|
|
8504
8543
|
filterEnabled: false,
|
|
8505
8544
|
sortId: activeSortId,
|
|
8506
|
-
sortOptions: (
|
|
8545
|
+
sortOptions: (_23 = (_22 = (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.renderReferenceLabelOptions) === null || _22 === void 0 ? void 0 : _22.call(_21)) !== null && _23 !== void 0 ? _23 : (isViewSettingsEnabled
|
|
8507
8546
|
? getViewSettingsColumns().map(function (eachColumn) {
|
|
8508
8547
|
var _a;
|
|
8509
8548
|
return ({
|
|
@@ -8532,9 +8571,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8532
8571
|
return renderSearchContent(newQuery);
|
|
8533
8572
|
},
|
|
8534
8573
|
}, editable: {
|
|
8535
|
-
active:
|
|
8536
|
-
? true
|
|
8537
|
-
: false,
|
|
8574
|
+
active: canInlineUpdate ? true : false,
|
|
8538
8575
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8539
8576
|
return __generator(this, function (_a) {
|
|
8540
8577
|
switch (_a.label) {
|
|
@@ -8546,7 +8583,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8546
8583
|
});
|
|
8547
8584
|
}); },
|
|
8548
8585
|
}, onObjectEdit: handleObjectCellEdit, addable: {
|
|
8549
|
-
active: ((
|
|
8586
|
+
active: ((_24 = props.edit) === null || _24 === void 0 ? void 0 : _24.listAddable) ? true : false,
|
|
8550
8587
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8551
8588
|
return __generator(this, function (_a) {
|
|
8552
8589
|
switch (_a.label) {
|
|
@@ -8557,11 +8594,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8557
8594
|
}
|
|
8558
8595
|
});
|
|
8559
8596
|
}); },
|
|
8560
|
-
}, darkMode: (
|
|
8597
|
+
}, darkMode: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.darkMode, hidePagination: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.disableEllipsisOnLongWord }));
|
|
8561
8598
|
}
|
|
8562
8599
|
};
|
|
8563
8600
|
var renderTabContent = function (tabs, dataType, requestedViewType) {
|
|
8564
|
-
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, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52
|
|
8601
|
+
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, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52;
|
|
8565
8602
|
var matchedTab = tabs.find(function (eachTab) { return eachTab.id === requestedViewType; });
|
|
8566
8603
|
/**
|
|
8567
8604
|
* INFO: a list tab must not supply the content of a read view. The selected
|
|
@@ -8577,14 +8614,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8577
8614
|
var isRefusedListTab = dataType === "read" && (matchedTab === null || matchedTab === void 0 ? void 0 : matchedTab.type) === "list";
|
|
8578
8615
|
var viewType = isRefusedListTab ? "general" : requestedViewType;
|
|
8579
8616
|
var selectedTabData = isRefusedListTab ? undefined : matchedTab;
|
|
8580
|
-
var multipleSelect =
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
if ((_b = props.
|
|
8584
|
-
multipleSelect = true;
|
|
8585
|
-
if ((_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareListMultipleSelectAddtionalActions)
|
|
8586
|
-
multipleSelect = true;
|
|
8587
|
-
if ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.disableMulti)
|
|
8617
|
+
var multipleSelect = canBatchUpdate ||
|
|
8618
|
+
canDeleteRecord ||
|
|
8619
|
+
!!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListMultipleSelectAddtionalActions);
|
|
8620
|
+
if ((_b = props.organise) === null || _b === void 0 ? void 0 : _b.disableMulti)
|
|
8588
8621
|
multipleSelect = false;
|
|
8589
8622
|
if (viewType === "general" || (selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.viewType) === "report") {
|
|
8590
8623
|
if (dataType === "list" || dataType === "union") {
|
|
@@ -8609,7 +8642,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8609
8642
|
}
|
|
8610
8643
|
if (shouldGroup && Object.keys(groupedStructures_1).length > 0) {
|
|
8611
8644
|
var readElement_1 = [];
|
|
8612
|
-
var sortedTabs = ((
|
|
8645
|
+
var sortedTabs = ((_c = props.organise) === null || _c === void 0 ? void 0 : _c.sortGroupByAlphabetically)
|
|
8613
8646
|
? Object.keys(groupedStructures_1).sort(function (a, b) {
|
|
8614
8647
|
if (a === "Others")
|
|
8615
8648
|
return 1;
|
|
@@ -8689,7 +8722,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8689
8722
|
allCanvas.length > 0 && (react_1.default.createElement("div", { className: "mt-5 rounded-md px-4 pb-4 sm:px-6 ".concat(((_b = props.organise) === null || _b === void 0 ? void 0 : _b.darkMode) ? "bg-white/5" : "bg-white") }, renderCanvas("read", allCanvas.map(function (eachModel) { return eachModel.id; }))))));
|
|
8690
8723
|
}
|
|
8691
8724
|
});
|
|
8692
|
-
var showReadFloatingNav_1 = ((
|
|
8725
|
+
var showReadFloatingNav_1 = ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.showReadFloatingNav) && allTabSections_1.length > 1;
|
|
8693
8726
|
var handleTabSectionClick_1 = function (tabKey) {
|
|
8694
8727
|
setReadTabSection(tabKey);
|
|
8695
8728
|
var element = readTabSectionRefs.current[tabKey];
|
|
@@ -8725,11 +8758,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8725
8758
|
}
|
|
8726
8759
|
else {
|
|
8727
8760
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
8728
|
-
react_1.default.createElement(detailList_1.DetailList, { darkMode: (
|
|
8729
|
-
? ((
|
|
8730
|
-
: "bg-white"), title: "General Details", list: renderDetailListData(structure), size: ((
|
|
8761
|
+
react_1.default.createElement(detailList_1.DetailList, { darkMode: (_e = props.organise) === null || _e === void 0 ? void 0 : _e.darkMode, darkModeBg: (_f = props.organise) === null || _f === void 0 ? void 0 : _f.darkModeBg, model: structure, referenceModel: referenceModelSchema, className: "mt-5 rounded-md ".concat(((_g = props.organise) === null || _g === void 0 ? void 0 : _g.darkMode)
|
|
8762
|
+
? ((_j = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.darkModeBg) !== null && _j !== void 0 ? _j : "bg-gray-900")
|
|
8763
|
+
: "bg-white"), title: "General Details", list: renderDetailListData(structure), size: ((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareCompactMode) ? "compact" : "default", handleReferenceLink: !schemaPresent && ((_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareReadReferenceView)
|
|
8731
8764
|
? props.bareSettings.bareReadReferenceView
|
|
8732
|
-
: undefined, splitView: (
|
|
8765
|
+
: undefined, splitView: (_m = props.organise) === null || _m === void 0 ? void 0 : _m.splitView }),
|
|
8733
8766
|
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(dataType)),
|
|
8734
8767
|
react_1.default.createElement("div", { className: "mt-8" }, renderListObject(dataType)),
|
|
8735
8768
|
react_1.default.createElement("div", { className: "mt-8" }, renderGanttChart(dataType)),
|
|
@@ -8738,66 +8771,66 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8738
8771
|
}
|
|
8739
8772
|
}
|
|
8740
8773
|
else if (selectedTabData) {
|
|
8741
|
-
if ((
|
|
8774
|
+
if ((_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareListComponent) {
|
|
8742
8775
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
8743
8776
|
props.bareSettings.bareListComponent(tableData, spaceTableData, tableLoading, pageIndex),
|
|
8744
|
-
!((
|
|
8777
|
+
!((_p = props.organise) === null || _p === void 0 ? void 0 : _p.hidePagination) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
|
|
8745
8778
|
handlePagination(value);
|
|
8746
|
-
}, darkMode: (
|
|
8779
|
+
}, darkMode: (_q = props.organise) === null || _q === void 0 ? void 0 : _q.darkMode, customPaginationSize: customPaginationSize }))));
|
|
8747
8780
|
}
|
|
8748
8781
|
else if (selectedTabData.viewType === "iframe") {
|
|
8749
8782
|
if (selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.customComponent) {
|
|
8750
8783
|
return selectedTabData.customComponent;
|
|
8751
8784
|
}
|
|
8752
8785
|
else {
|
|
8753
|
-
return (react_1.default.createElement("iframe", { id: "blixify-iframe", className: "w-full mt-5", style: { height: "70vh" }, src: (
|
|
8786
|
+
return (react_1.default.createElement("iframe", { id: "blixify-iframe", className: "w-full mt-5", style: { height: "70vh" }, src: (_r = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.iframeSrc) !== null && _r !== void 0 ? _r : "", title: (_s = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.id) !== null && _s !== void 0 ? _s : "", onLoad: props.onLoadIframe }));
|
|
8754
8787
|
}
|
|
8755
8788
|
}
|
|
8756
8789
|
else if (selectedTabData.viewType === "list") {
|
|
8757
8790
|
// INFO: when bareNewDTW is enabled, render NewList instead of legacy List
|
|
8758
|
-
if ((
|
|
8759
|
-
return (react_1.default.createElement(newList_1.NewList, { darkModeBg: (
|
|
8760
|
-
selectedIds.length > 0 &&
|
|
8791
|
+
if ((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareNewDTW) {
|
|
8792
|
+
return (react_1.default.createElement(newList_1.NewList, { darkModeBg: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.disableSelectFullData) === null || _w === void 0 ? void 0 : _w.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", maxSelectedCount: (_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareListMaxSelectedCount, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
8793
|
+
selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
8761
8794
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
|
|
8762
8795
|
handleBatchDraftData();
|
|
8763
8796
|
} }),
|
|
8764
8797
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
|
|
8765
8798
|
handleCloneSelectedData();
|
|
8766
8799
|
} }))),
|
|
8767
|
-
|
|
8800
|
+
canDeleteRecord && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
|
|
8768
8801
|
handleGenerateDeletePasscode();
|
|
8769
8802
|
setDeleteModal(true);
|
|
8770
8803
|
} })),
|
|
8771
|
-
!isFirebase &&
|
|
8804
|
+
!isFirebase && canBatchUpdate && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
|
|
8772
8805
|
setBatchUpdateModal(true);
|
|
8773
8806
|
} }))), onClickRow: function (id) {
|
|
8774
8807
|
var _a, _b;
|
|
8775
8808
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
8776
|
-
}, linkType: props.linkType, custom: props.custom, newTabUrl: (
|
|
8809
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_z = (_y = props.newTabUrl) === null || _y === void 0 ? void 0 : _y.default) !== null && _z !== void 0 ? _z : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_1 = (_0 = props.newTabUrl) === null || _0 === void 0 ? void 0 : _0.addons) !== null && _1 !== void 0 ? _1 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
8777
8810
|
handlePagination(value);
|
|
8778
|
-
}, darkMode: (
|
|
8811
|
+
}, darkMode: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.darkMode, className: "mt-5", hidePagination: (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.hidePagination, customPaginationSize: customPaginationSize, mobileTooltip: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListMobileTooltip }));
|
|
8779
8812
|
}
|
|
8780
8813
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
8781
|
-
react_1.default.createElement(list_1.List, { darkModeBg: (
|
|
8782
|
-
selectedIds.length > 0 &&
|
|
8814
|
+
react_1.default.createElement(list_1.List, { darkModeBg: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableSelectFullData) === null || _7 === void 0 ? void 0 : _7.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
8815
|
+
selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
8783
8816
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
|
|
8784
8817
|
handleBatchDraftData();
|
|
8785
8818
|
} }),
|
|
8786
8819
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
|
|
8787
8820
|
handleCloneSelectedData();
|
|
8788
8821
|
} }))),
|
|
8789
|
-
|
|
8822
|
+
canDeleteRecord && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
|
|
8790
8823
|
handleGenerateDeletePasscode();
|
|
8791
8824
|
setDeleteModal(true);
|
|
8792
8825
|
} })),
|
|
8793
|
-
!isFirebase &&
|
|
8826
|
+
!isFirebase && canBatchUpdate && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
|
|
8794
8827
|
setBatchUpdateModal(true);
|
|
8795
8828
|
} }))), onClickRow: function (id) {
|
|
8796
8829
|
var _a, _b;
|
|
8797
8830
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
8798
|
-
}, linkType: props.linkType, custom: props.custom, newTabUrl: (
|
|
8831
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_9 = (_8 = props.newTabUrl) === null || _8 === void 0 ? void 0 : _8.default) !== null && _9 !== void 0 ? _9 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_11 = (_10 = props.newTabUrl) === null || _10 === void 0 ? void 0 : _10.addons) !== null && _11 !== void 0 ? _11 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
8799
8832
|
handlePagination(value);
|
|
8800
|
-
}, className: "mt-5", hidePagination: (
|
|
8833
|
+
}, className: "mt-5", hidePagination: (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.hidePagination, customPaginationSize: customPaginationSize })));
|
|
8801
8834
|
}
|
|
8802
8835
|
else if (selectedTabData.viewType === "file" &&
|
|
8803
8836
|
resolvedType === "list") {
|
|
@@ -8812,9 +8845,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8812
8845
|
* exactly the context they came for. The filename inside the tile is
|
|
8813
8846
|
* still a direct link for when the file itself is the point.
|
|
8814
8847
|
*/
|
|
8815
|
-
var columnId_2 = (
|
|
8848
|
+
var columnId_2 = (_14 = (_13 = selectedTabData.fileSettings) === null || _13 === void 0 ? void 0 : _13.columnId) !== null && _14 !== void 0 ? _14 : "";
|
|
8816
8849
|
var fileColumn_1 = structure.find(function (eachModel) { return eachModel.id === columnId_2; });
|
|
8817
|
-
var fileImageEndpoint_1 = ((
|
|
8850
|
+
var fileImageEndpoint_1 = ((_15 = props.devSettings) === null || _15 === void 0 ? void 0 : _15.imageEndpoint) || devSettings.imageEndpoint;
|
|
8818
8851
|
/**
|
|
8819
8852
|
* INFO: a stored file is not a url. A single file/image column holds
|
|
8820
8853
|
* the download TOKEN — the file's name lives on the column
|
|
@@ -8874,7 +8907,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8874
8907
|
// INFO: the same surface the other list views sit on, so
|
|
8875
8908
|
// switching tabs does not change the shape of the page around
|
|
8876
8909
|
// the content.
|
|
8877
|
-
react_1.default.createElement("div", { className: "grid grid-cols-2 gap-4 rounded-lg p-4 sm:grid-cols-3 lg:grid-cols-4 ".concat(((
|
|
8910
|
+
react_1.default.createElement("div", { className: "grid grid-cols-2 gap-4 rounded-lg p-4 sm:grid-cols-3 lg:grid-cols-4 ".concat(((_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.darkMode) ? "bg-white/5" : "bg-white") }, tableData.map(function (eachRow, eachIndex) {
|
|
8878
8911
|
var _a, _b;
|
|
8879
8912
|
return (react_1.default.createElement(filePreview_1.FilePreview, { key: "".concat((_b = (_a = eachRow === null || eachRow === void 0 ? void 0 : eachRow.id) !== null && _a !== void 0 ? _a : eachRow === null || eachRow === void 0 ? void 0 : eachRow._id) !== null && _b !== void 0 ? _b : eachIndex, "-").concat(eachIndex), variant: "tile", file: handleResolveTileFile_1(eachRow), onClick: function () {
|
|
8880
8913
|
var _a, _b, _c, _d;
|
|
@@ -8888,24 +8921,24 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8888
8921
|
}))),
|
|
8889
8922
|
react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
|
|
8890
8923
|
handlePagination(value);
|
|
8891
|
-
}, darkMode: (
|
|
8924
|
+
}, darkMode: (_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.darkMode, customPaginationSize: customPaginationSize })));
|
|
8892
8925
|
}
|
|
8893
8926
|
else if (selectedTabData.viewType === "grid") {
|
|
8894
8927
|
var isScrollMode = renderCheckScrollMode();
|
|
8895
8928
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
8896
|
-
react_1.default.createElement(grid_1.Grid, { darkMode: (
|
|
8929
|
+
react_1.default.createElement(grid_1.Grid, { darkMode: (_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.darkMode, darkModeBg: (_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.darkModeBg, paginationType: renderResolvedPaginationType(), data: renderGridAndListData(selectedTabData.viewImage, "grid"), size: size, limit: limit, cursor: cursor, loading: tableLoading, horizontalScroll: isScrollMode, pageIndex: pageIndex, onClickData: function (id) {
|
|
8897
8930
|
var _a, _b;
|
|
8898
8931
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
8899
|
-
}, linkType: props.linkType, custom: props.custom, newTabUrl: (
|
|
8932
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_21 = (_20 = props.newTabUrl) === null || _20 === void 0 ? void 0 : _20.default) !== null && _21 !== void 0 ? _21 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_23 = (_22 = props.newTabUrl) === null || _22 === void 0 ? void 0 : _22.addons) !== null && _23 !== void 0 ? _23 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
8900
8933
|
handlePagination(value);
|
|
8901
|
-
}, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (
|
|
8934
|
+
}, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareListGridColClassName, className: "mt-5",
|
|
8902
8935
|
// INFO: under the new DTW the grid keeps the same footer as the
|
|
8903
8936
|
// table and list views instead of its own legacy page buttons
|
|
8904
|
-
hidePagination: ((
|
|
8905
|
-
!!((
|
|
8906
|
-
((
|
|
8907
|
-
!((
|
|
8908
|
-
.length, customPaginationSize: customPaginationSize, darkMode: (
|
|
8937
|
+
hidePagination: ((_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.hidePagination) ||
|
|
8938
|
+
!!((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareNewDTW), customPaginationSize: customPaginationSize }),
|
|
8939
|
+
((_27 = props.bareSettings) === null || _27 === void 0 ? void 0 : _27.bareNewDTW) &&
|
|
8940
|
+
!((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.hidePagination) && (react_1.default.createElement(newPagination_1.NewPagination, { paginationType: renderResolvedPaginationType(), pageIndex: pageIndex, limit: limit, size: size, cursor: cursor, resultCount: renderGridAndListData(selectedTabData.viewImage, "grid")
|
|
8941
|
+
.length, customPaginationSize: customPaginationSize, darkMode: (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.darkMode, darkModeBg: (_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.darkModeBg, handleUpdatePageIndex: function (value) {
|
|
8909
8942
|
handlePagination(value);
|
|
8910
8943
|
} }))));
|
|
8911
8944
|
}
|
|
@@ -9007,7 +9040,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9007
9040
|
return eventAvailabilities;
|
|
9008
9041
|
};
|
|
9009
9042
|
// INFO: when bareNewDTW is enabled, render NewCalendar instead of legacy Calendar
|
|
9010
|
-
if ((
|
|
9043
|
+
if ((_31 = props.bareSettings) === null || _31 === void 0 ? void 0 : _31.bareNewDTW) {
|
|
9011
9044
|
var newCalendarEvents = renderEventAvailabilities().map(function (ev) {
|
|
9012
9045
|
var _a, _b, _c, _d;
|
|
9013
9046
|
return ({
|
|
@@ -9027,13 +9060,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9027
9060
|
// INFO: viewSwitch — optional Month/Week/Agenda toggle. The range
|
|
9028
9061
|
// query follows via calendarView ("dayGridMonth" ↔ "timeGridWeek");
|
|
9029
9062
|
// agenda lists the fetched month chronologically.
|
|
9030
|
-
var viewSwitchOptions = (
|
|
9063
|
+
var viewSwitchOptions = (_32 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.viewSwitch) !== null && _32 !== void 0 ? _32 : [];
|
|
9031
9064
|
var VIEW_VARIANT_MAP = {
|
|
9032
9065
|
month: "fullMonth",
|
|
9033
9066
|
week: "weekTimeGrid",
|
|
9034
9067
|
agenda: "agenda",
|
|
9035
9068
|
};
|
|
9036
|
-
var activeVariant = (
|
|
9069
|
+
var activeVariant = (_33 = VIEW_VARIANT_MAP[newCalendarViewMode]) !== null && _33 !== void 0 ? _33 : "fullMonth";
|
|
9037
9070
|
return (react_1.default.createElement("div", { className: "mt-4" },
|
|
9038
9071
|
viewSwitchOptions.length > 1 && (react_1.default.createElement("div", { className: "mb-2 flex justify-end" },
|
|
9039
9072
|
react_1.default.createElement("div", { className: "inline-flex rounded-lg border border-gray-200 bg-white p-0.5" }, viewSwitchOptions.map(function (view) { return (react_1.default.createElement("button", { key: view, type: "button", onClick: function () {
|
|
@@ -9075,9 +9108,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9075
9108
|
var _a, _b;
|
|
9076
9109
|
if (event.id)
|
|
9077
9110
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", event.id, "general");
|
|
9078
|
-
}, darkMode: (
|
|
9111
|
+
}, darkMode: (_34 = props.organise) === null || _34 === void 0 ? void 0 : _34.darkMode, className: "w-full" }))));
|
|
9079
9112
|
}
|
|
9080
|
-
return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement(calendar_1.Calendar, { currentDate: calendarTabMonth, calendarView: (
|
|
9113
|
+
return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement(calendar_1.Calendar, { currentDate: calendarTabMonth, calendarView: (_35 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.defaultView) !== null && _35 !== void 0 ? _35 : calendarView, handleMonthChange: function (date) {
|
|
9081
9114
|
var startOfMonth = (0, dayjs_1.default)(calendarTabMonth).startOf("month");
|
|
9082
9115
|
var endOfMonth = (0, dayjs_1.default)(calendarTabMonth).endOf("month");
|
|
9083
9116
|
if (!(0, dayjs_1.default)(date).isBetween(startOfMonth, endOfMonth)) {
|
|
@@ -9095,7 +9128,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9095
9128
|
else if (selectedTabData.viewType === "feeds") {
|
|
9096
9129
|
var contentList_1 = [];
|
|
9097
9130
|
var feedsSettings_1 = selectedTabData.feedsSettings;
|
|
9098
|
-
var customFeedsData = (
|
|
9131
|
+
var customFeedsData = (_36 = feedsSettings_1 === null || feedsSettings_1 === void 0 ? void 0 : feedsSettings_1.customFeedsData) === null || _36 === void 0 ? void 0 : _36.call(feedsSettings_1, tableData, spaceTableData);
|
|
9099
9132
|
if (customFeedsData && customFeedsData.length > 0) {
|
|
9100
9133
|
customFeedsData.map(function (eachData) {
|
|
9101
9134
|
var _a, _b, _c, _d;
|
|
@@ -9140,21 +9173,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9140
9173
|
return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement("div", {
|
|
9141
9174
|
// INFO: NewFeeds is already a card like the table and list, so the new
|
|
9142
9175
|
// DTW renders it bare; the legacy feed still needs its own surface
|
|
9143
|
-
className: ((
|
|
9176
|
+
className: ((_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareNewDTW)
|
|
9144
9177
|
? ""
|
|
9145
|
-
: "p-4 rounded-lg ".concat(((
|
|
9146
|
-
((
|
|
9178
|
+
: "p-4 rounded-lg ".concat(((_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.darkMode) ? "bg-white/5" : "bg-white") },
|
|
9179
|
+
((_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareNewDTW) ? (react_1.default.createElement(newFeeds_1.NewFeeds, { bold: true, content: contentList_1, darkMode: (_40 = props.organise) === null || _40 === void 0 ? void 0 : _40.darkMode, onClickItem: function (id) { var _a, _b; return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general"); } })) : (react_1.default.createElement(feeds_1.Feeds, { bold: true, content: contentList_1, darkMode: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.darkMode })),
|
|
9147
9180
|
react_1.default.createElement("div", { className: "my-10" }),
|
|
9148
9181
|
contentList_1.length > 0 &&
|
|
9149
|
-
!((
|
|
9150
|
-
((
|
|
9182
|
+
!((_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.hidePagination) &&
|
|
9183
|
+
((_43 = props.bareSettings) === null || _43 === void 0 ? void 0 : _43.bareNewDTW) && (react_1.default.createElement(newPagination_1.NewPagination, { paginationType: renderResolvedPaginationType(), pageIndex: pageIndex, limit: limit, size: size, cursor: cursor, resultCount: tableData.length, customPaginationSize: customPaginationSize, darkMode: (_44 = props.organise) === null || _44 === void 0 ? void 0 : _44.darkMode, darkModeBg: (_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.darkModeBg, handleUpdatePageIndex: function (value) {
|
|
9151
9184
|
handlePagination(value);
|
|
9152
9185
|
} })),
|
|
9153
9186
|
contentList_1.length > 0 &&
|
|
9154
|
-
!((
|
|
9155
|
-
!((
|
|
9187
|
+
!((_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.hidePagination) &&
|
|
9188
|
+
!((_47 = props.bareSettings) === null || _47 === void 0 ? void 0 : _47.bareNewDTW) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
|
|
9156
9189
|
handlePagination(value);
|
|
9157
|
-
}, darkMode: (
|
|
9190
|
+
}, darkMode: (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.darkMode, customPaginationSize: customPaginationSize }))))));
|
|
9158
9191
|
}
|
|
9159
9192
|
else if (selectedTabData.viewType === "map") {
|
|
9160
9193
|
var mapSettings_1 = selectedTabData.mapSettings;
|
|
@@ -9243,17 +9276,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9243
9276
|
return null;
|
|
9244
9277
|
});
|
|
9245
9278
|
return (react_1.default.createElement("div", { className: "w-full h-[700px]" },
|
|
9246
|
-
react_1.default.createElement(mapView_1.MapView, { ref: mapViewRef, markerList: mapMarkerList_1, enableMapControl: true, enablePolygonSelect:
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9279
|
+
react_1.default.createElement(mapView_1.MapView, { ref: mapViewRef, markerList: mapMarkerList_1, enableMapControl: true, enablePolygonSelect: canBatchUpdate || canDeleteRecord, infoWindowComponent: infoWindowContent, infoWindowHeaderComponent: infoWindowHeaderComponent, handleSelectPolygon: canBatchUpdate || canDeleteRecord
|
|
9280
|
+
? function (ids) { return setSelectedIds(ids); }
|
|
9281
|
+
: undefined, handleUpdateOnClick: canBatchUpdate ? function () { return setBatchUpdateModal(true); } : undefined, handleDeleteOnClick: canDeleteRecord
|
|
9282
|
+
? function () {
|
|
9283
|
+
handleGenerateDeletePasscode();
|
|
9284
|
+
setDeleteModal(true);
|
|
9285
|
+
}
|
|
9286
|
+
: undefined })));
|
|
9250
9287
|
}
|
|
9251
9288
|
else
|
|
9252
9289
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
9253
9290
|
}
|
|
9254
9291
|
else if (selectedTabData.viewType === "kanban") {
|
|
9255
9292
|
var kanbanSettings = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.kanbanSettings;
|
|
9256
|
-
var kanbanTitle_2 = (
|
|
9293
|
+
var kanbanTitle_2 = (_49 = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _49 !== void 0 ? _49 : "";
|
|
9257
9294
|
var nullColumn_1 = false;
|
|
9258
9295
|
var groupBy_1 = [];
|
|
9259
9296
|
var groupLabel_1 = [];
|
|
@@ -9274,38 +9311,61 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9274
9311
|
});
|
|
9275
9312
|
var kanbanData = renderGridAndListData("", "kanban", kanbanTitle_2, kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.useColumnName);
|
|
9276
9313
|
// INFO: when bareNewDTW is enabled, render NewKanban instead of legacy Kanban
|
|
9277
|
-
if ((
|
|
9314
|
+
if ((_50 = props.bareSettings) === null || _50 === void 0 ? void 0 : _50.bareNewDTW) {
|
|
9278
9315
|
return (react_1.default.createElement(newKanban_1.NewKanban, { className: "inline-flex", data: kanbanData, loading: tableLoading, groupBy: groupBy_1, groupId: kanbanTitle_2 !== null && kanbanTitle_2 !== void 0 ? kanbanTitle_2 : "", groupLabel: groupLabel_1.length > 0 ? groupLabel_1 : undefined, nullColumn: nullColumn_1, alertMessage: kanbanData.length === limit
|
|
9279
9316
|
? "Data has exceeded limit, please apply filters"
|
|
9280
|
-
: "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable:
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9317
|
+
: "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: canUpdateRecord, droppable: canUpdateRecord && kanbanDroppable, mobileView: (_51 = props.bareSettings) === null || _51 === void 0 ? void 0 : _51.bareListMobileView, onUpdateData: canUpdateRecord
|
|
9318
|
+
? function (cardId, _fromCol, toCol) { return __awaiter(void 0, void 0, void 0, function () {
|
|
9319
|
+
var _a;
|
|
9320
|
+
return __generator(this, function (_b) {
|
|
9321
|
+
switch (_b.label) {
|
|
9322
|
+
case 0:
|
|
9323
|
+
setKanbanDroppable(false);
|
|
9324
|
+
_b.label = 1;
|
|
9325
|
+
case 1:
|
|
9326
|
+
_b.trys.push([1, , 3, 4]);
|
|
9327
|
+
return [4 /*yield*/, handleSubmitData("update", cardId, kanbanTitle_2, (_a = {}, _a[kanbanTitle_2] = toCol, _a))];
|
|
9328
|
+
case 2:
|
|
9329
|
+
_b.sent();
|
|
9330
|
+
return [3 /*break*/, 4];
|
|
9331
|
+
case 3:
|
|
9332
|
+
setKanbanDroppable(true);
|
|
9333
|
+
return [7 /*endfinally*/];
|
|
9334
|
+
case 4: return [2 /*return*/];
|
|
9335
|
+
}
|
|
9336
|
+
});
|
|
9337
|
+
}); }
|
|
9338
|
+
: undefined, onClickData: function (id) {
|
|
9287
9339
|
var _a, _b;
|
|
9288
9340
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
9289
|
-
}, darkMode: (
|
|
9341
|
+
}, darkMode: (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.darkMode }));
|
|
9290
9342
|
}
|
|
9291
9343
|
return (react_1.default.createElement(kanban_1.Kanban, { className: "inline-flex", data: kanbanData, loading: tableLoading, groupBy: groupBy_1, groupId: kanbanTitle_2 !== null && kanbanTitle_2 !== void 0 ? kanbanTitle_2 : "", groupLabel: groupLabel_1.length > 0 ? groupLabel_1 : undefined, nullColumn: nullColumn_1, alertMessage: kanbanData.length === limit
|
|
9292
9344
|
? "Data has exceeded limit, please apply filters"
|
|
9293
|
-
: "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable:
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9345
|
+
: "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: canUpdateRecord, droppable: canUpdateRecord && kanbanDroppable, onUpdateData: canUpdateRecord
|
|
9346
|
+
? function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
9347
|
+
var _a;
|
|
9348
|
+
return __generator(this, function (_b) {
|
|
9349
|
+
switch (_b.label) {
|
|
9350
|
+
case 0:
|
|
9351
|
+
setKanbanDroppable(false);
|
|
9352
|
+
_b.label = 1;
|
|
9353
|
+
case 1:
|
|
9354
|
+
_b.trys.push([1, , 3, 4]);
|
|
9355
|
+
return [4 /*yield*/, handleSubmitData("update", data.id, kanbanTitle_2, (_a = {},
|
|
9356
|
+
_a[kanbanTitle_2] = data[kanbanTitle_2],
|
|
9357
|
+
_a))];
|
|
9358
|
+
case 2:
|
|
9359
|
+
_b.sent();
|
|
9360
|
+
return [3 /*break*/, 4];
|
|
9361
|
+
case 3:
|
|
9362
|
+
setKanbanDroppable(true);
|
|
9363
|
+
return [7 /*endfinally*/];
|
|
9364
|
+
case 4: return [2 /*return*/];
|
|
9365
|
+
}
|
|
9366
|
+
});
|
|
9367
|
+
}); }
|
|
9368
|
+
: undefined, onClickData: function (id) {
|
|
9309
9369
|
var _a, _b;
|
|
9310
9370
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
9311
9371
|
} }));
|
|
@@ -9764,9 +9824,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9764
9824
|
return "";
|
|
9765
9825
|
};
|
|
9766
9826
|
var renderFeedsActionBtn = function (id, description) {
|
|
9767
|
-
var _a, _b, _c;
|
|
9768
9827
|
return (react_1.default.createElement("div", { className: "w-full flex justify-end gap-4 ".concat(description && "mt-2") },
|
|
9769
|
-
|
|
9828
|
+
canUpdateRecord && (react_1.default.createElement(outline_1.PencilSquareIcon, { className: "h-5 w-5 text-primary-500 hover:cursor-pointer", onClick: function (event) {
|
|
9770
9829
|
var _a, _b;
|
|
9771
9830
|
event.preventDefault();
|
|
9772
9831
|
event.stopPropagation();
|
|
@@ -9778,7 +9837,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9778
9837
|
setActivityModal === null || setActivityModal === void 0 ? void 0 : setActivityModal(true);
|
|
9779
9838
|
setActivityId === null || setActivityId === void 0 ? void 0 : setActivityId(id);
|
|
9780
9839
|
} })),
|
|
9781
|
-
|
|
9840
|
+
canDeleteRecord && (react_1.default.createElement(outline_1.TrashIcon, { className: "h-5 w-5 text-red-500 hover:cursor-pointer", onClick: function (event) {
|
|
9782
9841
|
event.preventDefault();
|
|
9783
9842
|
event.stopPropagation();
|
|
9784
9843
|
setDeleteModal(true);
|