blixify-ui-web 1.3.28 → 1.3.29
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/chart/ganttChart/index.d.ts +3 -0
- package/lib/components/chart/ganttChart/index.d.ts.map +1 -1
- package/lib/components/chart/ganttChart/index.js +15 -8
- package/lib/components/chart/ganttChart/index.js.map +1 -1
- package/lib/components/data/columnTypes/dateRangeCalendar.d.ts +1 -1
- package/lib/components/data/columnTypes/dateRangeCalendar.js +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +611 -331
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.js +14 -8
- package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
- package/lib/components/data/dataTemplate/timelineBars.d.ts +15 -0
- package/lib/components/data/dataTemplate/timelineBars.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/timelineBars.js +98 -1
- package/lib/components/data/dataTemplate/timelineBars.js.map +1 -1
- package/lib/components/data/flexFilter/index.d.ts.map +1 -1
- package/lib/components/data/flexFilter/index.js +73 -12
- package/lib/components/data/flexFilter/index.js.map +1 -1
- package/lib/components/data/readQuery/index.d.ts +1 -1
- package/lib/components/data/readQuery/index.d.ts.map +1 -1
- package/lib/components/data/readQuery/index.js.map +1 -1
- package/lib/components/data/updateModule.js +1 -1
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/display/mapView/routes.d.ts +14 -0
- package/lib/components/display/mapView/routes.d.ts.map +1 -1
- package/lib/components/display/mapView/routes.js +16 -1
- package/lib/components/display/mapView/routes.js.map +1 -1
- package/lib/components/display/newCalendar/index.d.ts +4 -0
- package/lib/components/display/newCalendar/index.d.ts.map +1 -1
- package/lib/components/display/newCalendar/index.js +166 -25
- package/lib/components/display/newCalendar/index.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +151 -176
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/display/newTable/labelPicker.d.ts +4 -3
- package/lib/components/display/newTable/labelPicker.d.ts.map +1 -1
- package/lib/components/display/newTable/labelPicker.js +6 -5
- package/lib/components/display/newTable/labelPicker.js.map +1 -1
- package/lib/components/display/newTable/tagLine.d.ts +1 -0
- package/lib/components/display/newTable/tagLine.d.ts.map +1 -1
- package/lib/components/display/newTable/tagLine.js +2 -2
- package/lib/components/display/newTable/tagLine.js.map +1 -1
- package/lib/components/display/tag/index.d.ts +3 -1
- package/lib/components/display/tag/index.d.ts.map +1 -1
- package/lib/components/display/tag/index.js +20 -4
- package/lib/components/display/tag/index.js.map +1 -1
- package/lib/components/display/tag/utils.d.ts +3 -0
- package/lib/components/display/tag/utils.d.ts.map +1 -1
- package/lib/components/display/tag/utils.js +21 -1
- package/lib/components/display/tag/utils.js.map +1 -1
- package/lib/components/input/datePicker/index.js +1 -1
- package/lib/components/input/datePicker/index.js.map +1 -1
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +3 -15
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/components/input/utils.d.ts +1 -1
- package/lib/tail.css +1 -1
- package/package.json +1 -1
|
@@ -254,8 +254,12 @@ var handleCheckEmptyCardValue = function (value) {
|
|
|
254
254
|
return false;
|
|
255
255
|
};
|
|
256
256
|
exports.handleCheckEmptyCardValue = handleCheckEmptyCardValue;
|
|
257
|
+
// INFO: rows a select-all update sends by id at most, and ids per delete
|
|
258
|
+
// request — both keep a request within what the server accepts
|
|
259
|
+
var SELECT_ALL_ID_CAP = 5000;
|
|
260
|
+
var DELETE_ID_CHUNK = 1000;
|
|
257
261
|
exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
258
|
-
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;
|
|
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;
|
|
259
263
|
// INFO: every view draws a lookup as its source column's type, read-only, so
|
|
260
264
|
// no type branch below meets "lookup"; rawProps.model keeps the lookups as
|
|
261
265
|
// stored for the columns handed back to the host
|
|
@@ -274,7 +278,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
274
278
|
// the list never refetching while the panel is open, which fails silently.
|
|
275
279
|
// INFO: the panel cannot navigate its way out — handleNavigate("read") is
|
|
276
280
|
// routed straight back into it — so expand-to-full-page is local state.
|
|
277
|
-
var
|
|
281
|
+
var _131 = (0, react_1.useState)(false), drawerPageView = _131[0], setDrawerPageView = _131[1];
|
|
278
282
|
// INFO: the panel keeps rendering the record it was opened with rather than
|
|
279
283
|
// live props. Without this, navigating back to the list would re-render the
|
|
280
284
|
// still-mounted panel as a second list behind the overlay.
|
|
@@ -329,7 +333,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
329
333
|
drawerFormEditedRef.current = false;
|
|
330
334
|
}
|
|
331
335
|
drawerOpenRef.current = isDrawerHost;
|
|
332
|
-
var
|
|
336
|
+
var _132 = (0, react_1.useState)(false), drawerDiscardModal = _132[0], setDrawerDiscardModal = _132[1];
|
|
333
337
|
// INFO: leaving the record ends the escape, so the next row opened from the
|
|
334
338
|
// list peeks in the panel again rather than inheriting a full page the user
|
|
335
339
|
// asked for once. Saving a form on the full page lands on its read view, which
|
|
@@ -408,7 +412,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
408
412
|
initialFilterReferenceDate: initialFilterReferenceDate,
|
|
409
413
|
};
|
|
410
414
|
};
|
|
411
|
-
var
|
|
415
|
+
var _133 = intialiseDefaultFilterValues(), initialFilterSearch = _133.initialFilterSearch, initialFilterSearchParams = _133.initialFilterSearchParams, initialFilterSelection = _133.initialFilterSelection, initialFilterReference = _133.initialFilterReference, initialFilterReferenceDate = _133.initialFilterReferenceDate;
|
|
412
416
|
// INFO: organise.initialSearch fills the Quick find box, which sends its
|
|
413
417
|
// value under "search". Without that box (hideSearch, Firebase, or a
|
|
414
418
|
// "search" query taking its place) there is nothing to fill
|
|
@@ -424,19 +428,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
424
428
|
// keyword: All's columns and sort, no stored filters, and nothing this
|
|
425
429
|
// person kept in the browser (view drafts, persistViewState) is read or
|
|
426
430
|
// written — until they pick a view, which is their own choice again
|
|
427
|
-
var
|
|
431
|
+
var _134 = (0, react_1.useState)(function () { var _a; return handleCanInitialSearch((_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery); }), isLinkOpen = _134[0], setIsLinkOpen = _134[1];
|
|
428
432
|
var handleSeedInitialSearch = function (params) {
|
|
429
433
|
var _a;
|
|
430
434
|
return isLinkOpen && ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSearch)
|
|
431
435
|
? __assign(__assign({}, params), { search: props.organise.initialSearch }) : params;
|
|
432
436
|
};
|
|
433
437
|
// INFO: Persist view state hook — handles storage read/write for filter/sort/column state
|
|
434
|
-
var
|
|
438
|
+
var _135 = (0, viewStatePersistence_1.usePersistedViewState)({
|
|
435
439
|
mode: isLinkOpen ? undefined : (_k = props.organise) === null || _k === void 0 ? void 0 : _k.persistViewState,
|
|
436
440
|
collectionId: props.collectionId,
|
|
437
441
|
persistKey: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.persistKey,
|
|
438
442
|
type: resolvedType,
|
|
439
|
-
}), rawPersistedState =
|
|
443
|
+
}), rawPersistedState = _135.persistedState, isPersistEnabled = _135.isEnabled, handleSaveView = _135.handleSaveView, handleRegisterViewSnapshot = _135.handleRegisterViewSnapshot;
|
|
440
444
|
// INFO: drop stored filters/sort on removed columns — they would empty the table
|
|
441
445
|
var persistedState = (0, react_1.useMemo)(function () {
|
|
442
446
|
var _a, _b, _c, _d;
|
|
@@ -452,8 +456,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
452
456
|
(_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareFlexFilterListObjects,
|
|
453
457
|
(_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareFlexFilterRelated,
|
|
454
458
|
]);
|
|
455
|
-
var
|
|
456
|
-
var
|
|
459
|
+
var _136 = (0, react_1.useState)(false), loading = _136[0], setLoading = _136[1];
|
|
460
|
+
var _137 = (0, react_1.useState)(), notification = _137[0], setNotification = _137[1];
|
|
457
461
|
// INFO: a success toast is confirmation, not a decision — it clears itself so
|
|
458
462
|
// it never sits on the floating step bar; errors stay until dismissed
|
|
459
463
|
(0, react_1.useEffect)(function () {
|
|
@@ -463,86 +467,93 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
463
467
|
return function () { return clearTimeout(timer); };
|
|
464
468
|
}, [notification]);
|
|
465
469
|
//INFO : Used by List
|
|
466
|
-
var
|
|
470
|
+
var _138 = (0, react_1.useState)(function () {
|
|
467
471
|
var _a;
|
|
468
472
|
return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearch);
|
|
469
|
-
}), filterSearch =
|
|
470
|
-
var
|
|
473
|
+
}), filterSearch = _138[0], setFilterSearch = _138[1];
|
|
474
|
+
var _139 = (0, react_1.useState)(function () {
|
|
471
475
|
var _a;
|
|
472
476
|
return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearchParams);
|
|
473
|
-
}), filterSearchParams =
|
|
474
|
-
var
|
|
475
|
-
var
|
|
476
|
-
var
|
|
477
|
-
var
|
|
478
|
-
var
|
|
477
|
+
}), filterSearchParams = _139[0], setFilterSearchParams = _139[1];
|
|
478
|
+
var _140 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _q !== void 0 ? _q : initialFilterSelection), filterSelection = _140[0], setFilterSelection = _140[1];
|
|
479
|
+
var _141 = (0, react_1.useState)((_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _r !== void 0 ? _r : initialFilterReference), filterReference = _141[0], setFilterReference = _141[1];
|
|
480
|
+
var _142 = (0, react_1.useState)({}), filterReferenceSearch = _142[0], setFilterReferenceSearch = _142[1];
|
|
481
|
+
var _143 = (0, react_1.useState)({}), filterReferenceList = _143[0], setFilterReferenceList = _143[1];
|
|
482
|
+
var _144 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
|
|
479
483
|
? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
|
|
480
|
-
: initialFilterReferenceDate), filterReferenceDate =
|
|
481
|
-
var
|
|
482
|
-
var
|
|
483
|
-
var
|
|
484
|
-
var
|
|
485
|
-
var
|
|
484
|
+
: initialFilterReferenceDate), filterReferenceDate = _144[0], setFilterReferenceDate = _144[1];
|
|
485
|
+
var _145 = (0, react_1.useState)(true), tableLoading = _145[0], setTableLoading = _145[1];
|
|
486
|
+
var _146 = (0, react_1.useState)(""), cursor = _146[0], setCursor = _146[1];
|
|
487
|
+
var _147 = (0, react_1.useState)(""), lastCursor = _147[0], setLastCursor = _147[1];
|
|
488
|
+
var _148 = (0, react_1.useState)([]), tableData = _148[0], setTableData = _148[1];
|
|
489
|
+
var _149 = (0, react_1.useState)([]), spaceTableData = _149[0], setSpaceTableData = _149[1];
|
|
486
490
|
// INFO: a save resolves after later renders, so it reads the table from here —
|
|
487
491
|
// the state it closed over can predate an earlier save on the same row
|
|
488
492
|
var tableDataRef = (0, react_1.useRef)([]);
|
|
489
493
|
var spaceTableDataRef = (0, react_1.useRef)([]);
|
|
490
494
|
tableDataRef.current = tableData;
|
|
491
495
|
spaceTableDataRef.current = spaceTableData;
|
|
492
|
-
var
|
|
493
|
-
var
|
|
496
|
+
var _150 = (0, react_1.useState)(0), size = _150[0], setSize = _150[1];
|
|
497
|
+
var _151 = (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 = _151[0], setPageIndex = _151[1];
|
|
494
498
|
// INFO: every change of page, including the return to the first page when a
|
|
495
499
|
// filter or search changes, which onChangePagination does not always report
|
|
496
500
|
(0, react_1.useEffect)(function () {
|
|
497
501
|
var _a, _b;
|
|
498
502
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePageIndex) === null || _b === void 0 ? void 0 : _b.call(_a, pageIndex);
|
|
499
503
|
}, [pageIndex]);
|
|
500
|
-
var
|
|
501
|
-
var
|
|
502
|
-
var
|
|
503
|
-
var
|
|
504
|
-
var
|
|
504
|
+
var _152 = (0, react_1.useState)([]), selectedIds = _152[0], setSelectedIds = _152[1];
|
|
505
|
+
var _153 = (0, react_1.useState)(false), selectAll = _153[0], setSelectAll = _153[1];
|
|
506
|
+
var _154 = (0, react_1.useState)(""), deletePasscode = _154[0], setDeletePasscode = _154[1];
|
|
507
|
+
var _155 = (0, react_1.useState)(""), deletePasscodeInput = _155[0], setDeletePasscodeInput = _155[1];
|
|
508
|
+
var _156 = (0, react_1.useState)(""), deleteFeedId = _156[0], setDeleteFeedId = _156[1];
|
|
505
509
|
//INFO : Used by List Organise
|
|
506
510
|
// INFO: Internal sort state that overrides props.organise?.sort when
|
|
507
511
|
// persistViewState is enabled and a persisted sort exists
|
|
508
|
-
var
|
|
509
|
-
var
|
|
510
|
-
var
|
|
511
|
-
var
|
|
512
|
+
var _157 = (0, react_1.useState)((_v = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _v !== void 0 ? _v : undefined), persistedSort = _157[0], setPersistedSort = _157[1];
|
|
513
|
+
var _158 = (0, react_1.useState)(false), filterDraft = _158[0], setFilterDraft = _158[1];
|
|
514
|
+
var _159 = (0, react_1.useState)(false), addTabModal = _159[0], setAddTabModal = _159[1];
|
|
515
|
+
var _160 = (0, react_1.useState)(-1), editTabIndex = _160[0], setEditTabIndex = _160[1];
|
|
512
516
|
//INFO : resolve the initial tab synchronously so the mount cond is already
|
|
513
517
|
// tab-scoped — an empty initial tab caused a second wasted list fetch
|
|
514
|
-
var
|
|
518
|
+
var _161 = (0, react_1.useState)(function () {
|
|
515
519
|
var _a;
|
|
516
520
|
return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, listViewId);
|
|
517
|
-
}), selectedTab =
|
|
518
|
-
var
|
|
521
|
+
}), selectedTab = _161[0], setSelectedTab = _161[1];
|
|
522
|
+
var _162 = (0, react_1.useState)("dayGridMonth"), calendarView = _162[0], setCalendarView = _162[1];
|
|
519
523
|
// INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
|
|
520
524
|
// (calendarView above drives the matching range query)
|
|
521
|
-
var
|
|
522
|
-
var
|
|
525
|
+
var _163 = (0, react_1.useState)("month"), newCalendarViewMode = _163[0], setNewCalendarViewMode = _163[1];
|
|
526
|
+
var _164 = (0, react_1.useState)(new Date()), calendarTabMonth = _164[0], setCalendarTabMonth = _164[1];
|
|
527
|
+
// INFO: read once per theme — it asks the browser to resolve a style
|
|
528
|
+
var timelinePrimaryColour = (0, react_1.useMemo)(function () { return (0, timelineBars_1.handleReadPrimaryColour)(); },
|
|
529
|
+
/* eslint-disable-next-line */
|
|
530
|
+
[(_w = props.organise) === null || _w === void 0 ? void 0 : _w.darkMode]);
|
|
531
|
+
// INFO: the period a timeline shows — it reads only the records whose bars
|
|
532
|
+
// overlap it, so a large datasheet loads one month or quarter at a time
|
|
533
|
+
var _165 = (0, react_1.useState)({ unit: "month", anchor: new Date() }), timelineRange = _165[0], setTimelineRange = _165[1];
|
|
523
534
|
// INFO: defaultViewSwitch picks the opening view only — the tab re-inits
|
|
524
535
|
// whenever its settings change, and that must not undo the user's switch
|
|
525
536
|
var calendarViewInitRef = (0, react_1.useRef)(false);
|
|
526
|
-
var
|
|
527
|
-
var
|
|
528
|
-
var
|
|
529
|
-
var
|
|
537
|
+
var _166 = (0, react_1.useState)(true), kanbanDroppable = _166[0], setKanbanDroppable = _166[1];
|
|
538
|
+
var _167 = (0, react_1.useState)([]), kanbanOptions = _167[0], setKanbanOptions = _167[1];
|
|
539
|
+
var _168 = (0, react_1.useState)(false), batchUpdateModal = _168[0], setBatchUpdateModal = _168[1];
|
|
540
|
+
var _169 = (0, react_1.useState)({
|
|
530
541
|
columnId: "",
|
|
531
542
|
columnData: {},
|
|
532
|
-
}), batchUpdateData =
|
|
543
|
+
}), batchUpdateData = _169[0], setBatchUpdateData = _169[1];
|
|
533
544
|
// INFO: system columns (created / updated at and by, record id, number)
|
|
534
545
|
// join the structure hidden; the ones a user shows are kept per view
|
|
535
|
-
var isSystemColumnsEnabled = !!((
|
|
536
|
-
var isSystemColumnsLocked = !!((
|
|
546
|
+
var isSystemColumnsEnabled = !!((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareSystemColumns);
|
|
547
|
+
var isSystemColumnsLocked = !!((_y = props.bareSettings) === null || _y === void 0 ? void 0 : _y.bareSystemColumnsLocked);
|
|
537
548
|
var appendedSystemColumnIds = isSystemColumnsEnabled
|
|
538
549
|
? 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; }); })
|
|
539
550
|
: [];
|
|
540
|
-
var
|
|
551
|
+
var _170 = (0, react_1.useState)((_z = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _z !== void 0 ? _z : []), shownSystemColumnIds = _170[0], setShownSystemColumnIds = _170[1];
|
|
541
552
|
var handleWithSystemColumns = function (model, shownIds) {
|
|
542
553
|
if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
|
|
543
554
|
return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
|
|
544
555
|
};
|
|
545
|
-
var
|
|
556
|
+
var _171 = (0, react_1.useState)(function () {
|
|
546
557
|
var _a;
|
|
547
558
|
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 : []);
|
|
548
559
|
if (!persistedState)
|
|
@@ -569,8 +580,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
569
580
|
});
|
|
570
581
|
}
|
|
571
582
|
return model;
|
|
572
|
-
}), structure =
|
|
573
|
-
var
|
|
583
|
+
}), structure = _171[0], setStructure = _171[1];
|
|
584
|
+
var _172 = (0, react_1.useState)(((_0 = props === null || props === void 0 ? void 0 : props.organise) === null || _0 === void 0 ? void 0 : _0.additionalQuery) || []), additionalQuery = _172[0], setAdditionalQuery = _172[1];
|
|
574
585
|
// INFO: State for user-configurable flex filters (Monday.com-style)
|
|
575
586
|
// INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
|
|
576
587
|
var defaultFlexFilterRow = [
|
|
@@ -582,13 +593,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
582
593
|
},
|
|
583
594
|
];
|
|
584
595
|
// INFO: rows the host opens the list with come before a saved view's
|
|
585
|
-
var initialFlexFilterRows = ((
|
|
596
|
+
var initialFlexFilterRows = ((_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.initialFlexFilters) &&
|
|
586
597
|
props.organise.initialFlexFilters.length > 0
|
|
587
598
|
? props.organise.initialFlexFilters
|
|
588
599
|
: (persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
589
600
|
? persistedState.flexFilters
|
|
590
601
|
: defaultFlexFilterRow;
|
|
591
|
-
var
|
|
602
|
+
var _173 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _173[0], setFlexFilters = _173[1];
|
|
592
603
|
// INFO: always-current mirror of flexFilters, read by the imperative apply/
|
|
593
604
|
// clear methods so chained calls in one tick aren't stale.
|
|
594
605
|
var flexFiltersRef = (0, react_1.useRef)(flexFilters);
|
|
@@ -601,111 +612,111 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
601
612
|
}, [flexFilters]);
|
|
602
613
|
// INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
|
|
603
614
|
// to prevent API calls on every keystroke when typing in value inputs
|
|
604
|
-
var
|
|
615
|
+
var _174 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _174[0], setFlexFiltersDebounced = _174[1];
|
|
605
616
|
// INFO: the filter rows of the export being set up — started from the
|
|
606
617
|
// list's own when the export opens, so changing them leaves the list as it is
|
|
607
|
-
var
|
|
608
|
-
var
|
|
609
|
-
var
|
|
610
|
-
var
|
|
611
|
-
var
|
|
618
|
+
var _175 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _175[0], setExportFlexFilters = _175[1];
|
|
619
|
+
var _176 = (0, react_1.useState)({}), flexFilterReferenceOptions = _176[0], setFlexFilterReferenceOptions = _176[1];
|
|
620
|
+
var _177 = (0, react_1.useState)({}), flexFilterReferenceSearch = _177[0], setFlexFilterReferenceSearch = _177[1];
|
|
621
|
+
var _178 = (0, react_1.useState)(false), flexFilterModalOpen = _178[0], setFlexFilterModalOpen = _178[1];
|
|
622
|
+
var _179 = (0, react_1.useState)(false), viewSettingsModalOpen = _179[0], setViewSettingsModalOpen = _179[1];
|
|
612
623
|
// INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
|
|
613
624
|
// Deliberately kept out of `structure`: the props-sync effect below resets
|
|
614
625
|
// structure to props.model whenever props change, which would wipe the
|
|
615
626
|
// choice, and the persist effect derives schema-level hiddenColumnIds from
|
|
616
627
|
// structure — writing user hides there would blur the two concepts.
|
|
617
|
-
var
|
|
618
|
-
var
|
|
619
|
-
var
|
|
620
|
-
var
|
|
628
|
+
var _180 = (0, react_1.useState)((_2 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _2 !== void 0 ? _2 : []), userHiddenColumnIds = _180[0], setUserHiddenColumnIds = _180[1];
|
|
629
|
+
var _181 = (0, react_1.useState)(""), columnSearch = _181[0], setColumnSearch = _181[1];
|
|
630
|
+
var _182 = (0, react_1.useState)([]), savedViews = _182[0], setSavedViews = _182[1];
|
|
631
|
+
var _183 = (0, react_1.useState)(null), activeSavedViewId = _183[0], setActiveSavedViewId = _183[1];
|
|
621
632
|
// INFO: the widths of the view on screen, by column id ("180px")
|
|
622
|
-
var
|
|
633
|
+
var _184 = (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 = _184[0], setColumnWidths = _184[1];
|
|
623
634
|
// INFO: the kanban lane widths of the view on screen, by lane id ("300px")
|
|
624
|
-
var
|
|
635
|
+
var _185 = (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 = _185[0], setLaneWidths = _185[1];
|
|
625
636
|
// INFO: the read drawer's dragged width ("520px"), kept in the view with the
|
|
626
637
|
// column widths. A restored persistViewState wins over All's, as a saved
|
|
627
638
|
// view or draft applied at opening replaces both
|
|
628
|
-
var
|
|
639
|
+
var _186 = (0, react_1.useState)(function () {
|
|
629
640
|
var _a, _b, _c;
|
|
630
641
|
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;
|
|
631
|
-
}), drawerWidth =
|
|
642
|
+
}), drawerWidth = _186[0], setDrawerWidth = _186[1];
|
|
632
643
|
// INFO: the columns the view on screen freezes at the left edge
|
|
633
|
-
var
|
|
644
|
+
var _187 = (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 = _187[0], setPinnedColumnIds = _187[1];
|
|
634
645
|
// INFO: unsaved changes are kept only once the opening view is on screen,
|
|
635
646
|
// so the defaults drawn before it never overwrite a person's own
|
|
636
|
-
var
|
|
647
|
+
var _188 = (0, react_1.useState)(false), isViewDraftReady = _188[0], setIsViewDraftReady = _188[1];
|
|
637
648
|
// INFO: null while the name box is closed
|
|
638
|
-
var
|
|
639
|
-
var
|
|
649
|
+
var _189 = (0, react_1.useState)(null), savedViewName = _189[0], setSavedViewName = _189[1];
|
|
650
|
+
var _190 = (0, react_1.useState)(null), deletingSavedViewId = _190[0], setDeletingSavedViewId = _190[1];
|
|
640
651
|
// INFO: the view chip being dragged, to drop it in another place
|
|
641
|
-
var
|
|
652
|
+
var _191 = (0, react_1.useState)(null), draggingSavedViewId = _191[0], setDraggingSavedViewId = _191[1];
|
|
642
653
|
// INFO: the tab strip in the order a drag has reached, saved once on drop
|
|
643
|
-
var
|
|
644
|
-
var
|
|
645
|
-
var
|
|
646
|
-
var
|
|
654
|
+
var _192 = (0, react_1.useState)(null), draggedTabs = _192[0], setDraggedTabs = _192[1];
|
|
655
|
+
var _193 = (0, react_1.useState)(null), renamingSavedView = _193[0], setRenamingSavedView = _193[1];
|
|
656
|
+
var _194 = (0, react_1.useState)(false), isSavedViewsExpanded = _194[0], setIsSavedViewsExpanded = _194[1];
|
|
657
|
+
var _195 = (0, react_1.useState)(null), draggingColumnId = _195[0], setDraggingColumnId = _195[1];
|
|
647
658
|
var columnRowRefs = (0, react_1.useRef)({});
|
|
648
659
|
//INFO : Used by Auth
|
|
649
|
-
var
|
|
660
|
+
var _196 = (0, react_1.useState)({
|
|
650
661
|
email: "",
|
|
651
662
|
google: "",
|
|
652
663
|
phone: "",
|
|
653
664
|
disabled: false,
|
|
654
665
|
create: false,
|
|
655
|
-
}), authMethods =
|
|
656
|
-
var
|
|
666
|
+
}), authMethods = _196[0], setAuthMethods = _196[1];
|
|
667
|
+
var _197 = (0, react_1.useState)(""), selectedAuthMethod = _197[0], setSelectedAuthMethod = _197[1];
|
|
657
668
|
// INFO: the sign-in check of a users datasheet's record is running; the
|
|
658
669
|
// panel shows a spinner rather than nothing, which read as "no login"
|
|
659
|
-
var
|
|
670
|
+
var _198 = (0, react_1.useState)(false), authLoading = _198[0], setAuthLoading = _198[1];
|
|
660
671
|
// INFO: a delete is running — the ref answers a second tap at once, before
|
|
661
672
|
// the state has rendered, and the state disables the confirm button
|
|
662
673
|
var deletingRef = (0, react_1.useRef)(false);
|
|
663
|
-
var
|
|
674
|
+
var _199 = (0, react_1.useState)(false), deleting = _199[0], setDeleting = _199[1];
|
|
664
675
|
// INFO: Used by Activity Log
|
|
665
|
-
var
|
|
666
|
-
var
|
|
676
|
+
var _200 = (0, react_1.useState)(false), activityModal = _200[0], setActivityModal = _200[1];
|
|
677
|
+
var _201 = (0, react_1.useState)(""), activityId = _201[0], setActivityId = _201[1];
|
|
667
678
|
//INFO : Used by Export
|
|
668
|
-
var
|
|
669
|
-
var
|
|
670
|
-
var
|
|
671
|
-
var
|
|
672
|
-
var
|
|
673
|
-
var
|
|
674
|
-
var
|
|
675
|
-
var
|
|
676
|
-
var
|
|
677
|
-
var
|
|
678
|
-
var
|
|
679
|
-
var
|
|
680
|
-
var
|
|
681
|
-
var
|
|
682
|
-
var
|
|
679
|
+
var _202 = (0, react_1.useState)(null), csvFile = _202[0], setCSVFile = _202[1];
|
|
680
|
+
var _203 = (0, react_1.useState)([]), csvFileData = _203[0], setCSVFileData = _203[1];
|
|
681
|
+
var _204 = (0, react_1.useState)(0), stepCSVIndex = _204[0], setStepCSVIndex = _204[1];
|
|
682
|
+
var _205 = (0, react_1.useState)({}), listCSVMapAttribute = _205[0], setListCSVMapAttribute = _205[1];
|
|
683
|
+
var _206 = (0, react_1.useState)({}), listCSVObjAttribute = _206[0], setListCSVObjAttribute = _206[1];
|
|
684
|
+
var _207 = (0, react_1.useState)([]), csvAPIAttribute = _207[0], setCSVAPIAttribute = _207[1];
|
|
685
|
+
var _208 = (0, react_1.useState)(((_3 = props.devSettings.currentUser) === null || _3 === void 0 ? void 0 : _3.userEmail) || ""), exportCSVEmail = _208[0], setExportCSVEmail = _208[1];
|
|
686
|
+
var _209 = (0, react_1.useState)(((_5 = (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.exportSettings) === null || _5 === void 0 ? void 0 : _5.defaultExportPDFName) || ""), exportPDFTitle = _209[0], setExportPDFTitle = _209[1];
|
|
687
|
+
var _210 = (0, react_1.useState)(false), exportPDFLoading = _210[0], setExportPDFLoading = _210[1];
|
|
688
|
+
var _211 = (0, react_1.useState)(false), exportReadPDFLoading = _211[0], setExportReadPDFLoading = _211[1];
|
|
689
|
+
var _212 = (0, react_1.useState)((_8 = (_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.exportSettings) === null || _7 === void 0 ? void 0 : _7.sumColumnId) !== null && _8 !== void 0 ? _8 : []), exportSumAttributeIds = _212[0], setExportSumAttributeIds = _212[1];
|
|
690
|
+
var _213 = (0, react_1.useState)((_11 = (_10 = (_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.exportSettings) === null || _10 === void 0 ? void 0 : _10.hideSubItems) !== null && _11 !== void 0 ? _11 : false), hideSubItems = _213[0], setHideSubItems = _213[1];
|
|
691
|
+
var _214 = (0, react_1.useState)([]), importTableData = _214[0], setImportTableData = _214[1];
|
|
692
|
+
var _215 = (0, react_1.useState)([]), queryList = _215[0], setQueryList = _215[1];
|
|
693
|
+
var _216 = (0, react_1.useState)(undefined), allQueryList = _216[0], setAllQueryList = _216[1];
|
|
683
694
|
// INFO: a restored state wins over the prop; its "" is a list the user
|
|
684
695
|
// ungrouped, so it opens ungrouped
|
|
685
|
-
var
|
|
696
|
+
var _217 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
|
|
686
697
|
? persistedState.groupBy || undefined
|
|
687
|
-
: (
|
|
698
|
+
: (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.groupBy), groupId = _217[0], setGroupId = _217[1];
|
|
688
699
|
// INFO: each group's total per number column, keyed by section id
|
|
689
|
-
var
|
|
700
|
+
var _218 = (0, react_1.useState)({}), groupSummaries = _218[0], setGroupSummaries = _218[1];
|
|
690
701
|
// INFO: each group's row count over every row the filters match; null until
|
|
691
702
|
// read. A band paged alone shows it until its own first page lands, and a
|
|
692
703
|
// band it counts empty is left out instead of waiting to be read
|
|
693
|
-
var
|
|
704
|
+
var _219 = (0, react_1.useState)(null), groupTotals = _219[0], setGroupTotals = _219[1];
|
|
694
705
|
// INFO: the last read of groupTotals failed, so bands fall back to the rows
|
|
695
706
|
// loaded instead of waiting on a total that is not coming
|
|
696
|
-
var
|
|
707
|
+
var _220 = (0, react_1.useState)(false), groupTotalsFailed = _220[0], setGroupTotalsFailed = _220[1];
|
|
697
708
|
var groupSummaryRequestRef = (0, react_1.useRef)(0);
|
|
698
709
|
// INFO: the grouped count waiting to go out, so a filter change can stop it
|
|
699
710
|
// before it sends the filters it was scheduled with
|
|
700
711
|
var groupSummaryTimerRef = (0, react_1.useRef)(null);
|
|
701
|
-
var
|
|
702
|
-
var
|
|
712
|
+
var _221 = (0, react_1.useState)({}), commentCounts = _221[0], setCommentCounts = _221[1];
|
|
713
|
+
var _222 = (0, react_1.useState)({}), commentUnread = _222[0], setCommentUnread = _222[1];
|
|
703
714
|
// INFO: Monday-board per-group paging. Keyed by the group key that
|
|
704
715
|
// handleBuildNewTableGroups() produces (an option, Unknown or No Value).
|
|
705
716
|
// Each group tracks its own loaded cursor + total so it can lazily load its
|
|
706
717
|
// next page as the user scrolls inside that band, independent of every other
|
|
707
718
|
// group. Only used when renderCheckGroupPaging() is true.
|
|
708
|
-
var
|
|
719
|
+
var _223 = (0, react_1.useState)({}), groupPageState = _223[0], setGroupPageState = _223[1];
|
|
709
720
|
// INFO: read fresh inside the async per-group fetch so chained scroll fires
|
|
710
721
|
// in one tick do not re-fetch an already in-flight page.
|
|
711
722
|
var groupPageStateRef = (0, react_1.useRef)({});
|
|
@@ -720,62 +731,62 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
720
731
|
var groupLoadingKeyRef = (0, react_1.useRef)(null);
|
|
721
732
|
var groupLoadQueueRef = (0, react_1.useRef)([]);
|
|
722
733
|
var handleFetchGroupNextPageRef = (0, react_1.useRef)(function () { });
|
|
723
|
-
var
|
|
724
|
-
var
|
|
734
|
+
var _224 = (0, react_1.useState)(""), readTabSection = _224[0], setReadTabSection = _224[1];
|
|
735
|
+
var _225 = (0, react_1.useState)(false), readFloatingNav = _225[0], setReadFloatingNav = _225[1];
|
|
725
736
|
var readTabSectionRefs = (0, react_1.useRef)({});
|
|
726
737
|
//INFO : Used by Read
|
|
727
738
|
//INFO : Used by Update
|
|
728
|
-
var
|
|
729
|
-
var
|
|
730
|
-
var
|
|
731
|
-
var
|
|
732
|
-
var
|
|
733
|
-
var
|
|
734
|
-
var
|
|
739
|
+
var _226 = (0, react_1.useState)(false), modalVisible = _226[0], setModalVisible = _226[1];
|
|
740
|
+
var _227 = (0, react_1.useState)(false), deleteModal = _227[0], setDeleteModal = _227[1];
|
|
741
|
+
var _228 = (0, react_1.useState)(false), excelModal = _228[0], setExcelModal = _228[1];
|
|
742
|
+
var _229 = (0, react_1.useState)(false), exportExcel = _229[0], setExportExcel = _229[1];
|
|
743
|
+
var _230 = (0, react_1.useState)(""), exportType = _230[0], setExportType = _230[1];
|
|
744
|
+
var _231 = (0, react_1.useState)(false), exportQR = _231[0], setExportQR = _231[1];
|
|
745
|
+
var _232 = (0, react_1.useState)(function () {
|
|
735
746
|
var _a, _b;
|
|
736
747
|
var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
|
|
737
748
|
return firstTabId;
|
|
738
|
-
}), activeTab =
|
|
739
|
-
var
|
|
740
|
-
var
|
|
741
|
-
var
|
|
742
|
-
var
|
|
743
|
-
var
|
|
744
|
-
var
|
|
745
|
-
var
|
|
749
|
+
}), activeTab = _232[0], setActiveTab = _232[1];
|
|
750
|
+
var _233 = (0, react_1.useState)(false), signatureSigning = _233[0], setSignatureSigning = _233[1];
|
|
751
|
+
var _234 = (0, react_1.useState)({}), selectedData = _234[0], setSelectedData = _234[1];
|
|
752
|
+
var _235 = (0, react_1.useState)(""), selectedObjectStructureId = _235[0], setSelectedObjectStructureId = _235[1];
|
|
753
|
+
var _236 = (0, react_1.useState)(""), selectedObjectId = _236[0], setSelectedObjectId = _236[1];
|
|
754
|
+
var _237 = (0, react_1.useState)(""), selectedListAddressId = _237[0], setSelectedListAddressId = _237[1];
|
|
755
|
+
var _238 = (0, react_1.useState)(-1), selectedListAddressIndex = _238[0], setSelectedListAddressIndex = _238[1];
|
|
756
|
+
var _239 = (0, react_1.useState)({
|
|
746
757
|
lat: 0,
|
|
747
758
|
lng: 0,
|
|
748
759
|
name: "",
|
|
749
|
-
}), selectedListAddress =
|
|
750
|
-
var
|
|
751
|
-
var
|
|
752
|
-
var
|
|
753
|
-
var
|
|
754
|
-
var
|
|
755
|
-
var
|
|
760
|
+
}), selectedListAddress = _239[0], setSelectedListAddress = _239[1];
|
|
761
|
+
var _240 = (0, react_1.useState)({}), selectedObjectData = _240[0], setSelectedObjectData = _240[1];
|
|
762
|
+
var _241 = (0, react_1.useState)(null), objectCellEdit = _241[0], setObjectCellEdit = _241[1];
|
|
763
|
+
var _242 = (0, react_1.useState)(false), referenceLoading = _242[0], setReferenceLoading = _242[1];
|
|
764
|
+
var _243 = (0, react_1.useState)({}), referencesOptions = _243[0], setReferencesOptions = _243[1];
|
|
765
|
+
var _244 = (0, react_1.useState)({}), referencesDetails = _244[0], setReferencesDetails = _244[1];
|
|
766
|
+
var _245 = (0, react_1.useState)({}), listReferencesOptions = _245[0], setListReferencesOptions = _245[1];
|
|
756
767
|
// INFO: the referenced records themselves, for a table cell that picks from
|
|
757
768
|
// a list on one (referenceSelection)
|
|
758
|
-
var
|
|
759
|
-
var
|
|
760
|
-
var
|
|
761
|
-
var
|
|
762
|
-
var
|
|
769
|
+
var _246 = (0, react_1.useState)({}), listReferencesDetails = _246[0], setListReferencesDetails = _246[1];
|
|
770
|
+
var _247 = (0, react_1.useState)({}), referenceDeleteTableData = _247[0], setReferenceDeleteTableData = _247[1];
|
|
771
|
+
var _248 = (0, react_1.useState)([]), relatedSections = _248[0], setRelatedSections = _248[1];
|
|
772
|
+
var _249 = (0, react_1.useState)(0), referenceDeleteIndex = _249[0], setReferenceDeleteIndex = _249[1];
|
|
773
|
+
var _250 = (0, react_1.useState)({
|
|
763
774
|
id: "",
|
|
764
775
|
name: "",
|
|
765
776
|
type: "string",
|
|
766
|
-
}), referenceCreationModal =
|
|
767
|
-
var
|
|
768
|
-
var
|
|
777
|
+
}), referenceCreationModal = _250[0], setReferenceCreationModal = _250[1];
|
|
778
|
+
var _251 = (0, react_1.useState)({}), referenceModelSchema = _251[0], setReferenceSchema = _251[1];
|
|
779
|
+
var _252 = (0, react_1.useState)([]), kanbanChecked = _252[0], setKanbanChecked = _252[1];
|
|
769
780
|
//INFO : Offline
|
|
770
|
-
var
|
|
771
|
-
var
|
|
781
|
+
var _253 = (0, react_1.useState)(0), offlineDataLength = _253[0], setOfflineDataLength = _253[1];
|
|
782
|
+
var _254 = (0, react_1.useState)(false), offlineModal = _254[0], setOfflineModal = _254[1];
|
|
772
783
|
// INFO: live-stream state — driven by socket connection and navigator.onLine
|
|
773
|
-
var
|
|
774
|
-
var
|
|
784
|
+
var _255 = (0, react_1.useState)(false), isLive = _255[0], setIsLive = _255[1];
|
|
785
|
+
var _256 = (0, react_1.useState)(false), isLiveOffline = _256[0], setIsLiveOffline = _256[1];
|
|
775
786
|
// INFO: true when navigator is offline — used to switch ReadQueryHoc between
|
|
776
787
|
// server reads (online, full pagination) and IndexedDB reads (offline, cached data).
|
|
777
788
|
// Independent of SSE status so it works even when bareSocketName is not set.
|
|
778
|
-
var
|
|
789
|
+
var _257 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _257[0], setIsNetworkOffline = _257[1];
|
|
779
790
|
var previousType = (0, react_1.useRef)(null);
|
|
780
791
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
781
792
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
@@ -925,7 +936,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
925
936
|
* viewId still wins when present: it is a deliberate destination, from a
|
|
926
937
|
* shared link or a back button.
|
|
927
938
|
*/
|
|
928
|
-
var defaultTabName = (
|
|
939
|
+
var defaultTabName = (_15 = (_14 = (_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.extendedTabs) === null || _14 === void 0 ? void 0 : _14.find(function (eachTab) { return eachTab.defaultTab; })) === null || _15 === void 0 ? void 0 : _15.name;
|
|
929
940
|
// INFO: the pinned tab is a LIST destination. Falling back to it while a
|
|
930
941
|
// record is open resolved the read view to a list tab, which renderTabContent
|
|
931
942
|
// refuses — so General Details rendered nothing. Only a list falls back.
|
|
@@ -937,14 +948,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
937
948
|
// INFO: Firestore reads and the monday wrapper join every condition with AND
|
|
938
949
|
// (monday flattens all ORs into one), so a flex OR group is offered on Mongo only
|
|
939
950
|
var isFlexOrSupported = !isFirebase && devSettings.server !== "mondayServer";
|
|
940
|
-
var isDateWarnings = !!((
|
|
941
|
-
var isDatasheetDefaults = !!((
|
|
951
|
+
var isDateWarnings = !!((_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.dateWarnings);
|
|
952
|
+
var isDatasheetDefaults = !!((_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.datasheetDefaults);
|
|
942
953
|
// INFO: the columns as the views draw them — with datasheet defaults every
|
|
943
954
|
// list option without a colour takes the palette colour of its position
|
|
944
955
|
var displayStructure = isDatasheetDefaults
|
|
945
956
|
? (0, defaultColours_1.handleApplyDefaultColours)(structure)
|
|
946
957
|
: structure;
|
|
947
|
-
var dbModule = isFirebaseClient ? (
|
|
958
|
+
var dbModule = isFirebaseClient ? (_18 = props.lib) === null || _18 === void 0 ? void 0 : _18.firebase : (_19 = props.lib) === null || _19 === void 0 ? void 0 : _19.axios;
|
|
948
959
|
var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
|
|
949
960
|
var selectedRelated = resolvedType === "read"
|
|
950
961
|
? relatedSections.find(function (eachSection) { return eachSection.id === viewType; })
|
|
@@ -1138,32 +1149,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1138
1149
|
}, [
|
|
1139
1150
|
resolvedType,
|
|
1140
1151
|
props.id,
|
|
1141
|
-
(
|
|
1152
|
+
(_20 = props.space) === null || _20 === void 0 ? void 0 : _20._id,
|
|
1142
1153
|
props.devSettings.schemaEndpoint,
|
|
1143
|
-
(
|
|
1154
|
+
(_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.showRelatedTab,
|
|
1144
1155
|
]);
|
|
1145
1156
|
/* eslint-enable */
|
|
1146
1157
|
// INFO: the view settings panel (columns, sort, rows per page) is standard on
|
|
1147
1158
|
// the new DTW; bareViewSettings stays the opt-in for legacy and bare DTWs
|
|
1148
|
-
var isViewSettingsEnabled = ((
|
|
1159
|
+
var isViewSettingsEnabled = ((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareViewSettings) || ((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareNewDTW)
|
|
1149
1160
|
? true
|
|
1150
1161
|
: false;
|
|
1151
1162
|
// INFO: a consumer that wires onChangeHide owns the hide at schema level
|
|
1152
1163
|
// (shared by every user) — toggling writes to the model and calls back. Without it
|
|
1153
1164
|
// the hide is this user's own and lives in userHiddenColumnIds.
|
|
1154
|
-
var isSchemaHideMode = ((
|
|
1165
|
+
var isSchemaHideMode = ((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.onChangeHide) ? true : false;
|
|
1155
1166
|
// INFO: rows per page is a view setting the user can change, so it starts from
|
|
1156
1167
|
// the persisted value and falls back to the consumer's limit
|
|
1157
|
-
var
|
|
1168
|
+
var _258 = (0, react_1.useState)((_26 = (_25 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _25 !== void 0 ? _25 : props.limit) !== null && _26 !== void 0 ? _26 : 10), pageLimit = _258[0], setPageLimit = _258[1];
|
|
1158
1169
|
var limit = pageLimit;
|
|
1159
|
-
var isSavedViewsEnabled = !!((
|
|
1170
|
+
var isSavedViewsEnabled = !!((_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.savedViews) && resolvedType === "list";
|
|
1171
|
+
// INFO: a calendar and a chart draw their own way, so columns, sort and
|
|
1172
|
+
// group have nothing to change there
|
|
1173
|
+
var isViewSettingsHiddenForTab = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "calendar" || (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "chart";
|
|
1174
|
+
// INFO: Group shapes a table, list or grid into sections, a map into routes
|
|
1175
|
+
// and a timeline into colours
|
|
1176
|
+
var isGroupPickerShown = !!((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.showGroupByFeature) && !isViewSettingsHiddenForTab;
|
|
1160
1177
|
// INFO: an app that stores views takes over from this browser's storage, so
|
|
1161
1178
|
// every view is the team's and nothing is kept locally
|
|
1162
|
-
var isAppViews = ((
|
|
1163
|
-
!!((
|
|
1179
|
+
var isAppViews = ((_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.sharedViews) !== undefined ||
|
|
1180
|
+
!!((_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.onChangeSharedViews);
|
|
1164
1181
|
// INFO: a saved view carries its sort, so the sort is held here as with persistViewState
|
|
1165
1182
|
var isInternalSort = isPersistEnabled || isSavedViewsEnabled;
|
|
1166
|
-
var activeSortId = (isInternalSort && persistedSort) || ((
|
|
1183
|
+
var activeSortId = (isInternalSort && persistedSort) || ((_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.sort);
|
|
1167
1184
|
var handleSortColumn = function (value) {
|
|
1168
1185
|
var _a, _b, _c, _d;
|
|
1169
1186
|
if (isInternalSort)
|
|
@@ -1193,7 +1210,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1193
1210
|
// INFO: Firebase pages by document cursor and a union by skip, so neither
|
|
1194
1211
|
// can hand over the whole set — there formula columns are not offered for
|
|
1195
1212
|
// sorting or filtering, rather than ordering one page
|
|
1196
|
-
var isFormulaViewSupported = !isFirebase && !((
|
|
1213
|
+
var isFormulaViewSupported = !isFirebase && !((_33 = (_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.unionCollections) === null || _33 === void 0 ? void 0 : _33.length);
|
|
1197
1214
|
var formulaSort = isFormulaViewSupported &&
|
|
1198
1215
|
(activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) &&
|
|
1199
1216
|
formulaColumnIds.includes(activeSortId.sortId)
|
|
@@ -1204,12 +1221,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1204
1221
|
// a union read runs them
|
|
1205
1222
|
// INFO: a people filter's "me" needs only who is signed in, which any
|
|
1206
1223
|
// backend can match
|
|
1207
|
-
var currentUserId = (
|
|
1208
|
-
var flexFilterExtras = !isFirebase && !((
|
|
1224
|
+
var currentUserId = (_34 = props.devSettings.currentUser) === null || _34 === void 0 ? void 0 : _34.userId;
|
|
1225
|
+
var flexFilterExtras = !isFirebase && !((_36 = (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.unionCollections) === null || _36 === void 0 ? void 0 : _36.length)
|
|
1209
1226
|
? {
|
|
1210
|
-
references: (
|
|
1211
|
-
listObjects: (
|
|
1212
|
-
related: (
|
|
1227
|
+
references: (_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareFlexFilterReferences,
|
|
1228
|
+
listObjects: (_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareFlexFilterListObjects,
|
|
1229
|
+
related: (_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareFlexFilterRelated,
|
|
1213
1230
|
currentUserId: currentUserId,
|
|
1214
1231
|
}
|
|
1215
1232
|
: currentUserId
|
|
@@ -1301,18 +1318,67 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1301
1318
|
displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
|
|
1302
1319
|
};
|
|
1303
1320
|
};
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1321
|
+
// INFO: a formula filter runs in the browser, so a select-all read on the
|
|
1322
|
+
// server matches more rows than the list shows — only the ids the formula
|
|
1323
|
+
// kept may be deleted or updated. null when the kept rows are not known
|
|
1324
|
+
var handleGetFormulaKeptIds = function () {
|
|
1325
|
+
if (formulaFlexQueries.length === 0)
|
|
1326
|
+
return null;
|
|
1327
|
+
var cached = formulaFullReadRef.current;
|
|
1328
|
+
if (!cached)
|
|
1329
|
+
return new Set();
|
|
1330
|
+
return new Set(handleApplyFormulaView(cached.rows, cached.displayRows).rows.map(function (eachRow) { return handleGetRowId(eachRow); }));
|
|
1331
|
+
};
|
|
1332
|
+
// INFO: a row's id whether it came straight from the server (its serverId)
|
|
1333
|
+
// or through the list, which renames _id to id
|
|
1334
|
+
var handleGetRowId = function (row) { var _a, _b, _c, _d; return String((_d = (_c = (_b = (_a = row === null || row === void 0 ? void 0 : row[serverId]) !== null && _a !== void 0 ? _a : row === null || row === void 0 ? void 0 : row.recordId) !== null && _b !== void 0 ? _b : row === null || row === void 0 ? void 0 : row.id) !== null && _c !== void 0 ? _c : row === null || row === void 0 ? void 0 : row._id) !== null && _d !== void 0 ? _d : ""); };
|
|
1335
|
+
// INFO: the count the reader saw when choosing select-all — a delete or
|
|
1336
|
+
// update refuses if what matches then is a different number, even if the
|
|
1337
|
+
// list has since reloaded with a new count
|
|
1338
|
+
var selectAllSizeRef = (0, react_1.useRef)(0);
|
|
1339
|
+
var handleGetChangedListMessage = function (matchedCount) {
|
|
1340
|
+
return "The list changed: ".concat(selectAllSizeRef.current.toLocaleString(), " records were selected but ").concat(matchedCount.toLocaleString(), " match now. Refresh and select again.");
|
|
1341
|
+
};
|
|
1342
|
+
// INFO: whether the reader narrowed the list — the app's own fixed
|
|
1343
|
+
// conditions (a workspace, a member's rows) are not the reader's filters
|
|
1344
|
+
var handleHasFilterValue = function (values) {
|
|
1345
|
+
return Object.values(values !== null && values !== void 0 ? values : {}).some(function (value) {
|
|
1346
|
+
return Array.isArray(value)
|
|
1347
|
+
? value.length > 0
|
|
1348
|
+
: value !== undefined &&
|
|
1349
|
+
value !== null &&
|
|
1350
|
+
value !== "" &&
|
|
1351
|
+
(value instanceof Date ||
|
|
1352
|
+
!(typeof value === "object" && Object.keys(value).length === 0));
|
|
1353
|
+
});
|
|
1354
|
+
};
|
|
1355
|
+
var handleCheckReaderFiltered = function () {
|
|
1356
|
+
return [
|
|
1357
|
+
filterSearchParams,
|
|
1358
|
+
filterSelection,
|
|
1359
|
+
filterReference,
|
|
1360
|
+
filterReferenceDate,
|
|
1361
|
+
].some(handleHasFilterValue) ||
|
|
1362
|
+
flexFiltersDebounced.some(function (eachFilter) {
|
|
1363
|
+
return (0, flexFilter_1.isFlexFilterActive)(eachFilter, structure, flexFilterExtras);
|
|
1364
|
+
});
|
|
1365
|
+
};
|
|
1366
|
+
// INFO: what a select-all covers, by count, so a delete says how much
|
|
1367
|
+
var handleGetSelectAllText = function () {
|
|
1368
|
+
return "".concat(size.toLocaleString(), " records ").concat(handleCheckReaderFiltered() ? "matching your filters" : "in this list");
|
|
1369
|
+
};
|
|
1370
|
+
var _259 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _259.canUpdateRecord, canInlineUpdate = _259.canInlineUpdate, canBatchUpdate = _259.canBatchUpdate, canDeleteRecord = _259.canDeleteRecord;
|
|
1371
|
+
var isEditor = ((_40 = props.edit) === null || _40 === void 0 ? void 0 : _40.allEditable) ? true : false;
|
|
1372
|
+
var isOffline = (_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.bareOffline;
|
|
1307
1373
|
// INFO: when bareOfflineNetworkAware is true, the save path is also gated on
|
|
1308
1374
|
// the live network state — online saves go to the server even if bareOffline
|
|
1309
1375
|
// is true, offline saves go to IDB as normal.
|
|
1310
|
-
var isOfflineNetworkListener = isOffline && ((
|
|
1311
|
-
var showId = (
|
|
1376
|
+
var isOfflineNetworkListener = isOffline && ((_42 = props.bareSettings) === null || _42 === void 0 ? void 0 : _42.bareOfflineNetworkListener);
|
|
1377
|
+
var showId = (_43 = props.space) === null || _43 === void 0 ? void 0 : _43.showId;
|
|
1312
1378
|
var remainId = showId || selectedObjectStructureId ? true : false;
|
|
1313
|
-
var idField = ((
|
|
1314
|
-
var pipeline = (
|
|
1315
|
-
if ((
|
|
1379
|
+
var idField = ((_44 = props.space) === null || _44 === void 0 ? void 0 : _44.idField) || ((_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.idField);
|
|
1380
|
+
var pipeline = (_46 = props === null || props === void 0 ? void 0 : props.space) === null || _46 === void 0 ? void 0 : _46.pipeline;
|
|
1381
|
+
if ((_47 = props.bareSettings) === null || _47 === void 0 ? void 0 : _47.bareListPipeline) {
|
|
1316
1382
|
pipeline = pipeline
|
|
1317
1383
|
? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
|
|
1318
1384
|
}
|
|
@@ -1325,30 +1391,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1325
1391
|
* three records came back instead of five files, and each tile received the
|
|
1326
1392
|
* whole array rather than one file, so every one of them read "Attachment".
|
|
1327
1393
|
*/
|
|
1328
|
-
var fileViewColumnId = (
|
|
1394
|
+
var fileViewColumnId = (_51 = (_50 = ((_49 = (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.extendedTabs) !== null && _49 !== void 0 ? _49 : []).find(function (eachTab) {
|
|
1329
1395
|
return eachTab.viewType === "file" &&
|
|
1330
1396
|
(0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
|
|
1331
|
-
})) === null ||
|
|
1332
|
-
|
|
1397
|
+
})) === null || _50 === void 0 ? void 0 : _50.fileSettings) === null || _51 === void 0 ? void 0 : _51.columnId;
|
|
1398
|
+
// INFO: select-all promises "all N records", so it is offered only where N
|
|
1399
|
+
// is the total a delete reads — not on Firebase (N is the rows loaded so
|
|
1400
|
+
// far), a union of datasheets (N counts the others too), a file view (N
|
|
1401
|
+
// counts files, not records) or offline
|
|
1402
|
+
var isSelectAllUncountable = isFirebase ||
|
|
1403
|
+
!!((_53 = (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.unionCollections) === null || _53 === void 0 ? void 0 : _53.length) ||
|
|
1404
|
+
!!fileViewColumnId ||
|
|
1405
|
+
!!((_54 = props.bareSettings) === null || _54 === void 0 ? void 0 : _54.bareOffline);
|
|
1406
|
+
var hasNavigation = ((_55 = props.organise) === null || _55 === void 0 ? void 0 : _55.handleNavigate) ? true : false;
|
|
1333
1407
|
var formColumn = "grid-cols-12";
|
|
1334
|
-
var useMobileView = (
|
|
1408
|
+
var useMobileView = (_57 = (_56 = props.bareSettings) === null || _56 === void 0 ? void 0 : _56.bareUpdateMobileView) !== null && _57 !== void 0 ? _57 : false;
|
|
1335
1409
|
var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
|
|
1336
|
-
var isActivityLog = (((
|
|
1337
|
-
((
|
|
1338
|
-
(((
|
|
1339
|
-
((
|
|
1410
|
+
var isActivityLog = (((_59 = (_58 = props.edit) === null || _58 === void 0 ? void 0 : _58.activityLog) === null || _59 === void 0 ? void 0 : _59.enableComments) &&
|
|
1411
|
+
((_60 = props.edit) === null || _60 === void 0 ? void 0 : _60.activityLog.commentCollectionId)) ||
|
|
1412
|
+
(((_62 = (_61 = props.edit) === null || _61 === void 0 ? void 0 : _61.activityLog) === null || _62 === void 0 ? void 0 : _62.enableLogs) &&
|
|
1413
|
+
((_63 = props.edit) === null || _63 === void 0 ? void 0 : _63.activityLog.logsCollectionId));
|
|
1340
1414
|
// INFO: a record's comments and logs shown in place of the record rather than
|
|
1341
1415
|
// in a drawer of their own — a related tab already sits inside the read
|
|
1342
1416
|
// drawer, and a second drawer over it hid the row being discussed. It opens
|
|
1343
1417
|
// the row through handleNavigate, so without one it stays off and the
|
|
1344
1418
|
// drawer is used, rather than leaving a comment button that does nothing
|
|
1345
1419
|
var isInlineActivity = !!isActivityLog &&
|
|
1346
|
-
!!((
|
|
1420
|
+
!!((_64 = props.bareSettings) === null || _64 === void 0 ? void 0 : _64.bareInlineActivity) &&
|
|
1347
1421
|
hasNavigation;
|
|
1348
1422
|
// INFO: each row button opens what it shows: the comment button the row's
|
|
1349
1423
|
// comments and logs alone, the eye (or the row) its details alone, so
|
|
1350
1424
|
// neither has to be scrolled past to reach the other
|
|
1351
|
-
var
|
|
1425
|
+
var _260 = (0, react_1.useState)(false), inlineActivityOnly = _260[0], setInlineActivityOnly = _260[1];
|
|
1352
1426
|
var isActivityOnly = isInlineActivity && inlineActivityOnly;
|
|
1353
1427
|
// INFO: the row whose comments were shown; going back to the list asks its
|
|
1354
1428
|
// comment count again, as the drawer does when it closes
|
|
@@ -1387,12 +1461,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1387
1461
|
// column
|
|
1388
1462
|
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 }));
|
|
1389
1463
|
};
|
|
1390
|
-
var customPaginationSize = ((
|
|
1464
|
+
var customPaginationSize = ((_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.customPaginationCount)
|
|
1391
1465
|
? props.organise.customPaginationCount(size)
|
|
1392
1466
|
: undefined;
|
|
1393
1467
|
//TODO : Code - Pass ...devSettings, search dbEndpoint:
|
|
1394
1468
|
var writeServerQuery = new writeQuery_1.WriteQuery({
|
|
1395
|
-
dbModule: (
|
|
1469
|
+
dbModule: (_66 = props.lib) === null || _66 === void 0 ? void 0 : _66.axios,
|
|
1396
1470
|
dbType: devSettings.server,
|
|
1397
1471
|
dbCollection: props.collectionId,
|
|
1398
1472
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -1400,7 +1474,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1400
1474
|
dbUserToken: devSettings.dbUserToken,
|
|
1401
1475
|
});
|
|
1402
1476
|
var readServerQuery = new readQuery_1.ReadQuery({
|
|
1403
|
-
dbModule: (
|
|
1477
|
+
dbModule: (_67 = props.lib) === null || _67 === void 0 ? void 0 : _67.axios,
|
|
1404
1478
|
dbType: devSettings.server,
|
|
1405
1479
|
dbCollection: props.collectionId,
|
|
1406
1480
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -1408,12 +1482,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1408
1482
|
dbUserToken: devSettings.dbUserToken,
|
|
1409
1483
|
});
|
|
1410
1484
|
var moreButtonPopUp = [
|
|
1411
|
-
((
|
|
1485
|
+
((_68 = props.edit) === null || _68 === void 0 ? void 0 : _68.allEditable) &&
|
|
1412
1486
|
// INFO: the import runs on the server (importEndpoint), so a Firestore
|
|
1413
1487
|
// datasheet served through one can import; only the browser-direct
|
|
1414
1488
|
// Firebase client has no server to import through
|
|
1415
1489
|
!isFirebaseClient &&
|
|
1416
|
-
!((
|
|
1490
|
+
!((_70 = (_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.exportSettings) === null || _70 === void 0 ? void 0 : _70.hideImportCSV)
|
|
1417
1491
|
? {
|
|
1418
1492
|
text: "Import Excel",
|
|
1419
1493
|
onClick: function () {
|
|
@@ -1422,7 +1496,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1422
1496
|
},
|
|
1423
1497
|
}
|
|
1424
1498
|
: null,
|
|
1425
|
-
!((
|
|
1499
|
+
!((_72 = (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.exportSettings) === null || _72 === void 0 ? void 0 : _72.hideExportCSV)
|
|
1426
1500
|
? {
|
|
1427
1501
|
text: "Export CSV",
|
|
1428
1502
|
onClick: function () {
|
|
@@ -1432,7 +1506,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1432
1506
|
},
|
|
1433
1507
|
}
|
|
1434
1508
|
: null,
|
|
1435
|
-
!((
|
|
1509
|
+
!((_74 = (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.exportSettings) === null || _74 === void 0 ? void 0 : _74.hideExportExcel)
|
|
1436
1510
|
? {
|
|
1437
1511
|
text: "Export Excel",
|
|
1438
1512
|
onClick: function () {
|
|
@@ -1442,7 +1516,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1442
1516
|
},
|
|
1443
1517
|
}
|
|
1444
1518
|
: null,
|
|
1445
|
-
!((
|
|
1519
|
+
!((_76 = (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.exportSettings) === null || _76 === void 0 ? void 0 : _76.hideExportPDF)
|
|
1446
1520
|
? {
|
|
1447
1521
|
text: "Export PDF",
|
|
1448
1522
|
onClick: function () {
|
|
@@ -1452,7 +1526,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1452
1526
|
},
|
|
1453
1527
|
}
|
|
1454
1528
|
: null,
|
|
1455
|
-
!((
|
|
1529
|
+
!((_78 = (_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.exportSettings) === null || _78 === void 0 ? void 0 : _78.hideExportQR)
|
|
1456
1530
|
? {
|
|
1457
1531
|
text: "Export QR",
|
|
1458
1532
|
onClick: function () {
|
|
@@ -1462,7 +1536,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1462
1536
|
},
|
|
1463
1537
|
}
|
|
1464
1538
|
: null,
|
|
1465
|
-
!((
|
|
1539
|
+
!((_80 = (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.exportSettings) === null || _80 === void 0 ? void 0 : _80.hideExportQR)
|
|
1466
1540
|
? {
|
|
1467
1541
|
text: "Export QR(Data)",
|
|
1468
1542
|
onClick: function () {
|
|
@@ -1472,7 +1546,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1472
1546
|
},
|
|
1473
1547
|
}
|
|
1474
1548
|
: null,
|
|
1475
|
-
!((
|
|
1549
|
+
!((_82 = (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.exportSettings) === null || _82 === void 0 ? void 0 : _82.hideExportPrint)
|
|
1476
1550
|
? {
|
|
1477
1551
|
text: "Print",
|
|
1478
1552
|
onClick: function () {
|
|
@@ -1484,8 +1558,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1484
1558
|
: null,
|
|
1485
1559
|
// INFO: drafts only exist where the form can save one, so the filter has
|
|
1486
1560
|
// nothing to find on any other page
|
|
1487
|
-
((
|
|
1488
|
-
!((
|
|
1561
|
+
((_83 = props.edit) === null || _83 === void 0 ? void 0 : _83.enableUpdateDraft) &&
|
|
1562
|
+
!((_85 = (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.exportSettings) === null || _85 === void 0 ? void 0 : _85.hideExportDraft)
|
|
1489
1563
|
? {
|
|
1490
1564
|
text: filterDraft ? "Show All Items" : "Filter Draft",
|
|
1491
1565
|
onClick: function () {
|
|
@@ -1494,7 +1568,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1494
1568
|
}
|
|
1495
1569
|
: null,
|
|
1496
1570
|
].filter(Boolean);
|
|
1497
|
-
if ((
|
|
1571
|
+
if ((_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.moreSettings)
|
|
1498
1572
|
moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
|
|
1499
1573
|
//=====================================================================================
|
|
1500
1574
|
//SECTION: User Column Visibility Handlers
|
|
@@ -1939,14 +2013,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1939
2013
|
//=====================================================================================
|
|
1940
2014
|
//SECTION: Saved Views
|
|
1941
2015
|
//=====================================================================================
|
|
1942
|
-
var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (
|
|
2016
|
+
var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.persistKey, (_88 = devSettings.currentUser) === null || _88 === void 0 ? void 0 : _88.userEmail);
|
|
1943
2017
|
(0, react_1.useEffect)(function () {
|
|
1944
2018
|
if (isSavedViewsEnabled && !isAppViews)
|
|
1945
2019
|
setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
|
|
1946
2020
|
}, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
|
|
1947
2021
|
// INFO: the app keeps All's settings, so every change is kept in this
|
|
1948
2022
|
// browser until the person updates the view for everyone or resets it
|
|
1949
|
-
var isViewDraftsEnabled = isSavedViewsEnabled && ((
|
|
2023
|
+
var isViewDraftsEnabled = isSavedViewsEnabled && ((_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.allView) !== undefined;
|
|
1950
2024
|
var handleGetViewDraftKey = function (viewId) {
|
|
1951
2025
|
var _a, _b;
|
|
1952
2026
|
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);
|
|
@@ -2075,7 +2149,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2075
2149
|
var lastSentSharedViewsRef = (0, react_1.useRef)(null);
|
|
2076
2150
|
(0, react_1.useEffect)(function () {
|
|
2077
2151
|
lastSentSharedViewsRef.current = null;
|
|
2078
|
-
}, [(
|
|
2152
|
+
}, [(_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.sharedViews]);
|
|
2079
2153
|
var handleStoreSharedViews = function (update) {
|
|
2080
2154
|
var _a, _b, _c;
|
|
2081
2155
|
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
|
|
@@ -2092,7 +2166,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2092
2166
|
var openingViewSettledRef = (0, react_1.useRef)(false);
|
|
2093
2167
|
// INFO: keyed on the ids, so a list handed in again on every render does
|
|
2094
2168
|
// not re-run the opening
|
|
2095
|
-
var starredViewIdsKey = ((
|
|
2169
|
+
var starredViewIdsKey = ((_92 = (_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.defaultSavedViewIds) !== null && _92 !== void 0 ? _92 : []).join("|");
|
|
2096
2170
|
(0, react_1.useEffect)(function () {
|
|
2097
2171
|
var _a, _b, _c, _d;
|
|
2098
2172
|
if (!isSavedViewsEnabled || openingViewSettledRef.current)
|
|
@@ -2130,13 +2204,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2130
2204
|
/* eslint-disable */
|
|
2131
2205
|
}, [
|
|
2132
2206
|
isSavedViewsEnabled,
|
|
2133
|
-
(
|
|
2207
|
+
(_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.initialSavedViewId,
|
|
2134
2208
|
starredViewIdsKey,
|
|
2135
|
-
(
|
|
2209
|
+
(_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.sharedViews,
|
|
2136
2210
|
savedViews,
|
|
2137
2211
|
]);
|
|
2138
2212
|
/* eslint-enable */
|
|
2139
|
-
var appDefaultViewIds = ((
|
|
2213
|
+
var appDefaultViewIds = ((_96 = (_95 = props.organise) === null || _95 === void 0 ? void 0 : _95.defaultSavedViews) !== null && _96 !== void 0 ? _96 : [])
|
|
2140
2214
|
.map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
|
|
2141
2215
|
.join("|");
|
|
2142
2216
|
// INFO: keyed on the ids, not the array, so an inline literal passed on every
|
|
@@ -2547,8 +2621,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2547
2621
|
laneWidths,
|
|
2548
2622
|
drawerWidth,
|
|
2549
2623
|
pinnedColumnIds,
|
|
2550
|
-
(
|
|
2551
|
-
(
|
|
2624
|
+
(_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.allView,
|
|
2625
|
+
(_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.sharedViews,
|
|
2552
2626
|
savedViews,
|
|
2553
2627
|
]);
|
|
2554
2628
|
/* eslint-enable */
|
|
@@ -2592,7 +2666,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2592
2666
|
if (scrollRestoredRef.current)
|
|
2593
2667
|
scrollCatchUpRef.current = null;
|
|
2594
2668
|
/* eslint-disable */
|
|
2595
|
-
}, [props.collectionId, (
|
|
2669
|
+
}, [props.collectionId, (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.persistKey]);
|
|
2596
2670
|
/* eslint-enable */
|
|
2597
2671
|
// INFO: wait a frame — rows land in state one tick before layout
|
|
2598
2672
|
(0, react_1.useEffect)(function () {
|
|
@@ -2627,7 +2701,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2627
2701
|
(0, react_1.useEffect)(function () {
|
|
2628
2702
|
handleOfflinePrefetch();
|
|
2629
2703
|
/* eslint-disable */
|
|
2630
|
-
}, [props.collectionId, (
|
|
2704
|
+
}, [props.collectionId, (_100 = props.bareSettings) === null || _100 === void 0 ? void 0 : _100.bareOffline]);
|
|
2631
2705
|
/* eslint-enable */
|
|
2632
2706
|
// INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
|
|
2633
2707
|
// Calls through handleRefreshRef so the interval always dispatches the latest
|
|
@@ -2647,7 +2721,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2647
2721
|
}, interval);
|
|
2648
2722
|
return function () { return clearInterval(timer); };
|
|
2649
2723
|
/* eslint-disable */
|
|
2650
|
-
}, [(
|
|
2724
|
+
}, [(_101 = props.bareSettings) === null || _101 === void 0 ? void 0 : _101.barePollingInterval, isLive, isNetworkOffline]);
|
|
2651
2725
|
/* eslint-enable */
|
|
2652
2726
|
// INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
|
|
2653
2727
|
// EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
|
|
@@ -2689,7 +2763,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2689
2763
|
};
|
|
2690
2764
|
/* eslint-disable */
|
|
2691
2765
|
}, [
|
|
2692
|
-
(
|
|
2766
|
+
(_102 = props.bareSettings) === null || _102 === void 0 ? void 0 : _102.bareSocketName,
|
|
2693
2767
|
props.collectionId,
|
|
2694
2768
|
props.devSettings.sseEndpoint,
|
|
2695
2769
|
props.devSettings.dbAPIToken,
|
|
@@ -2963,10 +3037,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2963
3037
|
props.collectionId,
|
|
2964
3038
|
props.model,
|
|
2965
3039
|
props.localURLEndpoint,
|
|
2966
|
-
(
|
|
3040
|
+
(_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.extendedTabs,
|
|
2967
3041
|
listViewId,
|
|
2968
|
-
(
|
|
2969
|
-
(
|
|
3042
|
+
(_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.additionalQuery,
|
|
3043
|
+
(_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.groupBy,
|
|
2970
3044
|
resolvedType,
|
|
2971
3045
|
]);
|
|
2972
3046
|
/**
|
|
@@ -3118,7 +3192,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
3118
3192
|
};
|
|
3119
3193
|
}, 100);
|
|
3120
3194
|
return function () { return clearTimeout(timeoutId); };
|
|
3121
|
-
}, [(
|
|
3195
|
+
}, [(_106 = props.organise) === null || _106 === void 0 ? void 0 : _106.showReadFloatingNav, resolvedType, props.id, loading]);
|
|
3122
3196
|
(0, react_1.useEffect)(function () {
|
|
3123
3197
|
if (resolvedType !== "read")
|
|
3124
3198
|
return;
|
|
@@ -3635,10 +3709,53 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
3635
3709
|
}
|
|
3636
3710
|
return sort;
|
|
3637
3711
|
};
|
|
3712
|
+
// INFO: a timeline reads one window at a time when it has both ends to
|
|
3713
|
+
// compare; Firebase cannot range two columns at once, so it reads all
|
|
3714
|
+
var handleCheckTimelineWindow = function (settings) { return !!(settings === null || settings === void 0 ? void 0 : settings.startDate) && !!(settings === null || settings === void 0 ? void 0 : settings.endDate) && !isFirebase; };
|
|
3638
3715
|
var handleReadQueryHocCond = function () {
|
|
3639
3716
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
3640
3717
|
var query = (_a = renderImpSearchFilterConditions()) !== null && _a !== void 0 ? _a : [];
|
|
3641
3718
|
var calendarSettings = false;
|
|
3719
|
+
var timelineQuerySettings = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "timeline"
|
|
3720
|
+
? selectedTab.timelineSettings
|
|
3721
|
+
: undefined;
|
|
3722
|
+
if (handleCheckTimelineWindow(timelineQuerySettings)) {
|
|
3723
|
+
var timelineWindow = (0, timelineBars_1.handleGetTimelineWindow)(timelineRange.unit, timelineRange.anchor);
|
|
3724
|
+
// INFO: a bar overlaps the window when it starts before the window ends
|
|
3725
|
+
// and ends after it starts; one column for both ends is a plain range.
|
|
3726
|
+
// A reader's own filter on a date column stays — the server keeps one
|
|
3727
|
+
// condition per column, so the window gives way on that column
|
|
3728
|
+
var startId = timelineQuerySettings.startDate;
|
|
3729
|
+
var endId = timelineQuerySettings.endDate;
|
|
3730
|
+
var handleIsFiltered = function (queryId) {
|
|
3731
|
+
return query.some(function (eachQuery) { return eachQuery.queryId === queryId && !eachQuery.orQuery; });
|
|
3732
|
+
};
|
|
3733
|
+
if (startId === endId) {
|
|
3734
|
+
if (!handleIsFiltered(startId))
|
|
3735
|
+
query.push({
|
|
3736
|
+
type: "><",
|
|
3737
|
+
queryId: startId,
|
|
3738
|
+
value: [
|
|
3739
|
+
timelineWindow.start.toISOString(),
|
|
3740
|
+
timelineWindow.end.toISOString(),
|
|
3741
|
+
],
|
|
3742
|
+
});
|
|
3743
|
+
}
|
|
3744
|
+
else {
|
|
3745
|
+
if (!handleIsFiltered(startId))
|
|
3746
|
+
query.push({
|
|
3747
|
+
type: "<",
|
|
3748
|
+
queryId: startId,
|
|
3749
|
+
value: timelineWindow.end.toISOString(),
|
|
3750
|
+
});
|
|
3751
|
+
if (!handleIsFiltered(endId))
|
|
3752
|
+
query.push({
|
|
3753
|
+
type: ">",
|
|
3754
|
+
queryId: endId,
|
|
3755
|
+
value: new Date(timelineWindow.start.getTime() - 1).toISOString(),
|
|
3756
|
+
});
|
|
3757
|
+
}
|
|
3758
|
+
}
|
|
3642
3759
|
if (selectedTab && selectedTab.viewType === "calendar") {
|
|
3643
3760
|
var startDate = (0, dayjs_1.default)(calendarTabMonth).toDate();
|
|
3644
3761
|
var endDate = (0, dayjs_1.default)(calendarTabMonth).toDate();
|
|
@@ -4068,6 +4185,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4068
4185
|
};
|
|
4069
4186
|
var handleSelectAllPages = function (value) {
|
|
4070
4187
|
var _a;
|
|
4188
|
+
if (value)
|
|
4189
|
+
selectAllSizeRef.current = size;
|
|
4071
4190
|
setSelectAll(value);
|
|
4072
4191
|
if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListHandleSelection) {
|
|
4073
4192
|
var query = renderImpSearchFilterConditions();
|
|
@@ -4505,6 +4624,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4505
4624
|
return;
|
|
4506
4625
|
if (renderResolvedPaginationType() === "cursor")
|
|
4507
4626
|
return;
|
|
4627
|
+
// INFO: a calendar, map or timeline already holds every row, and the read
|
|
4628
|
+
// does not change with the group — only how the rows are drawn does
|
|
4629
|
+
if (handleCheckFullSetView())
|
|
4630
|
+
return;
|
|
4508
4631
|
var isFirstPage = pageIndex === 0;
|
|
4509
4632
|
handleClearDataByFilter();
|
|
4510
4633
|
// INFO: from page 0 the request does not change, so ask for the read
|
|
@@ -4648,7 +4771,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4648
4771
|
// the link view ends and the list opens as it normally would. A change
|
|
4649
4772
|
// while a record is open (opening one drops the link from the URL) waits
|
|
4650
4773
|
// until the list shows again
|
|
4651
|
-
var lastInitialSearchRef = (0, react_1.useRef)((
|
|
4774
|
+
var lastInitialSearchRef = (0, react_1.useRef)((_107 = props.organise) === null || _107 === void 0 ? void 0 : _107.initialSearch);
|
|
4652
4775
|
// INFO: persistViewState reads its stored state only once the link view
|
|
4653
4776
|
// has ended, a render later
|
|
4654
4777
|
var isNormalOpenPendingRef = (0, react_1.useRef)(false);
|
|
@@ -4675,7 +4798,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4675
4798
|
setIsLinkOpen(true);
|
|
4676
4799
|
handleApplySavedView(null, true, value);
|
|
4677
4800
|
/* eslint-disable */
|
|
4678
|
-
}, [(
|
|
4801
|
+
}, [(_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.initialSearch, resolvedType]);
|
|
4679
4802
|
(0, react_1.useEffect)(function () {
|
|
4680
4803
|
if (!isNormalOpenPendingRef.current || isLinkOpen)
|
|
4681
4804
|
return;
|
|
@@ -5734,8 +5857,42 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5734
5857
|
}
|
|
5735
5858
|
setDeletePasscode(passcode);
|
|
5736
5859
|
};
|
|
5860
|
+
// INFO: select-all covers what the filters matched when it was picked; a
|
|
5861
|
+
// changed filter is a different set, so the selection ends rather than
|
|
5862
|
+
// carrying over to rows the reader has not seen
|
|
5863
|
+
// INFO: only what the reader sets — an app's own conditions can carry a
|
|
5864
|
+
// fresh timestamp on every render, which is not a change of filter
|
|
5865
|
+
var selectAllFilterKey = JSON.stringify([
|
|
5866
|
+
filterSearchParams,
|
|
5867
|
+
filterSelection,
|
|
5868
|
+
filterReference,
|
|
5869
|
+
(0, viewStatePersistence_1.serializeDateFilterState)(filterReferenceDate),
|
|
5870
|
+
flexFiltersDebounced
|
|
5871
|
+
.filter(function (eachFilter) {
|
|
5872
|
+
return (0, flexFilter_1.isFlexFilterActive)(eachFilter, structure, flexFilterExtras);
|
|
5873
|
+
})
|
|
5874
|
+
.map(function (_a) {
|
|
5875
|
+
var _id = _a.id, rest = __rest(_a, ["id"]);
|
|
5876
|
+
return rest;
|
|
5877
|
+
}),
|
|
5878
|
+
formulaFlexQueries,
|
|
5879
|
+
selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.name,
|
|
5880
|
+
]);
|
|
5881
|
+
var selectAllFilterKeyRef = (0, react_1.useRef)(selectAllFilterKey);
|
|
5882
|
+
(0, react_1.useEffect)(function () {
|
|
5883
|
+
if (selectAllFilterKeyRef.current === selectAllFilterKey)
|
|
5884
|
+
return;
|
|
5885
|
+
selectAllFilterKeyRef.current = selectAllFilterKey;
|
|
5886
|
+
// INFO: ticked rows from the old filter go too, so a delete never takes
|
|
5887
|
+
// rows that are no longer on screen
|
|
5888
|
+
if (selectAll)
|
|
5889
|
+
handleSelectAllPages(false);
|
|
5890
|
+
if (selectedIds.length > 0)
|
|
5891
|
+
handleSelectIds([]);
|
|
5892
|
+
/* eslint-disable-next-line */
|
|
5893
|
+
}, [selectAllFilterKey]);
|
|
5737
5894
|
var handleMultipleRemoveSelectedData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
5738
|
-
var passcodeMatch, offlineDataResp, offlineData, filteredData, ids, notReferenceId, query, responseData, responseData, data, uploadEndpoint, err_12;
|
|
5895
|
+
var passcodeMatch, offlineDataResp, offlineData, filteredData, ids, notReferenceId, query, responseData, formulaKeptIds_1, matchedRows, deleteIds, start, responseData, data, uploadEndpoint, err_12;
|
|
5739
5896
|
var _a, _b, _c, _d, _e;
|
|
5740
5897
|
return __generator(this, function (_f) {
|
|
5741
5898
|
switch (_f.label) {
|
|
@@ -5746,11 +5903,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5746
5903
|
setDeleting(true);
|
|
5747
5904
|
_f.label = 1;
|
|
5748
5905
|
case 1:
|
|
5749
|
-
_f.trys.push([1,
|
|
5906
|
+
_f.trys.push([1, 20, 21, 22]);
|
|
5750
5907
|
setLoading(true);
|
|
5751
5908
|
setModalVisible(true);
|
|
5752
5909
|
passcodeMatch = deletePasscodeInput === deletePasscode;
|
|
5753
|
-
if (!passcodeMatch) return [3 /*break*/,
|
|
5910
|
+
if (!passcodeMatch) return [3 /*break*/, 18];
|
|
5754
5911
|
if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareOffline)) return [3 /*break*/, 4];
|
|
5755
5912
|
return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
|
|
5756
5913
|
case 2:
|
|
@@ -5765,11 +5922,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5765
5922
|
})];
|
|
5766
5923
|
case 3:
|
|
5767
5924
|
_f.sent();
|
|
5768
|
-
return [3 /*break*/,
|
|
5925
|
+
return [3 /*break*/, 17];
|
|
5769
5926
|
case 4:
|
|
5770
5927
|
ids = [];
|
|
5771
5928
|
notReferenceId = [];
|
|
5772
|
-
if (!selectAll) return [3 /*break*/,
|
|
5929
|
+
if (!selectAll) return [3 /*break*/, 11];
|
|
5773
5930
|
query = renderImpSearchFilterConditions();
|
|
5774
5931
|
return [4 /*yield*/, readServerQuery.call({
|
|
5775
5932
|
type: "list",
|
|
@@ -5778,16 +5935,43 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5778
5935
|
})];
|
|
5779
5936
|
case 5:
|
|
5780
5937
|
responseData = _f.sent();
|
|
5781
|
-
|
|
5938
|
+
formulaKeptIds_1 = handleGetFormulaKeptIds();
|
|
5939
|
+
matchedRows = ((_c = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _c !== void 0 ? _c : []).filter(function (eachRow) {
|
|
5940
|
+
return !formulaKeptIds_1 || formulaKeptIds_1.has(handleGetRowId(eachRow));
|
|
5941
|
+
});
|
|
5942
|
+
// INFO: the rows found now must be the ones the reader was shown
|
|
5943
|
+
// the count of — if the list changed underneath, delete nothing
|
|
5944
|
+
if (matchedRows.length !== selectAllSizeRef.current) {
|
|
5945
|
+
setNotification({
|
|
5946
|
+
type: false,
|
|
5947
|
+
title: "Nothing deleted",
|
|
5948
|
+
msg: handleGetChangedListMessage(matchedRows.length),
|
|
5949
|
+
});
|
|
5950
|
+
setLoading(false);
|
|
5951
|
+
setModalVisible(false);
|
|
5952
|
+
return [2 /*return*/];
|
|
5953
|
+
}
|
|
5954
|
+
return [4 /*yield*/, handleCheckDeleteReference(matchedRows, true)];
|
|
5782
5955
|
case 6:
|
|
5783
5956
|
notReferenceId = _f.sent();
|
|
5957
|
+
deleteIds = notReferenceId !== null && notReferenceId !== void 0 ? notReferenceId : [];
|
|
5958
|
+
start = 0;
|
|
5959
|
+
_f.label = 7;
|
|
5960
|
+
case 7:
|
|
5961
|
+
if (!(start < deleteIds.length)) return [3 /*break*/, 10];
|
|
5784
5962
|
return [4 /*yield*/, writeServerQuery.call("batchDelete", {
|
|
5785
|
-
id:
|
|
5963
|
+
id: deleteIds.slice(start, start + DELETE_ID_CHUNK),
|
|
5786
5964
|
})];
|
|
5787
|
-
case
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
case
|
|
5965
|
+
case 8:
|
|
5966
|
+
_f.sent();
|
|
5967
|
+
_f.label = 9;
|
|
5968
|
+
case 9:
|
|
5969
|
+
start += DELETE_ID_CHUNK;
|
|
5970
|
+
return [3 /*break*/, 7];
|
|
5971
|
+
case 10:
|
|
5972
|
+
ids = deleteIds;
|
|
5973
|
+
return [3 /*break*/, 15];
|
|
5974
|
+
case 11: return [4 /*yield*/, readServerQuery.call({
|
|
5791
5975
|
type: "list",
|
|
5792
5976
|
query: [
|
|
5793
5977
|
{
|
|
@@ -5798,18 +5982,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5798
5982
|
],
|
|
5799
5983
|
stopLimit: true,
|
|
5800
5984
|
})];
|
|
5801
|
-
case
|
|
5985
|
+
case 12:
|
|
5802
5986
|
responseData = _f.sent();
|
|
5803
5987
|
return [4 /*yield*/, handleCheckDeleteReference((_d = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _d !== void 0 ? _d : [], true)];
|
|
5804
|
-
case
|
|
5988
|
+
case 13:
|
|
5805
5989
|
notReferenceId = _f.sent();
|
|
5806
5990
|
return [4 /*yield*/, writeServerQuery.call("batchDelete", {
|
|
5807
5991
|
id: notReferenceId,
|
|
5808
5992
|
})];
|
|
5809
|
-
case
|
|
5993
|
+
case 14:
|
|
5810
5994
|
ids = _f.sent();
|
|
5811
|
-
_f.label =
|
|
5812
|
-
case
|
|
5995
|
+
_f.label = 15;
|
|
5996
|
+
case 15:
|
|
5813
5997
|
data = new FormData();
|
|
5814
5998
|
data.append("data[assetCollectionName]", props.collectionId);
|
|
5815
5999
|
data.append("data[assetParentId]", JSON.stringify(ids !== null && ids !== void 0 ? ids : []));
|
|
@@ -5824,13 +6008,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5824
6008
|
url: "".concat(uploadEndpoint, "/batchDeleteDirectory"),
|
|
5825
6009
|
headers: { "Content-Type": "multipart/form-data" },
|
|
5826
6010
|
}))];
|
|
5827
|
-
case
|
|
6011
|
+
case 16:
|
|
5828
6012
|
_f.sent();
|
|
5829
6013
|
if (mapViewRef.current)
|
|
5830
6014
|
mapViewRef.current.handleClearPolygons();
|
|
5831
|
-
_f.label =
|
|
5832
|
-
case
|
|
5833
|
-
case
|
|
6015
|
+
_f.label = 17;
|
|
6016
|
+
case 17: return [3 /*break*/, 19];
|
|
6017
|
+
case 18:
|
|
5834
6018
|
setNotification({
|
|
5835
6019
|
type: false,
|
|
5836
6020
|
title: "Incorrect Passcode",
|
|
@@ -5839,16 +6023,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
5839
6023
|
setLoading(false);
|
|
5840
6024
|
setModalVisible(false);
|
|
5841
6025
|
return [2 /*return*/];
|
|
5842
|
-
case
|
|
5843
|
-
case
|
|
6026
|
+
case 19: return [3 /*break*/, 22];
|
|
6027
|
+
case 20:
|
|
5844
6028
|
err_12 = _f.sent();
|
|
5845
|
-
return [3 /*break*/,
|
|
5846
|
-
case
|
|
6029
|
+
return [3 /*break*/, 22];
|
|
6030
|
+
case 21:
|
|
5847
6031
|
deletingRef.current = false;
|
|
5848
6032
|
setDeleting(false);
|
|
5849
6033
|
return [7 /*endfinally*/];
|
|
5850
|
-
case
|
|
6034
|
+
case 22:
|
|
5851
6035
|
setDeletePasscodeInput("");
|
|
6036
|
+
// INFO: the selection is gone with the rows it covered
|
|
6037
|
+
if (selectAll)
|
|
6038
|
+
handleSelectAllPages(false);
|
|
5852
6039
|
handleRefresh();
|
|
5853
6040
|
return [2 /*return*/];
|
|
5854
6041
|
}
|
|
@@ -6123,19 +6310,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6123
6310
|
});
|
|
6124
6311
|
}); };
|
|
6125
6312
|
var handleBatchUpdateData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6126
|
-
var model_1, columnId_1, dataToSubmit_1, isFile, res, updateQuery, matchedRows, selectAllQuery, batchUpdateConfig, res, err_16;
|
|
6127
|
-
var _a;
|
|
6128
|
-
return __generator(this, function (
|
|
6129
|
-
switch (
|
|
6313
|
+
var model_1, columnId_1, dataToSubmit_1, isFile, res, updateQuery, handleRefuseUpdate, formulaKeptIds_2, isById, responseData, matchedRows, countData, matchedCount, selectAllQuery, batchUpdateConfig, res, err_16;
|
|
6314
|
+
var _a, _b;
|
|
6315
|
+
return __generator(this, function (_c) {
|
|
6316
|
+
switch (_c.label) {
|
|
6130
6317
|
case 0:
|
|
6131
6318
|
if (!canBatchUpdate)
|
|
6132
6319
|
return [2 /*return*/];
|
|
6133
6320
|
if (isBatchUpdatingRef.current)
|
|
6134
6321
|
return [2 /*return*/];
|
|
6135
6322
|
isBatchUpdatingRef.current = true;
|
|
6136
|
-
|
|
6323
|
+
_c.label = 1;
|
|
6137
6324
|
case 1:
|
|
6138
|
-
|
|
6325
|
+
_c.trys.push([1, 12, 13, 14]);
|
|
6139
6326
|
setLoading(true);
|
|
6140
6327
|
setModalVisible(true);
|
|
6141
6328
|
model_1 = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
|
|
@@ -6152,13 +6339,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6152
6339
|
});
|
|
6153
6340
|
}); }))];
|
|
6154
6341
|
case 2:
|
|
6155
|
-
res =
|
|
6342
|
+
res = _c.sent();
|
|
6156
6343
|
if (res) {
|
|
6157
6344
|
setLoading(false);
|
|
6158
6345
|
setModalVisible(false);
|
|
6159
6346
|
setBatchUpdateModal(false);
|
|
6160
6347
|
}
|
|
6161
|
-
return [3 /*break*/,
|
|
6348
|
+
return [3 /*break*/, 11];
|
|
6162
6349
|
case 3:
|
|
6163
6350
|
if (!(isFile && !dataToSubmit_1[columnId_1])) return [3 /*break*/, 5];
|
|
6164
6351
|
return [4 /*yield*/, Promise.all(selectedIds.map(function (eachId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -6173,28 +6360,56 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6173
6360
|
});
|
|
6174
6361
|
}); }))];
|
|
6175
6362
|
case 4:
|
|
6176
|
-
|
|
6177
|
-
|
|
6363
|
+
_c.sent();
|
|
6364
|
+
_c.label = 5;
|
|
6178
6365
|
case 5:
|
|
6179
6366
|
updateQuery = renderImpSearchFilterConditions();
|
|
6180
|
-
if (!
|
|
6181
|
-
|
|
6367
|
+
if (!selectAll) return [3 /*break*/, 9];
|
|
6368
|
+
handleRefuseUpdate = function (msg) {
|
|
6369
|
+
setNotification({ type: false, title: "Nothing updated", msg: msg });
|
|
6370
|
+
setLoading(false);
|
|
6371
|
+
setModalVisible(false);
|
|
6372
|
+
setBatchUpdateModal(false);
|
|
6373
|
+
setBatchUpdateData({ columnId: "", columnData: {} });
|
|
6374
|
+
};
|
|
6375
|
+
formulaKeptIds_2 = handleGetFormulaKeptIds();
|
|
6376
|
+
isById = !!formulaKeptIds_2 ||
|
|
6377
|
+
!!(updateQuery === null || updateQuery === void 0 ? void 0 : updateQuery.some(function (q) { var _a; return (_a = q.orQueryGroupId) === null || _a === void 0 ? void 0 : _a.startsWith(flexFilter_1.FLEX_OR_GROUP_PREFIX); }));
|
|
6378
|
+
if (!isById) return [3 /*break*/, 7];
|
|
6182
6379
|
return [4 /*yield*/, readServerQuery.call({
|
|
6183
6380
|
type: "list",
|
|
6184
6381
|
query: updateQuery,
|
|
6185
6382
|
stopLimit: true,
|
|
6186
6383
|
})];
|
|
6187
6384
|
case 6:
|
|
6188
|
-
|
|
6385
|
+
responseData = _c.sent();
|
|
6386
|
+
matchedRows = ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _a !== void 0 ? _a : []).filter(function (eachRow) {
|
|
6387
|
+
return !formulaKeptIds_2 || formulaKeptIds_2.has(handleGetRowId(eachRow));
|
|
6388
|
+
});
|
|
6389
|
+
if (matchedRows.length !== selectAllSizeRef.current)
|
|
6390
|
+
return [2 /*return*/, handleRefuseUpdate(handleGetChangedListMessage(matchedRows.length))];
|
|
6391
|
+
if (matchedRows.length > SELECT_ALL_ID_CAP)
|
|
6392
|
+
return [2 /*return*/, handleRefuseUpdate("Up to ".concat(SELECT_ALL_ID_CAP.toLocaleString(), " records can be updated at once with these filters. Narrow the filters and try again."))];
|
|
6189
6393
|
updateQuery = [
|
|
6190
6394
|
{
|
|
6191
6395
|
queryId: serverId,
|
|
6192
6396
|
type: "in",
|
|
6193
|
-
value:
|
|
6397
|
+
value: matchedRows.map(function (eachRow) { return eachRow === null || eachRow === void 0 ? void 0 : eachRow[serverId]; }),
|
|
6194
6398
|
},
|
|
6195
6399
|
];
|
|
6196
|
-
|
|
6197
|
-
case 7:
|
|
6400
|
+
return [3 /*break*/, 9];
|
|
6401
|
+
case 7: return [4 /*yield*/, readServerQuery.call({
|
|
6402
|
+
type: "list",
|
|
6403
|
+
query: updateQuery,
|
|
6404
|
+
limit: 1,
|
|
6405
|
+
})];
|
|
6406
|
+
case 8:
|
|
6407
|
+
countData = _c.sent();
|
|
6408
|
+
matchedCount = (_b = countData === null || countData === void 0 ? void 0 : countData.count) !== null && _b !== void 0 ? _b : 0;
|
|
6409
|
+
if (matchedCount !== selectAllSizeRef.current)
|
|
6410
|
+
return [2 /*return*/, handleRefuseUpdate(handleGetChangedListMessage(matchedCount))];
|
|
6411
|
+
_c.label = 9;
|
|
6412
|
+
case 9:
|
|
6198
6413
|
selectAllQuery = updateQuery
|
|
6199
6414
|
? updateQuery
|
|
6200
6415
|
: [
|
|
@@ -6223,15 +6438,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6223
6438
|
batchUpdateConfig["data"] = dataToSubmit_1;
|
|
6224
6439
|
}
|
|
6225
6440
|
return [4 /*yield*/, writeServerQuery.call("batchUpdate", batchUpdateConfig)];
|
|
6226
|
-
case
|
|
6227
|
-
res =
|
|
6441
|
+
case 10:
|
|
6442
|
+
res = _c.sent();
|
|
6228
6443
|
if (res) {
|
|
6229
6444
|
handleRefresh(false, true);
|
|
6230
6445
|
}
|
|
6231
|
-
|
|
6232
|
-
case
|
|
6233
|
-
case
|
|
6234
|
-
err_16 =
|
|
6446
|
+
_c.label = 11;
|
|
6447
|
+
case 11: return [3 /*break*/, 14];
|
|
6448
|
+
case 12:
|
|
6449
|
+
err_16 = _c.sent();
|
|
6235
6450
|
if (err_16.response) {
|
|
6236
6451
|
setNotification({
|
|
6237
6452
|
type: false,
|
|
@@ -6239,11 +6454,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6239
6454
|
msg: handleGetWriteErrorMessage(err_16.response),
|
|
6240
6455
|
});
|
|
6241
6456
|
}
|
|
6242
|
-
return [3 /*break*/,
|
|
6243
|
-
case
|
|
6457
|
+
return [3 /*break*/, 14];
|
|
6458
|
+
case 13:
|
|
6244
6459
|
isBatchUpdatingRef.current = false;
|
|
6245
6460
|
return [7 /*endfinally*/];
|
|
6246
|
-
case
|
|
6461
|
+
case 14:
|
|
6247
6462
|
setBatchUpdateData({ columnId: "", columnData: {} });
|
|
6248
6463
|
return [2 /*return*/];
|
|
6249
6464
|
}
|
|
@@ -6419,7 +6634,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6419
6634
|
var columnTypeActions = {
|
|
6420
6635
|
canUpdate: canUpdateRecord,
|
|
6421
6636
|
dateWarnings: isDateWarnings,
|
|
6422
|
-
onButtonClick: (
|
|
6637
|
+
onButtonClick: (_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.onButtonClick,
|
|
6423
6638
|
onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6424
6639
|
var _a;
|
|
6425
6640
|
return __generator(this, function (_b) {
|
|
@@ -6436,7 +6651,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6436
6651
|
}
|
|
6437
6652
|
});
|
|
6438
6653
|
}); },
|
|
6439
|
-
onTimeTrackingAction: ((
|
|
6654
|
+
onTimeTrackingAction: ((_110 = props.organise) === null || _110 === void 0 ? void 0 : _110.onTimeTrackingAction) && canUpdateRecord
|
|
6440
6655
|
? function (rowId, columnId, action) {
|
|
6441
6656
|
return handleTimeTrackingAction(rowId, columnId, action);
|
|
6442
6657
|
}
|
|
@@ -7892,10 +8107,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7892
8107
|
formulaRows = formulaFullReadRef.current;
|
|
7893
8108
|
if (formulaFlexQueries.length > 0 && formulaRows) {
|
|
7894
8109
|
kept = handleApplyFormulaView(formulaRows.rows, formulaRows.displayRows).rows;
|
|
8110
|
+
// INFO: these rows came through the list, which renames _id to id
|
|
7895
8111
|
exportQueryList.push({
|
|
7896
8112
|
type: "in",
|
|
7897
8113
|
queryId: serverId,
|
|
7898
|
-
value: kept.map(function (eachRow) { return eachRow
|
|
8114
|
+
value: kept.map(function (eachRow) { return handleGetRowId(eachRow); }),
|
|
7899
8115
|
});
|
|
7900
8116
|
}
|
|
7901
8117
|
baseUrl = props.devSettings.functionEndpoint;
|
|
@@ -8570,7 +8786,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8570
8786
|
: getActiveUserHiddenColumnIds().includes(column.id);
|
|
8571
8787
|
};
|
|
8572
8788
|
var renderViewSettingsContent = function () {
|
|
8573
|
-
var _a, _b, _c, _d, _e, _f
|
|
8789
|
+
var _a, _b, _c, _d, _e, _f;
|
|
8574
8790
|
var viewColumns = getViewSettingsColumns();
|
|
8575
8791
|
var hiddenCount = viewColumns.filter(getIsColumnHidden).length;
|
|
8576
8792
|
var visibleCount = viewColumns.length - hiddenCount;
|
|
@@ -8665,10 +8881,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8665
8881
|
type: value,
|
|
8666
8882
|
});
|
|
8667
8883
|
} })))),
|
|
8668
|
-
|
|
8884
|
+
isGroupPickerShown && (react_1.default.createElement("div", { className: "mt-3 border-t pt-3 ".concat(dividerColor) },
|
|
8669
8885
|
react_1.default.createElement("p", { className: "text-sm font-medium ".concat(labelColor) }, "Group"),
|
|
8670
8886
|
react_1.default.createElement("div", { className: "mt-1" },
|
|
8671
|
-
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: (
|
|
8887
|
+
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) {
|
|
8672
8888
|
return handleChangeGroupBy(value !== null && value !== void 0 ? value : "", true);
|
|
8673
8889
|
} })))),
|
|
8674
8890
|
react_1.default.createElement("div", { className: "mt-3 border-t pt-3 ".concat(dividerColor) },
|
|
@@ -8690,8 +8906,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8690
8906
|
: rows;
|
|
8691
8907
|
};
|
|
8692
8908
|
/* eslint-disable */
|
|
8693
|
-
var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (
|
|
8694
|
-
var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (
|
|
8909
|
+
var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_111 = props.bareSettings) === null || _111 === void 0 ? void 0 : _111.bareNewDTW]);
|
|
8910
|
+
var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_112 = props.bareSettings) === null || _112 === void 0 ? void 0 : _112.bareNewDTW]);
|
|
8695
8911
|
/* eslint-enable */
|
|
8696
8912
|
// INFO: beside a record's title, the pencil opens its edit form for whoever
|
|
8697
8913
|
// may update, and the bubble opens comments and logs for anyone who can see
|
|
@@ -9897,7 +10113,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
9897
10113
|
props.renderSettings.renderListUI(actionComponent, filterComponent_1, dataComponent)));
|
|
9898
10114
|
}
|
|
9899
10115
|
var renderListFilterElements = function () {
|
|
9900
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
10116
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
9901
10117
|
// INFO: When bareListFilterAsPopup is true, filters are shown in a popup instead.
|
|
9902
10118
|
if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListFilterAsPopup)
|
|
9903
10119
|
return null;
|
|
@@ -9922,8 +10138,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
9922
10138
|
}
|
|
9923
10139
|
var filterElementList = [];
|
|
9924
10140
|
if (!((_f = props.organise) === null || _f === void 0 ? void 0 : _f.filterComponentNewRow)) {
|
|
9925
|
-
if (
|
|
9926
|
-
filterElementList.push(react_1.default.createElement(select_1.Select, { portalDropdown: true, label: "Group", darkMode: (
|
|
10141
|
+
if (isGroupPickerShown) {
|
|
10142
|
+
filterElementList.push(react_1.default.createElement(select_1.Select, { portalDropdown: true, label: "Group", darkMode: (_g = props.organise) === null || _g === void 0 ? void 0 : _g.darkMode, options: handleGetGroupByOptions(), value: groupId !== null && groupId !== void 0 ? groupId : "", onChange: function (value) { return handleChangeGroupBy(value !== null && value !== void 0 ? value : "", true); } }));
|
|
9927
10143
|
}
|
|
9928
10144
|
if (filterComponent_1 &&
|
|
9929
10145
|
Array.isArray(filterComponent_1) &&
|
|
@@ -9970,7 +10186,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
9970
10186
|
// per page in one panel. Standard on the new DTW; videColumnEnabled
|
|
9971
10187
|
// keeps it available to legacy and bare DTWs. A calendar has no
|
|
9972
10188
|
// columns, sort or pages, so it gets no panel.
|
|
9973
|
-
if (isViewSettingsEnabled &&
|
|
10189
|
+
if (isViewSettingsEnabled && !isViewSettingsHiddenForTab) {
|
|
9974
10190
|
var hiddenColumnCount_1 = getViewSettingsColumns().filter(getIsColumnHidden).length;
|
|
9975
10191
|
// INFO: desktop and mobile both render, CSS decides which is shown —
|
|
9976
10192
|
// distinct test ids keep the two unambiguous for e2e
|
|
@@ -10081,7 +10297,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10081
10297
|
return filterElementList;
|
|
10082
10298
|
}
|
|
10083
10299
|
if ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.filterComponentNewRow) {
|
|
10084
|
-
if (
|
|
10300
|
+
if (isGroupPickerShown) {
|
|
10085
10301
|
filterElementList.push(react_1.default.createElement(select_1.Select, { portalDropdown: true, label: "Group", darkMode: (_e = props.organise) === null || _e === void 0 ? void 0 : _e.darkMode, options: handleGetGroupByOptions(), value: groupId !== null && groupId !== void 0 ? groupId : "", onChange: function (value) { return handleChangeGroupBy(value !== null && value !== void 0 ? value : "", true); } }));
|
|
10086
10302
|
}
|
|
10087
10303
|
if (filterComponent_1 &&
|
|
@@ -10151,7 +10367,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10151
10367
|
: undefined,
|
|
10152
10368
|
onViewSettingsClick: isMobileToolbar_1 &&
|
|
10153
10369
|
isViewSettingsEnabled &&
|
|
10154
|
-
|
|
10370
|
+
!isViewSettingsHiddenForTab
|
|
10155
10371
|
? function () { return setViewSettingsModalOpen(true); }
|
|
10156
10372
|
: undefined,
|
|
10157
10373
|
viewSettingsCount: getViewSettingsColumns().filter(getIsColumnHidden).length,
|
|
@@ -11371,8 +11587,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11371
11587
|
react_1.default.createElement("div", { className: "font-semibold text-md mt-5" },
|
|
11372
11588
|
"Group By ",
|
|
11373
11589
|
eachKey),
|
|
11374
|
-
react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], referencesOptions: listReferencesOptions, size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ?
|
|
11375
|
-
isFormulaView
|
|
11590
|
+
react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], referencesOptions: listReferencesOptions, size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? handleGetSelectAllText() : "", disableSelectFullData: ((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table) ||
|
|
11591
|
+
isFormulaView ||
|
|
11592
|
+
isSelectAllUncountable, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
11376
11593
|
selectedIds.length > 0 &&
|
|
11377
11594
|
canBatchUpdate &&
|
|
11378
11595
|
!((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -11474,7 +11691,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11474
11691
|
? function (groupKey, page) {
|
|
11475
11692
|
return handleFetchGroupPage(groupKey, page);
|
|
11476
11693
|
}
|
|
11477
|
-
: undefined, groupLoadingStatus: renderCheckGroupPaging() ? groupPageState : undefined, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ?
|
|
11694
|
+
: undefined, groupLoadingStatus: renderCheckGroupPaging() ? groupPageState : undefined, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? handleGetSelectAllText() : "", disableSelectFullData: ((_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.disableSelectFullData) === null || _g === void 0 ? void 0 : _g.table) ||
|
|
11695
|
+
isFormulaView ||
|
|
11696
|
+
isSelectAllUncountable, maxSelectedCount: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareListMaxSelectedCount, mobileView: (_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareListMobileView, mobileTooltip: (_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareMobileTooltip, gridLines: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListGridLines, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (canBatchUpdate &&
|
|
11478
11697
|
!((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareHideTableExtraMultipleAction)
|
|
11479
11698
|
? [
|
|
11480
11699
|
{
|
|
@@ -11634,7 +11853,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11634
11853
|
right: (_17 = (_16 = props.bareSettings) === null || _16 === void 0 ? void 0 : _16.bareListTablePinColumns) === null || _17 === void 0 ? void 0 : _17.right,
|
|
11635
11854
|
} }));
|
|
11636
11855
|
}
|
|
11637
|
-
return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ?
|
|
11856
|
+
return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? handleGetSelectAllText() : "", disableSelectFullData: ((_19 = (_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.disableSelectFullData) === null || _19 === void 0 ? void 0 : _19.table) ||
|
|
11857
|
+
isFormulaView ||
|
|
11858
|
+
isSelectAllUncountable, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
11638
11859
|
selectedIds.length > 0 &&
|
|
11639
11860
|
canBatchUpdate &&
|
|
11640
11861
|
!((_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -12075,7 +12296,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12075
12296
|
else if (selectedTabData.viewType === "list") {
|
|
12076
12297
|
// INFO: when bareNewDTW is enabled, render NewList instead of legacy List
|
|
12077
12298
|
if ((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareNewDTW) {
|
|
12078
|
-
return (react_1.default.createElement(newList_1.NewList, __assign({ darkModeBg: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.disableSelectFullData) === null || _w === void 0 ? void 0 : _w.list) ||
|
|
12299
|
+
return (react_1.default.createElement(newList_1.NewList, __assign({ darkModeBg: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.disableSelectFullData) === null || _w === void 0 ? void 0 : _w.list) ||
|
|
12300
|
+
isFormulaView ||
|
|
12301
|
+
isSelectAllUncountable, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? handleGetSelectAllText() : "", maxSelectedCount: (_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareListMaxSelectedCount, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
12079
12302
|
selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12080
12303
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
|
|
12081
12304
|
handleCloneSelectedData();
|
|
@@ -12099,7 +12322,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12099
12322
|
(renderCheckGroupPaging() && !renderCheckScrollMode()), customPaginationSize: customPaginationSize, mobileTooltip: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListMobileTooltip, onRowEdit: recordEditAction, onRowActivity: recordActivityAction })));
|
|
12100
12323
|
}
|
|
12101
12324
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12102
|
-
react_1.default.createElement(list_1.List, { darkModeBg: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableSelectFullData) === null || _7 === void 0 ? void 0 : _7.list) ||
|
|
12325
|
+
react_1.default.createElement(list_1.List, { darkModeBg: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableSelectFullData) === null || _7 === void 0 ? void 0 : _7.list) ||
|
|
12326
|
+
isFormulaView ||
|
|
12327
|
+
isSelectAllUncountable, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? handleGetSelectAllText() : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
12103
12328
|
selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12104
12329
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
|
|
12105
12330
|
handleCloneSelectedData();
|
|
@@ -12468,6 +12693,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12468
12693
|
}
|
|
12469
12694
|
else if (selectedTabData.viewType === "timeline") {
|
|
12470
12695
|
var timelineSettings_1 = selectedTabData.timelineSettings;
|
|
12696
|
+
// INFO: bars are the primary colour; a group — picked in the view or
|
|
12697
|
+
// saved on the tab — gives each of its values a colour of its own
|
|
12698
|
+
var timelineGroupId_1 = groupId || (timelineSettings_1 === null || timelineSettings_1 === void 0 ? void 0 : timelineSettings_1.groupId) || "";
|
|
12471
12699
|
// INFO: pin each group value to a fixed colour — deterministic across
|
|
12472
12700
|
// fetches, mirroring the calendar's groupColorMap / first-appearance
|
|
12473
12701
|
// assignment so the two views colour the same data the same way
|
|
@@ -12475,22 +12703,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12475
12703
|
? JSON.parse(JSON.stringify(timelineSettings_1.groupColor))
|
|
12476
12704
|
: ["red", "blue", "green", "indigo", "orange", "violet", "yellow"];
|
|
12477
12705
|
var timelineValuesWithColour_1 = {};
|
|
12478
|
-
if (timelineSettings_1 === null || timelineSettings_1 === void 0 ? void 0 : timelineSettings_1.groupColorMap)
|
|
12706
|
+
if ((timelineSettings_1 === null || timelineSettings_1 === void 0 ? void 0 : timelineSettings_1.groupColorMap) &&
|
|
12707
|
+
timelineGroupId_1 === timelineSettings_1.groupId) {
|
|
12479
12708
|
Object.assign(timelineValuesWithColour_1, timelineSettings_1.groupColorMap);
|
|
12480
12709
|
}
|
|
12481
|
-
else if (
|
|
12482
|
-
|
|
12483
|
-
|
|
12710
|
+
else if (timelineGroupId_1) {
|
|
12711
|
+
// INFO: colours repeat past the palette rather than running out
|
|
12712
|
+
var colourIndex_1 = 0;
|
|
12713
|
+
spaceTableData.forEach(function (eachTableData) {
|
|
12484
12714
|
if (timelineColorPalette_1.length === 0)
|
|
12485
|
-
return
|
|
12486
|
-
var
|
|
12487
|
-
if (!
|
|
12488
|
-
return
|
|
12489
|
-
|
|
12490
|
-
|
|
12491
|
-
|
|
12492
|
-
}
|
|
12493
|
-
return null;
|
|
12715
|
+
return;
|
|
12716
|
+
var groupKey = (0, timelineBars_1.handleGetGroupValueKey)(eachTableData[timelineGroupId_1]);
|
|
12717
|
+
if (!groupKey || timelineValuesWithColour_1[groupKey])
|
|
12718
|
+
return;
|
|
12719
|
+
timelineValuesWithColour_1[groupKey] =
|
|
12720
|
+
timelineColorPalette_1[colourIndex_1 % timelineColorPalette_1.length];
|
|
12721
|
+
colourIndex_1 += 1;
|
|
12494
12722
|
});
|
|
12495
12723
|
}
|
|
12496
12724
|
// INFO: Tailwind palette hexes — the Gantt colours bars through Apex's
|
|
@@ -12522,24 +12750,63 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12522
12750
|
if (!startDate.isValid() || !endDate.isValid())
|
|
12523
12751
|
continue;
|
|
12524
12752
|
var color = undefined;
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
|
|
12528
|
-
color = TIMELINE_COLOR_HEX_1[timelineValuesWithColour_1[
|
|
12753
|
+
var group = undefined;
|
|
12754
|
+
if (timelineGroupId_1 && eachData[timelineGroupId_1]) {
|
|
12755
|
+
group = (0, timelineBars_1.handleGetGroupValueKey)(eachData[timelineGroupId_1]);
|
|
12756
|
+
color = TIMELINE_COLOR_HEX_1[timelineValuesWithColour_1[group]];
|
|
12529
12757
|
}
|
|
12530
|
-
tasks.push(__assign(__assign({ id: eachData.id, name: (_a = (0, readModule_1.handleCutPreviewText)(eachData[timelineSettings_1.title])) !== null && _a !== void 0 ? _a : "" }, (0, timelineBars_1.handleGetTimelineSpan)(startDate, endDate)), { color: color }));
|
|
12758
|
+
tasks.push(__assign(__assign({ id: eachData.id, name: (_a = (0, readModule_1.handleCutPreviewText)(eachData[timelineSettings_1.title])) !== null && _a !== void 0 ? _a : "" }, (0, timelineBars_1.handleGetTimelineSpan)(startDate, endDate)), { color: color, group: group }));
|
|
12531
12759
|
}
|
|
12532
|
-
return tasks;
|
|
12760
|
+
return timelineGroupId_1 ? (0, timelineBars_1.handleOrderByGroup)(tasks) : tasks;
|
|
12533
12761
|
};
|
|
12534
12762
|
var timelineTasks = renderTimelineTasks();
|
|
12535
12763
|
// INFO: parallel hex list for Apex distributed bars — one colour per
|
|
12536
12764
|
// task, in the same order; undefined falls back to the chart default
|
|
12537
|
-
var
|
|
12538
|
-
|
|
12539
|
-
|
|
12540
|
-
|
|
12541
|
-
|
|
12542
|
-
|
|
12765
|
+
var timelinePrimary_1 = timelinePrimaryColour;
|
|
12766
|
+
var timelineColors = timelineTasks.map(function (eachTask) { var _a; return (_a = eachTask.color) !== null && _a !== void 0 ? _a : timelinePrimary_1; });
|
|
12767
|
+
var timelineWindow_1 = (0, timelineBars_1.handleGetTimelineWindow)(timelineRange.unit, timelineRange.anchor);
|
|
12768
|
+
var handleChangeTimelineRange_1 = function (next) {
|
|
12769
|
+
setTimelineRange(next);
|
|
12770
|
+
// INFO: a new window is a new query; the list refetches on it
|
|
12771
|
+
setTableLoading(true);
|
|
12772
|
+
};
|
|
12773
|
+
var renderTimelineRangeBar = function () {
|
|
12774
|
+
var _a;
|
|
12775
|
+
return (react_1.default.createElement("div", { className: "mb-2 flex flex-wrap items-center justify-between gap-2" },
|
|
12776
|
+
react_1.default.createElement("div", { className: "flex items-center gap-1" },
|
|
12777
|
+
react_1.default.createElement("button", { type: "button", "data-testid": "dtw-timeline-prev", "aria-label": "Previous period", onClick: function () {
|
|
12778
|
+
return handleChangeTimelineRange_1(__assign(__assign({}, timelineRange), { anchor: (0, timelineBars_1.handleShiftTimelineWindow)(timelineRange.unit, timelineRange.anchor, -1) }));
|
|
12779
|
+
}, className: "rounded-lg p-1.5 hover:bg-gray-100" },
|
|
12780
|
+
react_1.default.createElement(HeroIcons.ChevronLeftIcon, { className: "h-4 w-4 text-gray-500" })),
|
|
12781
|
+
react_1.default.createElement("p", { "data-testid": "dtw-timeline-label", className: "min-w-[8rem] text-center text-sm font-bold ".concat(((_a = props.organise) === null || _a === void 0 ? void 0 : _a.darkMode) ? "text-gray-100" : "text-gray-800") }, timelineWindow_1.label),
|
|
12782
|
+
react_1.default.createElement("button", { type: "button", "data-testid": "dtw-timeline-next", "aria-label": "Next period", onClick: function () {
|
|
12783
|
+
return handleChangeTimelineRange_1(__assign(__assign({}, timelineRange), { anchor: (0, timelineBars_1.handleShiftTimelineWindow)(timelineRange.unit, timelineRange.anchor, 1) }));
|
|
12784
|
+
}, className: "rounded-lg p-1.5 hover:bg-gray-100" },
|
|
12785
|
+
react_1.default.createElement(HeroIcons.ChevronRightIcon, { className: "h-4 w-4 text-gray-500" }))),
|
|
12786
|
+
react_1.default.createElement("div", { className: "inline-flex rounded-lg border border-gray-200 bg-white p-0.5" }, timelineBars_1.TIMELINE_UNITS.map(function (unit) { return (react_1.default.createElement("button", { key: unit, type: "button", onClick: function () {
|
|
12787
|
+
if (unit === timelineRange.unit)
|
|
12788
|
+
return;
|
|
12789
|
+
handleChangeTimelineRange_1(__assign(__assign({}, timelineRange), { unit: unit }));
|
|
12790
|
+
}, className: "rounded-md px-3 py-1 text-xs font-medium capitalize ".concat(timelineRange.unit === unit
|
|
12791
|
+
? "bg-primary-500 text-white"
|
|
12792
|
+
: "text-gray-500 hover:bg-gray-50") }, unit)); }))));
|
|
12793
|
+
};
|
|
12794
|
+
return (react_1.default.createElement("div", { className: "mt-4" },
|
|
12795
|
+
handleCheckTimelineWindow(timelineSettings_1) &&
|
|
12796
|
+
renderTimelineRangeBar(),
|
|
12797
|
+
tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : timelineTasks.length === 0 ? (react_1.default.createElement(emptyState_1.EmptyState, { icon: react_1.default.createElement(HeroIcons.CalendarDaysIcon, { className: "h-10 w-10 text-gray-400" }), text: "Nothing to show on the timeline", description: "Records need both a start and end date to appear here.", darkMode: (_40 = props.organise) === null || _40 === void 0 ? void 0 : _40.darkMode })) : (
|
|
12798
|
+
// INFO: a row per record at a readable height, scrolling past a
|
|
12799
|
+
// screen rather than squeezing every bar into a fixed chart
|
|
12800
|
+
react_1.default.createElement("div", { "data-testid": "dtw-timeline-scroll", className: "max-h-[70vh] overflow-y-auto" },
|
|
12801
|
+
react_1.default.createElement(ganttChart_1.GanttChart, { title: typeof props.title === "string" ? props.title : "Timeline", tasks: timelineTasks, colors: timelineColors, chartOnly: true, chartSize: (0, timelineBars_1.handleGetTimelineHeight)(timelineTasks.length), rangeStart: handleCheckTimelineWindow(timelineSettings_1)
|
|
12802
|
+
? timelineWindow_1.start
|
|
12803
|
+
: undefined, rangeEnd: handleCheckTimelineWindow(timelineSettings_1)
|
|
12804
|
+
? timelineWindow_1.end
|
|
12805
|
+
: undefined, axisOnTop: true, barLabelColor: "#ffffff", darkMode: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.darkMode, onClick: function (taskId) {
|
|
12806
|
+
var _a, _b;
|
|
12807
|
+
if (taskId)
|
|
12808
|
+
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", taskId, "general");
|
|
12809
|
+
} })))));
|
|
12543
12810
|
}
|
|
12544
12811
|
else if (selectedTabData.viewType === "feeds") {
|
|
12545
12812
|
var contentList_1 = [];
|
|
@@ -12621,9 +12888,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12621
12888
|
else if (selectedTabData.viewType === "map") {
|
|
12622
12889
|
var mapSettings_1 = selectedTabData.mapSettings;
|
|
12623
12890
|
if (mapSettings_1) {
|
|
12891
|
+
// INFO: on a map the view's Group draws a route through each group's
|
|
12892
|
+
// pins, and its Sort orders the stops — the rows arrive in that
|
|
12893
|
+
// order, so the route follows them. Only the tab's own route columns
|
|
12894
|
+
// can be replanned by dragging: a picked sort column would be
|
|
12895
|
+
// overwritten with stop numbers
|
|
12896
|
+
var _66 = (0, routes_1.handleResolveViewRoute)(mapSettings_1, groupId), mapRouteBy = _66.routeBy, mapRouteOrder = _66.routeOrder, isRoutePlannable = _66.isPlannable;
|
|
12624
12897
|
// INFO: pins take the route column's colour unless another column is
|
|
12625
12898
|
// picked, so a trip's pins match its line with one setting
|
|
12626
|
-
var pinGroup_1 = mapSettings_1.group || mapSettings_1.routeBy || "";
|
|
12899
|
+
var pinGroup_1 = groupId || mapSettings_1.group || mapSettings_1.routeBy || "";
|
|
12627
12900
|
var mapMarkerList_1 = [];
|
|
12628
12901
|
var uniqueGroupList_1 = [];
|
|
12629
12902
|
var markerColorMap_1 = {};
|
|
@@ -12636,9 +12909,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12636
12909
|
];
|
|
12637
12910
|
if (pinGroup_1) {
|
|
12638
12911
|
spaceTableData.map(function (eachData) {
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
uniqueGroupList_1.push(
|
|
12912
|
+
var groupKey = (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1]);
|
|
12913
|
+
if (groupKey && !uniqueGroupList_1.includes(groupKey)) {
|
|
12914
|
+
uniqueGroupList_1.push(groupKey);
|
|
12642
12915
|
}
|
|
12643
12916
|
return null;
|
|
12644
12917
|
});
|
|
@@ -12696,9 +12969,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12696
12969
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
12697
12970
|
var eachMarkerColor = "white";
|
|
12698
12971
|
if (pinGroup_1) {
|
|
12699
|
-
|
|
12700
|
-
|
|
12701
|
-
|
|
12972
|
+
var groupKey = (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1]);
|
|
12973
|
+
if (groupKey)
|
|
12974
|
+
eachMarkerColor = markerColorMap_1[groupKey];
|
|
12702
12975
|
}
|
|
12703
12976
|
if (eachData[mapSettings_1.address]) {
|
|
12704
12977
|
var markerData_1 = {
|
|
@@ -12713,7 +12986,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12713
12986
|
? ((_e = eachData[mapSettings_1.title]) !== null && _e !== void 0 ? _e : "")
|
|
12714
12987
|
: "",
|
|
12715
12988
|
address: (_g = (_f = eachData[mapSettings_1.address]) === null || _f === void 0 ? void 0 : _f.name) !== null && _g !== void 0 ? _g : "",
|
|
12716
|
-
|
|
12989
|
+
// INFO: a linked record reads by its name in the legend, a
|
|
12990
|
+
// coloured list value by its text
|
|
12991
|
+
group: pinGroup_1
|
|
12992
|
+
? typeof eachData[pinGroup_1] === "object" &&
|
|
12993
|
+
eachData[pinGroup_1] &&
|
|
12994
|
+
!react_1.default.isValidElement(eachData[pinGroup_1])
|
|
12995
|
+
? ((_h = eachData[pinGroup_1].name) !== null && _h !== void 0 ? _h : (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1]))
|
|
12996
|
+
: (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1])
|
|
12997
|
+
: "",
|
|
12717
12998
|
},
|
|
12718
12999
|
};
|
|
12719
13000
|
Object.keys(eachData).forEach(function (eachKey) {
|
|
@@ -12732,7 +13013,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12732
13013
|
return null;
|
|
12733
13014
|
});
|
|
12734
13015
|
return (react_1.default.createElement("div", { className: "w-full h-[700px]" },
|
|
12735
|
-
react_1.default.createElement(mapView_1.MapView, { ref: mapViewRef, markerList: mapMarkerList_1, routeList: (0, routes_1.handleBuildRoutesFromRows)(spaceTableData, mapMarkerList_1,
|
|
13016
|
+
react_1.default.createElement(mapView_1.MapView, { ref: mapViewRef, markerList: mapMarkerList_1, routeList: (0, routes_1.handleBuildRoutesFromRows)(spaceTableData, mapMarkerList_1, mapRouteBy, mapRouteOrder, mapSettings_1.routeStart, mapSettings_1.routeEnd), onChangeRoute: canUpdateRecord && isRoutePlannable
|
|
12736
13017
|
? function (change) {
|
|
12737
13018
|
return handleSaveRecordChanges((0, routes_1.handleBuildRouteChanges)(spaceTableData, mapSettings_1.routeBy, mapSettings_1.routeOrder, change, [mapSettings_1.routeStart, mapSettings_1.routeEnd]));
|
|
12738
13019
|
}
|
|
@@ -13193,12 +13474,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13193
13474
|
react_1.default.createElement("div", { className: "px-3 sm:px-0" },
|
|
13194
13475
|
react_1.default.createElement("div", { className: "flex" },
|
|
13195
13476
|
react_1.default.createElement("h2", { className: "mt-2 mb-2 text-xl font-bold ".concat(((_a = props.organise) === null || _a === void 0 ? void 0 : _a.darkMode) ? "text-white" : "text-gray-900") }, "Delete Confirmation")),
|
|
13196
|
-
react_1.default.createElement("p", { className: "mt-2 mb-4" },
|
|
13197
|
-
"
|
|
13198
|
-
"
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
"data?"),
|
|
13477
|
+
react_1.default.createElement("p", { className: "mt-2 mb-4" }, resolvedType === "list" && !deleteFeedId && selectAll
|
|
13478
|
+
? "Permanently delete all ".concat(handleGetSelectAllText(), "?")
|
|
13479
|
+
: resolvedType === "list" && !deleteFeedId
|
|
13480
|
+
? "Permanently delete ".concat(selectedIds.length.toLocaleString(), " ").concat(selectedIds.length === 1 ? "record" : "records", "?")
|
|
13481
|
+
: "Are you sure you want to permanently delete this data?"),
|
|
13202
13482
|
resolvedType === "list" && !deleteFeedId && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
13203
13483
|
react_1.default.createElement("p", { className: "mb-2" },
|
|
13204
13484
|
"Enter passcode",
|
|
@@ -13328,14 +13608,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13328
13608
|
};
|
|
13329
13609
|
return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
|
|
13330
13610
|
renderNotification("root"),
|
|
13331
|
-
((
|
|
13611
|
+
((_114 = (_113 = props.renderSettings) === null || _113 === void 0 ? void 0 : _113.renderLoadingUI) === null || _114 === void 0 ? void 0 : _114.call(_113)) && loading ? ((_115 = props.renderSettings) === null || _115 === void 0 ? void 0 : _115.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_116 = props.organise) === null || _116 === void 0 ? void 0 : _116.darkMode, darkModeBg: (_117 = props.organise) === null || _117 === void 0 ? void 0 : _117.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
|
|
13332
13612
|
var _a, _b;
|
|
13333
13613
|
if (loading)
|
|
13334
13614
|
return;
|
|
13335
13615
|
handlePopUpModal(false);
|
|
13336
13616
|
setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
|
|
13337
13617
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
|
|
13338
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13618
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_118 = props.organise) === null || _118 === void 0 ? void 0 : _118.darkMode, darkModeBg: (_119 = props.organise) === null || _119 === void 0 ? void 0 : _119.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
|
|
13339
13619
|
return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
|
|
13340
13620
|
if (dataId) {
|
|
13341
13621
|
var currentValue = selectedData[referenceCreationModal.id];
|
|
@@ -13351,19 +13631,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13351
13631
|
}, onClose: function () {
|
|
13352
13632
|
setReferenceCreationModal({ id: "", name: "", type: "string" });
|
|
13353
13633
|
} }),
|
|
13354
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13634
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_120 = props.organise) === null || _120 === void 0 ? void 0 : _120.darkMode, darkModeBg: (_121 = props.organise) === null || _121 === void 0 ? void 0 : _121.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
|
|
13355
13635
|
setReferenceDeleteTableData({});
|
|
13356
13636
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13357
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13637
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_122 = props.organise) === null || _122 === void 0 ? void 0 : _122.darkMode, darkModeBg: (_123 = props.organise) === null || _123 === void 0 ? void 0 : _123.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
|
|
13358
13638
|
setDeletePasscodeInput("");
|
|
13359
13639
|
setDeleteModal(!deleteModal);
|
|
13360
13640
|
setDeleteFeedId("");
|
|
13361
13641
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13362
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13642
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_124 = props.organise) === null || _124 === void 0 ? void 0 : _124.darkMode, darkModeBg: (_125 = props.organise) === null || _125 === void 0 ? void 0 : _125.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
|
|
13363
13643
|
setBatchUpdateData({ columnId: "", columnData: {} });
|
|
13364
13644
|
setBatchUpdateModal(false);
|
|
13365
13645
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13366
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13646
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_126 = props.organise) === null || _126 === void 0 ? void 0 : _126.darkMode, darkModeBg: (_127 = props.organise) === null || _127 === void 0 ? void 0 : _127.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
|
|
13367
13647
|
var _a, _b;
|
|
13368
13648
|
if (props.space)
|
|
13369
13649
|
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 }));
|
|
@@ -13380,14 +13660,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13380
13660
|
(0, react_dom_1.createPortal)(
|
|
13381
13661
|
// INFO: z-50 lifts it over a Modal the table may sit in (z-40)
|
|
13382
13662
|
react_1.default.createElement("div", { className: "relative z-50" },
|
|
13383
|
-
react_1.default.createElement(drawer_1.Drawer, { darkMode: (
|
|
13663
|
+
react_1.default.createElement(drawer_1.Drawer, { darkMode: (_128 = props.organise) === null || _128 === void 0 ? void 0 : _128.darkMode, darkModeBg: (_129 = props.organise) === null || _129 === void 0 ? void 0 : _129.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
|
|
13384
13664
|
// INFO: the record stays set while the drawer slides out — clearing it
|
|
13385
13665
|
// would remount the hidden panel collection-wide and fetch again. The
|
|
13386
13666
|
// toolbar's collection-wide button clears it when it opens.
|
|
13387
13667
|
onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75",
|
|
13388
13668
|
// INFO: dragged like the read drawer; the width sticks across
|
|
13389
13669
|
// opens while the list stays mounted
|
|
13390
|
-
resizable: true, title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((
|
|
13670
|
+
resizable: true, title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((_130 = props.id) !== null && _130 !== void 0 ? _130 : "") : activityId) })), document.body),
|
|
13391
13671
|
renderScrollSentinel()));
|
|
13392
13672
|
});
|
|
13393
13673
|
//# sourceMappingURL=index.js.map
|