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