blixify-ui-web 1.3.29 → 1.3.31
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/columnTypes/groupSections.d.ts +6 -0
- package/lib/components/data/columnTypes/groupSections.d.ts.map +1 -1
- package/lib/components/data/columnTypes/groupSections.js +49 -2
- package/lib/components/data/columnTypes/groupSections.js.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +16 -0
- package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +487 -384
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +2 -0
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js +29 -0
- package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
- package/lib/components/data/flexFilter/index.d.ts +1 -0
- package/lib/components/data/flexFilter/index.d.ts.map +1 -1
- package/lib/components/data/flexFilter/index.js +2 -1
- package/lib/components/data/flexFilter/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -257,9 +257,13 @@ exports.handleCheckEmptyCardValue = handleCheckEmptyCardValue;
|
|
|
257
257
|
// INFO: rows a select-all update sends by id at most, and ids per delete
|
|
258
258
|
// request — both keep a request within what the server accepts
|
|
259
259
|
var SELECT_ALL_ID_CAP = 5000;
|
|
260
|
+
// INFO: rows the "Can't delete yet" box lists before "and N more"
|
|
261
|
+
var DELETE_BLOCKED_ROWS = 50;
|
|
262
|
+
// INFO: the conditions a server's batch update reads the same way as a list
|
|
263
|
+
var BATCH_UPDATE_QUERY_TYPES = ["=", "!=", ">", "<", "in", "!in"];
|
|
260
264
|
var DELETE_ID_CHUNK = 1000;
|
|
261
265
|
exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
262
|
-
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, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130;
|
|
266
|
+
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, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133;
|
|
263
267
|
// INFO: every view draws a lookup as its source column's type, read-only, so
|
|
264
268
|
// no type branch below meets "lookup"; rawProps.model keeps the lookups as
|
|
265
269
|
// stored for the columns handed back to the host
|
|
@@ -278,7 +282,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
278
282
|
// the list never refetching while the panel is open, which fails silently.
|
|
279
283
|
// INFO: the panel cannot navigate its way out — handleNavigate("read") is
|
|
280
284
|
// routed straight back into it — so expand-to-full-page is local state.
|
|
281
|
-
var
|
|
285
|
+
var _134 = (0, react_1.useState)(false), drawerPageView = _134[0], setDrawerPageView = _134[1];
|
|
282
286
|
// INFO: the panel keeps rendering the record it was opened with rather than
|
|
283
287
|
// live props. Without this, navigating back to the list would re-render the
|
|
284
288
|
// still-mounted panel as a second list behind the overlay.
|
|
@@ -333,7 +337,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
333
337
|
drawerFormEditedRef.current = false;
|
|
334
338
|
}
|
|
335
339
|
drawerOpenRef.current = isDrawerHost;
|
|
336
|
-
var
|
|
340
|
+
var _135 = (0, react_1.useState)(false), drawerDiscardModal = _135[0], setDrawerDiscardModal = _135[1];
|
|
337
341
|
// INFO: leaving the record ends the escape, so the next row opened from the
|
|
338
342
|
// list peeks in the panel again rather than inheriting a full page the user
|
|
339
343
|
// asked for once. Saving a form on the full page lands on its read view, which
|
|
@@ -412,7 +416,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
412
416
|
initialFilterReferenceDate: initialFilterReferenceDate,
|
|
413
417
|
};
|
|
414
418
|
};
|
|
415
|
-
var
|
|
419
|
+
var _136 = intialiseDefaultFilterValues(), initialFilterSearch = _136.initialFilterSearch, initialFilterSearchParams = _136.initialFilterSearchParams, initialFilterSelection = _136.initialFilterSelection, initialFilterReference = _136.initialFilterReference, initialFilterReferenceDate = _136.initialFilterReferenceDate;
|
|
416
420
|
// INFO: organise.initialSearch fills the Quick find box, which sends its
|
|
417
421
|
// value under "search". Without that box (hideSearch, Firebase, or a
|
|
418
422
|
// "search" query taking its place) there is nothing to fill
|
|
@@ -428,19 +432,25 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
428
432
|
// keyword: All's columns and sort, no stored filters, and nothing this
|
|
429
433
|
// person kept in the browser (view drafts, persistViewState) is read or
|
|
430
434
|
// written — until they pick a view, which is their own choice again
|
|
431
|
-
var
|
|
435
|
+
var _137 = (0, react_1.useState)(function () {
|
|
436
|
+
var _a, _b, _c;
|
|
437
|
+
return handleCanInitialSearch((_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) ||
|
|
438
|
+
!!((_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.linkFlexFilters) === null || _c === void 0 ? void 0 : _c.length);
|
|
439
|
+
}), isLinkOpen = _137[0], setIsLinkOpen = _137[1];
|
|
432
440
|
var handleSeedInitialSearch = function (params) {
|
|
433
441
|
var _a;
|
|
434
|
-
return isLinkOpen &&
|
|
442
|
+
return isLinkOpen &&
|
|
443
|
+
((_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSearch) &&
|
|
444
|
+
handleCanInitialSearch(props.organise.additionalQuery)
|
|
435
445
|
? __assign(__assign({}, params), { search: props.organise.initialSearch }) : params;
|
|
436
446
|
};
|
|
437
447
|
// INFO: Persist view state hook — handles storage read/write for filter/sort/column state
|
|
438
|
-
var
|
|
448
|
+
var _138 = (0, viewStatePersistence_1.usePersistedViewState)({
|
|
439
449
|
mode: isLinkOpen ? undefined : (_k = props.organise) === null || _k === void 0 ? void 0 : _k.persistViewState,
|
|
440
450
|
collectionId: props.collectionId,
|
|
441
451
|
persistKey: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.persistKey,
|
|
442
452
|
type: resolvedType,
|
|
443
|
-
}), rawPersistedState =
|
|
453
|
+
}), rawPersistedState = _138.persistedState, isPersistEnabled = _138.isEnabled, handleSaveView = _138.handleSaveView, handleRegisterViewSnapshot = _138.handleRegisterViewSnapshot;
|
|
444
454
|
// INFO: drop stored filters/sort on removed columns — they would empty the table
|
|
445
455
|
var persistedState = (0, react_1.useMemo)(function () {
|
|
446
456
|
var _a, _b, _c, _d;
|
|
@@ -456,8 +466,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
456
466
|
(_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareFlexFilterListObjects,
|
|
457
467
|
(_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareFlexFilterRelated,
|
|
458
468
|
]);
|
|
459
|
-
var
|
|
460
|
-
var
|
|
469
|
+
var _139 = (0, react_1.useState)(false), loading = _139[0], setLoading = _139[1];
|
|
470
|
+
var _140 = (0, react_1.useState)(), notification = _140[0], setNotification = _140[1];
|
|
461
471
|
// INFO: a success toast is confirmation, not a decision — it clears itself so
|
|
462
472
|
// it never sits on the floating step bar; errors stay until dismissed
|
|
463
473
|
(0, react_1.useEffect)(function () {
|
|
@@ -467,80 +477,80 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
467
477
|
return function () { return clearTimeout(timer); };
|
|
468
478
|
}, [notification]);
|
|
469
479
|
//INFO : Used by List
|
|
470
|
-
var
|
|
480
|
+
var _141 = (0, react_1.useState)(function () {
|
|
471
481
|
var _a;
|
|
472
482
|
return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearch);
|
|
473
|
-
}), filterSearch =
|
|
474
|
-
var
|
|
483
|
+
}), filterSearch = _141[0], setFilterSearch = _141[1];
|
|
484
|
+
var _142 = (0, react_1.useState)(function () {
|
|
475
485
|
var _a;
|
|
476
486
|
return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearchParams);
|
|
477
|
-
}), filterSearchParams =
|
|
478
|
-
var
|
|
479
|
-
var
|
|
480
|
-
var
|
|
481
|
-
var
|
|
482
|
-
var
|
|
487
|
+
}), filterSearchParams = _142[0], setFilterSearchParams = _142[1];
|
|
488
|
+
var _143 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _q !== void 0 ? _q : initialFilterSelection), filterSelection = _143[0], setFilterSelection = _143[1];
|
|
489
|
+
var _144 = (0, react_1.useState)((_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _r !== void 0 ? _r : initialFilterReference), filterReference = _144[0], setFilterReference = _144[1];
|
|
490
|
+
var _145 = (0, react_1.useState)({}), filterReferenceSearch = _145[0], setFilterReferenceSearch = _145[1];
|
|
491
|
+
var _146 = (0, react_1.useState)({}), filterReferenceList = _146[0], setFilterReferenceList = _146[1];
|
|
492
|
+
var _147 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
|
|
483
493
|
? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
|
|
484
|
-
: initialFilterReferenceDate), filterReferenceDate =
|
|
485
|
-
var
|
|
486
|
-
var
|
|
487
|
-
var
|
|
488
|
-
var
|
|
489
|
-
var
|
|
494
|
+
: initialFilterReferenceDate), filterReferenceDate = _147[0], setFilterReferenceDate = _147[1];
|
|
495
|
+
var _148 = (0, react_1.useState)(true), tableLoading = _148[0], setTableLoading = _148[1];
|
|
496
|
+
var _149 = (0, react_1.useState)(""), cursor = _149[0], setCursor = _149[1];
|
|
497
|
+
var _150 = (0, react_1.useState)(""), lastCursor = _150[0], setLastCursor = _150[1];
|
|
498
|
+
var _151 = (0, react_1.useState)([]), tableData = _151[0], setTableData = _151[1];
|
|
499
|
+
var _152 = (0, react_1.useState)([]), spaceTableData = _152[0], setSpaceTableData = _152[1];
|
|
490
500
|
// INFO: a save resolves after later renders, so it reads the table from here —
|
|
491
501
|
// the state it closed over can predate an earlier save on the same row
|
|
492
502
|
var tableDataRef = (0, react_1.useRef)([]);
|
|
493
503
|
var spaceTableDataRef = (0, react_1.useRef)([]);
|
|
494
504
|
tableDataRef.current = tableData;
|
|
495
505
|
spaceTableDataRef.current = spaceTableData;
|
|
496
|
-
var
|
|
497
|
-
var
|
|
506
|
+
var _153 = (0, react_1.useState)(0), size = _153[0], setSize = _153[1];
|
|
507
|
+
var _154 = (0, react_1.useState)((_u = (_s = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _s !== void 0 ? _s : (_t = props.organise) === null || _t === void 0 ? void 0 : _t.pageIndex) !== null && _u !== void 0 ? _u : 0), pageIndex = _154[0], setPageIndex = _154[1];
|
|
498
508
|
// INFO: every change of page, including the return to the first page when a
|
|
499
509
|
// filter or search changes, which onChangePagination does not always report
|
|
500
510
|
(0, react_1.useEffect)(function () {
|
|
501
511
|
var _a, _b;
|
|
502
512
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePageIndex) === null || _b === void 0 ? void 0 : _b.call(_a, pageIndex);
|
|
503
513
|
}, [pageIndex]);
|
|
504
|
-
var
|
|
505
|
-
var
|
|
506
|
-
var
|
|
507
|
-
var
|
|
508
|
-
var
|
|
514
|
+
var _155 = (0, react_1.useState)([]), selectedIds = _155[0], setSelectedIds = _155[1];
|
|
515
|
+
var _156 = (0, react_1.useState)(false), selectAll = _156[0], setSelectAll = _156[1];
|
|
516
|
+
var _157 = (0, react_1.useState)(""), deletePasscode = _157[0], setDeletePasscode = _157[1];
|
|
517
|
+
var _158 = (0, react_1.useState)(""), deletePasscodeInput = _158[0], setDeletePasscodeInput = _158[1];
|
|
518
|
+
var _159 = (0, react_1.useState)(""), deleteFeedId = _159[0], setDeleteFeedId = _159[1];
|
|
509
519
|
//INFO : Used by List Organise
|
|
510
520
|
// INFO: Internal sort state that overrides props.organise?.sort when
|
|
511
521
|
// persistViewState is enabled and a persisted sort exists
|
|
512
|
-
var
|
|
513
|
-
var
|
|
514
|
-
var
|
|
515
|
-
var
|
|
522
|
+
var _160 = (0, react_1.useState)((_v = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _v !== void 0 ? _v : undefined), persistedSort = _160[0], setPersistedSort = _160[1];
|
|
523
|
+
var _161 = (0, react_1.useState)(false), filterDraft = _161[0], setFilterDraft = _161[1];
|
|
524
|
+
var _162 = (0, react_1.useState)(false), addTabModal = _162[0], setAddTabModal = _162[1];
|
|
525
|
+
var _163 = (0, react_1.useState)(-1), editTabIndex = _163[0], setEditTabIndex = _163[1];
|
|
516
526
|
//INFO : resolve the initial tab synchronously so the mount cond is already
|
|
517
527
|
// tab-scoped — an empty initial tab caused a second wasted list fetch
|
|
518
|
-
var
|
|
528
|
+
var _164 = (0, react_1.useState)(function () {
|
|
519
529
|
var _a;
|
|
520
530
|
return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, listViewId);
|
|
521
|
-
}), selectedTab =
|
|
522
|
-
var
|
|
531
|
+
}), selectedTab = _164[0], setSelectedTab = _164[1];
|
|
532
|
+
var _165 = (0, react_1.useState)("dayGridMonth"), calendarView = _165[0], setCalendarView = _165[1];
|
|
523
533
|
// INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
|
|
524
534
|
// (calendarView above drives the matching range query)
|
|
525
|
-
var
|
|
526
|
-
var
|
|
535
|
+
var _166 = (0, react_1.useState)("month"), newCalendarViewMode = _166[0], setNewCalendarViewMode = _166[1];
|
|
536
|
+
var _167 = (0, react_1.useState)(new Date()), calendarTabMonth = _167[0], setCalendarTabMonth = _167[1];
|
|
527
537
|
// INFO: read once per theme — it asks the browser to resolve a style
|
|
528
538
|
var timelinePrimaryColour = (0, react_1.useMemo)(function () { return (0, timelineBars_1.handleReadPrimaryColour)(); },
|
|
529
539
|
/* eslint-disable-next-line */
|
|
530
540
|
[(_w = props.organise) === null || _w === void 0 ? void 0 : _w.darkMode]);
|
|
531
541
|
// INFO: the period a timeline shows — it reads only the records whose bars
|
|
532
542
|
// overlap it, so a large datasheet loads one month or quarter at a time
|
|
533
|
-
var
|
|
543
|
+
var _168 = (0, react_1.useState)({ unit: "month", anchor: new Date() }), timelineRange = _168[0], setTimelineRange = _168[1];
|
|
534
544
|
// INFO: defaultViewSwitch picks the opening view only — the tab re-inits
|
|
535
545
|
// whenever its settings change, and that must not undo the user's switch
|
|
536
546
|
var calendarViewInitRef = (0, react_1.useRef)(false);
|
|
537
|
-
var
|
|
538
|
-
var
|
|
539
|
-
var
|
|
540
|
-
var
|
|
547
|
+
var _169 = (0, react_1.useState)(true), kanbanDroppable = _169[0], setKanbanDroppable = _169[1];
|
|
548
|
+
var _170 = (0, react_1.useState)([]), kanbanOptions = _170[0], setKanbanOptions = _170[1];
|
|
549
|
+
var _171 = (0, react_1.useState)(false), batchUpdateModal = _171[0], setBatchUpdateModal = _171[1];
|
|
550
|
+
var _172 = (0, react_1.useState)({
|
|
541
551
|
columnId: "",
|
|
542
552
|
columnData: {},
|
|
543
|
-
}), batchUpdateData =
|
|
553
|
+
}), batchUpdateData = _172[0], setBatchUpdateData = _172[1];
|
|
544
554
|
// INFO: system columns (created / updated at and by, record id, number)
|
|
545
555
|
// join the structure hidden; the ones a user shows are kept per view
|
|
546
556
|
var isSystemColumnsEnabled = !!((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareSystemColumns);
|
|
@@ -548,12 +558,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
548
558
|
var appendedSystemColumnIds = isSystemColumnsEnabled
|
|
549
559
|
? systemColumns_1.SYSTEM_COLUMN_IDS.filter(function (eachId) { var _a; return !((_a = props.model) !== null && _a !== void 0 ? _a : []).some(function (each) { return each.id === eachId; }); })
|
|
550
560
|
: [];
|
|
551
|
-
var
|
|
561
|
+
var _173 = (0, react_1.useState)((_z = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _z !== void 0 ? _z : []), shownSystemColumnIds = _173[0], setShownSystemColumnIds = _173[1];
|
|
552
562
|
var handleWithSystemColumns = function (model, shownIds) {
|
|
553
563
|
if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
|
|
554
564
|
return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
|
|
555
565
|
};
|
|
556
|
-
var
|
|
566
|
+
var _174 = (0, react_1.useState)(function () {
|
|
557
567
|
var _a;
|
|
558
568
|
var baseModel = handleWithSystemColumns((props === null || props === void 0 ? void 0 : props.model) || [], (_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _a !== void 0 ? _a : []);
|
|
559
569
|
if (!persistedState)
|
|
@@ -580,8 +590,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
580
590
|
});
|
|
581
591
|
}
|
|
582
592
|
return model;
|
|
583
|
-
}), structure =
|
|
584
|
-
var
|
|
593
|
+
}), structure = _174[0], setStructure = _174[1];
|
|
594
|
+
var _175 = (0, react_1.useState)(((_0 = props === null || props === void 0 ? void 0 : props.organise) === null || _0 === void 0 ? void 0 : _0.additionalQuery) || []), additionalQuery = _175[0], setAdditionalQuery = _175[1];
|
|
585
595
|
// INFO: State for user-configurable flex filters (Monday.com-style)
|
|
586
596
|
// INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
|
|
587
597
|
var defaultFlexFilterRow = [
|
|
@@ -593,13 +603,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
593
603
|
},
|
|
594
604
|
];
|
|
595
605
|
// INFO: rows the host opens the list with come before a saved view's
|
|
596
|
-
var initialFlexFilterRows = ((_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.
|
|
597
|
-
props.organise.
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
?
|
|
601
|
-
:
|
|
602
|
-
|
|
606
|
+
var initialFlexFilterRows = ((_2 = (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.linkFlexFilters) === null || _2 === void 0 ? void 0 : _2.length)
|
|
607
|
+
? props.organise.linkFlexFilters
|
|
608
|
+
: ((_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.initialFlexFilters) &&
|
|
609
|
+
props.organise.initialFlexFilters.length > 0
|
|
610
|
+
? props.organise.initialFlexFilters
|
|
611
|
+
: (persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
612
|
+
? persistedState.flexFilters
|
|
613
|
+
: defaultFlexFilterRow;
|
|
614
|
+
var _176 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _176[0], setFlexFilters = _176[1];
|
|
603
615
|
// INFO: always-current mirror of flexFilters, read by the imperative apply/
|
|
604
616
|
// clear methods so chained calls in one tick aren't stale.
|
|
605
617
|
var flexFiltersRef = (0, react_1.useRef)(flexFilters);
|
|
@@ -612,111 +624,113 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
612
624
|
}, [flexFilters]);
|
|
613
625
|
// INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
|
|
614
626
|
// to prevent API calls on every keystroke when typing in value inputs
|
|
615
|
-
var
|
|
627
|
+
var _177 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _177[0], setFlexFiltersDebounced = _177[1];
|
|
616
628
|
// INFO: the filter rows of the export being set up — started from the
|
|
617
629
|
// list's own when the export opens, so changing them leaves the list as it is
|
|
618
|
-
var
|
|
619
|
-
var
|
|
620
|
-
var
|
|
621
|
-
var
|
|
622
|
-
var
|
|
630
|
+
var _178 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _178[0], setExportFlexFilters = _178[1];
|
|
631
|
+
var _179 = (0, react_1.useState)({}), flexFilterReferenceOptions = _179[0], setFlexFilterReferenceOptions = _179[1];
|
|
632
|
+
var _180 = (0, react_1.useState)({}), flexFilterReferenceSearch = _180[0], setFlexFilterReferenceSearch = _180[1];
|
|
633
|
+
var _181 = (0, react_1.useState)(false), flexFilterModalOpen = _181[0], setFlexFilterModalOpen = _181[1];
|
|
634
|
+
var _182 = (0, react_1.useState)(false), viewSettingsModalOpen = _182[0], setViewSettingsModalOpen = _182[1];
|
|
623
635
|
// INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
|
|
624
636
|
// Deliberately kept out of `structure`: the props-sync effect below resets
|
|
625
637
|
// structure to props.model whenever props change, which would wipe the
|
|
626
638
|
// choice, and the persist effect derives schema-level hiddenColumnIds from
|
|
627
639
|
// structure — writing user hides there would blur the two concepts.
|
|
628
|
-
var
|
|
629
|
-
var
|
|
630
|
-
var
|
|
631
|
-
var
|
|
640
|
+
var _183 = (0, react_1.useState)((_4 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _4 !== void 0 ? _4 : []), userHiddenColumnIds = _183[0], setUserHiddenColumnIds = _183[1];
|
|
641
|
+
var _184 = (0, react_1.useState)(""), columnSearch = _184[0], setColumnSearch = _184[1];
|
|
642
|
+
var _185 = (0, react_1.useState)([]), savedViews = _185[0], setSavedViews = _185[1];
|
|
643
|
+
var _186 = (0, react_1.useState)(null), activeSavedViewId = _186[0], setActiveSavedViewId = _186[1];
|
|
632
644
|
// INFO: the widths of the view on screen, by column id ("180px")
|
|
633
|
-
var
|
|
645
|
+
var _187 = (0, react_1.useState)(function () { var _a, _b, _c; return (_c = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) === null || _b === void 0 ? void 0 : _b.columnWidths) !== null && _c !== void 0 ? _c : {}; }), columnWidths = _187[0], setColumnWidths = _187[1];
|
|
634
646
|
// INFO: the kanban lane widths of the view on screen, by lane id ("300px")
|
|
635
|
-
var
|
|
647
|
+
var _188 = (0, react_1.useState)(function () { var _a, _b, _c; return (_c = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) === null || _b === void 0 ? void 0 : _b.laneWidths) !== null && _c !== void 0 ? _c : {}; }), laneWidths = _188[0], setLaneWidths = _188[1];
|
|
636
648
|
// INFO: the read drawer's dragged width ("520px"), kept in the view with the
|
|
637
649
|
// column widths. A restored persistViewState wins over All's, as a saved
|
|
638
650
|
// view or draft applied at opening replaces both
|
|
639
|
-
var
|
|
651
|
+
var _189 = (0, react_1.useState)(function () {
|
|
640
652
|
var _a, _b, _c;
|
|
641
653
|
return (_a = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.drawerWidth : undefined)) !== null && _a !== void 0 ? _a : (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.allView) === null || _c === void 0 ? void 0 : _c.drawerWidth;
|
|
642
|
-
}), drawerWidth =
|
|
654
|
+
}), drawerWidth = _189[0], setDrawerWidth = _189[1];
|
|
643
655
|
// INFO: the columns the view on screen freezes at the left edge
|
|
644
|
-
var
|
|
656
|
+
var _190 = (0, react_1.useState)(function () { var _a, _b; return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) === null || _b === void 0 ? void 0 : _b.pinnedColumnIds; }), pinnedColumnIds = _190[0], setPinnedColumnIds = _190[1];
|
|
645
657
|
// INFO: unsaved changes are kept only once the opening view is on screen,
|
|
646
658
|
// so the defaults drawn before it never overwrite a person's own
|
|
647
|
-
var
|
|
659
|
+
var _191 = (0, react_1.useState)(false), isViewDraftReady = _191[0], setIsViewDraftReady = _191[1];
|
|
648
660
|
// INFO: null while the name box is closed
|
|
649
|
-
var
|
|
650
|
-
var
|
|
661
|
+
var _192 = (0, react_1.useState)(null), savedViewName = _192[0], setSavedViewName = _192[1];
|
|
662
|
+
var _193 = (0, react_1.useState)(null), deletingSavedViewId = _193[0], setDeletingSavedViewId = _193[1];
|
|
651
663
|
// INFO: the view chip being dragged, to drop it in another place
|
|
652
|
-
var
|
|
664
|
+
var _194 = (0, react_1.useState)(null), draggingSavedViewId = _194[0], setDraggingSavedViewId = _194[1];
|
|
653
665
|
// INFO: the tab strip in the order a drag has reached, saved once on drop
|
|
654
|
-
var
|
|
655
|
-
var
|
|
656
|
-
var
|
|
657
|
-
var
|
|
666
|
+
var _195 = (0, react_1.useState)(null), draggedTabs = _195[0], setDraggedTabs = _195[1];
|
|
667
|
+
var _196 = (0, react_1.useState)(null), renamingSavedView = _196[0], setRenamingSavedView = _196[1];
|
|
668
|
+
var _197 = (0, react_1.useState)(false), isSavedViewsExpanded = _197[0], setIsSavedViewsExpanded = _197[1];
|
|
669
|
+
var _198 = (0, react_1.useState)(null), draggingColumnId = _198[0], setDraggingColumnId = _198[1];
|
|
658
670
|
var columnRowRefs = (0, react_1.useRef)({});
|
|
659
671
|
//INFO : Used by Auth
|
|
660
|
-
var
|
|
672
|
+
var _199 = (0, react_1.useState)({
|
|
661
673
|
email: "",
|
|
662
674
|
google: "",
|
|
663
675
|
phone: "",
|
|
664
676
|
disabled: false,
|
|
665
677
|
create: false,
|
|
666
|
-
}), authMethods =
|
|
667
|
-
var
|
|
678
|
+
}), authMethods = _199[0], setAuthMethods = _199[1];
|
|
679
|
+
var _200 = (0, react_1.useState)(""), selectedAuthMethod = _200[0], setSelectedAuthMethod = _200[1];
|
|
668
680
|
// INFO: the sign-in check of a users datasheet's record is running; the
|
|
669
681
|
// panel shows a spinner rather than nothing, which read as "no login"
|
|
670
|
-
var
|
|
682
|
+
var _201 = (0, react_1.useState)(false), authLoading = _201[0], setAuthLoading = _201[1];
|
|
671
683
|
// INFO: a delete is running — the ref answers a second tap at once, before
|
|
672
684
|
// the state has rendered, and the state disables the confirm button
|
|
673
685
|
var deletingRef = (0, react_1.useRef)(false);
|
|
674
|
-
var
|
|
686
|
+
var _202 = (0, react_1.useState)(false), deleting = _202[0], setDeleting = _202[1];
|
|
675
687
|
// INFO: Used by Activity Log
|
|
676
|
-
var
|
|
677
|
-
var
|
|
688
|
+
var _203 = (0, react_1.useState)(false), activityModal = _203[0], setActivityModal = _203[1];
|
|
689
|
+
var _204 = (0, react_1.useState)(""), activityId = _204[0], setActivityId = _204[1];
|
|
678
690
|
//INFO : Used by Export
|
|
679
|
-
var
|
|
680
|
-
var
|
|
681
|
-
var
|
|
682
|
-
var
|
|
683
|
-
var
|
|
684
|
-
var
|
|
685
|
-
var
|
|
686
|
-
var
|
|
687
|
-
var
|
|
688
|
-
var
|
|
689
|
-
var
|
|
690
|
-
var
|
|
691
|
-
var
|
|
692
|
-
var
|
|
693
|
-
var
|
|
691
|
+
var _205 = (0, react_1.useState)(null), csvFile = _205[0], setCSVFile = _205[1];
|
|
692
|
+
var _206 = (0, react_1.useState)([]), csvFileData = _206[0], setCSVFileData = _206[1];
|
|
693
|
+
var _207 = (0, react_1.useState)(0), stepCSVIndex = _207[0], setStepCSVIndex = _207[1];
|
|
694
|
+
var _208 = (0, react_1.useState)({}), listCSVMapAttribute = _208[0], setListCSVMapAttribute = _208[1];
|
|
695
|
+
var _209 = (0, react_1.useState)({}), listCSVObjAttribute = _209[0], setListCSVObjAttribute = _209[1];
|
|
696
|
+
var _210 = (0, react_1.useState)([]), csvAPIAttribute = _210[0], setCSVAPIAttribute = _210[1];
|
|
697
|
+
var _211 = (0, react_1.useState)(((_5 = props.devSettings.currentUser) === null || _5 === void 0 ? void 0 : _5.userEmail) || ""), exportCSVEmail = _211[0], setExportCSVEmail = _211[1];
|
|
698
|
+
var _212 = (0, react_1.useState)(((_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.exportSettings) === null || _7 === void 0 ? void 0 : _7.defaultExportPDFName) || ""), exportPDFTitle = _212[0], setExportPDFTitle = _212[1];
|
|
699
|
+
var _213 = (0, react_1.useState)(false), exportPDFLoading = _213[0], setExportPDFLoading = _213[1];
|
|
700
|
+
var _214 = (0, react_1.useState)(false), exportReadPDFLoading = _214[0], setExportReadPDFLoading = _214[1];
|
|
701
|
+
var _215 = (0, react_1.useState)((_10 = (_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.exportSettings) === null || _9 === void 0 ? void 0 : _9.sumColumnId) !== null && _10 !== void 0 ? _10 : []), exportSumAttributeIds = _215[0], setExportSumAttributeIds = _215[1];
|
|
702
|
+
var _216 = (0, react_1.useState)((_13 = (_12 = (_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.exportSettings) === null || _12 === void 0 ? void 0 : _12.hideSubItems) !== null && _13 !== void 0 ? _13 : false), hideSubItems = _216[0], setHideSubItems = _216[1];
|
|
703
|
+
var _217 = (0, react_1.useState)([]), importTableData = _217[0], setImportTableData = _217[1];
|
|
704
|
+
var _218 = (0, react_1.useState)([]), queryList = _218[0], setQueryList = _218[1];
|
|
705
|
+
var _219 = (0, react_1.useState)(undefined), allQueryList = _219[0], setAllQueryList = _219[1];
|
|
694
706
|
// INFO: a restored state wins over the prop; its "" is a list the user
|
|
695
707
|
// ungrouped, so it opens ungrouped
|
|
696
|
-
var
|
|
708
|
+
var _220 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
|
|
697
709
|
? persistedState.groupBy || undefined
|
|
698
|
-
: (
|
|
710
|
+
: (_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.groupBy), groupId = _220[0], setGroupId = _220[1];
|
|
711
|
+
// INFO: groups by their record count, or in the column's own order
|
|
712
|
+
var _221 = (0, react_1.useState)((_15 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupOrder) !== null && _15 !== void 0 ? _15 : ""), groupOrder = _221[0], setGroupOrder = _221[1];
|
|
699
713
|
// INFO: each group's total per number column, keyed by section id
|
|
700
|
-
var
|
|
714
|
+
var _222 = (0, react_1.useState)({}), groupSummaries = _222[0], setGroupSummaries = _222[1];
|
|
701
715
|
// INFO: each group's row count over every row the filters match; null until
|
|
702
716
|
// read. A band paged alone shows it until its own first page lands, and a
|
|
703
717
|
// band it counts empty is left out instead of waiting to be read
|
|
704
|
-
var
|
|
718
|
+
var _223 = (0, react_1.useState)(null), groupTotals = _223[0], setGroupTotals = _223[1];
|
|
705
719
|
// INFO: the last read of groupTotals failed, so bands fall back to the rows
|
|
706
720
|
// loaded instead of waiting on a total that is not coming
|
|
707
|
-
var
|
|
721
|
+
var _224 = (0, react_1.useState)(false), groupTotalsFailed = _224[0], setGroupTotalsFailed = _224[1];
|
|
708
722
|
var groupSummaryRequestRef = (0, react_1.useRef)(0);
|
|
709
723
|
// INFO: the grouped count waiting to go out, so a filter change can stop it
|
|
710
724
|
// before it sends the filters it was scheduled with
|
|
711
725
|
var groupSummaryTimerRef = (0, react_1.useRef)(null);
|
|
712
|
-
var
|
|
713
|
-
var
|
|
726
|
+
var _225 = (0, react_1.useState)({}), commentCounts = _225[0], setCommentCounts = _225[1];
|
|
727
|
+
var _226 = (0, react_1.useState)({}), commentUnread = _226[0], setCommentUnread = _226[1];
|
|
714
728
|
// INFO: Monday-board per-group paging. Keyed by the group key that
|
|
715
729
|
// handleBuildNewTableGroups() produces (an option, Unknown or No Value).
|
|
716
730
|
// Each group tracks its own loaded cursor + total so it can lazily load its
|
|
717
731
|
// next page as the user scrolls inside that band, independent of every other
|
|
718
732
|
// group. Only used when renderCheckGroupPaging() is true.
|
|
719
|
-
var
|
|
733
|
+
var _227 = (0, react_1.useState)({}), groupPageState = _227[0], setGroupPageState = _227[1];
|
|
720
734
|
// INFO: read fresh inside the async per-group fetch so chained scroll fires
|
|
721
735
|
// in one tick do not re-fetch an already in-flight page.
|
|
722
736
|
var groupPageStateRef = (0, react_1.useRef)({});
|
|
@@ -731,62 +745,63 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
731
745
|
var groupLoadingKeyRef = (0, react_1.useRef)(null);
|
|
732
746
|
var groupLoadQueueRef = (0, react_1.useRef)([]);
|
|
733
747
|
var handleFetchGroupNextPageRef = (0, react_1.useRef)(function () { });
|
|
734
|
-
var
|
|
735
|
-
var
|
|
748
|
+
var _228 = (0, react_1.useState)(""), readTabSection = _228[0], setReadTabSection = _228[1];
|
|
749
|
+
var _229 = (0, react_1.useState)(false), readFloatingNav = _229[0], setReadFloatingNav = _229[1];
|
|
736
750
|
var readTabSectionRefs = (0, react_1.useRef)({});
|
|
737
751
|
//INFO : Used by Read
|
|
738
752
|
//INFO : Used by Update
|
|
739
|
-
var
|
|
740
|
-
var
|
|
741
|
-
var
|
|
742
|
-
var
|
|
743
|
-
var
|
|
744
|
-
var
|
|
745
|
-
var
|
|
753
|
+
var _230 = (0, react_1.useState)(false), modalVisible = _230[0], setModalVisible = _230[1];
|
|
754
|
+
var _231 = (0, react_1.useState)(false), deleteModal = _231[0], setDeleteModal = _231[1];
|
|
755
|
+
var _232 = (0, react_1.useState)(false), excelModal = _232[0], setExcelModal = _232[1];
|
|
756
|
+
var _233 = (0, react_1.useState)(false), exportExcel = _233[0], setExportExcel = _233[1];
|
|
757
|
+
var _234 = (0, react_1.useState)(""), exportType = _234[0], setExportType = _234[1];
|
|
758
|
+
var _235 = (0, react_1.useState)(false), exportQR = _235[0], setExportQR = _235[1];
|
|
759
|
+
var _236 = (0, react_1.useState)(function () {
|
|
746
760
|
var _a, _b;
|
|
747
761
|
var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
|
|
748
762
|
return firstTabId;
|
|
749
|
-
}), activeTab =
|
|
750
|
-
var
|
|
751
|
-
var
|
|
752
|
-
var
|
|
753
|
-
var
|
|
754
|
-
var
|
|
755
|
-
var
|
|
756
|
-
var
|
|
763
|
+
}), activeTab = _236[0], setActiveTab = _236[1];
|
|
764
|
+
var _237 = (0, react_1.useState)(false), signatureSigning = _237[0], setSignatureSigning = _237[1];
|
|
765
|
+
var _238 = (0, react_1.useState)({}), selectedData = _238[0], setSelectedData = _238[1];
|
|
766
|
+
var _239 = (0, react_1.useState)(""), selectedObjectStructureId = _239[0], setSelectedObjectStructureId = _239[1];
|
|
767
|
+
var _240 = (0, react_1.useState)(""), selectedObjectId = _240[0], setSelectedObjectId = _240[1];
|
|
768
|
+
var _241 = (0, react_1.useState)(""), selectedListAddressId = _241[0], setSelectedListAddressId = _241[1];
|
|
769
|
+
var _242 = (0, react_1.useState)(-1), selectedListAddressIndex = _242[0], setSelectedListAddressIndex = _242[1];
|
|
770
|
+
var _243 = (0, react_1.useState)({
|
|
757
771
|
lat: 0,
|
|
758
772
|
lng: 0,
|
|
759
773
|
name: "",
|
|
760
|
-
}), selectedListAddress =
|
|
761
|
-
var
|
|
762
|
-
var
|
|
763
|
-
var
|
|
764
|
-
var
|
|
765
|
-
var
|
|
766
|
-
var
|
|
774
|
+
}), selectedListAddress = _243[0], setSelectedListAddress = _243[1];
|
|
775
|
+
var _244 = (0, react_1.useState)({}), selectedObjectData = _244[0], setSelectedObjectData = _244[1];
|
|
776
|
+
var _245 = (0, react_1.useState)(null), objectCellEdit = _245[0], setObjectCellEdit = _245[1];
|
|
777
|
+
var _246 = (0, react_1.useState)(false), referenceLoading = _246[0], setReferenceLoading = _246[1];
|
|
778
|
+
var _247 = (0, react_1.useState)({}), referencesOptions = _247[0], setReferencesOptions = _247[1];
|
|
779
|
+
var _248 = (0, react_1.useState)({}), referencesDetails = _248[0], setReferencesDetails = _248[1];
|
|
780
|
+
var _249 = (0, react_1.useState)({}), listReferencesOptions = _249[0], setListReferencesOptions = _249[1];
|
|
767
781
|
// INFO: the referenced records themselves, for a table cell that picks from
|
|
768
782
|
// a list on one (referenceSelection)
|
|
769
|
-
var
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
var
|
|
773
|
-
var
|
|
783
|
+
var _250 = (0, react_1.useState)({}), listReferencesDetails = _250[0], setListReferencesDetails = _250[1];
|
|
784
|
+
// INFO: each record that could not be deleted, by the datasheet still
|
|
785
|
+
// linking to it
|
|
786
|
+
var _251 = (0, react_1.useState)([]), referenceDeleteTableData = _251[0], setReferenceDeleteTableData = _251[1];
|
|
787
|
+
var _252 = (0, react_1.useState)([]), relatedSections = _252[0], setRelatedSections = _252[1];
|
|
788
|
+
var _253 = (0, react_1.useState)({
|
|
774
789
|
id: "",
|
|
775
790
|
name: "",
|
|
776
791
|
type: "string",
|
|
777
|
-
}), referenceCreationModal =
|
|
778
|
-
var
|
|
779
|
-
var
|
|
792
|
+
}), referenceCreationModal = _253[0], setReferenceCreationModal = _253[1];
|
|
793
|
+
var _254 = (0, react_1.useState)({}), referenceModelSchema = _254[0], setReferenceSchema = _254[1];
|
|
794
|
+
var _255 = (0, react_1.useState)([]), kanbanChecked = _255[0], setKanbanChecked = _255[1];
|
|
780
795
|
//INFO : Offline
|
|
781
|
-
var
|
|
782
|
-
var
|
|
796
|
+
var _256 = (0, react_1.useState)(0), offlineDataLength = _256[0], setOfflineDataLength = _256[1];
|
|
797
|
+
var _257 = (0, react_1.useState)(false), offlineModal = _257[0], setOfflineModal = _257[1];
|
|
783
798
|
// INFO: live-stream state — driven by socket connection and navigator.onLine
|
|
784
|
-
var
|
|
785
|
-
var
|
|
799
|
+
var _258 = (0, react_1.useState)(false), isLive = _258[0], setIsLive = _258[1];
|
|
800
|
+
var _259 = (0, react_1.useState)(false), isLiveOffline = _259[0], setIsLiveOffline = _259[1];
|
|
786
801
|
// INFO: true when navigator is offline — used to switch ReadQueryHoc between
|
|
787
802
|
// server reads (online, full pagination) and IndexedDB reads (offline, cached data).
|
|
788
803
|
// Independent of SSE status so it works even when bareSocketName is not set.
|
|
789
|
-
var
|
|
804
|
+
var _260 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _260[0], setIsNetworkOffline = _260[1];
|
|
790
805
|
var previousType = (0, react_1.useRef)(null);
|
|
791
806
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
792
807
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
@@ -936,7 +951,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
936
951
|
* viewId still wins when present: it is a deliberate destination, from a
|
|
937
952
|
* shared link or a back button.
|
|
938
953
|
*/
|
|
939
|
-
var defaultTabName = (
|
|
954
|
+
var defaultTabName = (_18 = (_17 = (_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.extendedTabs) === null || _17 === void 0 ? void 0 : _17.find(function (eachTab) { return eachTab.defaultTab; })) === null || _18 === void 0 ? void 0 : _18.name;
|
|
940
955
|
// INFO: the pinned tab is a LIST destination. Falling back to it while a
|
|
941
956
|
// record is open resolved the read view to a list tab, which renderTabContent
|
|
942
957
|
// refuses — so General Details rendered nothing. Only a list falls back.
|
|
@@ -948,14 +963,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
948
963
|
// INFO: Firestore reads and the monday wrapper join every condition with AND
|
|
949
964
|
// (monday flattens all ORs into one), so a flex OR group is offered on Mongo only
|
|
950
965
|
var isFlexOrSupported = !isFirebase && devSettings.server !== "mondayServer";
|
|
951
|
-
var isDateWarnings = !!((
|
|
952
|
-
var isDatasheetDefaults = !!((
|
|
966
|
+
var isDateWarnings = !!((_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.dateWarnings);
|
|
967
|
+
var isDatasheetDefaults = !!((_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.datasheetDefaults);
|
|
953
968
|
// INFO: the columns as the views draw them — with datasheet defaults every
|
|
954
969
|
// list option without a colour takes the palette colour of its position
|
|
955
970
|
var displayStructure = isDatasheetDefaults
|
|
956
971
|
? (0, defaultColours_1.handleApplyDefaultColours)(structure)
|
|
957
972
|
: structure;
|
|
958
|
-
var dbModule = isFirebaseClient ? (
|
|
973
|
+
var dbModule = isFirebaseClient ? (_21 = props.lib) === null || _21 === void 0 ? void 0 : _21.firebase : (_22 = props.lib) === null || _22 === void 0 ? void 0 : _22.axios;
|
|
959
974
|
var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
|
|
960
975
|
var selectedRelated = resolvedType === "read"
|
|
961
976
|
? relatedSections.find(function (eachSection) { return eachSection.id === viewType; })
|
|
@@ -1149,38 +1164,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1149
1164
|
}, [
|
|
1150
1165
|
resolvedType,
|
|
1151
1166
|
props.id,
|
|
1152
|
-
(
|
|
1167
|
+
(_23 = props.space) === null || _23 === void 0 ? void 0 : _23._id,
|
|
1153
1168
|
props.devSettings.schemaEndpoint,
|
|
1154
|
-
(
|
|
1169
|
+
(_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.showRelatedTab,
|
|
1155
1170
|
]);
|
|
1156
1171
|
/* eslint-enable */
|
|
1157
1172
|
// INFO: the view settings panel (columns, sort, rows per page) is standard on
|
|
1158
1173
|
// the new DTW; bareViewSettings stays the opt-in for legacy and bare DTWs
|
|
1159
|
-
var isViewSettingsEnabled = ((
|
|
1174
|
+
var isViewSettingsEnabled = ((_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareViewSettings) || ((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareNewDTW)
|
|
1160
1175
|
? true
|
|
1161
1176
|
: false;
|
|
1162
1177
|
// INFO: a consumer that wires onChangeHide owns the hide at schema level
|
|
1163
1178
|
// (shared by every user) — toggling writes to the model and calls back. Without it
|
|
1164
1179
|
// the hide is this user's own and lives in userHiddenColumnIds.
|
|
1165
|
-
var isSchemaHideMode = ((
|
|
1180
|
+
var isSchemaHideMode = ((_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.onChangeHide) ? true : false;
|
|
1166
1181
|
// INFO: rows per page is a view setting the user can change, so it starts from
|
|
1167
1182
|
// the persisted value and falls back to the consumer's limit
|
|
1168
|
-
var
|
|
1183
|
+
var _261 = (0, react_1.useState)((_29 = (_28 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _28 !== void 0 ? _28 : props.limit) !== null && _29 !== void 0 ? _29 : 10), pageLimit = _261[0], setPageLimit = _261[1];
|
|
1169
1184
|
var limit = pageLimit;
|
|
1170
|
-
var isSavedViewsEnabled = !!((
|
|
1185
|
+
var isSavedViewsEnabled = !!((_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.savedViews) && resolvedType === "list";
|
|
1171
1186
|
// INFO: a calendar and a chart draw their own way, so columns, sort and
|
|
1172
1187
|
// group have nothing to change there
|
|
1173
1188
|
var isViewSettingsHiddenForTab = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "calendar" || (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "chart";
|
|
1174
1189
|
// INFO: Group shapes a table, list or grid into sections, a map into routes
|
|
1175
1190
|
// and a timeline into colours
|
|
1176
|
-
var isGroupPickerShown = !!((
|
|
1191
|
+
var isGroupPickerShown = !!((_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.showGroupByFeature) && !isViewSettingsHiddenForTab;
|
|
1177
1192
|
// INFO: an app that stores views takes over from this browser's storage, so
|
|
1178
1193
|
// every view is the team's and nothing is kept locally
|
|
1179
|
-
var isAppViews = ((
|
|
1180
|
-
!!((
|
|
1194
|
+
var isAppViews = ((_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.sharedViews) !== undefined ||
|
|
1195
|
+
!!((_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.onChangeSharedViews);
|
|
1181
1196
|
// INFO: a saved view carries its sort, so the sort is held here as with persistViewState
|
|
1182
1197
|
var isInternalSort = isPersistEnabled || isSavedViewsEnabled;
|
|
1183
|
-
var activeSortId = (isInternalSort && persistedSort) || ((
|
|
1198
|
+
var activeSortId = (isInternalSort && persistedSort) || ((_34 = props.organise) === null || _34 === void 0 ? void 0 : _34.sort);
|
|
1184
1199
|
var handleSortColumn = function (value) {
|
|
1185
1200
|
var _a, _b, _c, _d;
|
|
1186
1201
|
if (isInternalSort)
|
|
@@ -1210,7 +1225,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1210
1225
|
// INFO: Firebase pages by document cursor and a union by skip, so neither
|
|
1211
1226
|
// can hand over the whole set — there formula columns are not offered for
|
|
1212
1227
|
// sorting or filtering, rather than ordering one page
|
|
1213
|
-
var isFormulaViewSupported = !isFirebase && !((
|
|
1228
|
+
var isFormulaViewSupported = !isFirebase && !((_36 = (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.unionCollections) === null || _36 === void 0 ? void 0 : _36.length);
|
|
1214
1229
|
var formulaSort = isFormulaViewSupported &&
|
|
1215
1230
|
(activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) &&
|
|
1216
1231
|
formulaColumnIds.includes(activeSortId.sortId)
|
|
@@ -1221,17 +1236,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1221
1236
|
// a union read runs them
|
|
1222
1237
|
// INFO: a people filter's "me" needs only who is signed in, which any
|
|
1223
1238
|
// backend can match
|
|
1224
|
-
var currentUserId = (
|
|
1225
|
-
var flexFilterExtras = !isFirebase && !((
|
|
1239
|
+
var currentUserId = (_37 = props.devSettings.currentUser) === null || _37 === void 0 ? void 0 : _37.userId;
|
|
1240
|
+
var flexFilterExtras = !isFirebase && !((_39 = (_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.unionCollections) === null || _39 === void 0 ? void 0 : _39.length)
|
|
1226
1241
|
? {
|
|
1227
|
-
references: (
|
|
1228
|
-
listObjects: (
|
|
1229
|
-
related: (
|
|
1242
|
+
references: (_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.bareFlexFilterReferences,
|
|
1243
|
+
listObjects: (_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.bareFlexFilterListObjects,
|
|
1244
|
+
related: (_42 = props.bareSettings) === null || _42 === void 0 ? void 0 : _42.bareFlexFilterRelated,
|
|
1230
1245
|
currentUserId: currentUserId,
|
|
1231
1246
|
}
|
|
1232
|
-
:
|
|
1233
|
-
? { currentUserId: currentUserId }
|
|
1234
|
-
:
|
|
1247
|
+
: isFirebase
|
|
1248
|
+
? { currentUserId: currentUserId, isFirestore: true }
|
|
1249
|
+
: currentUserId
|
|
1250
|
+
? { currentUserId: currentUserId }
|
|
1251
|
+
: undefined;
|
|
1235
1252
|
// INFO: a formula filter is matched in the browser and the rest on the
|
|
1236
1253
|
// server, so a group is split between them: a group of formula filters
|
|
1237
1254
|
// only still matches any of them here, while a formula filter grouped with
|
|
@@ -1367,18 +1384,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1367
1384
|
var handleGetSelectAllText = function () {
|
|
1368
1385
|
return "".concat(size.toLocaleString(), " records ").concat(handleCheckReaderFiltered() ? "matching your filters" : "in this list");
|
|
1369
1386
|
};
|
|
1370
|
-
var
|
|
1371
|
-
var isEditor = ((
|
|
1372
|
-
var isOffline = (
|
|
1387
|
+
var _262 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _262.canUpdateRecord, canInlineUpdate = _262.canInlineUpdate, canBatchUpdate = _262.canBatchUpdate, canDeleteRecord = _262.canDeleteRecord;
|
|
1388
|
+
var isEditor = ((_43 = props.edit) === null || _43 === void 0 ? void 0 : _43.allEditable) ? true : false;
|
|
1389
|
+
var isOffline = (_44 = props.bareSettings) === null || _44 === void 0 ? void 0 : _44.bareOffline;
|
|
1373
1390
|
// INFO: when bareOfflineNetworkAware is true, the save path is also gated on
|
|
1374
1391
|
// the live network state — online saves go to the server even if bareOffline
|
|
1375
1392
|
// is true, offline saves go to IDB as normal.
|
|
1376
|
-
var isOfflineNetworkListener = isOffline && ((
|
|
1377
|
-
var showId = (
|
|
1393
|
+
var isOfflineNetworkListener = isOffline && ((_45 = props.bareSettings) === null || _45 === void 0 ? void 0 : _45.bareOfflineNetworkListener);
|
|
1394
|
+
var showId = (_46 = props.space) === null || _46 === void 0 ? void 0 : _46.showId;
|
|
1378
1395
|
var remainId = showId || selectedObjectStructureId ? true : false;
|
|
1379
|
-
var idField = ((
|
|
1380
|
-
var pipeline = (
|
|
1381
|
-
if ((
|
|
1396
|
+
var idField = ((_47 = props.space) === null || _47 === void 0 ? void 0 : _47.idField) || ((_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.idField);
|
|
1397
|
+
var pipeline = (_49 = props === null || props === void 0 ? void 0 : props.space) === null || _49 === void 0 ? void 0 : _49.pipeline;
|
|
1398
|
+
if ((_50 = props.bareSettings) === null || _50 === void 0 ? void 0 : _50.bareListPipeline) {
|
|
1382
1399
|
pipeline = pipeline
|
|
1383
1400
|
? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
|
|
1384
1401
|
}
|
|
@@ -1391,38 +1408,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1391
1408
|
* three records came back instead of five files, and each tile received the
|
|
1392
1409
|
* whole array rather than one file, so every one of them read "Attachment".
|
|
1393
1410
|
*/
|
|
1394
|
-
var fileViewColumnId = (
|
|
1411
|
+
var fileViewColumnId = (_54 = (_53 = ((_52 = (_51 = props.organise) === null || _51 === void 0 ? void 0 : _51.extendedTabs) !== null && _52 !== void 0 ? _52 : []).find(function (eachTab) {
|
|
1395
1412
|
return eachTab.viewType === "file" &&
|
|
1396
1413
|
(0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
|
|
1397
|
-
})) === null ||
|
|
1414
|
+
})) === null || _53 === void 0 ? void 0 : _53.fileSettings) === null || _54 === void 0 ? void 0 : _54.columnId;
|
|
1398
1415
|
// INFO: select-all promises "all N records", so it is offered only where N
|
|
1399
1416
|
// is the total a delete reads — not on Firebase (N is the rows loaded so
|
|
1400
1417
|
// far), a union of datasheets (N counts the others too), a file view (N
|
|
1401
1418
|
// counts files, not records) or offline
|
|
1402
1419
|
var isSelectAllUncountable = isFirebase ||
|
|
1403
|
-
!!((
|
|
1420
|
+
!!((_56 = (_55 = props.organise) === null || _55 === void 0 ? void 0 : _55.unionCollections) === null || _56 === void 0 ? void 0 : _56.length) ||
|
|
1404
1421
|
!!fileViewColumnId ||
|
|
1405
|
-
!!((
|
|
1406
|
-
var hasNavigation = ((
|
|
1422
|
+
!!((_57 = props.bareSettings) === null || _57 === void 0 ? void 0 : _57.bareOffline);
|
|
1423
|
+
var hasNavigation = ((_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.handleNavigate) ? true : false;
|
|
1407
1424
|
var formColumn = "grid-cols-12";
|
|
1408
|
-
var useMobileView = (
|
|
1425
|
+
var useMobileView = (_60 = (_59 = props.bareSettings) === null || _59 === void 0 ? void 0 : _59.bareUpdateMobileView) !== null && _60 !== void 0 ? _60 : false;
|
|
1409
1426
|
var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
|
|
1410
|
-
var isActivityLog = (((
|
|
1411
|
-
((
|
|
1412
|
-
(((
|
|
1413
|
-
((
|
|
1427
|
+
var isActivityLog = (((_62 = (_61 = props.edit) === null || _61 === void 0 ? void 0 : _61.activityLog) === null || _62 === void 0 ? void 0 : _62.enableComments) &&
|
|
1428
|
+
((_63 = props.edit) === null || _63 === void 0 ? void 0 : _63.activityLog.commentCollectionId)) ||
|
|
1429
|
+
(((_65 = (_64 = props.edit) === null || _64 === void 0 ? void 0 : _64.activityLog) === null || _65 === void 0 ? void 0 : _65.enableLogs) &&
|
|
1430
|
+
((_66 = props.edit) === null || _66 === void 0 ? void 0 : _66.activityLog.logsCollectionId));
|
|
1414
1431
|
// INFO: a record's comments and logs shown in place of the record rather than
|
|
1415
1432
|
// in a drawer of their own — a related tab already sits inside the read
|
|
1416
1433
|
// drawer, and a second drawer over it hid the row being discussed. It opens
|
|
1417
1434
|
// the row through handleNavigate, so without one it stays off and the
|
|
1418
1435
|
// drawer is used, rather than leaving a comment button that does nothing
|
|
1419
1436
|
var isInlineActivity = !!isActivityLog &&
|
|
1420
|
-
!!((
|
|
1437
|
+
!!((_67 = props.bareSettings) === null || _67 === void 0 ? void 0 : _67.bareInlineActivity) &&
|
|
1421
1438
|
hasNavigation;
|
|
1422
1439
|
// INFO: each row button opens what it shows: the comment button the row's
|
|
1423
1440
|
// comments and logs alone, the eye (or the row) its details alone, so
|
|
1424
1441
|
// neither has to be scrolled past to reach the other
|
|
1425
|
-
var
|
|
1442
|
+
var _263 = (0, react_1.useState)(false), inlineActivityOnly = _263[0], setInlineActivityOnly = _263[1];
|
|
1426
1443
|
var isActivityOnly = isInlineActivity && inlineActivityOnly;
|
|
1427
1444
|
// INFO: the row whose comments were shown; going back to the list asks its
|
|
1428
1445
|
// comment count again, as the drawer does when it closes
|
|
@@ -1461,12 +1478,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1461
1478
|
// column
|
|
1462
1479
|
recordTitleColumn: (_d = ((_c = (_b = structure.find(function (eachDS) { return eachDS.id === "title"; })) !== null && _b !== void 0 ? _b : structure.find(function (eachDS) { return eachDS.id === "name"; })) !== null && _c !== void 0 ? _c : structure.find(function (eachDS) { return eachDS.type === "string"; }))) === null || _d === void 0 ? void 0 : _d.id, model: structure }));
|
|
1463
1480
|
};
|
|
1464
|
-
var customPaginationSize = ((
|
|
1481
|
+
var customPaginationSize = ((_68 = props.organise) === null || _68 === void 0 ? void 0 : _68.customPaginationCount)
|
|
1465
1482
|
? props.organise.customPaginationCount(size)
|
|
1466
1483
|
: undefined;
|
|
1467
1484
|
//TODO : Code - Pass ...devSettings, search dbEndpoint:
|
|
1468
1485
|
var writeServerQuery = new writeQuery_1.WriteQuery({
|
|
1469
|
-
dbModule: (
|
|
1486
|
+
dbModule: (_69 = props.lib) === null || _69 === void 0 ? void 0 : _69.axios,
|
|
1470
1487
|
dbType: devSettings.server,
|
|
1471
1488
|
dbCollection: props.collectionId,
|
|
1472
1489
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -1474,7 +1491,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1474
1491
|
dbUserToken: devSettings.dbUserToken,
|
|
1475
1492
|
});
|
|
1476
1493
|
var readServerQuery = new readQuery_1.ReadQuery({
|
|
1477
|
-
dbModule: (
|
|
1494
|
+
dbModule: (_70 = props.lib) === null || _70 === void 0 ? void 0 : _70.axios,
|
|
1478
1495
|
dbType: devSettings.server,
|
|
1479
1496
|
dbCollection: props.collectionId,
|
|
1480
1497
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -1482,12 +1499,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1482
1499
|
dbUserToken: devSettings.dbUserToken,
|
|
1483
1500
|
});
|
|
1484
1501
|
var moreButtonPopUp = [
|
|
1485
|
-
((
|
|
1502
|
+
((_71 = props.edit) === null || _71 === void 0 ? void 0 : _71.allEditable) &&
|
|
1486
1503
|
// INFO: the import runs on the server (importEndpoint), so a Firestore
|
|
1487
1504
|
// datasheet served through one can import; only the browser-direct
|
|
1488
1505
|
// Firebase client has no server to import through
|
|
1489
1506
|
!isFirebaseClient &&
|
|
1490
|
-
!((
|
|
1507
|
+
!((_73 = (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.exportSettings) === null || _73 === void 0 ? void 0 : _73.hideImportCSV)
|
|
1491
1508
|
? {
|
|
1492
1509
|
text: "Import Excel",
|
|
1493
1510
|
onClick: function () {
|
|
@@ -1496,7 +1513,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1496
1513
|
},
|
|
1497
1514
|
}
|
|
1498
1515
|
: null,
|
|
1499
|
-
!((
|
|
1516
|
+
!((_75 = (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.exportSettings) === null || _75 === void 0 ? void 0 : _75.hideExportCSV)
|
|
1500
1517
|
? {
|
|
1501
1518
|
text: "Export CSV",
|
|
1502
1519
|
onClick: function () {
|
|
@@ -1506,7 +1523,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1506
1523
|
},
|
|
1507
1524
|
}
|
|
1508
1525
|
: null,
|
|
1509
|
-
!((
|
|
1526
|
+
!((_77 = (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.exportSettings) === null || _77 === void 0 ? void 0 : _77.hideExportExcel)
|
|
1510
1527
|
? {
|
|
1511
1528
|
text: "Export Excel",
|
|
1512
1529
|
onClick: function () {
|
|
@@ -1516,7 +1533,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1516
1533
|
},
|
|
1517
1534
|
}
|
|
1518
1535
|
: null,
|
|
1519
|
-
!((
|
|
1536
|
+
!((_79 = (_78 = props.organise) === null || _78 === void 0 ? void 0 : _78.exportSettings) === null || _79 === void 0 ? void 0 : _79.hideExportPDF)
|
|
1520
1537
|
? {
|
|
1521
1538
|
text: "Export PDF",
|
|
1522
1539
|
onClick: function () {
|
|
@@ -1526,7 +1543,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1526
1543
|
},
|
|
1527
1544
|
}
|
|
1528
1545
|
: null,
|
|
1529
|
-
!((
|
|
1546
|
+
!((_81 = (_80 = props.organise) === null || _80 === void 0 ? void 0 : _80.exportSettings) === null || _81 === void 0 ? void 0 : _81.hideExportQR)
|
|
1530
1547
|
? {
|
|
1531
1548
|
text: "Export QR",
|
|
1532
1549
|
onClick: function () {
|
|
@@ -1536,7 +1553,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1536
1553
|
},
|
|
1537
1554
|
}
|
|
1538
1555
|
: null,
|
|
1539
|
-
!((
|
|
1556
|
+
!((_83 = (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.exportSettings) === null || _83 === void 0 ? void 0 : _83.hideExportQR)
|
|
1540
1557
|
? {
|
|
1541
1558
|
text: "Export QR(Data)",
|
|
1542
1559
|
onClick: function () {
|
|
@@ -1546,7 +1563,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1546
1563
|
},
|
|
1547
1564
|
}
|
|
1548
1565
|
: null,
|
|
1549
|
-
!((
|
|
1566
|
+
!((_85 = (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.exportSettings) === null || _85 === void 0 ? void 0 : _85.hideExportPrint)
|
|
1550
1567
|
? {
|
|
1551
1568
|
text: "Print",
|
|
1552
1569
|
onClick: function () {
|
|
@@ -1558,8 +1575,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1558
1575
|
: null,
|
|
1559
1576
|
// INFO: drafts only exist where the form can save one, so the filter has
|
|
1560
1577
|
// nothing to find on any other page
|
|
1561
|
-
((
|
|
1562
|
-
!((
|
|
1578
|
+
((_86 = props.edit) === null || _86 === void 0 ? void 0 : _86.enableUpdateDraft) &&
|
|
1579
|
+
!((_88 = (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.exportSettings) === null || _88 === void 0 ? void 0 : _88.hideExportDraft)
|
|
1563
1580
|
? {
|
|
1564
1581
|
text: filterDraft ? "Show All Items" : "Filter Draft",
|
|
1565
1582
|
onClick: function () {
|
|
@@ -1568,7 +1585,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1568
1585
|
}
|
|
1569
1586
|
: null,
|
|
1570
1587
|
].filter(Boolean);
|
|
1571
|
-
if ((
|
|
1588
|
+
if ((_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.moreSettings)
|
|
1572
1589
|
moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
|
|
1573
1590
|
//=====================================================================================
|
|
1574
1591
|
//SECTION: User Column Visibility Handlers
|
|
@@ -2007,20 +2024,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2007
2024
|
// INFO: scroll mode reloads from page 0; the anchor restores the position
|
|
2008
2025
|
pageIndex: renderCheckScrollMode() ? 0 : pageIndex, hiddenColumnIds: structure.filter(function (col) { return col.hide; }).map(function (col) { return col.id; }),
|
|
2009
2026
|
// INFO: raw, so switching bareViewSettings off does not wipe the user's choice
|
|
2010
|
-
userHiddenColumnIds: userHiddenColumnIds, shownSystemColumnIds: shownSystemColumnIds, columnOrder: structure.map(function (col) { return col.id; }), columnWidths: columnWidths, laneWidths: laneWidths, drawerWidth: drawerWidth, pinnedColumnIds: pinnedColumnIds, groupBy: groupId !== null && groupId !== void 0 ? groupId : "" }, scrollCaptureRef.current));
|
|
2027
|
+
userHiddenColumnIds: userHiddenColumnIds, shownSystemColumnIds: shownSystemColumnIds, columnOrder: structure.map(function (col) { return col.id; }), columnWidths: columnWidths, laneWidths: laneWidths, drawerWidth: drawerWidth, pinnedColumnIds: pinnedColumnIds, groupBy: groupId !== null && groupId !== void 0 ? groupId : "", groupOrder: groupId ? groupOrder : "" }, scrollCaptureRef.current));
|
|
2011
2028
|
};
|
|
2012
2029
|
handleRegisterViewSnapshot(handleBuildViewSnapshot);
|
|
2013
2030
|
//=====================================================================================
|
|
2014
2031
|
//SECTION: Saved Views
|
|
2015
2032
|
//=====================================================================================
|
|
2016
|
-
var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (
|
|
2033
|
+
var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.persistKey, (_91 = devSettings.currentUser) === null || _91 === void 0 ? void 0 : _91.userEmail);
|
|
2017
2034
|
(0, react_1.useEffect)(function () {
|
|
2018
2035
|
if (isSavedViewsEnabled && !isAppViews)
|
|
2019
2036
|
setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
|
|
2020
2037
|
}, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
|
|
2021
2038
|
// INFO: the app keeps All's settings, so every change is kept in this
|
|
2022
2039
|
// browser until the person updates the view for everyone or resets it
|
|
2023
|
-
var isViewDraftsEnabled = isSavedViewsEnabled && ((
|
|
2040
|
+
var isViewDraftsEnabled = isSavedViewsEnabled && ((_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.allView) !== undefined;
|
|
2024
2041
|
var handleGetViewDraftKey = function (viewId) {
|
|
2025
2042
|
var _a, _b;
|
|
2026
2043
|
return (0, viewStatePersistence_1.buildViewDraftKey)(props.collectionId, viewId !== null && viewId !== void 0 ? viewId : "all", (_a = props.organise) === null || _a === void 0 ? void 0 : _a.persistKey, (_b = devSettings.currentUser) === null || _b === void 0 ? void 0 : _b.userEmail);
|
|
@@ -2149,7 +2166,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2149
2166
|
var lastSentSharedViewsRef = (0, react_1.useRef)(null);
|
|
2150
2167
|
(0, react_1.useEffect)(function () {
|
|
2151
2168
|
lastSentSharedViewsRef.current = null;
|
|
2152
|
-
}, [(
|
|
2169
|
+
}, [(_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.sharedViews]);
|
|
2153
2170
|
var handleStoreSharedViews = function (update) {
|
|
2154
2171
|
var _a, _b, _c;
|
|
2155
2172
|
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
|
|
@@ -2166,15 +2183,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2166
2183
|
var openingViewSettledRef = (0, react_1.useRef)(false);
|
|
2167
2184
|
// INFO: keyed on the ids, so a list handed in again on every render does
|
|
2168
2185
|
// not re-run the opening
|
|
2169
|
-
var starredViewIdsKey = ((
|
|
2186
|
+
var starredViewIdsKey = ((_95 = (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.defaultSavedViewIds) !== null && _95 !== void 0 ? _95 : []).join("|");
|
|
2170
2187
|
(0, react_1.useEffect)(function () {
|
|
2171
|
-
var _a, _b, _c, _d;
|
|
2188
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2172
2189
|
if (!isSavedViewsEnabled || openingViewSettledRef.current)
|
|
2173
2190
|
return;
|
|
2174
|
-
// INFO: a link opens on All with only its keyword, never on a
|
|
2175
|
-
|
|
2191
|
+
// INFO: a link opens on All with only its keyword or filters, never on a
|
|
2192
|
+
// ★ view
|
|
2193
|
+
if (isLinkOpen &&
|
|
2194
|
+
(((_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSearch) || ((_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.linkFlexFilters) === null || _c === void 0 ? void 0 : _c.length))) {
|
|
2176
2195
|
openingViewSettledRef.current = true;
|
|
2177
|
-
handleApplySavedView(null, true,
|
|
2196
|
+
handleApplySavedView(null, true,
|
|
2197
|
+
// INFO: the keyword only where there is a Quick find box to show it
|
|
2198
|
+
handleCanInitialSearch((_d = props.organise) === null || _d === void 0 ? void 0 : _d.additionalQuery)
|
|
2199
|
+
? (_e = props.organise) === null || _e === void 0 ? void 0 : _e.initialSearch
|
|
2200
|
+
: undefined, undefined, (_f = props.organise) === null || _f === void 0 ? void 0 : _f.linkFlexFilters);
|
|
2178
2201
|
setIsViewDraftReady(true);
|
|
2179
2202
|
return;
|
|
2180
2203
|
}
|
|
@@ -2183,7 +2206,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2183
2206
|
setIsViewDraftReady(true);
|
|
2184
2207
|
return;
|
|
2185
2208
|
}
|
|
2186
|
-
var wantedId = (
|
|
2209
|
+
var wantedId = (_h = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.initialSavedViewId) !== null && _h !== void 0 ? _h : handleGetStarredViewId();
|
|
2187
2210
|
if (!wantedId) {
|
|
2188
2211
|
// INFO: All opens with its stored settings and this person's changes
|
|
2189
2212
|
if (isViewDraftsEnabled) {
|
|
@@ -2194,7 +2217,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2194
2217
|
return;
|
|
2195
2218
|
}
|
|
2196
2219
|
// INFO: the app's views may still be loading
|
|
2197
|
-
if (isAppViews && ((
|
|
2220
|
+
if (isAppViews && ((_j = props.organise) === null || _j === void 0 ? void 0 : _j.sharedViews) === undefined)
|
|
2198
2221
|
return;
|
|
2199
2222
|
openingViewSettledRef.current = true;
|
|
2200
2223
|
var view = handleGetTabSavedViews().find(function (eachView) { return eachView.id === wantedId; });
|
|
@@ -2204,13 +2227,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2204
2227
|
/* eslint-disable */
|
|
2205
2228
|
}, [
|
|
2206
2229
|
isSavedViewsEnabled,
|
|
2207
|
-
(
|
|
2230
|
+
(_96 = props.organise) === null || _96 === void 0 ? void 0 : _96.initialSavedViewId,
|
|
2208
2231
|
starredViewIdsKey,
|
|
2209
|
-
(
|
|
2232
|
+
(_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.sharedViews,
|
|
2210
2233
|
savedViews,
|
|
2211
2234
|
]);
|
|
2212
2235
|
/* eslint-enable */
|
|
2213
|
-
var appDefaultViewIds = ((
|
|
2236
|
+
var appDefaultViewIds = ((_99 = (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.defaultSavedViews) !== null && _99 !== void 0 ? _99 : [])
|
|
2214
2237
|
.map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
|
|
2215
2238
|
.join("|");
|
|
2216
2239
|
// INFO: keyed on the ids, not the array, so an inline literal passed on every
|
|
@@ -2284,11 +2307,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2284
2307
|
};
|
|
2285
2308
|
// INFO: notify — only a user's choice is handed back; a list opening on a
|
|
2286
2309
|
// view or syncing the host's own groupBy tells the host nothing new
|
|
2310
|
+
// INFO: ordering groups applies where the rows are drawn in group sections
|
|
2311
|
+
// — the table, a list and a grid — not to a map's routes or a timeline's
|
|
2312
|
+
// colours
|
|
2313
|
+
var handleCheckGroupOrderShown = function () {
|
|
2314
|
+
var _a;
|
|
2315
|
+
return !!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW) &&
|
|
2316
|
+
!handleCheckLookupGroupBy() &&
|
|
2317
|
+
(!(selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) ||
|
|
2318
|
+
["general", "table", "report", "list", "grid"].includes(selectedTab.viewType));
|
|
2319
|
+
};
|
|
2287
2320
|
var handleChangeGroupBy = function (value, notify) {
|
|
2288
2321
|
var _a, _b;
|
|
2289
2322
|
if (value === (groupId !== null && groupId !== void 0 ? groupId : ""))
|
|
2290
2323
|
return;
|
|
2291
2324
|
setGroupId(value);
|
|
2325
|
+
if (!value)
|
|
2326
|
+
setGroupOrder("");
|
|
2292
2327
|
if (notify)
|
|
2293
2328
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeGroupBy) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
|
2294
2329
|
};
|
|
@@ -2298,15 +2333,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2298
2333
|
// INFO: linkSearch — the list opens as a fresh datasheet with only that
|
|
2299
2334
|
// keyword: All's columns and sort, none of its filters, and no draft.
|
|
2300
2335
|
// restoredState — the state persistViewState kept, applied in place of a view
|
|
2301
|
-
var handleApplySavedView = function (view, isOpening, linkSearch, restoredState) {
|
|
2302
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
2336
|
+
var handleApplySavedView = function (view, isOpening, linkSearch, restoredState, linkFlexFilters) {
|
|
2337
|
+
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;
|
|
2303
2338
|
var next;
|
|
2304
|
-
if (linkSearch) {
|
|
2339
|
+
if (linkSearch || (linkFlexFilters === null || linkFlexFilters === void 0 ? void 0 : linkFlexFilters.length)) {
|
|
2305
2340
|
// INFO: the filter keys are left out, not set to undefined, so the
|
|
2306
2341
|
// app's own additionalQuery defaults still apply
|
|
2307
|
-
var
|
|
2342
|
+
var _0 = (_a = handleGetStoredViewState(null)) !== null && _a !== void 0 ? _a : {}, _search = _0.filterSearchParams, _selection = _0.filterSelection, _reference = _0.filterReference, _date = _0.filterReferenceDate, _flex = _0.flexFilters, allLayout = __rest(_0, ["filterSearchParams", "filterSelection", "filterReference", "filterReferenceDate", "flexFilters"]);
|
|
2308
2343
|
next = handleResolveViewState(allLayout);
|
|
2309
|
-
next = __assign(__assign(
|
|
2344
|
+
next = __assign(__assign(__assign({}, next), (linkSearch
|
|
2345
|
+
? {
|
|
2346
|
+
filterSearchParams: __assign(__assign({}, next.filterSearchParams), { search: linkSearch }),
|
|
2347
|
+
}
|
|
2348
|
+
: {})), ((linkFlexFilters === null || linkFlexFilters === void 0 ? void 0 : linkFlexFilters.length) ? { flexFilters: linkFlexFilters } : {}));
|
|
2310
2349
|
}
|
|
2311
2350
|
else if (restoredState) {
|
|
2312
2351
|
next = handleResolveViewState(restoredState);
|
|
@@ -2343,10 +2382,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2343
2382
|
if (next.pageLimit)
|
|
2344
2383
|
setPageLimit(next.pageLimit);
|
|
2345
2384
|
handleChangeGroupBy((_l = next.groupBy) !== null && _l !== void 0 ? _l : "", !isOpening);
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2385
|
+
setGroupOrder((_m = next.groupOrder) !== null && _m !== void 0 ? _m : "");
|
|
2386
|
+
setUserHiddenColumnIds((_o = next.userHiddenColumnIds) !== null && _o !== void 0 ? _o : []);
|
|
2387
|
+
setShownSystemColumnIds((_p = next.shownSystemColumnIds) !== null && _p !== void 0 ? _p : []);
|
|
2388
|
+
setColumnWidths((_q = next.columnWidths) !== null && _q !== void 0 ? _q : {});
|
|
2389
|
+
setLaneWidths((_r = next.laneWidths) !== null && _r !== void 0 ? _r : {});
|
|
2350
2390
|
setDrawerWidth(next.drawerWidth);
|
|
2351
2391
|
setPinnedColumnIds(next.pinnedColumnIds);
|
|
2352
2392
|
if (view) {
|
|
@@ -2363,12 +2403,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2363
2403
|
pendingViewCondKeyRef.current = JSON.stringify(handleReadQueryHocCond());
|
|
2364
2404
|
handleClearDataByFilter();
|
|
2365
2405
|
if (pageIndex !== 0)
|
|
2366
|
-
(
|
|
2367
|
-
(
|
|
2406
|
+
(_t = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.onChangePagination) === null || _t === void 0 ? void 0 : _t.call(_s, 0);
|
|
2407
|
+
(_v = (_u = props.bareSettings) === null || _u === void 0 ? void 0 : _u.bareListHandleFilter) === null || _v === void 0 ? void 0 : _v.call(_u, (_w = next.filterSearchParams) !== null && _w !== void 0 ? _w : {}, (_x = next.filterSelection) !== null && _x !== void 0 ? _x : {}, next.filterReferenceDate
|
|
2368
2408
|
? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
|
|
2369
|
-
: initialFilterReferenceDate, (
|
|
2409
|
+
: initialFilterReferenceDate, (_y = next.filterReference) !== null && _y !== void 0 ? _y : {});
|
|
2370
2410
|
}
|
|
2371
|
-
setActiveSavedViewId((
|
|
2411
|
+
setActiveSavedViewId((_z = view === null || view === void 0 ? void 0 : view.id) !== null && _z !== void 0 ? _z : null);
|
|
2372
2412
|
setDeletingSavedViewId(null);
|
|
2373
2413
|
};
|
|
2374
2414
|
// INFO: re-read storage before each write so a change made in another browser
|
|
@@ -2617,12 +2657,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2617
2657
|
shownSystemColumnIds,
|
|
2618
2658
|
pageLimit,
|
|
2619
2659
|
groupId,
|
|
2660
|
+
groupOrder,
|
|
2620
2661
|
columnWidths,
|
|
2621
2662
|
laneWidths,
|
|
2622
2663
|
drawerWidth,
|
|
2623
2664
|
pinnedColumnIds,
|
|
2624
|
-
(
|
|
2625
|
-
(
|
|
2665
|
+
(_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.allView,
|
|
2666
|
+
(_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.sharedViews,
|
|
2626
2667
|
savedViews,
|
|
2627
2668
|
]);
|
|
2628
2669
|
/* eslint-enable */
|
|
@@ -2666,7 +2707,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2666
2707
|
if (scrollRestoredRef.current)
|
|
2667
2708
|
scrollCatchUpRef.current = null;
|
|
2668
2709
|
/* eslint-disable */
|
|
2669
|
-
}, [props.collectionId, (
|
|
2710
|
+
}, [props.collectionId, (_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.persistKey]);
|
|
2670
2711
|
/* eslint-enable */
|
|
2671
2712
|
// INFO: wait a frame — rows land in state one tick before layout
|
|
2672
2713
|
(0, react_1.useEffect)(function () {
|
|
@@ -2701,7 +2742,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2701
2742
|
(0, react_1.useEffect)(function () {
|
|
2702
2743
|
handleOfflinePrefetch();
|
|
2703
2744
|
/* eslint-disable */
|
|
2704
|
-
}, [props.collectionId, (
|
|
2745
|
+
}, [props.collectionId, (_103 = props.bareSettings) === null || _103 === void 0 ? void 0 : _103.bareOffline]);
|
|
2705
2746
|
/* eslint-enable */
|
|
2706
2747
|
// INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
|
|
2707
2748
|
// Calls through handleRefreshRef so the interval always dispatches the latest
|
|
@@ -2721,7 +2762,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2721
2762
|
}, interval);
|
|
2722
2763
|
return function () { return clearInterval(timer); };
|
|
2723
2764
|
/* eslint-disable */
|
|
2724
|
-
}, [(
|
|
2765
|
+
}, [(_104 = props.bareSettings) === null || _104 === void 0 ? void 0 : _104.barePollingInterval, isLive, isNetworkOffline]);
|
|
2725
2766
|
/* eslint-enable */
|
|
2726
2767
|
// INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
|
|
2727
2768
|
// EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
|
|
@@ -2763,7 +2804,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2763
2804
|
};
|
|
2764
2805
|
/* eslint-disable */
|
|
2765
2806
|
}, [
|
|
2766
|
-
(
|
|
2807
|
+
(_105 = props.bareSettings) === null || _105 === void 0 ? void 0 : _105.bareSocketName,
|
|
2767
2808
|
props.collectionId,
|
|
2768
2809
|
props.devSettings.sseEndpoint,
|
|
2769
2810
|
props.devSettings.dbAPIToken,
|
|
@@ -3037,10 +3078,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
3037
3078
|
props.collectionId,
|
|
3038
3079
|
props.model,
|
|
3039
3080
|
props.localURLEndpoint,
|
|
3040
|
-
(
|
|
3081
|
+
(_106 = props.organise) === null || _106 === void 0 ? void 0 : _106.extendedTabs,
|
|
3041
3082
|
listViewId,
|
|
3042
|
-
(
|
|
3043
|
-
(
|
|
3083
|
+
(_107 = props.organise) === null || _107 === void 0 ? void 0 : _107.additionalQuery,
|
|
3084
|
+
(_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.groupBy,
|
|
3044
3085
|
resolvedType,
|
|
3045
3086
|
]);
|
|
3046
3087
|
/**
|
|
@@ -3192,7 +3233,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
3192
3233
|
};
|
|
3193
3234
|
}, 100);
|
|
3194
3235
|
return function () { return clearTimeout(timeoutId); };
|
|
3195
|
-
}, [(
|
|
3236
|
+
}, [(_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.showReadFloatingNav, resolvedType, props.id, loading]);
|
|
3196
3237
|
(0, react_1.useEffect)(function () {
|
|
3197
3238
|
if (resolvedType !== "read")
|
|
3198
3239
|
return;
|
|
@@ -4771,7 +4812,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4771
4812
|
// the link view ends and the list opens as it normally would. A change
|
|
4772
4813
|
// while a record is open (opening one drops the link from the URL) waits
|
|
4773
4814
|
// until the list shows again
|
|
4774
|
-
var lastInitialSearchRef = (0, react_1.useRef)((
|
|
4815
|
+
var lastInitialSearchRef = (0, react_1.useRef)((_110 = props.organise) === null || _110 === void 0 ? void 0 : _110.initialSearch);
|
|
4775
4816
|
// INFO: persistViewState reads its stored state only once the link view
|
|
4776
4817
|
// has ended, a render later
|
|
4777
4818
|
var isNormalOpenPendingRef = (0, react_1.useRef)(false);
|
|
@@ -4798,7 +4839,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4798
4839
|
setIsLinkOpen(true);
|
|
4799
4840
|
handleApplySavedView(null, true, value);
|
|
4800
4841
|
/* eslint-disable */
|
|
4801
|
-
}, [(
|
|
4842
|
+
}, [(_111 = props.organise) === null || _111 === void 0 ? void 0 : _111.initialSearch, resolvedType]);
|
|
4802
4843
|
(0, react_1.useEffect)(function () {
|
|
4803
4844
|
if (!isNormalOpenPendingRef.current || isLinkOpen)
|
|
4804
4845
|
return;
|
|
@@ -5892,7 +5933,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5892
5933
|
/* eslint-disable-next-line */
|
|
5893
5934
|
}, [selectAllFilterKey]);
|
|
5894
5935
|
var handleMultipleRemoveSelectedData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
5895
|
-
var passcodeMatch, offlineDataResp, offlineData, filteredData, ids, notReferenceId, query, responseData, formulaKeptIds_1, matchedRows, deleteIds, start, responseData, data, uploadEndpoint,
|
|
5936
|
+
var passcodeMatch, offlineDataResp, offlineData, filteredData, ids, notReferenceId, query, responseData, formulaKeptIds_1, matchedRows, deleteIds, deletedIds, start, chunk, err_12, responseData, data, uploadEndpoint, err_13;
|
|
5896
5937
|
var _a, _b, _c, _d, _e;
|
|
5897
5938
|
return __generator(this, function (_f) {
|
|
5898
5939
|
switch (_f.label) {
|
|
@@ -5903,11 +5944,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5903
5944
|
setDeleting(true);
|
|
5904
5945
|
_f.label = 1;
|
|
5905
5946
|
case 1:
|
|
5906
|
-
_f.trys.push([1,
|
|
5947
|
+
_f.trys.push([1, 24, 25, 26]);
|
|
5907
5948
|
setLoading(true);
|
|
5908
5949
|
setModalVisible(true);
|
|
5909
5950
|
passcodeMatch = deletePasscodeInput === deletePasscode;
|
|
5910
|
-
if (!passcodeMatch) return [3 /*break*/,
|
|
5951
|
+
if (!passcodeMatch) return [3 /*break*/, 22];
|
|
5911
5952
|
if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareOffline)) return [3 /*break*/, 4];
|
|
5912
5953
|
return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
|
|
5913
5954
|
case 2:
|
|
@@ -5922,11 +5963,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5922
5963
|
})];
|
|
5923
5964
|
case 3:
|
|
5924
5965
|
_f.sent();
|
|
5925
|
-
return [3 /*break*/,
|
|
5966
|
+
return [3 /*break*/, 21];
|
|
5926
5967
|
case 4:
|
|
5927
5968
|
ids = [];
|
|
5928
5969
|
notReferenceId = [];
|
|
5929
|
-
if (!selectAll) return [3 /*break*/,
|
|
5970
|
+
if (!selectAll) return [3 /*break*/, 13];
|
|
5930
5971
|
query = renderImpSearchFilterConditions();
|
|
5931
5972
|
return [4 /*yield*/, readServerQuery.call({
|
|
5932
5973
|
type: "list",
|
|
@@ -5955,23 +5996,37 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5955
5996
|
case 6:
|
|
5956
5997
|
notReferenceId = _f.sent();
|
|
5957
5998
|
deleteIds = notReferenceId !== null && notReferenceId !== void 0 ? notReferenceId : [];
|
|
5999
|
+
deletedIds = [];
|
|
5958
6000
|
start = 0;
|
|
5959
6001
|
_f.label = 7;
|
|
5960
6002
|
case 7:
|
|
5961
|
-
if (!(start < deleteIds.length)) return [3 /*break*/,
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
})];
|
|
6003
|
+
if (!(start < deleteIds.length)) return [3 /*break*/, 12];
|
|
6004
|
+
chunk = deleteIds.slice(start, start + DELETE_ID_CHUNK);
|
|
6005
|
+
_f.label = 8;
|
|
5965
6006
|
case 8:
|
|
5966
|
-
_f.
|
|
5967
|
-
|
|
6007
|
+
_f.trys.push([8, 10, , 11]);
|
|
6008
|
+
return [4 /*yield*/, writeServerQuery.call("batchDelete", { id: chunk })];
|
|
5968
6009
|
case 9:
|
|
6010
|
+
_f.sent();
|
|
6011
|
+
deletedIds.push.apply(deletedIds, chunk);
|
|
6012
|
+
return [3 /*break*/, 11];
|
|
6013
|
+
case 10:
|
|
6014
|
+
err_12 = _f.sent();
|
|
6015
|
+
// INFO: a part that fails stops the rest, and says how far it
|
|
6016
|
+
// got — the parts before it are already gone
|
|
6017
|
+
setNotification({
|
|
6018
|
+
type: false,
|
|
6019
|
+
title: "Delete stopped",
|
|
6020
|
+
msg: "".concat(deletedIds.length.toLocaleString(), " of ").concat(deleteIds.length.toLocaleString(), " records were deleted before an error. Refresh to see what is left."),
|
|
6021
|
+
});
|
|
6022
|
+
return [3 /*break*/, 12];
|
|
6023
|
+
case 11:
|
|
5969
6024
|
start += DELETE_ID_CHUNK;
|
|
5970
6025
|
return [3 /*break*/, 7];
|
|
5971
|
-
case
|
|
5972
|
-
ids =
|
|
5973
|
-
return [3 /*break*/,
|
|
5974
|
-
case
|
|
6026
|
+
case 12:
|
|
6027
|
+
ids = deletedIds;
|
|
6028
|
+
return [3 /*break*/, 18];
|
|
6029
|
+
case 13: return [4 /*yield*/, readServerQuery.call({
|
|
5975
6030
|
type: "list",
|
|
5976
6031
|
query: [
|
|
5977
6032
|
{
|
|
@@ -5982,18 +6037,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5982
6037
|
],
|
|
5983
6038
|
stopLimit: true,
|
|
5984
6039
|
})];
|
|
5985
|
-
case
|
|
6040
|
+
case 14:
|
|
5986
6041
|
responseData = _f.sent();
|
|
5987
6042
|
return [4 /*yield*/, handleCheckDeleteReference((_d = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _d !== void 0 ? _d : [], true)];
|
|
5988
|
-
case
|
|
6043
|
+
case 15:
|
|
5989
6044
|
notReferenceId = _f.sent();
|
|
6045
|
+
if (!((notReferenceId !== null && notReferenceId !== void 0 ? notReferenceId : []).length > 0)) return [3 /*break*/, 17];
|
|
5990
6046
|
return [4 /*yield*/, writeServerQuery.call("batchDelete", {
|
|
5991
6047
|
id: notReferenceId,
|
|
5992
6048
|
})];
|
|
5993
|
-
case
|
|
5994
|
-
|
|
5995
|
-
_f.label =
|
|
5996
|
-
case
|
|
6049
|
+
case 16:
|
|
6050
|
+
_f.sent();
|
|
6051
|
+
_f.label = 17;
|
|
6052
|
+
case 17:
|
|
6053
|
+
ids = notReferenceId !== null && notReferenceId !== void 0 ? notReferenceId : [];
|
|
6054
|
+
_f.label = 18;
|
|
6055
|
+
case 18:
|
|
6056
|
+
if (!((ids !== null && ids !== void 0 ? ids : []).length > 0)) return [3 /*break*/, 20];
|
|
5997
6057
|
data = new FormData();
|
|
5998
6058
|
data.append("data[assetCollectionName]", props.collectionId);
|
|
5999
6059
|
data.append("data[assetParentId]", JSON.stringify(ids !== null && ids !== void 0 ? ids : []));
|
|
@@ -6008,13 +6068,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6008
6068
|
url: "".concat(uploadEndpoint, "/batchDeleteDirectory"),
|
|
6009
6069
|
headers: { "Content-Type": "multipart/form-data" },
|
|
6010
6070
|
}))];
|
|
6011
|
-
case
|
|
6071
|
+
case 19:
|
|
6012
6072
|
_f.sent();
|
|
6073
|
+
_f.label = 20;
|
|
6074
|
+
case 20:
|
|
6013
6075
|
if (mapViewRef.current)
|
|
6014
6076
|
mapViewRef.current.handleClearPolygons();
|
|
6015
|
-
_f.label =
|
|
6016
|
-
case
|
|
6017
|
-
case
|
|
6077
|
+
_f.label = 21;
|
|
6078
|
+
case 21: return [3 /*break*/, 23];
|
|
6079
|
+
case 22:
|
|
6018
6080
|
setNotification({
|
|
6019
6081
|
type: false,
|
|
6020
6082
|
title: "Incorrect Passcode",
|
|
@@ -6023,15 +6085,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6023
6085
|
setLoading(false);
|
|
6024
6086
|
setModalVisible(false);
|
|
6025
6087
|
return [2 /*return*/];
|
|
6026
|
-
case
|
|
6027
|
-
case
|
|
6028
|
-
|
|
6029
|
-
return [3 /*break*/,
|
|
6030
|
-
case
|
|
6088
|
+
case 23: return [3 /*break*/, 26];
|
|
6089
|
+
case 24:
|
|
6090
|
+
err_13 = _f.sent();
|
|
6091
|
+
return [3 /*break*/, 26];
|
|
6092
|
+
case 25:
|
|
6031
6093
|
deletingRef.current = false;
|
|
6032
6094
|
setDeleting(false);
|
|
6033
6095
|
return [7 /*endfinally*/];
|
|
6034
|
-
case
|
|
6096
|
+
case 26:
|
|
6035
6097
|
setDeletePasscodeInput("");
|
|
6036
6098
|
// INFO: the selection is gone with the rows it covered
|
|
6037
6099
|
if (selectAll)
|
|
@@ -6042,7 +6104,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6042
6104
|
});
|
|
6043
6105
|
}); };
|
|
6044
6106
|
var handleRemoveSelectedData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6045
|
-
var deleted, deletable, selectedId_1, deleteIds, res, offlineDataResp, offlineData, selectedIndex_2, doc,
|
|
6107
|
+
var deleted, deletable, selectedId_1, deleteIds, res, offlineDataResp, offlineData, selectedIndex_2, doc, err_14;
|
|
6046
6108
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
6047
6109
|
return __generator(this, function (_k) {
|
|
6048
6110
|
switch (_k.label) {
|
|
@@ -6140,7 +6202,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6140
6202
|
_k.label = 13;
|
|
6141
6203
|
case 13: return [3 /*break*/, 16];
|
|
6142
6204
|
case 14:
|
|
6143
|
-
|
|
6205
|
+
err_14 = _k.sent();
|
|
6144
6206
|
setDeleteModal(false);
|
|
6145
6207
|
setDeleteFeedId("");
|
|
6146
6208
|
return [3 /*break*/, 16];
|
|
@@ -6162,21 +6224,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6162
6224
|
});
|
|
6163
6225
|
}); };
|
|
6164
6226
|
var handleCheckDeleteReference = function (selectedData, multipleDelete) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6165
|
-
var existDataIds, existsData, handleFindReference_1, referenceSources_1,
|
|
6227
|
+
var existDataIds, existsData, handleFindReference_1, referenceSources_1, err_15;
|
|
6166
6228
|
var _a, _b, _c;
|
|
6167
6229
|
return __generator(this, function (_d) {
|
|
6168
6230
|
switch (_d.label) {
|
|
6169
6231
|
case 0:
|
|
6170
6232
|
existDataIds = [];
|
|
6171
|
-
existsData =
|
|
6233
|
+
existsData = [];
|
|
6172
6234
|
_d.label = 1;
|
|
6173
6235
|
case 1:
|
|
6174
6236
|
_d.trys.push([1, 4, , 5]);
|
|
6175
6237
|
handleFindReference_1 = function (data, referenceStructure, space, spaceId, spaceName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6176
6238
|
var referenceRQ, currentReferenceSelectedList;
|
|
6177
|
-
var _a, _b, _c
|
|
6178
|
-
return __generator(this, function (
|
|
6179
|
-
switch (
|
|
6239
|
+
var _a, _b, _c;
|
|
6240
|
+
return __generator(this, function (_d) {
|
|
6241
|
+
switch (_d.label) {
|
|
6180
6242
|
case 0:
|
|
6181
6243
|
referenceRQ = new readQuery_1.ReadQuery({
|
|
6182
6244
|
dbModule: dbModule,
|
|
@@ -6193,19 +6255,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6193
6255
|
],
|
|
6194
6256
|
})];
|
|
6195
6257
|
case 1:
|
|
6196
|
-
currentReferenceSelectedList =
|
|
6258
|
+
currentReferenceSelectedList = _d.sent();
|
|
6197
6259
|
if ((currentReferenceSelectedList === null || currentReferenceSelectedList === void 0 ? void 0 : currentReferenceSelectedList.data) &&
|
|
6198
6260
|
(currentReferenceSelectedList === null || currentReferenceSelectedList === void 0 ? void 0 : currentReferenceSelectedList.data.length) > 0) {
|
|
6199
6261
|
if (!existDataIds.includes(data[serverId]))
|
|
6200
6262
|
existDataIds.push(data[serverId]);
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
]
|
|
6208
|
-
|
|
6263
|
+
existsData.push({
|
|
6264
|
+
collectionId: space ? space._id : (spaceId !== null && spaceId !== void 0 ? spaceId : ""),
|
|
6265
|
+
collectionName: space ? space.name : (spaceName !== null && spaceName !== void 0 ? spaceName : ""),
|
|
6266
|
+
columnId: referenceStructure.id,
|
|
6267
|
+
columnType: referenceStructure.type,
|
|
6268
|
+
recordId: data[serverId],
|
|
6269
|
+
recordLabel: String((_b = data[(_a = referenceStructure === null || referenceStructure === void 0 ? void 0 : referenceStructure.referenceLabel) !== null && _a !== void 0 ? _a : ""]) !== null && _b !== void 0 ? _b : data[serverId]),
|
|
6270
|
+
count: (_c = currentReferenceSelectedList.count) !== null && _c !== void 0 ? _c : currentReferenceSelectedList.data.length,
|
|
6271
|
+
});
|
|
6209
6272
|
}
|
|
6210
6273
|
return [2 /*return*/];
|
|
6211
6274
|
}
|
|
@@ -6247,10 +6310,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6247
6310
|
_d.sent();
|
|
6248
6311
|
return [3 /*break*/, 5];
|
|
6249
6312
|
case 4:
|
|
6250
|
-
|
|
6251
|
-
|
|
6313
|
+
err_15 = _d.sent();
|
|
6314
|
+
// INFO: a datasheet that could not be checked may still link to these
|
|
6315
|
+
// records, so none of them is deleted
|
|
6316
|
+
setNotification({
|
|
6317
|
+
type: false,
|
|
6318
|
+
title: "Nothing deleted",
|
|
6319
|
+
msg: "Couldn't check where these records are used. Try again.",
|
|
6320
|
+
});
|
|
6321
|
+
return [2 /*return*/, []];
|
|
6252
6322
|
case 5:
|
|
6253
|
-
setReferenceDeleteTableData(existsData)
|
|
6323
|
+
setReferenceDeleteTableData(__spreadArray([], existsData, true).sort(function (left, right) {
|
|
6324
|
+
return left.recordLabel.localeCompare(right.recordLabel) ||
|
|
6325
|
+
left.collectionName.localeCompare(right.collectionName);
|
|
6326
|
+
}));
|
|
6254
6327
|
return [2 /*return*/, selectedData
|
|
6255
6328
|
.filter(function (eachData) {
|
|
6256
6329
|
return !existDataIds.includes(eachData[serverId]);
|
|
@@ -6260,7 +6333,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6260
6333
|
});
|
|
6261
6334
|
}); };
|
|
6262
6335
|
var handleCloneSelectedData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6263
|
-
var responseData, newDataList_1, res,
|
|
6336
|
+
var responseData, newDataList_1, res, err_16;
|
|
6264
6337
|
return __generator(this, function (_a) {
|
|
6265
6338
|
switch (_a.label) {
|
|
6266
6339
|
case 0:
|
|
@@ -6301,7 +6374,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6301
6374
|
_a.label = 4;
|
|
6302
6375
|
case 4: return [3 /*break*/, 6];
|
|
6303
6376
|
case 5:
|
|
6304
|
-
|
|
6377
|
+
err_16 = _a.sent();
|
|
6305
6378
|
return [3 /*break*/, 6];
|
|
6306
6379
|
case 6:
|
|
6307
6380
|
setLoading(false);
|
|
@@ -6310,7 +6383,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6310
6383
|
});
|
|
6311
6384
|
}); };
|
|
6312
6385
|
var handleBatchUpdateData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6313
|
-
var model_1, columnId_1, dataToSubmit_1, isFile, res, updateQuery, handleRefuseUpdate, formulaKeptIds_2, isById, responseData, matchedRows, countData, matchedCount, selectAllQuery, batchUpdateConfig, res,
|
|
6386
|
+
var model_1, columnId_1, dataToSubmit_1, isFile, res, updateQuery, handleRefuseUpdate, formulaKeptIds_2, isById, responseData, matchedRows, countData, matchedCount, selectAllQuery, batchUpdateConfig, res, err_17;
|
|
6314
6387
|
var _a, _b;
|
|
6315
6388
|
return __generator(this, function (_c) {
|
|
6316
6389
|
switch (_c.label) {
|
|
@@ -6374,7 +6447,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6374
6447
|
};
|
|
6375
6448
|
formulaKeptIds_2 = handleGetFormulaKeptIds();
|
|
6376
6449
|
isById = !!formulaKeptIds_2 ||
|
|
6377
|
-
!!(updateQuery === null || updateQuery === void 0 ? void 0 : updateQuery.some(function (q) {
|
|
6450
|
+
!!(updateQuery === null || updateQuery === void 0 ? void 0 : updateQuery.some(function (q) {
|
|
6451
|
+
var _a;
|
|
6452
|
+
return !BATCH_UPDATE_QUERY_TYPES.includes(q.type) ||
|
|
6453
|
+
!!((_a = q.foreign) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
6454
|
+
!!q.related ||
|
|
6455
|
+
!!q.orQuery ||
|
|
6456
|
+
!!q.orQueryGroupId;
|
|
6457
|
+
}));
|
|
6378
6458
|
if (!isById) return [3 /*break*/, 7];
|
|
6379
6459
|
return [4 /*yield*/, readServerQuery.call({
|
|
6380
6460
|
type: "list",
|
|
@@ -6446,12 +6526,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6446
6526
|
_c.label = 11;
|
|
6447
6527
|
case 11: return [3 /*break*/, 14];
|
|
6448
6528
|
case 12:
|
|
6449
|
-
|
|
6450
|
-
if (
|
|
6529
|
+
err_17 = _c.sent();
|
|
6530
|
+
if (err_17.response) {
|
|
6451
6531
|
setNotification({
|
|
6452
6532
|
type: false,
|
|
6453
6533
|
title: "Error",
|
|
6454
|
-
msg: handleGetWriteErrorMessage(
|
|
6534
|
+
msg: handleGetWriteErrorMessage(err_17.response),
|
|
6455
6535
|
});
|
|
6456
6536
|
}
|
|
6457
6537
|
return [3 /*break*/, 14];
|
|
@@ -6465,7 +6545,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6465
6545
|
});
|
|
6466
6546
|
}); };
|
|
6467
6547
|
var handleUploadOfflineData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6468
|
-
var dataUploadedId, offlineDataResp, offlineData, offlineDataIds, updateDataRes, updateDataList, _loop_1, i,
|
|
6548
|
+
var dataUploadedId, offlineDataResp, offlineData, offlineDataIds, updateDataRes, updateDataList, _loop_1, i, err_18, success, fullDataResp, fullData, updatedData;
|
|
6469
6549
|
var _a, _b, _c, _d, _e, _f;
|
|
6470
6550
|
return __generator(this, function (_g) {
|
|
6471
6551
|
switch (_g.label) {
|
|
@@ -6501,7 +6581,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6501
6581
|
updateDataRes = _g.sent();
|
|
6502
6582
|
updateDataList = (_b = updateDataRes === null || updateDataRes === void 0 ? void 0 : updateDataRes.data) !== null && _b !== void 0 ? _b : [];
|
|
6503
6583
|
_loop_1 = function (i) {
|
|
6504
|
-
var eachOfflineData, offlineDataId, storedBaseline, serverDoc, isUpdate, preComplete, res,
|
|
6584
|
+
var eachOfflineData, offlineDataId, storedBaseline, serverDoc, isUpdate, preComplete, res, err_19;
|
|
6505
6585
|
var _h;
|
|
6506
6586
|
return __generator(this, function (_j) {
|
|
6507
6587
|
switch (_j.label) {
|
|
@@ -6562,7 +6642,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6562
6642
|
_j.sent();
|
|
6563
6643
|
return [3 /*break*/, 8];
|
|
6564
6644
|
case 7:
|
|
6565
|
-
|
|
6645
|
+
err_19 = _j.sent();
|
|
6566
6646
|
return [3 /*break*/, 8];
|
|
6567
6647
|
case 8: return [2 /*return*/];
|
|
6568
6648
|
}
|
|
@@ -6581,7 +6661,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6581
6661
|
return [3 /*break*/, 4];
|
|
6582
6662
|
case 7: return [3 /*break*/, 9];
|
|
6583
6663
|
case 8:
|
|
6584
|
-
|
|
6664
|
+
err_18 = _g.sent();
|
|
6585
6665
|
return [3 /*break*/, 9];
|
|
6586
6666
|
case 9:
|
|
6587
6667
|
success = dataUploadedId.length === offlineData.length;
|
|
@@ -6634,7 +6714,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6634
6714
|
var columnTypeActions = {
|
|
6635
6715
|
canUpdate: canUpdateRecord,
|
|
6636
6716
|
dateWarnings: isDateWarnings,
|
|
6637
|
-
onButtonClick: (
|
|
6717
|
+
onButtonClick: (_112 = props.organise) === null || _112 === void 0 ? void 0 : _112.onButtonClick,
|
|
6638
6718
|
onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6639
6719
|
var _a;
|
|
6640
6720
|
return __generator(this, function (_b) {
|
|
@@ -6651,7 +6731,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6651
6731
|
}
|
|
6652
6732
|
});
|
|
6653
6733
|
}); },
|
|
6654
|
-
onTimeTrackingAction: ((
|
|
6734
|
+
onTimeTrackingAction: ((_113 = props.organise) === null || _113 === void 0 ? void 0 : _113.onTimeTrackingAction) && canUpdateRecord
|
|
6655
6735
|
? function (rowId, columnId, action) {
|
|
6656
6736
|
return handleTimeTrackingAction(rowId, columnId, action);
|
|
6657
6737
|
}
|
|
@@ -6680,7 +6760,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6680
6760
|
});
|
|
6681
6761
|
}); };
|
|
6682
6762
|
var handleSubmitData = function (type, rowId, columnId, data, offlineId, isOfflineUpdate, isDraft) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6683
|
-
var selectedId, id, handleIsSavedSubmit, createSelectedData_1, uniqueDataStructure, uniqueColumnId, res, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_3,
|
|
6763
|
+
var selectedId, id, handleIsSavedSubmit, createSelectedData_1, uniqueDataStructure, uniqueColumnId, res, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_3, err_20, isUniqueIdFieldCreate, isExistingDoc, newRecordData_1, changedAttributeIds, baseDraftValue, hasBaseDraftChange, offlineDataResp, clonedForOffline, tempData, selectedIndex_4, offlineData, err_21, dataToSubmit_2, changedAttributeIds, baseDraftValue, hasBaseDraftChange, operationType, currentRow, wentToServer, dataId, err_22, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_5, _a;
|
|
6684
6764
|
var _b, _c, _d, _e;
|
|
6685
6765
|
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
6686
6766
|
return __generator(this, function (_z) {
|
|
@@ -6812,7 +6892,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6812
6892
|
res = true;
|
|
6813
6893
|
return [3 /*break*/, 9];
|
|
6814
6894
|
case 8:
|
|
6815
|
-
|
|
6895
|
+
err_20 = _z.sent();
|
|
6816
6896
|
return [3 /*break*/, 9];
|
|
6817
6897
|
case 9: return [3 /*break*/, 16];
|
|
6818
6898
|
case 10:
|
|
@@ -6979,7 +7059,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6979
7059
|
res = true;
|
|
6980
7060
|
return [3 /*break*/, 22];
|
|
6981
7061
|
case 21:
|
|
6982
|
-
|
|
7062
|
+
err_21 = _z.sent();
|
|
6983
7063
|
return [3 /*break*/, 22];
|
|
6984
7064
|
case 22: return [3 /*break*/, 25];
|
|
6985
7065
|
case 23:
|
|
@@ -7129,8 +7209,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7129
7209
|
dataId = res ? id : "";
|
|
7130
7210
|
return [2 /*return*/, dataId];
|
|
7131
7211
|
case 39:
|
|
7132
|
-
|
|
7133
|
-
console.log("error",
|
|
7212
|
+
err_22 = _z.sent();
|
|
7213
|
+
console.log("error", err_22);
|
|
7134
7214
|
// INFO: clear in-flight guard on failure so the next save retries as a create
|
|
7135
7215
|
if (isCreatingRef.current) {
|
|
7136
7216
|
isCreatingRef.current = false;
|
|
@@ -7141,7 +7221,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7141
7221
|
id &&
|
|
7142
7222
|
!offlineId &&
|
|
7143
7223
|
!isOfflineUpdate &&
|
|
7144
|
-
!
|
|
7224
|
+
!err_22.response)) return [3 /*break*/, 44];
|
|
7145
7225
|
_z.label = 40;
|
|
7146
7226
|
case 40:
|
|
7147
7227
|
_z.trys.push([40, 43, , 44]);
|
|
@@ -7200,11 +7280,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7200
7280
|
_a = _z.sent();
|
|
7201
7281
|
return [3 /*break*/, 44];
|
|
7202
7282
|
case 44:
|
|
7203
|
-
if (
|
|
7283
|
+
if (err_22.response) {
|
|
7204
7284
|
setNotification({
|
|
7205
7285
|
type: false,
|
|
7206
7286
|
title: "Error",
|
|
7207
|
-
msg: handleGetWriteErrorMessage(
|
|
7287
|
+
msg: handleGetWriteErrorMessage(err_22.response),
|
|
7208
7288
|
});
|
|
7209
7289
|
}
|
|
7210
7290
|
return [3 /*break*/, 45];
|
|
@@ -7251,7 +7331,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7251
7331
|
});
|
|
7252
7332
|
}); };
|
|
7253
7333
|
var handleSubmit = function (isDraft) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7254
|
-
var preComplete, res, updatedMarkdownData_1, uploadedData_2, uploadTypes_1,
|
|
7334
|
+
var preComplete, res, updatedMarkdownData_1, uploadedData_2, uploadTypes_1, err_23;
|
|
7255
7335
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
7256
7336
|
return __generator(this, function (_m) {
|
|
7257
7337
|
switch (_m.label) {
|
|
@@ -7384,7 +7464,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7384
7464
|
isSubmittingRef.current = false;
|
|
7385
7465
|
return [3 /*break*/, 9];
|
|
7386
7466
|
case 8:
|
|
7387
|
-
|
|
7467
|
+
err_23 = _m.sent();
|
|
7388
7468
|
setModalVisible(false);
|
|
7389
7469
|
setLoading(false);
|
|
7390
7470
|
isSubmittingRef.current = false;
|
|
@@ -7394,7 +7474,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7394
7474
|
});
|
|
7395
7475
|
}); };
|
|
7396
7476
|
var handleUpdateKanbanChecked = function (id, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7397
|
-
var
|
|
7477
|
+
var err_24;
|
|
7398
7478
|
var _a;
|
|
7399
7479
|
return __generator(this, function (_b) {
|
|
7400
7480
|
switch (_b.label) {
|
|
@@ -7412,7 +7492,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7412
7492
|
_b.sent();
|
|
7413
7493
|
return [3 /*break*/, 4];
|
|
7414
7494
|
case 3:
|
|
7415
|
-
|
|
7495
|
+
err_24 = _b.sent();
|
|
7416
7496
|
return [3 /*break*/, 4];
|
|
7417
7497
|
case 4: return [2 /*return*/];
|
|
7418
7498
|
}
|
|
@@ -7789,7 +7869,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7789
7869
|
handleUpdateChangeData(clonedData);
|
|
7790
7870
|
};
|
|
7791
7871
|
var handleOnChangeSelect = function (id, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7792
|
-
var _a, data, model, isUpdate, clonedData, refetchReference, currentSchema, allowedWatchedColumnTypes_1, watchedColumns, _i, watchedColumns_1, eachWatched, dependency, referenceRQ, valueRes,
|
|
7872
|
+
var _a, data, model, isUpdate, clonedData, refetchReference, currentSchema, allowedWatchedColumnTypes_1, watchedColumns, _i, watchedColumns_1, eachWatched, dependency, referenceRQ, valueRes, err_25;
|
|
7793
7873
|
return __generator(this, function (_b) {
|
|
7794
7874
|
switch (_b.label) {
|
|
7795
7875
|
case 0:
|
|
@@ -7852,7 +7932,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7852
7932
|
return [3 /*break*/, 3];
|
|
7853
7933
|
case 6: return [3 /*break*/, 8];
|
|
7854
7934
|
case 7:
|
|
7855
|
-
|
|
7935
|
+
err_25 = _b.sent();
|
|
7856
7936
|
return [3 /*break*/, 8];
|
|
7857
7937
|
case 8:
|
|
7858
7938
|
clonedData[id] = value;
|
|
@@ -7930,7 +8010,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7930
8010
|
}
|
|
7931
8011
|
};
|
|
7932
8012
|
var handleStepCSV = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
7933
|
-
var csvList_1, _loop_2, _i, _a, _b, eachKey, eachValue, valid_1, errorValue_1, excelFormData, updateFields, response, open_1,
|
|
8013
|
+
var csvList_1, _loop_2, _i, _a, _b, eachKey, eachValue, valid_1, errorValue_1, excelFormData, updateFields, response, open_1, err_26;
|
|
7934
8014
|
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
7935
8015
|
return __generator(this, function (_p) {
|
|
7936
8016
|
switch (_p.label) {
|
|
@@ -8077,12 +8157,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8077
8157
|
_p.label = 5;
|
|
8078
8158
|
case 5: return [3 /*break*/, 7];
|
|
8079
8159
|
case 6:
|
|
8080
|
-
|
|
8160
|
+
err_26 = _p.sent();
|
|
8081
8161
|
setLoading(false);
|
|
8082
8162
|
setNotification({
|
|
8083
8163
|
type: false,
|
|
8084
8164
|
title: "Import Error",
|
|
8085
|
-
msg:
|
|
8165
|
+
msg: err_26.message,
|
|
8086
8166
|
});
|
|
8087
8167
|
return [3 /*break*/, 7];
|
|
8088
8168
|
case 7: return [2 /*return*/];
|
|
@@ -8090,7 +8170,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8090
8170
|
});
|
|
8091
8171
|
}); };
|
|
8092
8172
|
var handleExportCSVData = function (downloadLinkOnly, printOnly) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8093
|
-
var exportQueryList, formulaRows, kept, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg,
|
|
8173
|
+
var exportQueryList, formulaRows, kept, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg, err_27;
|
|
8094
8174
|
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;
|
|
8095
8175
|
return __generator(this, function (_2) {
|
|
8096
8176
|
switch (_2.label) {
|
|
@@ -8176,7 +8256,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8176
8256
|
setExportCSVEmail((_1 = (_0 = props.devSettings.currentUser) === null || _0 === void 0 ? void 0 : _0.userEmail) !== null && _1 !== void 0 ? _1 : "");
|
|
8177
8257
|
return [3 /*break*/, 6];
|
|
8178
8258
|
case 5:
|
|
8179
|
-
|
|
8259
|
+
err_27 = _2.sent();
|
|
8180
8260
|
setNotification({
|
|
8181
8261
|
type: true,
|
|
8182
8262
|
title: "Export Failed",
|
|
@@ -8232,7 +8312,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8232
8312
|
});
|
|
8233
8313
|
}); };
|
|
8234
8314
|
var handleExportReadPDF = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
8235
|
-
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,
|
|
8315
|
+
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;
|
|
8236
8316
|
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;
|
|
8237
8317
|
return __generator(this, function (_4) {
|
|
8238
8318
|
switch (_4.label) {
|
|
@@ -8403,8 +8483,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8403
8483
|
headerHeight = imageHeight_1 + 2;
|
|
8404
8484
|
return [3 /*break*/, 13];
|
|
8405
8485
|
case 12:
|
|
8406
|
-
|
|
8407
|
-
console.error("Failed to load PDF header image:",
|
|
8486
|
+
err_28 = _4.sent();
|
|
8487
|
+
console.error("Failed to load PDF header image:", err_28);
|
|
8408
8488
|
console.error("Image source:", headerConfig_1.image.src);
|
|
8409
8489
|
return [3 /*break*/, 13];
|
|
8410
8490
|
case 13:
|
|
@@ -8545,8 +8625,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8545
8625
|
}
|
|
8546
8626
|
return [3 /*break*/, 17];
|
|
8547
8627
|
case 15:
|
|
8548
|
-
|
|
8549
|
-
console.error("PDF export error:",
|
|
8628
|
+
err_29 = _4.sent();
|
|
8629
|
+
console.error("PDF export error:", err_29);
|
|
8550
8630
|
setNotification({
|
|
8551
8631
|
type: false,
|
|
8552
8632
|
title: "Error",
|
|
@@ -8786,7 +8866,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8786
8866
|
: getActiveUserHiddenColumnIds().includes(column.id);
|
|
8787
8867
|
};
|
|
8788
8868
|
var renderViewSettingsContent = function () {
|
|
8789
|
-
var _a, _b, _c, _d, _e, _f;
|
|
8869
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
8790
8870
|
var viewColumns = getViewSettingsColumns();
|
|
8791
8871
|
var hiddenCount = viewColumns.filter(getIsColumnHidden).length;
|
|
8792
8872
|
var visibleCount = viewColumns.length - hiddenCount;
|
|
@@ -8886,7 +8966,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8886
8966
|
react_1.default.createElement("div", { className: "mt-1" },
|
|
8887
8967
|
react_1.default.createElement(select_1.Select, { id: "dtw-view-group-by", portalDropdown: true, label: "", placeholder: "Column", value: groupId !== null && groupId !== void 0 ? groupId : "", darkMode: (_f = props.organise) === null || _f === void 0 ? void 0 : _f.darkMode, options: handleGetGroupByOptions(), onChange: function (value) {
|
|
8888
8968
|
return handleChangeGroupBy(value !== null && value !== void 0 ? value : "", true);
|
|
8889
|
-
} }))
|
|
8969
|
+
} })),
|
|
8970
|
+
groupId && handleCheckGroupOrderShown() && (react_1.default.createElement("div", { className: "mt-2" },
|
|
8971
|
+
react_1.default.createElement(select_1.Select, { id: "dtw-view-group-order", portalDropdown: true, label: "", value: groupOrder, darkMode: (_g = props.organise) === null || _g === void 0 ? void 0 : _g.darkMode, options: [
|
|
8972
|
+
{ key: "", label: "Column order" },
|
|
8973
|
+
{ key: "most", label: "Most records first" },
|
|
8974
|
+
{ key: "fewest", label: "Fewest records first" },
|
|
8975
|
+
], onChange: function (value) {
|
|
8976
|
+
return setGroupOrder((value !== null && value !== void 0 ? value : ""));
|
|
8977
|
+
} }))))),
|
|
8890
8978
|
react_1.default.createElement("div", { className: "mt-3 border-t pt-3 ".concat(dividerColor) },
|
|
8891
8979
|
react_1.default.createElement("p", { className: "text-sm font-medium ".concat(labelColor) }, "Rows per page"),
|
|
8892
8980
|
react_1.default.createElement("div", { className: "mt-2 flex flex-row flex-wrap gap-2" }, PAGE_LIMIT_OPTIONS.map(function (eachOption) { return (react_1.default.createElement("button", { key: eachOption, type: "button", "data-testid": "dtw-page-limit-".concat(eachOption), className: "rounded-md border px-3 py-1 text-sm ".concat(pageLimit === eachOption
|
|
@@ -8906,8 +8994,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8906
8994
|
: rows;
|
|
8907
8995
|
};
|
|
8908
8996
|
/* eslint-disable */
|
|
8909
|
-
var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (
|
|
8910
|
-
var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (
|
|
8997
|
+
var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_114 = props.bareSettings) === null || _114 === void 0 ? void 0 : _114.bareNewDTW]);
|
|
8998
|
+
var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_115 = props.bareSettings) === null || _115 === void 0 ? void 0 : _115.bareNewDTW]);
|
|
8911
8999
|
/* eslint-enable */
|
|
8912
9000
|
// INFO: beside a record's title, the pencil opens its edit form for whoever
|
|
8913
9001
|
// may update, and the bubble opens comments and logs for anyone who can see
|
|
@@ -10927,7 +11015,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10927
11015
|
// around it. Each is saved with only its changed fields, then patched into
|
|
10928
11016
|
// the list in place
|
|
10929
11017
|
var handleSaveRecordChanges = function (changes) { return __awaiter(void 0, void 0, void 0, function () {
|
|
10930
|
-
var _loop_3, _i, changes_1, eachChange,
|
|
11018
|
+
var _loop_3, _i, changes_1, eachChange, err_30;
|
|
10931
11019
|
var _a;
|
|
10932
11020
|
return __generator(this, function (_b) {
|
|
10933
11021
|
switch (_b.label) {
|
|
@@ -10976,12 +11064,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10976
11064
|
return [3 /*break*/, 2];
|
|
10977
11065
|
case 5: return [3 /*break*/, 8];
|
|
10978
11066
|
case 6:
|
|
10979
|
-
|
|
11067
|
+
err_30 = _b.sent();
|
|
10980
11068
|
setNotification({
|
|
10981
11069
|
type: false,
|
|
10982
11070
|
title: "Error",
|
|
10983
|
-
msg: (
|
|
10984
|
-
? handleGetWriteErrorMessage(
|
|
11071
|
+
msg: (err_30 === null || err_30 === void 0 ? void 0 : err_30.response)
|
|
11072
|
+
? handleGetWriteErrorMessage(err_30.response)
|
|
10985
11073
|
: "The changes could not be saved",
|
|
10986
11074
|
});
|
|
10987
11075
|
return [3 /*break*/, 8];
|
|
@@ -11118,7 +11206,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11118
11206
|
((_b = groupPageState[eachGroup.id]) === null || _b === void 0 ? void 0 : _b.size) === 0);
|
|
11119
11207
|
})
|
|
11120
11208
|
: sections;
|
|
11121
|
-
|
|
11209
|
+
// INFO: coloured in the column's order first, so a group keeps its colour
|
|
11210
|
+
// when the order changes
|
|
11211
|
+
return (0, groupSections_1.handleOrderGroupSections)(handleApplyGroupDefaults(shownSections), groupOrder);
|
|
11122
11212
|
};
|
|
11123
11213
|
// INFO: every section is coloured — by its option's
|
|
11124
11214
|
// position, so a group keeps its colour as others empty — person groups
|
|
@@ -11385,7 +11475,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11385
11475
|
// tableData / spaceTableData, so handleBuildNewTableGroups() keeps building
|
|
11386
11476
|
// bands from one source; each group advances its own cursor
|
|
11387
11477
|
var handleFetchGroupNextPage = function (groupKey) { return __awaiter(void 0, void 0, void 0, function () {
|
|
11388
|
-
var current, groupSize, cursor, generation, page_1, existingIds_1, appendRaw_1, appendPretty_1, nextCursor,
|
|
11478
|
+
var current, groupSize, cursor, generation, page_1, existingIds_1, appendRaw_1, appendPretty_1, nextCursor, err_31, nextKey;
|
|
11389
11479
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
11390
11480
|
return __generator(this, function (_h) {
|
|
11391
11481
|
switch (_h.label) {
|
|
@@ -11449,7 +11539,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11449
11539
|
});
|
|
11450
11540
|
return [3 /*break*/, 5];
|
|
11451
11541
|
case 3:
|
|
11452
|
-
|
|
11542
|
+
err_31 = _h.sent();
|
|
11453
11543
|
if (generation !== groupPagingGenRef.current)
|
|
11454
11544
|
return [2 /*return*/];
|
|
11455
11545
|
// INFO: clear the in-flight flag so a failed page can be retried on the
|
|
@@ -11474,7 +11564,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11474
11564
|
// INFO: page mode — swaps ONE group's rows for its page `page`; every other
|
|
11475
11565
|
// group keeps the page it is on
|
|
11476
11566
|
var handleFetchGroupPage = function (groupKey, page) { return __awaiter(void 0, void 0, void 0, function () {
|
|
11477
|
-
var generation, result, keptRaw_1, keptPretty_1, loaded,
|
|
11567
|
+
var generation, result, keptRaw_1, keptPretty_1, loaded, err_32;
|
|
11478
11568
|
return __generator(this, function (_a) {
|
|
11479
11569
|
switch (_a.label) {
|
|
11480
11570
|
case 0:
|
|
@@ -11510,7 +11600,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11510
11600
|
});
|
|
11511
11601
|
return [3 /*break*/, 4];
|
|
11512
11602
|
case 3:
|
|
11513
|
-
|
|
11603
|
+
err_32 = _a.sent();
|
|
11514
11604
|
if (generation !== groupPagingGenRef.current)
|
|
11515
11605
|
return [2 /*return*/];
|
|
11516
11606
|
handleSetGroupPageState(groupKey, { loadingMore: false });
|
|
@@ -13431,39 +13521,52 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13431
13521
|
}
|
|
13432
13522
|
};
|
|
13433
13523
|
var renderReferenceDeleteTable = function () {
|
|
13434
|
-
var _a;
|
|
13435
|
-
var
|
|
13436
|
-
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13441
|
-
|
|
13442
|
-
|
|
13524
|
+
var _a, _b, _c, _d, _e;
|
|
13525
|
+
var canOpen = !!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onOpenReferencingRecords);
|
|
13526
|
+
var isMultiple = new Set(referenceDeleteTableData.map(function (each) { return each.recordId; })).size > 1;
|
|
13527
|
+
var handleGetRowKey = function (each) {
|
|
13528
|
+
return "".concat(each.recordId, "|").concat(each.collectionId, "|").concat(each.columnId);
|
|
13529
|
+
};
|
|
13530
|
+
// INFO: the first rows only — a select-all of many linked records would
|
|
13531
|
+
// otherwise list thousands
|
|
13532
|
+
var shownLinks = referenceDeleteTableData.slice(0, DELETE_BLOCKED_ROWS);
|
|
13533
|
+
var hiddenLinks = referenceDeleteTableData.length - shownLinks.length;
|
|
13534
|
+
var rows = shownLinks.map(function (each) { return ({
|
|
13535
|
+
id: handleGetRowKey(each),
|
|
13536
|
+
record: each.recordLabel,
|
|
13537
|
+
usedIn: each.collectionName,
|
|
13538
|
+
count: "".concat(each.count.toLocaleString(), " ").concat(each.count === 1 ? "record" : "records").concat(canOpen ? " ↗" : ""),
|
|
13539
|
+
}); });
|
|
13443
13540
|
return (react_1.default.createElement("div", { className: "px-3 sm:px-0" },
|
|
13444
|
-
react_1.default.createElement("
|
|
13445
|
-
|
|
13446
|
-
|
|
13447
|
-
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13452
|
-
|
|
13453
|
-
|
|
13454
|
-
|
|
13455
|
-
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
|
|
13459
|
-
|
|
13460
|
-
|
|
13461
|
-
|
|
13541
|
+
react_1.default.createElement("h2", { className: "mt-2 mb-2 text-xl font-bold ".concat(((_b = props.organise) === null || _b === void 0 ? void 0 : _b.darkMode) ? "text-white" : "text-gray-900") }, "Can't delete yet"),
|
|
13542
|
+
react_1.default.createElement("p", { className: "mt-2 mb-4 text-sm ".concat(((_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode) ? "text-gray-300" : "text-gray-600") },
|
|
13543
|
+
isMultiple ? "These records are" : "This record is",
|
|
13544
|
+
" still used in the datasheets below.",
|
|
13545
|
+
" ",
|
|
13546
|
+
canOpen
|
|
13547
|
+
? "Open each to change or delete those records, then try again."
|
|
13548
|
+
: "Change or delete those records first, then try again."),
|
|
13549
|
+
react_1.default.createElement(newTable_1.NewTable, { loading: false, className: "w-full", darkMode: (_d = props.organise) === null || _d === void 0 ? void 0 : _d.darkMode, header: __spreadArray(__spreadArray([], (isMultiple ? [{ key: "record", title: "Record" }] : []), true), [
|
|
13550
|
+
{ key: "usedIn", title: "Used in" },
|
|
13551
|
+
{ key: "count", title: "Linked" },
|
|
13552
|
+
], false), data: rows, onClickRow: canOpen
|
|
13553
|
+
? function (rowId) {
|
|
13554
|
+
var _a, _b;
|
|
13555
|
+
var link = referenceDeleteTableData.find(function (each) { return handleGetRowKey(each) === rowId; });
|
|
13556
|
+
if (!link)
|
|
13557
|
+
return;
|
|
13558
|
+
// INFO: closed first, so it is not left over the datasheet
|
|
13559
|
+
// the app opens
|
|
13560
|
+
setReferenceDeleteTableData([]);
|
|
13561
|
+
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onOpenReferencingRecords) === null || _b === void 0 ? void 0 : _b.call(_a, link);
|
|
13562
|
+
}
|
|
13563
|
+
: undefined }),
|
|
13564
|
+
hiddenLinks > 0 && (react_1.default.createElement("p", { className: "mt-2 text-xs ".concat(((_e = props.organise) === null || _e === void 0 ? void 0 : _e.darkMode) ? "text-gray-400" : "text-gray-500") },
|
|
13565
|
+
"And ",
|
|
13566
|
+
hiddenLinks.toLocaleString(),
|
|
13567
|
+
" more.")),
|
|
13462
13568
|
react_1.default.createElement("div", { className: "flex flex-row justify-end pt-5 mt-6 space-x-2" },
|
|
13463
|
-
react_1.default.createElement(button_1.Button, { text: "Close", size: "small", type: "normal", onClick: function () {
|
|
13464
|
-
setReferenceDeleteIndex(0);
|
|
13465
|
-
setReferenceDeleteTableData({});
|
|
13466
|
-
} }))));
|
|
13569
|
+
react_1.default.createElement(button_1.Button, { text: "Close", size: "small", type: "normal", onClick: function () { return setReferenceDeleteTableData([]); } }))));
|
|
13467
13570
|
};
|
|
13468
13571
|
var renderDeleteModalContent = function () {
|
|
13469
13572
|
var _a;
|
|
@@ -13608,14 +13711,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13608
13711
|
};
|
|
13609
13712
|
return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
|
|
13610
13713
|
renderNotification("root"),
|
|
13611
|
-
((
|
|
13714
|
+
((_117 = (_116 = props.renderSettings) === null || _116 === void 0 ? void 0 : _116.renderLoadingUI) === null || _117 === void 0 ? void 0 : _117.call(_116)) && loading ? ((_118 = props.renderSettings) === null || _118 === void 0 ? void 0 : _118.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_119 = props.organise) === null || _119 === void 0 ? void 0 : _119.darkMode, darkModeBg: (_120 = props.organise) === null || _120 === void 0 ? void 0 : _120.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
|
|
13612
13715
|
var _a, _b;
|
|
13613
13716
|
if (loading)
|
|
13614
13717
|
return;
|
|
13615
13718
|
handlePopUpModal(false);
|
|
13616
13719
|
setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
|
|
13617
13720
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
|
|
13618
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13721
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_121 = props.organise) === null || _121 === void 0 ? void 0 : _121.darkMode, darkModeBg: (_122 = props.organise) === null || _122 === void 0 ? void 0 : _122.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
|
|
13619
13722
|
return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
|
|
13620
13723
|
if (dataId) {
|
|
13621
13724
|
var currentValue = selectedData[referenceCreationModal.id];
|
|
@@ -13631,19 +13734,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13631
13734
|
}, onClose: function () {
|
|
13632
13735
|
setReferenceCreationModal({ id: "", name: "", type: "string" });
|
|
13633
13736
|
} }),
|
|
13634
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13635
|
-
setReferenceDeleteTableData(
|
|
13737
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_123 = props.organise) === null || _123 === void 0 ? void 0 : _123.darkMode, darkModeBg: (_124 = props.organise) === null || _124 === void 0 ? void 0 : _124.darkModeBg, maxWidth: "2xl", open: referenceDeleteTableData.length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
|
|
13738
|
+
setReferenceDeleteTableData([]);
|
|
13636
13739
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13637
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13740
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_125 = props.organise) === null || _125 === void 0 ? void 0 : _125.darkMode, darkModeBg: (_126 = props.organise) === null || _126 === void 0 ? void 0 : _126.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
|
|
13638
13741
|
setDeletePasscodeInput("");
|
|
13639
13742
|
setDeleteModal(!deleteModal);
|
|
13640
13743
|
setDeleteFeedId("");
|
|
13641
13744
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13642
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13745
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_127 = props.organise) === null || _127 === void 0 ? void 0 : _127.darkMode, darkModeBg: (_128 = props.organise) === null || _128 === void 0 ? void 0 : _128.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
|
|
13643
13746
|
setBatchUpdateData({ columnId: "", columnData: {} });
|
|
13644
13747
|
setBatchUpdateModal(false);
|
|
13645
13748
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13646
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13749
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_129 = props.organise) === null || _129 === void 0 ? void 0 : _129.darkMode, darkModeBg: (_130 = props.organise) === null || _130 === void 0 ? void 0 : _130.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
|
|
13647
13750
|
var _a, _b;
|
|
13648
13751
|
if (props.space)
|
|
13649
13752
|
return (react_1.default.createElement(authModal_1.AuthModal, { space: props.space, userId: (_a = props.id) !== null && _a !== void 0 ? _a : "", client: (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, type: selectedAuthMethod, authMethods: authMethods, onComplete: handleAuthComplete }));
|
|
@@ -13660,14 +13763,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13660
13763
|
(0, react_dom_1.createPortal)(
|
|
13661
13764
|
// INFO: z-50 lifts it over a Modal the table may sit in (z-40)
|
|
13662
13765
|
react_1.default.createElement("div", { className: "relative z-50" },
|
|
13663
|
-
react_1.default.createElement(drawer_1.Drawer, { darkMode: (
|
|
13766
|
+
react_1.default.createElement(drawer_1.Drawer, { darkMode: (_131 = props.organise) === null || _131 === void 0 ? void 0 : _131.darkMode, darkModeBg: (_132 = props.organise) === null || _132 === void 0 ? void 0 : _132.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
|
|
13664
13767
|
// INFO: the record stays set while the drawer slides out — clearing it
|
|
13665
13768
|
// would remount the hidden panel collection-wide and fetch again. The
|
|
13666
13769
|
// toolbar's collection-wide button clears it when it opens.
|
|
13667
13770
|
onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75",
|
|
13668
13771
|
// INFO: dragged like the read drawer; the width sticks across
|
|
13669
13772
|
// opens while the list stays mounted
|
|
13670
|
-
resizable: true, title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((
|
|
13773
|
+
resizable: true, title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((_133 = props.id) !== null && _133 !== void 0 ? _133 : "") : activityId) })), document.body),
|
|
13671
13774
|
renderScrollSentinel()));
|
|
13672
13775
|
});
|
|
13673
13776
|
//# sourceMappingURL=index.js.map
|