blixify-ui-web 1.3.34 → 1.3.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +441 -365
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/display/drawer/index.d.ts +3 -1
- package/lib/components/display/drawer/index.d.ts.map +1 -1
- package/lib/components/display/drawer/index.js +63 -47
- package/lib/components/display/drawer/index.js.map +1 -1
- package/lib/components/display/groupSection/index.d.ts +8 -0
- package/lib/components/display/groupSection/index.d.ts.map +1 -1
- package/lib/components/display/groupSection/index.js +46 -1
- package/lib/components/display/groupSection/index.js.map +1 -1
- package/lib/components/display/newGrid/index.d.ts.map +1 -1
- package/lib/components/display/newGrid/index.js +4 -1
- package/lib/components/display/newGrid/index.js.map +1 -1
- package/lib/components/display/newKanban/index.d.ts.map +1 -1
- package/lib/components/display/newKanban/index.js +15 -14
- package/lib/components/display/newKanban/index.js.map +1 -1
- package/lib/components/display/newList/index.d.ts.map +1 -1
- package/lib/components/display/newList/index.js +4 -1
- package/lib/components/display/newList/index.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts +1 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +89 -78
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/input/markdown/index.d.ts.map +1 -1
- package/lib/components/input/markdown/index.js +1 -1
- package/lib/components/input/markdown/index.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +1 -1
|
@@ -102,7 +102,6 @@ var BookmarkIcon_1 = __importDefault(require("@heroicons/react/24/outline/Bookma
|
|
|
102
102
|
var solid_1 = require("@heroicons/react/24/solid");
|
|
103
103
|
var html2canvas_1 = __importDefault(require("html2canvas"));
|
|
104
104
|
var jspdf_1 = __importDefault(require("jspdf"));
|
|
105
|
-
var react_dom_1 = require("react-dom");
|
|
106
105
|
var react_1 = __importStar(require("react"));
|
|
107
106
|
var uuid_1 = require("uuid");
|
|
108
107
|
var button_1 = require("../../action/button");
|
|
@@ -139,6 +138,7 @@ var address_1 = require("../../input/address");
|
|
|
139
138
|
var canvas_1 = require("../../input/canvas");
|
|
140
139
|
var form_1 = require("../../input/form");
|
|
141
140
|
var select_1 = require("../../input/select");
|
|
141
|
+
var checkbox_1 = require("../../input/checkbox");
|
|
142
142
|
var textInput_1 = require("../../input/textInput");
|
|
143
143
|
var uploadInput_1 = require("../../input/uploadInput");
|
|
144
144
|
var bars_1 = require("../../navigation/bars");
|
|
@@ -519,42 +519,45 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
519
519
|
var _156 = (0, react_1.useState)(false), selectAll = _156[0], setSelectAll = _156[1];
|
|
520
520
|
var _157 = (0, react_1.useState)(""), deletePasscode = _157[0], setDeletePasscode = _157[1];
|
|
521
521
|
var _158 = (0, react_1.useState)(""), deletePasscodeInput = _158[0], setDeletePasscodeInput = _158[1];
|
|
522
|
-
|
|
522
|
+
// INFO: the up-front Delete anyway — skips the link check for the whole
|
|
523
|
+
// delete, for people trusted with it (canDeleteAnyway)
|
|
524
|
+
var _159 = (0, react_1.useState)(false), isSkipLinkCheck = _159[0], setIsSkipLinkCheck = _159[1];
|
|
525
|
+
var _160 = (0, react_1.useState)(""), deleteFeedId = _160[0], setDeleteFeedId = _160[1];
|
|
523
526
|
//INFO : Used by List Organise
|
|
524
527
|
// INFO: Internal sort state that overrides props.organise?.sort when
|
|
525
528
|
// persistViewState is enabled and a persisted sort exists
|
|
526
|
-
var
|
|
527
|
-
var
|
|
528
|
-
var
|
|
529
|
-
var
|
|
529
|
+
var _161 = (0, react_1.useState)((_v = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _v !== void 0 ? _v : undefined), persistedSort = _161[0], setPersistedSort = _161[1];
|
|
530
|
+
var _162 = (0, react_1.useState)(false), filterDraft = _162[0], setFilterDraft = _162[1];
|
|
531
|
+
var _163 = (0, react_1.useState)(false), addTabModal = _163[0], setAddTabModal = _163[1];
|
|
532
|
+
var _164 = (0, react_1.useState)(-1), editTabIndex = _164[0], setEditTabIndex = _164[1];
|
|
530
533
|
//INFO : resolve the initial tab synchronously so the mount cond is already
|
|
531
534
|
// tab-scoped — an empty initial tab caused a second wasted list fetch
|
|
532
|
-
var
|
|
535
|
+
var _165 = (0, react_1.useState)(function () {
|
|
533
536
|
var _a;
|
|
534
537
|
return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, listViewId);
|
|
535
|
-
}), selectedTab =
|
|
536
|
-
var
|
|
538
|
+
}), selectedTab = _165[0], setSelectedTab = _165[1];
|
|
539
|
+
var _166 = (0, react_1.useState)("dayGridMonth"), calendarView = _166[0], setCalendarView = _166[1];
|
|
537
540
|
// INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
|
|
538
541
|
// (calendarView above drives the matching range query)
|
|
539
|
-
var
|
|
540
|
-
var
|
|
542
|
+
var _167 = (0, react_1.useState)("month"), newCalendarViewMode = _167[0], setNewCalendarViewMode = _167[1];
|
|
543
|
+
var _168 = (0, react_1.useState)(new Date()), calendarTabMonth = _168[0], setCalendarTabMonth = _168[1];
|
|
541
544
|
// INFO: read once per theme — it asks the browser to resolve a style
|
|
542
545
|
var timelinePrimaryColour = (0, react_1.useMemo)(function () { return (0, timelineBars_1.handleReadPrimaryColour)(); },
|
|
543
546
|
/* eslint-disable-next-line */
|
|
544
547
|
[(_w = props.organise) === null || _w === void 0 ? void 0 : _w.darkMode]);
|
|
545
548
|
// INFO: the period a timeline shows — it reads only the records whose bars
|
|
546
549
|
// overlap it, so a large datasheet loads one month or quarter at a time
|
|
547
|
-
var
|
|
550
|
+
var _169 = (0, react_1.useState)({ unit: "month", anchor: new Date() }), timelineRange = _169[0], setTimelineRange = _169[1];
|
|
548
551
|
// INFO: defaultViewSwitch picks the opening view only — the tab re-inits
|
|
549
552
|
// whenever its settings change, and that must not undo the user's switch
|
|
550
553
|
var calendarViewInitRef = (0, react_1.useRef)(false);
|
|
551
|
-
var
|
|
552
|
-
var
|
|
553
|
-
var
|
|
554
|
-
var
|
|
554
|
+
var _170 = (0, react_1.useState)(true), kanbanDroppable = _170[0], setKanbanDroppable = _170[1];
|
|
555
|
+
var _171 = (0, react_1.useState)([]), kanbanOptions = _171[0], setKanbanOptions = _171[1];
|
|
556
|
+
var _172 = (0, react_1.useState)(false), batchUpdateModal = _172[0], setBatchUpdateModal = _172[1];
|
|
557
|
+
var _173 = (0, react_1.useState)({
|
|
555
558
|
columnId: "",
|
|
556
559
|
columnData: {},
|
|
557
|
-
}), batchUpdateData =
|
|
560
|
+
}), batchUpdateData = _173[0], setBatchUpdateData = _173[1];
|
|
558
561
|
// INFO: system columns (created / updated at and by, record id, number)
|
|
559
562
|
// join the structure hidden; the ones a user shows are kept per view
|
|
560
563
|
var isSystemColumnsEnabled = !!((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareSystemColumns);
|
|
@@ -562,12 +565,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
562
565
|
var appendedSystemColumnIds = isSystemColumnsEnabled
|
|
563
566
|
? 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; }); })
|
|
564
567
|
: [];
|
|
565
|
-
var
|
|
568
|
+
var _174 = (0, react_1.useState)((_z = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _z !== void 0 ? _z : []), shownSystemColumnIds = _174[0], setShownSystemColumnIds = _174[1];
|
|
566
569
|
var handleWithSystemColumns = function (model, shownIds) {
|
|
567
570
|
if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
|
|
568
571
|
return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
|
|
569
572
|
};
|
|
570
|
-
var
|
|
573
|
+
var _175 = (0, react_1.useState)(function () {
|
|
571
574
|
var _a;
|
|
572
575
|
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 : []);
|
|
573
576
|
if (!persistedState)
|
|
@@ -594,8 +597,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
594
597
|
});
|
|
595
598
|
}
|
|
596
599
|
return model;
|
|
597
|
-
}), structure =
|
|
598
|
-
var
|
|
600
|
+
}), structure = _175[0], setStructure = _175[1];
|
|
601
|
+
var _176 = (0, react_1.useState)(((_0 = props === null || props === void 0 ? void 0 : props.organise) === null || _0 === void 0 ? void 0 : _0.additionalQuery) || []), additionalQuery = _176[0], setAdditionalQuery = _176[1];
|
|
599
602
|
// INFO: State for user-configurable flex filters (Monday.com-style)
|
|
600
603
|
// INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
|
|
601
604
|
var defaultFlexFilterRow = [
|
|
@@ -615,7 +618,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
615
618
|
: (persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
616
619
|
? persistedState.flexFilters
|
|
617
620
|
: defaultFlexFilterRow;
|
|
618
|
-
var
|
|
621
|
+
var _177 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _177[0], setFlexFilters = _177[1];
|
|
619
622
|
// INFO: always-current mirror of flexFilters, read by the imperative apply/
|
|
620
623
|
// clear methods so chained calls in one tick aren't stale.
|
|
621
624
|
var flexFiltersRef = (0, react_1.useRef)(flexFilters);
|
|
@@ -628,115 +631,119 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
628
631
|
}, [flexFilters]);
|
|
629
632
|
// INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
|
|
630
633
|
// to prevent API calls on every keystroke when typing in value inputs
|
|
631
|
-
var
|
|
634
|
+
var _178 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _178[0], setFlexFiltersDebounced = _178[1];
|
|
632
635
|
// INFO: the filter rows of the export being set up — started from the
|
|
633
636
|
// list's own when the export opens, so changing them leaves the list as it is
|
|
634
|
-
var
|
|
635
|
-
var
|
|
636
|
-
var
|
|
637
|
-
var
|
|
638
|
-
var
|
|
637
|
+
var _179 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _179[0], setExportFlexFilters = _179[1];
|
|
638
|
+
var _180 = (0, react_1.useState)({}), flexFilterReferenceOptions = _180[0], setFlexFilterReferenceOptions = _180[1];
|
|
639
|
+
var _181 = (0, react_1.useState)({}), flexFilterReferenceSearch = _181[0], setFlexFilterReferenceSearch = _181[1];
|
|
640
|
+
var _182 = (0, react_1.useState)(false), flexFilterModalOpen = _182[0], setFlexFilterModalOpen = _182[1];
|
|
641
|
+
var _183 = (0, react_1.useState)(false), viewSettingsModalOpen = _183[0], setViewSettingsModalOpen = _183[1];
|
|
639
642
|
// INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
|
|
640
643
|
// Deliberately kept out of `structure`: the props-sync effect below resets
|
|
641
644
|
// structure to props.model whenever props change, which would wipe the
|
|
642
645
|
// choice, and the persist effect derives schema-level hiddenColumnIds from
|
|
643
646
|
// structure — writing user hides there would blur the two concepts.
|
|
644
|
-
var
|
|
645
|
-
var
|
|
646
|
-
var
|
|
647
|
-
var
|
|
647
|
+
var _184 = (0, react_1.useState)((_4 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _4 !== void 0 ? _4 : []), userHiddenColumnIds = _184[0], setUserHiddenColumnIds = _184[1];
|
|
648
|
+
var _185 = (0, react_1.useState)(""), columnSearch = _185[0], setColumnSearch = _185[1];
|
|
649
|
+
var _186 = (0, react_1.useState)([]), savedViews = _186[0], setSavedViews = _186[1];
|
|
650
|
+
var _187 = (0, react_1.useState)(null), activeSavedViewId = _187[0], setActiveSavedViewId = _187[1];
|
|
648
651
|
// INFO: the widths of the view on screen, by column id ("180px")
|
|
649
|
-
var
|
|
652
|
+
var _188 = (0, react_1.useState)(function () { var _a, _b, _c; return (_c = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) === null || _b === void 0 ? void 0 : _b.columnWidths) !== null && _c !== void 0 ? _c : {}; }), columnWidths = _188[0], setColumnWidths = _188[1];
|
|
650
653
|
// INFO: the kanban lane widths of the view on screen, by lane id ("300px")
|
|
651
|
-
var
|
|
654
|
+
var _189 = (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 = _189[0], setLaneWidths = _189[1];
|
|
652
655
|
// INFO: the read drawer's dragged width ("520px"), kept in the view with the
|
|
653
656
|
// column widths. A restored persistViewState wins over All's, as a saved
|
|
654
657
|
// view or draft applied at opening replaces both
|
|
655
|
-
var
|
|
658
|
+
var _190 = (0, react_1.useState)(function () {
|
|
656
659
|
var _a, _b, _c;
|
|
657
660
|
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;
|
|
658
|
-
}), drawerWidth =
|
|
661
|
+
}), drawerWidth = _190[0], setDrawerWidth = _190[1];
|
|
659
662
|
// INFO: the columns the view on screen freezes at the left edge
|
|
660
|
-
var
|
|
663
|
+
var _191 = (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 = _191[0], setPinnedColumnIds = _191[1];
|
|
661
664
|
// INFO: unsaved changes are kept only once the opening view is on screen,
|
|
662
665
|
// so the defaults drawn before it never overwrite a person's own
|
|
663
|
-
var
|
|
666
|
+
var _192 = (0, react_1.useState)(false), isViewDraftReady = _192[0], setIsViewDraftReady = _192[1];
|
|
664
667
|
// INFO: null while the name box is closed
|
|
665
|
-
var
|
|
666
|
-
var
|
|
668
|
+
var _193 = (0, react_1.useState)(null), savedViewName = _193[0], setSavedViewName = _193[1];
|
|
669
|
+
var _194 = (0, react_1.useState)(null), deletingSavedViewId = _194[0], setDeletingSavedViewId = _194[1];
|
|
667
670
|
// INFO: the view chip being dragged, to drop it in another place
|
|
668
|
-
var
|
|
671
|
+
var _195 = (0, react_1.useState)(null), draggingSavedViewId = _195[0], setDraggingSavedViewId = _195[1];
|
|
669
672
|
// INFO: the tab strip in the order a drag has reached, saved once on drop
|
|
670
|
-
var
|
|
671
|
-
var
|
|
672
|
-
var
|
|
673
|
-
var
|
|
673
|
+
var _196 = (0, react_1.useState)(null), draggedTabs = _196[0], setDraggedTabs = _196[1];
|
|
674
|
+
var _197 = (0, react_1.useState)(null), renamingSavedView = _197[0], setRenamingSavedView = _197[1];
|
|
675
|
+
var _198 = (0, react_1.useState)(false), isSavedViewsExpanded = _198[0], setIsSavedViewsExpanded = _198[1];
|
|
676
|
+
var _199 = (0, react_1.useState)(null), draggingColumnId = _199[0], setDraggingColumnId = _199[1];
|
|
674
677
|
var columnRowRefs = (0, react_1.useRef)({});
|
|
675
678
|
//INFO : Used by Auth
|
|
676
|
-
var
|
|
679
|
+
var _200 = (0, react_1.useState)({
|
|
677
680
|
email: "",
|
|
678
681
|
google: "",
|
|
679
682
|
phone: "",
|
|
680
683
|
disabled: false,
|
|
681
684
|
create: false,
|
|
682
|
-
}), authMethods =
|
|
683
|
-
var
|
|
685
|
+
}), authMethods = _200[0], setAuthMethods = _200[1];
|
|
686
|
+
var _201 = (0, react_1.useState)(""), selectedAuthMethod = _201[0], setSelectedAuthMethod = _201[1];
|
|
684
687
|
// INFO: the sign-in check of a users datasheet's record is running; the
|
|
685
688
|
// panel shows a spinner rather than nothing, which read as "no login"
|
|
686
|
-
var
|
|
689
|
+
var _202 = (0, react_1.useState)(false), authLoading = _202[0], setAuthLoading = _202[1];
|
|
687
690
|
// INFO: a delete is running — the ref answers a second tap at once, before
|
|
688
691
|
// the state has rendered, and the state disables the confirm button
|
|
689
692
|
var deletingRef = (0, react_1.useRef)(false);
|
|
690
|
-
var
|
|
693
|
+
var _203 = (0, react_1.useState)(false), deleting = _203[0], setDeleting = _203[1];
|
|
691
694
|
// INFO: Used by Activity Log
|
|
692
|
-
var
|
|
693
|
-
var
|
|
695
|
+
var _204 = (0, react_1.useState)(false), activityModal = _204[0], setActivityModal = _204[1];
|
|
696
|
+
var _205 = (0, react_1.useState)(""), activityId = _205[0], setActivityId = _205[1];
|
|
694
697
|
//INFO : Used by Export
|
|
695
|
-
var
|
|
696
|
-
var
|
|
697
|
-
var
|
|
698
|
-
var
|
|
699
|
-
var
|
|
700
|
-
var
|
|
701
|
-
var
|
|
702
|
-
var
|
|
703
|
-
var
|
|
704
|
-
var
|
|
705
|
-
var
|
|
706
|
-
var
|
|
707
|
-
var
|
|
708
|
-
var
|
|
709
|
-
var
|
|
698
|
+
var _206 = (0, react_1.useState)(null), csvFile = _206[0], setCSVFile = _206[1];
|
|
699
|
+
var _207 = (0, react_1.useState)([]), csvFileData = _207[0], setCSVFileData = _207[1];
|
|
700
|
+
var _208 = (0, react_1.useState)(0), stepCSVIndex = _208[0], setStepCSVIndex = _208[1];
|
|
701
|
+
var _209 = (0, react_1.useState)({}), listCSVMapAttribute = _209[0], setListCSVMapAttribute = _209[1];
|
|
702
|
+
var _210 = (0, react_1.useState)({}), listCSVObjAttribute = _210[0], setListCSVObjAttribute = _210[1];
|
|
703
|
+
var _211 = (0, react_1.useState)([]), csvAPIAttribute = _211[0], setCSVAPIAttribute = _211[1];
|
|
704
|
+
var _212 = (0, react_1.useState)(((_5 = props.devSettings.currentUser) === null || _5 === void 0 ? void 0 : _5.userEmail) || ""), exportCSVEmail = _212[0], setExportCSVEmail = _212[1];
|
|
705
|
+
var _213 = (0, react_1.useState)(((_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.exportSettings) === null || _7 === void 0 ? void 0 : _7.defaultExportPDFName) || ""), exportPDFTitle = _213[0], setExportPDFTitle = _213[1];
|
|
706
|
+
var _214 = (0, react_1.useState)(false), exportPDFLoading = _214[0], setExportPDFLoading = _214[1];
|
|
707
|
+
var _215 = (0, react_1.useState)(false), exportReadPDFLoading = _215[0], setExportReadPDFLoading = _215[1];
|
|
708
|
+
var _216 = (0, react_1.useState)((_10 = (_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.exportSettings) === null || _9 === void 0 ? void 0 : _9.sumColumnId) !== null && _10 !== void 0 ? _10 : []), exportSumAttributeIds = _216[0], setExportSumAttributeIds = _216[1];
|
|
709
|
+
var _217 = (0, react_1.useState)((_13 = (_12 = (_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.exportSettings) === null || _12 === void 0 ? void 0 : _12.hideSubItems) !== null && _13 !== void 0 ? _13 : false), hideSubItems = _217[0], setHideSubItems = _217[1];
|
|
710
|
+
var _218 = (0, react_1.useState)([]), importTableData = _218[0], setImportTableData = _218[1];
|
|
711
|
+
var _219 = (0, react_1.useState)([]), queryList = _219[0], setQueryList = _219[1];
|
|
712
|
+
var _220 = (0, react_1.useState)(undefined), allQueryList = _220[0], setAllQueryList = _220[1];
|
|
710
713
|
// INFO: a restored state wins over the prop; its "" is a list the user
|
|
711
714
|
// ungrouped, so it opens ungrouped
|
|
712
|
-
var
|
|
715
|
+
var _221 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
|
|
713
716
|
? persistedState.groupBy || undefined
|
|
714
|
-
: (_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.groupBy), groupId =
|
|
717
|
+
: (_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.groupBy), groupId = _221[0], setGroupId = _221[1];
|
|
715
718
|
// INFO: groups by their record count, or in the column's own order
|
|
716
|
-
var
|
|
719
|
+
var _222 = (0, react_1.useState)((_15 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupOrder) !== null && _15 !== void 0 ? _15 : ""), groupOrder = _222[0], setGroupOrder = _222[1];
|
|
717
720
|
// INFO: each group's total per number column, keyed by section id
|
|
718
|
-
var
|
|
721
|
+
var _223 = (0, react_1.useState)({}), groupSummaries = _223[0], setGroupSummaries = _223[1];
|
|
719
722
|
// INFO: each group's row count over every row the filters match; null until
|
|
720
723
|
// read. A band paged alone shows it until its own first page lands, and a
|
|
721
724
|
// band it counts empty is left out instead of waiting to be read
|
|
722
|
-
var
|
|
725
|
+
var _224 = (0, react_1.useState)(null), groupTotals = _224[0], setGroupTotals = _224[1];
|
|
723
726
|
// INFO: the last read of groupTotals failed, so bands fall back to the rows
|
|
724
727
|
// loaded instead of waiting on a total that is not coming
|
|
725
|
-
var
|
|
728
|
+
var _225 = (0, react_1.useState)(false), groupTotalsFailed = _225[0], setGroupTotalsFailed = _225[1];
|
|
726
729
|
var groupSummaryRequestRef = (0, react_1.useRef)(0);
|
|
727
730
|
// INFO: the grouped count waiting to go out, so a filter change can stop it
|
|
728
731
|
// before it sends the filters it was scheduled with
|
|
729
732
|
var groupSummaryTimerRef = (0, react_1.useRef)(null);
|
|
730
|
-
var
|
|
731
|
-
var
|
|
733
|
+
var _226 = (0, react_1.useState)({}), commentCounts = _226[0], setCommentCounts = _226[1];
|
|
734
|
+
var _227 = (0, react_1.useState)({}), commentUnread = _227[0], setCommentUnread = _227[1];
|
|
732
735
|
// INFO: Monday-board per-group paging. Keyed by the group key that
|
|
733
736
|
// handleBuildNewTableGroups() produces (an option, Unknown or No Value).
|
|
734
737
|
// Each group tracks its own loaded cursor + total so it can lazily load its
|
|
735
738
|
// next page as the user scrolls inside that band, independent of every other
|
|
736
739
|
// group. Only used when renderCheckGroupPaging() is true.
|
|
737
|
-
var
|
|
740
|
+
var _228 = (0, react_1.useState)({}), groupPageState = _228[0], setGroupPageState = _228[1];
|
|
738
741
|
// INFO: read fresh inside the async per-group fetch so chained scroll fires
|
|
739
742
|
// in one tick do not re-fetch an already in-flight page.
|
|
743
|
+
// INFO: every band of the table, or section of the list or grid tab, is
|
|
744
|
+
// collapsed, so no row is on screen and the scroll sentinel under the view
|
|
745
|
+
// would read page after page; it waits until one is opened again
|
|
746
|
+
var _229 = (0, react_1.useState)(false), isAllGroupsCollapsed = _229[0], setIsAllGroupsCollapsed = _229[1];
|
|
740
747
|
var groupPageStateRef = (0, react_1.useRef)({});
|
|
741
748
|
groupPageStateRef.current = groupPageState;
|
|
742
749
|
// INFO: bumped on every fresh read, so a group page requested before the
|
|
@@ -749,52 +756,52 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
749
756
|
var groupLoadingKeyRef = (0, react_1.useRef)(null);
|
|
750
757
|
var groupLoadQueueRef = (0, react_1.useRef)([]);
|
|
751
758
|
var handleFetchGroupNextPageRef = (0, react_1.useRef)(function () { });
|
|
752
|
-
var
|
|
753
|
-
var
|
|
759
|
+
var _230 = (0, react_1.useState)(""), readTabSection = _230[0], setReadTabSection = _230[1];
|
|
760
|
+
var _231 = (0, react_1.useState)(false), readFloatingNav = _231[0], setReadFloatingNav = _231[1];
|
|
754
761
|
var readTabSectionRefs = (0, react_1.useRef)({});
|
|
755
762
|
//INFO : Used by Read
|
|
756
763
|
//INFO : Used by Update
|
|
757
|
-
var
|
|
758
|
-
var
|
|
759
|
-
var
|
|
760
|
-
var
|
|
761
|
-
var
|
|
762
|
-
var
|
|
763
|
-
var
|
|
764
|
+
var _232 = (0, react_1.useState)(false), modalVisible = _232[0], setModalVisible = _232[1];
|
|
765
|
+
var _233 = (0, react_1.useState)(false), deleteModal = _233[0], setDeleteModal = _233[1];
|
|
766
|
+
var _234 = (0, react_1.useState)(false), excelModal = _234[0], setExcelModal = _234[1];
|
|
767
|
+
var _235 = (0, react_1.useState)(false), exportExcel = _235[0], setExportExcel = _235[1];
|
|
768
|
+
var _236 = (0, react_1.useState)(""), exportType = _236[0], setExportType = _236[1];
|
|
769
|
+
var _237 = (0, react_1.useState)(false), exportQR = _237[0], setExportQR = _237[1];
|
|
770
|
+
var _238 = (0, react_1.useState)(function () {
|
|
764
771
|
var _a, _b;
|
|
765
772
|
var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
|
|
766
773
|
return firstTabId;
|
|
767
|
-
}), activeTab =
|
|
768
|
-
var
|
|
769
|
-
var
|
|
770
|
-
var
|
|
771
|
-
var
|
|
772
|
-
var
|
|
773
|
-
var
|
|
774
|
-
var
|
|
774
|
+
}), activeTab = _238[0], setActiveTab = _238[1];
|
|
775
|
+
var _239 = (0, react_1.useState)(false), signatureSigning = _239[0], setSignatureSigning = _239[1];
|
|
776
|
+
var _240 = (0, react_1.useState)({}), selectedData = _240[0], setSelectedData = _240[1];
|
|
777
|
+
var _241 = (0, react_1.useState)(""), selectedObjectStructureId = _241[0], setSelectedObjectStructureId = _241[1];
|
|
778
|
+
var _242 = (0, react_1.useState)(""), selectedObjectId = _242[0], setSelectedObjectId = _242[1];
|
|
779
|
+
var _243 = (0, react_1.useState)(""), selectedListAddressId = _243[0], setSelectedListAddressId = _243[1];
|
|
780
|
+
var _244 = (0, react_1.useState)(-1), selectedListAddressIndex = _244[0], setSelectedListAddressIndex = _244[1];
|
|
781
|
+
var _245 = (0, react_1.useState)({
|
|
775
782
|
lat: 0,
|
|
776
783
|
lng: 0,
|
|
777
784
|
name: "",
|
|
778
|
-
}), selectedListAddress =
|
|
779
|
-
var
|
|
780
|
-
var
|
|
781
|
-
var
|
|
782
|
-
var
|
|
783
|
-
var
|
|
784
|
-
var
|
|
785
|
+
}), selectedListAddress = _245[0], setSelectedListAddress = _245[1];
|
|
786
|
+
var _246 = (0, react_1.useState)({}), selectedObjectData = _246[0], setSelectedObjectData = _246[1];
|
|
787
|
+
var _247 = (0, react_1.useState)(null), objectCellEdit = _247[0], setObjectCellEdit = _247[1];
|
|
788
|
+
var _248 = (0, react_1.useState)(false), referenceLoading = _248[0], setReferenceLoading = _248[1];
|
|
789
|
+
var _249 = (0, react_1.useState)({}), referencesOptions = _249[0], setReferencesOptions = _249[1];
|
|
790
|
+
var _250 = (0, react_1.useState)({}), referencesDetails = _250[0], setReferencesDetails = _250[1];
|
|
791
|
+
var _251 = (0, react_1.useState)({}), listReferencesOptions = _251[0], setListReferencesOptions = _251[1];
|
|
785
792
|
// INFO: the referenced records themselves, for a table cell that picks from
|
|
786
793
|
// a list on one (referenceSelection)
|
|
787
|
-
var
|
|
794
|
+
var _252 = (0, react_1.useState)({}), listReferencesDetails = _252[0], setListReferencesDetails = _252[1];
|
|
788
795
|
// INFO: each record that could not be deleted, by the datasheet still
|
|
789
796
|
// linking to it
|
|
790
|
-
var
|
|
797
|
+
var _253 = (0, react_1.useState)([]), referenceDeleteTableData = _253[0], setReferenceDeleteTableData = _253[1];
|
|
791
798
|
// INFO: the records a delete left because they are still linked — what
|
|
792
799
|
// "Delete anyway" deletes
|
|
793
800
|
var blockedDeleteIdsRef = (0, react_1.useRef)([]);
|
|
794
801
|
// INFO: "Delete anyway" is for a list's delete; a single record's delete
|
|
795
802
|
// has its own steps around it
|
|
796
803
|
var isBlockedFromListRef = (0, react_1.useRef)(false);
|
|
797
|
-
var
|
|
804
|
+
var _254 = (0, react_1.useState)(false), isDeleteAnywayConfirm = _254[0], setIsDeleteAnywayConfirm = _254[1];
|
|
798
805
|
// INFO: a batched delete stops when the list goes away mid-run
|
|
799
806
|
var isMountedRef = (0, react_1.useRef)(true);
|
|
800
807
|
(0, react_1.useEffect)(function () {
|
|
@@ -807,26 +814,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
807
814
|
(0, react_1.useEffect)(function () {
|
|
808
815
|
setIsDeleteAnywayConfirm(false);
|
|
809
816
|
}, [referenceDeleteTableData]);
|
|
817
|
+
// INFO: never carried into the next delete, however this one closed
|
|
818
|
+
(0, react_1.useEffect)(function () {
|
|
819
|
+
if (!deleteModal)
|
|
820
|
+
setIsSkipLinkCheck(false);
|
|
821
|
+
}, [deleteModal]);
|
|
810
822
|
// INFO: how far a batched delete has got, shown while it runs
|
|
811
|
-
|
|
812
|
-
var
|
|
813
|
-
var
|
|
823
|
+
// INFO: deleted is only known where a pass checks links before deleting
|
|
824
|
+
var _255 = (0, react_1.useState)(null), deleteProgress = _255[0], setDeleteProgress = _255[1];
|
|
825
|
+
var _256 = (0, react_1.useState)([]), relatedSections = _256[0], setRelatedSections = _256[1];
|
|
826
|
+
var _257 = (0, react_1.useState)({
|
|
814
827
|
id: "",
|
|
815
828
|
name: "",
|
|
816
829
|
type: "string",
|
|
817
|
-
}), referenceCreationModal =
|
|
818
|
-
var
|
|
819
|
-
var
|
|
830
|
+
}), referenceCreationModal = _257[0], setReferenceCreationModal = _257[1];
|
|
831
|
+
var _258 = (0, react_1.useState)({}), referenceModelSchema = _258[0], setReferenceSchema = _258[1];
|
|
832
|
+
var _259 = (0, react_1.useState)([]), kanbanChecked = _259[0], setKanbanChecked = _259[1];
|
|
820
833
|
//INFO : Offline
|
|
821
|
-
var
|
|
822
|
-
var
|
|
834
|
+
var _260 = (0, react_1.useState)(0), offlineDataLength = _260[0], setOfflineDataLength = _260[1];
|
|
835
|
+
var _261 = (0, react_1.useState)(false), offlineModal = _261[0], setOfflineModal = _261[1];
|
|
823
836
|
// INFO: live-stream state — driven by socket connection and navigator.onLine
|
|
824
|
-
var
|
|
825
|
-
var
|
|
837
|
+
var _262 = (0, react_1.useState)(false), isLive = _262[0], setIsLive = _262[1];
|
|
838
|
+
var _263 = (0, react_1.useState)(false), isLiveOffline = _263[0], setIsLiveOffline = _263[1];
|
|
826
839
|
// INFO: true when navigator is offline — used to switch ReadQueryHoc between
|
|
827
840
|
// server reads (online, full pagination) and IndexedDB reads (offline, cached data).
|
|
828
841
|
// Independent of SSE status so it works even when bareSocketName is not set.
|
|
829
|
-
var
|
|
842
|
+
var _264 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _264[0], setIsNetworkOffline = _264[1];
|
|
830
843
|
var previousType = (0, react_1.useRef)(null);
|
|
831
844
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
832
845
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
@@ -1205,7 +1218,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1205
1218
|
var isSchemaHideMode = ((_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.onChangeHide) ? true : false;
|
|
1206
1219
|
// INFO: rows per page is a view setting the user can change, so it starts from
|
|
1207
1220
|
// the persisted value and falls back to the consumer's limit
|
|
1208
|
-
var
|
|
1221
|
+
var _265 = (0, react_1.useState)((_29 = (_28 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _28 !== void 0 ? _28 : props.limit) !== null && _29 !== void 0 ? _29 : 10), pageLimit = _265[0], setPageLimit = _265[1];
|
|
1209
1222
|
var limit = pageLimit;
|
|
1210
1223
|
var isSavedViewsEnabled = !!((_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.savedViews) && resolvedType === "list";
|
|
1211
1224
|
// INFO: a calendar and a chart draw their own way, so columns, sort and
|
|
@@ -1409,7 +1422,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1409
1422
|
var handleGetSelectAllText = function () {
|
|
1410
1423
|
return "".concat(size.toLocaleString(), " records ").concat(handleCheckReaderFiltered() ? "matching your filters" : "in this list");
|
|
1411
1424
|
};
|
|
1412
|
-
var
|
|
1425
|
+
var _266 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _266.canUpdateRecord, canInlineUpdate = _266.canInlineUpdate, canBatchUpdate = _266.canBatchUpdate, canDeleteRecord = _266.canDeleteRecord;
|
|
1413
1426
|
var isEditor = ((_43 = props.edit) === null || _43 === void 0 ? void 0 : _43.allEditable) ? true : false;
|
|
1414
1427
|
var isOffline = (_44 = props.bareSettings) === null || _44 === void 0 ? void 0 : _44.bareOffline;
|
|
1415
1428
|
// INFO: when bareOfflineNetworkAware is true, the save path is also gated on
|
|
@@ -1464,7 +1477,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1464
1477
|
// INFO: each row button opens what it shows: the comment button the row's
|
|
1465
1478
|
// comments and logs alone, the eye (or the row) its details alone, so
|
|
1466
1479
|
// neither has to be scrolled past to reach the other
|
|
1467
|
-
var
|
|
1480
|
+
var _267 = (0, react_1.useState)(false), inlineActivityOnly = _267[0], setInlineActivityOnly = _267[1];
|
|
1468
1481
|
var isActivityOnly = isInlineActivity && inlineActivityOnly;
|
|
1469
1482
|
// INFO: the row whose comments were shown; going back to the list asks its
|
|
1470
1483
|
// comment count again, as the drawer does when it closes
|
|
@@ -2868,6 +2881,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2868
2881
|
var isScrollMode = renderCheckScrollMode();
|
|
2869
2882
|
if (!isScrollMode || tableLoading || tableData.length === 0)
|
|
2870
2883
|
return;
|
|
2884
|
+
if (isAllGroupsCollapsed)
|
|
2885
|
+
return;
|
|
2871
2886
|
var sentinel = scrollSentinelRef.current;
|
|
2872
2887
|
if (!sentinel)
|
|
2873
2888
|
return;
|
|
@@ -2899,6 +2914,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2899
2914
|
cursor,
|
|
2900
2915
|
tableLoading,
|
|
2901
2916
|
isFirebase,
|
|
2917
|
+
isAllGroupsCollapsed,
|
|
2902
2918
|
]);
|
|
2903
2919
|
/* eslint-enable */
|
|
2904
2920
|
(0, react_1.useEffect)(function () {
|
|
@@ -6035,165 +6051,183 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6035
6051
|
* and its free records deleted. Linked records are kept and listed at the
|
|
6036
6052
|
* end; any error stops it and says how far it got.
|
|
6037
6053
|
*/
|
|
6038
|
-
var handleDeleteInBatches = function (
|
|
6039
|
-
var
|
|
6040
|
-
var
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
return [
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
dbType: props.devSettings.server,
|
|
6097
|
-
dbCollection: eachSource.collectionId,
|
|
6098
|
-
dbEndpoint: props.devSettings.dbEndpoint,
|
|
6099
|
-
dbAPIToken: props.devSettings.dbAPIToken,
|
|
6100
|
-
dbUserToken: props.devSettings.dbUserToken,
|
|
6101
|
-
});
|
|
6102
|
-
columnId = eachSource.column.id;
|
|
6103
|
-
return [4 /*yield*/, referenceRQ.call({
|
|
6104
|
-
type: "list",
|
|
6105
|
-
query: [{ type: "in", queryId: columnId, value: batchIds }],
|
|
6106
|
-
stopLimit: true,
|
|
6107
|
-
attributeIds: [columnId],
|
|
6108
|
-
})];
|
|
6109
|
-
case 1:
|
|
6110
|
-
linking = _g.sent();
|
|
6111
|
-
((_c = linking === null || linking === void 0 ? void 0 : linking.data) !== null && _c !== void 0 ? _c : []).forEach(function (eachRow) {
|
|
6112
|
-
var values = Array.isArray(eachRow === null || eachRow === void 0 ? void 0 : eachRow[columnId])
|
|
6113
|
-
? eachRow[columnId]
|
|
6114
|
-
: [eachRow === null || eachRow === void 0 ? void 0 : eachRow[columnId]];
|
|
6115
|
-
values.forEach(function (eachValue) {
|
|
6116
|
-
var _a, _b, _c;
|
|
6117
|
-
var id = String((_b = (_a = eachValue === null || eachValue === void 0 ? void 0 : eachValue._id) !== null && _a !== void 0 ? _a : eachValue === null || eachValue === void 0 ? void 0 : eachValue.id) !== null && _b !== void 0 ? _b : eachValue);
|
|
6118
|
-
if (!batchSet.has(id))
|
|
6119
|
-
return;
|
|
6120
|
-
linkedIds.add(id);
|
|
6121
|
-
var key = "".concat(eachSource.collectionId, "|").concat(columnId);
|
|
6122
|
-
var link = (_c = linkedBySource.get(key)) !== null && _c !== void 0 ? _c : {
|
|
6123
|
-
collectionId: eachSource.collectionId,
|
|
6124
|
-
collectionName: eachSource.collectionName,
|
|
6125
|
-
columnId: columnId,
|
|
6126
|
-
columnType: eachSource.column.type,
|
|
6127
|
-
recordId: "",
|
|
6128
|
-
recordLabel: "",
|
|
6129
|
-
count: 0,
|
|
6130
|
-
};
|
|
6131
|
-
link.count += 1;
|
|
6132
|
-
linkedBySource.set(key, link);
|
|
6133
|
-
});
|
|
6134
|
-
});
|
|
6135
|
-
return [2 /*return*/];
|
|
6136
|
-
}
|
|
6054
|
+
var handleDeleteInBatches = function (query_1, total_1) {
|
|
6055
|
+
var args_1 = [];
|
|
6056
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
6057
|
+
args_1[_i - 2] = arguments[_i];
|
|
6058
|
+
}
|
|
6059
|
+
return __awaiter(void 0, __spreadArray([query_1, total_1], args_1, true), void 0, function (query, total, isSkipLinks) {
|
|
6060
|
+
var sources, _a, blockedIds, linkedBySource, deletedCount, processed, lastId, _loop_1, state_1, err_14;
|
|
6061
|
+
var _b, _c, _d;
|
|
6062
|
+
if (isSkipLinks === void 0) { isSkipLinks = false; }
|
|
6063
|
+
return __generator(this, function (_e) {
|
|
6064
|
+
switch (_e.label) {
|
|
6065
|
+
case 0:
|
|
6066
|
+
if (!isSkipLinks) return [3 /*break*/, 1];
|
|
6067
|
+
_a = [];
|
|
6068
|
+
return [3 /*break*/, 3];
|
|
6069
|
+
case 1: return [4 /*yield*/, (0, referenceScan_1.handleListReferenceSources)({
|
|
6070
|
+
dbModule: dbModule,
|
|
6071
|
+
devSettings: props.devSettings,
|
|
6072
|
+
space: props.space,
|
|
6073
|
+
fresh: true,
|
|
6074
|
+
bareReferenceDel: (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareReferenceDel,
|
|
6075
|
+
})];
|
|
6076
|
+
case 2:
|
|
6077
|
+
_a = _e.sent();
|
|
6078
|
+
_e.label = 3;
|
|
6079
|
+
case 3:
|
|
6080
|
+
sources = _a;
|
|
6081
|
+
blockedIds = [];
|
|
6082
|
+
linkedBySource = new Map();
|
|
6083
|
+
deletedCount = 0;
|
|
6084
|
+
processed = 0;
|
|
6085
|
+
lastId = "";
|
|
6086
|
+
setDeleteProgress(isSkipLinks
|
|
6087
|
+
? { done: 0, total: total, isDeleteOnly: true }
|
|
6088
|
+
: { done: 0, total: total, deleted: 0 });
|
|
6089
|
+
_e.label = 4;
|
|
6090
|
+
case 4:
|
|
6091
|
+
_e.trys.push([4, 8, , 9]);
|
|
6092
|
+
_loop_1 = function () {
|
|
6093
|
+
var page, batchIds, batchSet, linkedIds, _loop_2, _f, sources_1, eachSource, _g, deletedIds, isStopped;
|
|
6094
|
+
return __generator(this, function (_h) {
|
|
6095
|
+
switch (_h.label) {
|
|
6096
|
+
case 0:
|
|
6097
|
+
if (!isMountedRef.current)
|
|
6098
|
+
throw new Error("left");
|
|
6099
|
+
return [4 /*yield*/, readServerQuery.call({
|
|
6100
|
+
type: "list",
|
|
6101
|
+
query: __spreadArray(__spreadArray([], query, true), (lastId
|
|
6102
|
+
? [{ type: ">", queryId: serverId, value: lastId }]
|
|
6103
|
+
: []), true),
|
|
6104
|
+
sort: { sortId: serverId, type: "asc" },
|
|
6105
|
+
limit: DELETE_BATCH_SIZE,
|
|
6106
|
+
attributeIds: [serverId],
|
|
6107
|
+
})];
|
|
6108
|
+
case 1:
|
|
6109
|
+
page = _h.sent();
|
|
6110
|
+
batchIds = ((_c = page === null || page === void 0 ? void 0 : page.data) !== null && _c !== void 0 ? _c : []).map(function (eachRow) {
|
|
6111
|
+
return handleGetRowId(eachRow);
|
|
6137
6112
|
});
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6113
|
+
if (batchIds.length === 0)
|
|
6114
|
+
return [2 /*return*/, "break"];
|
|
6115
|
+
if (lastId && !(batchIds[0] > lastId))
|
|
6116
|
+
throw new Error("no progress");
|
|
6117
|
+
lastId = batchIds[batchIds.length - 1];
|
|
6118
|
+
batchSet = new Set(batchIds);
|
|
6119
|
+
linkedIds = new Set();
|
|
6120
|
+
_loop_2 = function (eachSource) {
|
|
6121
|
+
var referenceRQ, columnId, linking;
|
|
6122
|
+
return __generator(this, function (_j) {
|
|
6123
|
+
switch (_j.label) {
|
|
6124
|
+
case 0:
|
|
6125
|
+
referenceRQ = new readQuery_1.ReadQuery({
|
|
6126
|
+
dbModule: dbModule,
|
|
6127
|
+
dbType: props.devSettings.server,
|
|
6128
|
+
dbCollection: eachSource.collectionId,
|
|
6129
|
+
dbEndpoint: props.devSettings.dbEndpoint,
|
|
6130
|
+
dbAPIToken: props.devSettings.dbAPIToken,
|
|
6131
|
+
dbUserToken: props.devSettings.dbUserToken,
|
|
6132
|
+
});
|
|
6133
|
+
columnId = eachSource.column.id;
|
|
6134
|
+
return [4 /*yield*/, referenceRQ.call({
|
|
6135
|
+
type: "list",
|
|
6136
|
+
query: [{ type: "in", queryId: columnId, value: batchIds }],
|
|
6137
|
+
stopLimit: true,
|
|
6138
|
+
attributeIds: [columnId],
|
|
6139
|
+
})];
|
|
6140
|
+
case 1:
|
|
6141
|
+
linking = _j.sent();
|
|
6142
|
+
((_d = linking === null || linking === void 0 ? void 0 : linking.data) !== null && _d !== void 0 ? _d : []).forEach(function (eachRow) {
|
|
6143
|
+
var values = Array.isArray(eachRow === null || eachRow === void 0 ? void 0 : eachRow[columnId])
|
|
6144
|
+
? eachRow[columnId]
|
|
6145
|
+
: [eachRow === null || eachRow === void 0 ? void 0 : eachRow[columnId]];
|
|
6146
|
+
values.forEach(function (eachValue) {
|
|
6147
|
+
var _a, _b, _c;
|
|
6148
|
+
var id = String((_b = (_a = eachValue === null || eachValue === void 0 ? void 0 : eachValue._id) !== null && _a !== void 0 ? _a : eachValue === null || eachValue === void 0 ? void 0 : eachValue.id) !== null && _b !== void 0 ? _b : eachValue);
|
|
6149
|
+
if (!batchSet.has(id))
|
|
6150
|
+
return;
|
|
6151
|
+
linkedIds.add(id);
|
|
6152
|
+
var key = "".concat(eachSource.collectionId, "|").concat(columnId);
|
|
6153
|
+
var link = (_c = linkedBySource.get(key)) !== null && _c !== void 0 ? _c : {
|
|
6154
|
+
collectionId: eachSource.collectionId,
|
|
6155
|
+
collectionName: eachSource.collectionName,
|
|
6156
|
+
columnId: columnId,
|
|
6157
|
+
columnType: eachSource.column.type,
|
|
6158
|
+
recordId: "",
|
|
6159
|
+
recordLabel: "",
|
|
6160
|
+
count: 0,
|
|
6161
|
+
};
|
|
6162
|
+
link.count += 1;
|
|
6163
|
+
linkedBySource.set(key, link);
|
|
6164
|
+
});
|
|
6165
|
+
});
|
|
6166
|
+
return [2 /*return*/];
|
|
6167
|
+
}
|
|
6168
|
+
});
|
|
6169
|
+
};
|
|
6170
|
+
_f = 0, sources_1 = sources;
|
|
6171
|
+
_h.label = 2;
|
|
6172
|
+
case 2:
|
|
6173
|
+
if (!(_f < sources_1.length)) return [3 /*break*/, 5];
|
|
6174
|
+
eachSource = sources_1[_f];
|
|
6175
|
+
return [5 /*yield**/, _loop_2(eachSource)];
|
|
6176
|
+
case 3:
|
|
6177
|
+
_h.sent();
|
|
6178
|
+
_h.label = 4;
|
|
6179
|
+
case 4:
|
|
6180
|
+
_f++;
|
|
6181
|
+
return [3 /*break*/, 2];
|
|
6182
|
+
case 5:
|
|
6183
|
+
blockedIds.push.apply(blockedIds, Array.from(linkedIds));
|
|
6184
|
+
return [4 /*yield*/, handleDeleteIdsInParts(batchIds.filter(function (eachId) { return !linkedIds.has(eachId); }))];
|
|
6185
|
+
case 6:
|
|
6186
|
+
_g = _h.sent(), deletedIds = _g.deletedIds, isStopped = _g.isStopped;
|
|
6187
|
+
deletedCount += deletedIds.length;
|
|
6188
|
+
processed += batchIds.length;
|
|
6189
|
+
setDeleteProgress(isSkipLinks
|
|
6190
|
+
? { done: processed, total: total, isDeleteOnly: true }
|
|
6191
|
+
: { done: processed, total: total, deleted: deletedCount });
|
|
6192
|
+
if (isStopped)
|
|
6193
|
+
throw new Error("stopped");
|
|
6194
|
+
if (batchIds.length < DELETE_BATCH_SIZE)
|
|
6195
|
+
return [2 /*return*/, "break"];
|
|
6196
|
+
return [2 /*return*/];
|
|
6197
|
+
}
|
|
6198
|
+
});
|
|
6199
|
+
};
|
|
6200
|
+
_e.label = 5;
|
|
6201
|
+
case 5:
|
|
6202
|
+
if (!(processed < total)) return [3 /*break*/, 7];
|
|
6203
|
+
return [5 /*yield**/, _loop_1()];
|
|
6204
|
+
case 6:
|
|
6205
|
+
state_1 = _e.sent();
|
|
6206
|
+
if (state_1 === "break")
|
|
6207
|
+
return [3 /*break*/, 7];
|
|
6174
6208
|
return [3 /*break*/, 5];
|
|
6175
|
-
return [3 /*break*/,
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
}
|
|
6209
|
+
case 7: return [3 /*break*/, 9];
|
|
6210
|
+
case 8:
|
|
6211
|
+
err_14 = _e.sent();
|
|
6212
|
+
setNotification({
|
|
6213
|
+
type: false,
|
|
6214
|
+
title: "Delete stopped",
|
|
6215
|
+
msg: "".concat(deletedCount.toLocaleString(), " of ").concat(total.toLocaleString(), " records were deleted before an error. Refresh to see what is left."),
|
|
6216
|
+
});
|
|
6217
|
+
return [3 /*break*/, 9];
|
|
6218
|
+
case 9:
|
|
6219
|
+
setDeleteProgress(null);
|
|
6220
|
+
blockedDeleteIdsRef.current = blockedIds;
|
|
6221
|
+
isBlockedFromListRef.current = true;
|
|
6222
|
+
// INFO: a batch reads too many records to name each, so the box lists the
|
|
6223
|
+
// linking datasheets with how many of the selection each still links
|
|
6224
|
+
if (blockedIds.length > 0)
|
|
6225
|
+
setReferenceDeleteTableData(Array.from(linkedBySource.values()).map(function (eachLink) { return (__assign(__assign({}, eachLink), { recordLabel: "".concat(blockedIds.length.toLocaleString(), " selected records"), isSummary: true })); }));
|
|
6226
|
+
return [2 /*return*/, deletedCount];
|
|
6227
|
+
}
|
|
6228
|
+
});
|
|
6195
6229
|
});
|
|
6196
|
-
}
|
|
6230
|
+
};
|
|
6197
6231
|
// INFO: deletes records still linked elsewhere without the link check —
|
|
6198
6232
|
// the records linking to them keep the link, which then shows as missing
|
|
6199
6233
|
var handleDeleteAnyway = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -6214,7 +6248,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6214
6248
|
_b.trys.push([1, , 6, 7]);
|
|
6215
6249
|
setLoading(true);
|
|
6216
6250
|
setModalVisible(true);
|
|
6217
|
-
setDeleteProgress({ done: 0, total: ids.length });
|
|
6251
|
+
setDeleteProgress({ done: 0, total: ids.length, isDeleteOnly: true });
|
|
6218
6252
|
deletedIds = [];
|
|
6219
6253
|
start = 0;
|
|
6220
6254
|
_b.label = 2;
|
|
@@ -6227,6 +6261,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6227
6261
|
setDeleteProgress({
|
|
6228
6262
|
done: start + batchDeleted.length,
|
|
6229
6263
|
total: ids.length,
|
|
6264
|
+
isDeleteOnly: true,
|
|
6230
6265
|
});
|
|
6231
6266
|
if (isStopped) {
|
|
6232
6267
|
setNotification({
|
|
@@ -6253,27 +6288,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6253
6288
|
});
|
|
6254
6289
|
}); };
|
|
6255
6290
|
var handleMultipleRemoveSelectedData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6256
|
-
var passcodeMatch, offlineDataResp, offlineData, filteredData, ids, notReferenceId, query, countData, matchedCount, isIdFiltered, query, responseData, formulaKeptIds_1, matchedRows, deleteIds,
|
|
6257
|
-
var
|
|
6258
|
-
return __generator(this, function (
|
|
6259
|
-
switch (
|
|
6291
|
+
var deletedCount, isFailed, isSkipLinks, passcodeMatch, offlineDataResp, offlineData, filteredData, ids, notReferenceId, query, countData, matchedCount, isIdFiltered, query, responseData, formulaKeptIds_1, matchedRows, _a, deleteIds, _b, deletedIds, isStopped, responseData, _c, err_15;
|
|
6292
|
+
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
6293
|
+
return __generator(this, function (_p) {
|
|
6294
|
+
switch (_p.label) {
|
|
6260
6295
|
case 0:
|
|
6261
6296
|
if (deletingRef.current)
|
|
6262
6297
|
return [2 /*return*/];
|
|
6263
6298
|
deletingRef.current = true;
|
|
6264
6299
|
setDeleting(true);
|
|
6265
|
-
|
|
6300
|
+
deletedCount = 0;
|
|
6301
|
+
isFailed = false;
|
|
6302
|
+
isSkipLinks = isSkipLinkCheck && !!((_d = props.organise) === null || _d === void 0 ? void 0 : _d.canDeleteAnyway);
|
|
6303
|
+
_p.label = 1;
|
|
6266
6304
|
case 1:
|
|
6267
|
-
|
|
6305
|
+
_p.trys.push([1, 26, 27, 28]);
|
|
6268
6306
|
setLoading(true);
|
|
6269
6307
|
setModalVisible(true);
|
|
6270
6308
|
passcodeMatch = deletePasscodeInput === deletePasscode;
|
|
6271
|
-
if (!passcodeMatch) return [3 /*break*/,
|
|
6272
|
-
if (!((
|
|
6309
|
+
if (!passcodeMatch) return [3 /*break*/, 24];
|
|
6310
|
+
if (!((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareOffline)) return [3 /*break*/, 4];
|
|
6273
6311
|
return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
|
|
6274
6312
|
case 2:
|
|
6275
|
-
offlineDataResp =
|
|
6276
|
-
offlineData = (
|
|
6313
|
+
offlineDataResp = _p.sent();
|
|
6314
|
+
offlineData = (_f = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _f !== void 0 ? _f : [];
|
|
6277
6315
|
filteredData = offlineData.filter(function (eachOfflineData) {
|
|
6278
6316
|
return !selectedIds.includes(eachOfflineData[serverId]);
|
|
6279
6317
|
});
|
|
@@ -6282,21 +6320,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6282
6320
|
type: props.collectionId,
|
|
6283
6321
|
})];
|
|
6284
6322
|
case 3:
|
|
6285
|
-
|
|
6286
|
-
|
|
6323
|
+
_p.sent();
|
|
6324
|
+
deletedCount = selectedIds.length;
|
|
6325
|
+
return [3 /*break*/, 23];
|
|
6287
6326
|
case 4:
|
|
6288
6327
|
ids = [];
|
|
6289
6328
|
notReferenceId = [];
|
|
6290
6329
|
if (!(selectAll && !handleGetFormulaKeptIds())) return [3 /*break*/, 6];
|
|
6291
|
-
query = (
|
|
6330
|
+
query = (_g = renderImpSearchFilterConditions()) !== null && _g !== void 0 ? _g : [];
|
|
6292
6331
|
return [4 /*yield*/, readServerQuery.call({
|
|
6293
6332
|
type: "list",
|
|
6294
6333
|
query: query,
|
|
6295
6334
|
limit: 1,
|
|
6296
6335
|
})];
|
|
6297
6336
|
case 5:
|
|
6298
|
-
countData =
|
|
6299
|
-
matchedCount = (
|
|
6337
|
+
countData = _p.sent();
|
|
6338
|
+
matchedCount = (_h = countData === null || countData === void 0 ? void 0 : countData.count) !== null && _h !== void 0 ? _h : 0;
|
|
6300
6339
|
if (matchedCount !== selectAllSizeRef.current) {
|
|
6301
6340
|
setNotification({
|
|
6302
6341
|
type: false,
|
|
@@ -6307,22 +6346,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6307
6346
|
setModalVisible(false);
|
|
6308
6347
|
return [2 /*return*/];
|
|
6309
6348
|
}
|
|
6310
|
-
|
|
6349
|
+
_p.label = 6;
|
|
6311
6350
|
case 6:
|
|
6312
|
-
isIdFiltered = ((
|
|
6351
|
+
isIdFiltered = ((_j = renderImpSearchFilterConditions()) !== null && _j !== void 0 ? _j : []).some(function (eachQuery) {
|
|
6313
6352
|
return eachQuery.queryId === serverId && eachQuery.type !== "exists";
|
|
6314
6353
|
});
|
|
6315
6354
|
if (!(selectAll &&
|
|
6316
6355
|
!handleGetFormulaKeptIds() &&
|
|
6317
6356
|
!isIdFiltered &&
|
|
6318
6357
|
selectAllSizeRef.current > DELETE_BATCH_THRESHOLD)) return [3 /*break*/, 8];
|
|
6319
|
-
return [4 /*yield*/, handleDeleteInBatches((
|
|
6358
|
+
return [4 /*yield*/, handleDeleteInBatches((_k = renderImpSearchFilterConditions()) !== null && _k !== void 0 ? _k : [], selectAllSizeRef.current, isSkipLinks)];
|
|
6320
6359
|
case 7:
|
|
6321
|
-
|
|
6360
|
+
deletedCount = _p.sent();
|
|
6322
6361
|
ids = [];
|
|
6323
|
-
return [3 /*break*/,
|
|
6362
|
+
return [3 /*break*/, 21];
|
|
6324
6363
|
case 8:
|
|
6325
|
-
if (!selectAll) return [3 /*break*/,
|
|
6364
|
+
if (!selectAll) return [3 /*break*/, 14];
|
|
6326
6365
|
query = renderImpSearchFilterConditions();
|
|
6327
6366
|
return [4 /*yield*/, readServerQuery.call({
|
|
6328
6367
|
type: "list",
|
|
@@ -6330,9 +6369,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6330
6369
|
stopLimit: true,
|
|
6331
6370
|
})];
|
|
6332
6371
|
case 9:
|
|
6333
|
-
responseData =
|
|
6372
|
+
responseData = _p.sent();
|
|
6334
6373
|
formulaKeptIds_1 = handleGetFormulaKeptIds();
|
|
6335
|
-
matchedRows = ((
|
|
6374
|
+
matchedRows = ((_l = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _l !== void 0 ? _l : []).filter(function (eachRow) {
|
|
6336
6375
|
return !formulaKeptIds_1 || formulaKeptIds_1.has(handleGetRowId(eachRow));
|
|
6337
6376
|
});
|
|
6338
6377
|
// INFO: the rows found now must be the ones the reader was shown
|
|
@@ -6347,13 +6386,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6347
6386
|
setModalVisible(false);
|
|
6348
6387
|
return [2 /*return*/];
|
|
6349
6388
|
}
|
|
6350
|
-
return [
|
|
6351
|
-
|
|
6352
|
-
|
|
6389
|
+
if (!isSkipLinks) return [3 /*break*/, 10];
|
|
6390
|
+
_a = matchedRows.map(function (eachRow) { return eachRow[serverId]; });
|
|
6391
|
+
return [3 /*break*/, 12];
|
|
6392
|
+
case 10: return [4 /*yield*/, handleCheckDeleteReference(matchedRows, true)];
|
|
6393
|
+
case 11:
|
|
6394
|
+
_a = _p.sent();
|
|
6395
|
+
_p.label = 12;
|
|
6396
|
+
case 12:
|
|
6397
|
+
notReferenceId = _a;
|
|
6353
6398
|
deleteIds = notReferenceId !== null && notReferenceId !== void 0 ? notReferenceId : [];
|
|
6354
6399
|
return [4 /*yield*/, handleDeleteIdsInParts(deleteIds)];
|
|
6355
|
-
case
|
|
6356
|
-
|
|
6400
|
+
case 13:
|
|
6401
|
+
_b = _p.sent(), deletedIds = _b.deletedIds, isStopped = _b.isStopped;
|
|
6402
|
+
deletedCount = deletedIds.length;
|
|
6357
6403
|
if (isStopped)
|
|
6358
6404
|
setNotification({
|
|
6359
6405
|
type: false,
|
|
@@ -6361,8 +6407,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6361
6407
|
msg: "".concat(deletedIds.length.toLocaleString(), " of ").concat(deleteIds.length.toLocaleString(), " records were deleted before an error. Refresh to see what is left."),
|
|
6362
6408
|
});
|
|
6363
6409
|
ids = [];
|
|
6364
|
-
return [3 /*break*/,
|
|
6365
|
-
case
|
|
6410
|
+
return [3 /*break*/, 21];
|
|
6411
|
+
case 14: return [4 /*yield*/, readServerQuery.call({
|
|
6366
6412
|
type: "list",
|
|
6367
6413
|
query: [
|
|
6368
6414
|
{
|
|
@@ -6373,32 +6419,39 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6373
6419
|
],
|
|
6374
6420
|
stopLimit: true,
|
|
6375
6421
|
})];
|
|
6376
|
-
case
|
|
6377
|
-
responseData =
|
|
6378
|
-
return [
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6422
|
+
case 15:
|
|
6423
|
+
responseData = _p.sent();
|
|
6424
|
+
if (!isSkipLinks) return [3 /*break*/, 16];
|
|
6425
|
+
_c = ((_m = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _m !== void 0 ? _m : []).map(function (eachRow) { return eachRow[serverId]; });
|
|
6426
|
+
return [3 /*break*/, 18];
|
|
6427
|
+
case 16: return [4 /*yield*/, handleCheckDeleteReference((_o = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _o !== void 0 ? _o : [], true)];
|
|
6428
|
+
case 17:
|
|
6429
|
+
_c = _p.sent();
|
|
6430
|
+
_p.label = 18;
|
|
6431
|
+
case 18:
|
|
6432
|
+
notReferenceId = _c;
|
|
6433
|
+
if (!((notReferenceId !== null && notReferenceId !== void 0 ? notReferenceId : []).length > 0)) return [3 /*break*/, 20];
|
|
6382
6434
|
return [4 /*yield*/, writeServerQuery.call("batchDelete", {
|
|
6383
6435
|
id: notReferenceId,
|
|
6384
6436
|
})];
|
|
6385
|
-
case
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
case
|
|
6437
|
+
case 19:
|
|
6438
|
+
_p.sent();
|
|
6439
|
+
_p.label = 20;
|
|
6440
|
+
case 20:
|
|
6389
6441
|
ids = notReferenceId !== null && notReferenceId !== void 0 ? notReferenceId : [];
|
|
6390
|
-
|
|
6391
|
-
|
|
6442
|
+
deletedCount = ids.length;
|
|
6443
|
+
_p.label = 21;
|
|
6444
|
+
case 21:
|
|
6392
6445
|
// INFO: files go only with records that were deleted
|
|
6393
6446
|
return [4 /*yield*/, handleDeleteRecordFiles(ids !== null && ids !== void 0 ? ids : [])];
|
|
6394
|
-
case
|
|
6447
|
+
case 22:
|
|
6395
6448
|
// INFO: files go only with records that were deleted
|
|
6396
|
-
|
|
6449
|
+
_p.sent();
|
|
6397
6450
|
if (mapViewRef.current)
|
|
6398
6451
|
mapViewRef.current.handleClearPolygons();
|
|
6399
|
-
|
|
6400
|
-
case
|
|
6401
|
-
case
|
|
6452
|
+
_p.label = 23;
|
|
6453
|
+
case 23: return [3 /*break*/, 25];
|
|
6454
|
+
case 24:
|
|
6402
6455
|
setNotification({
|
|
6403
6456
|
type: false,
|
|
6404
6457
|
title: "Incorrect Passcode",
|
|
@@ -6407,16 +6460,26 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6407
6460
|
setLoading(false);
|
|
6408
6461
|
setModalVisible(false);
|
|
6409
6462
|
return [2 /*return*/];
|
|
6410
|
-
case
|
|
6411
|
-
case
|
|
6412
|
-
err_15 =
|
|
6413
|
-
|
|
6414
|
-
|
|
6463
|
+
case 25: return [3 /*break*/, 28];
|
|
6464
|
+
case 26:
|
|
6465
|
+
err_15 = _p.sent();
|
|
6466
|
+
isFailed = true;
|
|
6467
|
+
return [3 /*break*/, 28];
|
|
6468
|
+
case 27:
|
|
6415
6469
|
deletingRef.current = false;
|
|
6416
6470
|
setDeleting(false);
|
|
6417
6471
|
return [7 /*endfinally*/];
|
|
6418
|
-
case
|
|
6472
|
+
case 28:
|
|
6419
6473
|
setDeletePasscodeInput("");
|
|
6474
|
+
setIsSkipLinkCheck(false);
|
|
6475
|
+
// INFO: when every picked record is still linked nothing changed, so the
|
|
6476
|
+
// list and its selection stay as they are behind "Can't delete yet"
|
|
6477
|
+
if (deletedCount === 0 && !isFailed) {
|
|
6478
|
+
setLoading(false);
|
|
6479
|
+
setModalVisible(false);
|
|
6480
|
+
setDeleteModal(false);
|
|
6481
|
+
return [2 /*return*/];
|
|
6482
|
+
}
|
|
6420
6483
|
// INFO: the selection is gone with the rows it covered
|
|
6421
6484
|
if (selectAll)
|
|
6422
6485
|
handleSelectAllPages(false);
|
|
@@ -7656,9 +7719,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7656
7719
|
}); };
|
|
7657
7720
|
var handleSubmit = function (isDraft) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7658
7721
|
var preComplete, res, updatedMarkdownData_1, uploadedData_2, uploadTypes_1, err_25;
|
|
7659
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
7660
|
-
return __generator(this, function (
|
|
7661
|
-
switch (
|
|
7722
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7723
|
+
return __generator(this, function (_j) {
|
|
7724
|
+
switch (_j.label) {
|
|
7662
7725
|
case 0:
|
|
7663
7726
|
// INFO: re-entry guard — if a submit is already in-flight (double-click,
|
|
7664
7727
|
// rapid Enter keypresses, or concurrent bareSaveOnTabChange calls), return
|
|
@@ -7667,28 +7730,28 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7667
7730
|
if (isSubmittingRef.current)
|
|
7668
7731
|
return [2 /*return*/];
|
|
7669
7732
|
isSubmittingRef.current = true;
|
|
7670
|
-
|
|
7733
|
+
_j.label = 1;
|
|
7671
7734
|
case 1:
|
|
7672
|
-
|
|
7735
|
+
_j.trys.push([1, 8, , 9]);
|
|
7673
7736
|
setLoading(true);
|
|
7674
7737
|
setModalVisible(true);
|
|
7675
7738
|
preComplete = true;
|
|
7676
7739
|
if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateHandlePreComplete)) return [3 /*break*/, 3];
|
|
7677
7740
|
return [4 /*yield*/, props.bareSettings.bareUpdateHandlePreComplete(selectedData, handleResolveRawData())];
|
|
7678
7741
|
case 2:
|
|
7679
|
-
preComplete =
|
|
7680
|
-
|
|
7742
|
+
preComplete = _j.sent();
|
|
7743
|
+
_j.label = 3;
|
|
7681
7744
|
case 3:
|
|
7682
7745
|
if (!preComplete)
|
|
7683
7746
|
throw "Error";
|
|
7684
7747
|
if (!((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareUpdateHandleComplete)) return [3 /*break*/, 5];
|
|
7685
7748
|
return [4 /*yield*/, props.bareSettings.bareUpdateHandleComplete(selectedData, handleResolveRawData())];
|
|
7686
7749
|
case 4:
|
|
7687
|
-
|
|
7750
|
+
_j.sent();
|
|
7688
7751
|
return [3 /*break*/, 7];
|
|
7689
7752
|
case 5: return [4 /*yield*/, handleSubmitData(undefined, undefined, undefined, undefined, undefined, undefined, isDraft)];
|
|
7690
7753
|
case 6:
|
|
7691
|
-
res =
|
|
7754
|
+
res = _j.sent();
|
|
7692
7755
|
if (res) {
|
|
7693
7756
|
// INFO: bareUpdateHandlePostComplete is deliberately not called here.
|
|
7694
7757
|
// handleSubmitData already calls it once, right after the write, with
|
|
@@ -7748,7 +7811,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7748
7811
|
setSelectedData(function (prev) { return (__assign(__assign({}, prev), updatedMarkdownData_1)); });
|
|
7749
7812
|
}
|
|
7750
7813
|
if (props.id === "new" || !props.id) {
|
|
7751
|
-
(_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.handleNavigate) === null || _e === void 0 ? void 0 : _e.call(_d, "update", res, (
|
|
7814
|
+
(_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.handleNavigate) === null || _e === void 0 ? void 0 : _e.call(_d, "update", res, handleResolveRecordTabId());
|
|
7752
7815
|
}
|
|
7753
7816
|
if (silentDraftRef.current) {
|
|
7754
7817
|
silentDraftRef.current = false;
|
|
@@ -7765,7 +7828,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7765
7828
|
// INFO: Non-draft (final submit) — reset dirty tracking and rebase baseline.
|
|
7766
7829
|
// Usually the component navigates away, but in case it doesn't (e.g. custom onComplete
|
|
7767
7830
|
// that stays on the same page), ensure clean state for subsequent interactions.
|
|
7768
|
-
if ((
|
|
7831
|
+
if ((_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareUpsertPartialUpdate) {
|
|
7769
7832
|
loadedSelectedData.current = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, true, showId, true);
|
|
7770
7833
|
dirtyFieldsRef.current.clear();
|
|
7771
7834
|
}
|
|
@@ -7773,22 +7836,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
7773
7836
|
props.onComplete(res);
|
|
7774
7837
|
}
|
|
7775
7838
|
else {
|
|
7776
|
-
|
|
7777
|
-
(_j = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.handleNavigate) === null || _j === void 0 ? void 0 : _j.call(_h, "read", res, selectedTab.id);
|
|
7778
|
-
}
|
|
7779
|
-
else
|
|
7780
|
-
(_l = (_k = props.organise) === null || _k === void 0 ? void 0 : _k.handleNavigate) === null || _l === void 0 ? void 0 : _l.call(_k, "read", res, "general");
|
|
7839
|
+
(_h = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.handleNavigate) === null || _h === void 0 ? void 0 : _h.call(_g, "read", res, handleResolveRecordTabId());
|
|
7781
7840
|
}
|
|
7782
7841
|
}
|
|
7783
7842
|
}
|
|
7784
|
-
|
|
7843
|
+
_j.label = 7;
|
|
7785
7844
|
case 7:
|
|
7786
7845
|
setModalVisible(false);
|
|
7787
7846
|
setLoading(false);
|
|
7788
7847
|
isSubmittingRef.current = false;
|
|
7789
7848
|
return [3 /*break*/, 9];
|
|
7790
7849
|
case 8:
|
|
7791
|
-
err_25 =
|
|
7850
|
+
err_25 = _j.sent();
|
|
7792
7851
|
setModalVisible(false);
|
|
7793
7852
|
setLoading(false);
|
|
7794
7853
|
isSubmittingRef.current = false;
|
|
@@ -9019,6 +9078,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
9019
9078
|
}
|
|
9020
9079
|
}
|
|
9021
9080
|
};
|
|
9081
|
+
// INFO: the tab a just-created record opens on. A form opened from a list
|
|
9082
|
+
// inherits that list's tab — a board or grid — and a read view given a list
|
|
9083
|
+
// tab draws nothing, so the new record opened blank.
|
|
9084
|
+
var handleResolveRecordTabId = function () {
|
|
9085
|
+
return (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.id) && selectedTab.type !== "list" ? selectedTab.id : "general";
|
|
9086
|
+
};
|
|
9022
9087
|
var handleBreadcrumbNavigate = function (type, dataId) {
|
|
9023
9088
|
var _a, _b;
|
|
9024
9089
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, type !== null && type !== void 0 ? type : "list", dataId !== null && dataId !== void 0 ? dataId : "", (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.id) ? selectedTab.id : "general");
|
|
@@ -11161,6 +11226,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11161
11226
|
// grouping keeps it, so rows of groups not loaded yet stay reachable.
|
|
11162
11227
|
if (renderCheckGroupPaging())
|
|
11163
11228
|
return null;
|
|
11229
|
+
if (isAllGroupsCollapsed)
|
|
11230
|
+
return null;
|
|
11164
11231
|
if (renderCheckScrollExhausted())
|
|
11165
11232
|
return null;
|
|
11166
11233
|
// INFO: only show the append spinner once we already have rows. On the
|
|
@@ -11988,6 +12055,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11988
12055
|
}
|
|
11989
12056
|
: undefined,
|
|
11990
12057
|
groupLoadingStatus: isGroupPaging ? groupPageState : undefined,
|
|
12058
|
+
onAllGroupsCollapsedChange: setIsAllGroupsCollapsed,
|
|
11991
12059
|
};
|
|
11992
12060
|
};
|
|
11993
12061
|
var renderGroupTable = function (multipleSelect) {
|
|
@@ -12121,7 +12189,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12121
12189
|
else {
|
|
12122
12190
|
// INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
|
|
12123
12191
|
if ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareNewDTW) {
|
|
12124
|
-
return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: newTableRows, spaceData: newTableSpaceRows !== null && newTableSpaceRows !== void 0 ? newTableSpaceRows : [], referencesOptions: listReferencesOptions, referencesDetails: listReferencesDetails, groups: handleBuildNewTableGroups(true), groupColumnKey: groupId || undefined, onRowActivity: recordActivityAction, onRowEdit: recordEditAction, onRowOpen: recordOpenAction, commentCounts: ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.onFetchCommentCounts) ? commentCounts : undefined, commentUnread: ((_e = props.organise) === null || _e === void 0 ? void 0 : _e.onFetchCommentCounts) ? commentUnread : undefined, onMoveRowToGroup: isDatasheetDefaults && canUpdateRecord && groupId
|
|
12192
|
+
return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: newTableRows, spaceData: newTableSpaceRows !== null && newTableSpaceRows !== void 0 ? newTableSpaceRows : [], referencesOptions: listReferencesOptions, referencesDetails: listReferencesDetails, groups: handleBuildNewTableGroups(true), groupColumnKey: groupId || undefined, onAllGroupsCollapsedChange: setIsAllGroupsCollapsed, onRowActivity: recordActivityAction, onRowEdit: recordEditAction, onRowOpen: recordOpenAction, commentCounts: ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.onFetchCommentCounts) ? commentCounts : undefined, commentUnread: ((_e = props.organise) === null || _e === void 0 ? void 0 : _e.onFetchCommentCounts) ? commentUnread : undefined, onMoveRowToGroup: isDatasheetDefaults && canUpdateRecord && groupId
|
|
12125
12193
|
? handleMoveRowToGroup
|
|
12126
12194
|
: undefined,
|
|
12127
12195
|
// INFO: per-group paging — scroll appends inside a band, page
|
|
@@ -13633,7 +13701,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13633
13701
|
" of",
|
|
13634
13702
|
" ",
|
|
13635
13703
|
deleteProgress.total.toLocaleString(),
|
|
13636
|
-
" records
|
|
13704
|
+
" records",
|
|
13705
|
+
" ",
|
|
13706
|
+
deleteProgress.isDeleteOnly ? "deleted" : "checked",
|
|
13707
|
+
deleteProgress.deleted !== undefined &&
|
|
13708
|
+
" \u00B7 ".concat(deleteProgress.deleted.toLocaleString(), " deleted")),
|
|
13637
13709
|
react_1.default.createElement("div", { className: "mt-3 h-2 w-full overflow-hidden rounded-full ".concat(((_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode) ? "bg-gray-700" : "bg-gray-200") },
|
|
13638
13710
|
react_1.default.createElement("div", { className: "h-2 rounded-full bg-primary-500 transition-all", style: { width: "".concat(percent, "%") } }))));
|
|
13639
13711
|
}
|
|
@@ -13927,9 +13999,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13927
13999
|
var link = referenceDeleteTableData.find(function (each) { return handleGetRowKey(each) === rowId; });
|
|
13928
14000
|
if (!link)
|
|
13929
14001
|
return;
|
|
13930
|
-
// INFO:
|
|
13931
|
-
//
|
|
13932
|
-
setReferenceDeleteTableData([]);
|
|
14002
|
+
// INFO: kept open, so the reader can come back to the other
|
|
14003
|
+
// rows or Delete anyway after looking at one datasheet
|
|
13933
14004
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onOpenReferencingRecords) === null || _b === void 0 ? void 0 : _b.call(_a, link);
|
|
13934
14005
|
}
|
|
13935
14006
|
: undefined }),
|
|
@@ -13955,7 +14026,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13955
14026
|
} }))));
|
|
13956
14027
|
};
|
|
13957
14028
|
var renderDeleteModalContent = function () {
|
|
13958
|
-
var _a;
|
|
14029
|
+
var _a, _b, _c;
|
|
13959
14030
|
if (!deleteModal)
|
|
13960
14031
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
13961
14032
|
else
|
|
@@ -13974,10 +14045,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13974
14045
|
" ",
|
|
13975
14046
|
react_1.default.createElement("span", { className: "font-semibold" }, deletePasscode),
|
|
13976
14047
|
" to delete."),
|
|
13977
|
-
react_1.default.createElement(textInput_1.TextInput, { id: "dtw-delete-passcode", label: "", value: deletePasscodeInput, onChange: function (e) { return setDeletePasscodeInput(e.target.value); }, type: "password", placeholder: "Type your passcode here" })
|
|
14048
|
+
react_1.default.createElement(textInput_1.TextInput, { id: "dtw-delete-passcode", label: "", value: deletePasscodeInput, onChange: function (e) { return setDeletePasscodeInput(e.target.value); }, type: "password", placeholder: "Type your passcode here" }),
|
|
14049
|
+
((_b = props.organise) === null || _b === void 0 ? void 0 : _b.canDeleteAnyway) && (react_1.default.createElement(checkbox_1.Checkbox, { id: "dtw-delete-skip-links", className: "mt-4", optional: true, darkMode: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode, itemList: [
|
|
14050
|
+
{
|
|
14051
|
+
key: "skip",
|
|
14052
|
+
label: "Also delete records that are still linked",
|
|
14053
|
+
},
|
|
14054
|
+
], selectItemList: isSkipLinkCheck ? ["skip"] : [], onChange: function (items) {
|
|
14055
|
+
return setIsSkipLinkCheck(items.includes("skip"));
|
|
14056
|
+
} })))),
|
|
13978
14057
|
react_1.default.createElement("div", { className: "flex flex-row justify-end pt-5 mt-6 space-x-2" },
|
|
13979
14058
|
react_1.default.createElement(button_1.Button, { id: "dtw-delete-close", text: "Close", size: "small", type: "light", onClick: function () {
|
|
13980
14059
|
setDeletePasscodeInput("");
|
|
14060
|
+
setIsSkipLinkCheck(false);
|
|
13981
14061
|
setDeleteModal(false);
|
|
13982
14062
|
} }),
|
|
13983
14063
|
react_1.default.createElement(button_1.Button, { id: "dtw-delete-confirm", text: "Delete", size: "small", type: "danger", disable: deleting, onClick: function () {
|
|
@@ -14143,20 +14223,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
14143
14223
|
renderContent(),
|
|
14144
14224
|
renderReadDrawer(),
|
|
14145
14225
|
canHostDrawer && renderDrawerDiscardModal(),
|
|
14146
|
-
isActivityLog &&
|
|
14147
|
-
!isInlineActivity &&
|
|
14148
|
-
typeof document !== "undefined" &&
|
|
14149
|
-
(0, react_dom_1.createPortal)(
|
|
14226
|
+
isActivityLog && !isInlineActivity && (react_1.default.createElement(drawer_1.Drawer, { darkMode: (_131 = props.organise) === null || _131 === void 0 ? void 0 : _131.darkMode, darkModeBg: (_132 = props.organise) === null || _132 === void 0 ? void 0 : _132.darkModeBg, testId: "dt-activity-drawer",
|
|
14150
14227
|
// INFO: z-50 lifts it over a Modal the table may sit in (z-40)
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
resizable: true, title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((_133 = props.id) !== null && _133 !== void 0 ? _133 : "") : activityId) })), document.body),
|
|
14228
|
+
zIndex: "z-50", open: activityModal,
|
|
14229
|
+
// INFO: the record stays set while the drawer slides out — clearing it
|
|
14230
|
+
// would remount the hidden panel collection-wide and fetch again. The
|
|
14231
|
+
// toolbar's collection-wide button clears it when it opens.
|
|
14232
|
+
onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75",
|
|
14233
|
+
// INFO: dragged like the read drawer; the width sticks across
|
|
14234
|
+
// opens while the list stays mounted
|
|
14235
|
+
resizable: true, title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((_133 = props.id) !== null && _133 !== void 0 ? _133 : "") : activityId) })),
|
|
14160
14236
|
renderScrollSentinel()));
|
|
14161
14237
|
});
|
|
14162
14238
|
//# sourceMappingURL=index.js.map
|