strapi-plugin-bulk-updater 1.6.11 → 1.7.1
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/dist/_chunks/{BulkUpdater-CFStXO-q.mjs → BulkUpdater-BQnhVw0j.mjs} +75 -44
- package/dist/_chunks/BulkUpdater-BQnhVw0j.mjs.map +1 -0
- package/dist/_chunks/{BulkUpdater-BSlEEUTV.js → BulkUpdater-BrBWtCjS.js} +75 -44
- package/dist/_chunks/BulkUpdater-BrBWtCjS.js.map +1 -0
- package/dist/_chunks/{SettingsPage-BrfS4_qy.mjs → SettingsPage-DYD6M988.mjs} +2 -2
- package/dist/_chunks/{SettingsPage-BrfS4_qy.mjs.map → SettingsPage-DYD6M988.mjs.map} +1 -1
- package/dist/_chunks/{SettingsPage-BgEO2BNP.js → SettingsPage-DsKfbhNd.js} +2 -2
- package/dist/_chunks/{SettingsPage-BgEO2BNP.js.map → SettingsPage-DsKfbhNd.js.map} +1 -1
- package/dist/_chunks/{ValidationRulesTab-BslJyrBj.mjs → ValidationRulesTab-BzS4_gcN.mjs} +43 -3
- package/dist/_chunks/ValidationRulesTab-BzS4_gcN.mjs.map +1 -0
- package/dist/_chunks/{ValidationRulesTab-Cs0YDlMx.js → ValidationRulesTab-DZw6CujQ.js} +43 -3
- package/dist/_chunks/ValidationRulesTab-DZw6CujQ.js.map +1 -0
- package/dist/_chunks/{index-CjR6IZqM.js → index-BCOsNd1S.js} +16 -4
- package/dist/_chunks/index-BCOsNd1S.js.map +1 -0
- package/dist/_chunks/{index-4eNIGyGu.mjs → index-CjbxZZjb.mjs} +16 -4
- package/dist/_chunks/index-CjbxZZjb.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +475 -282
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +475 -282
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/_chunks/BulkUpdater-BSlEEUTV.js.map +0 -1
- package/dist/_chunks/BulkUpdater-CFStXO-q.mjs.map +0 -1
- package/dist/_chunks/ValidationRulesTab-BslJyrBj.mjs.map +0 -1
- package/dist/_chunks/ValidationRulesTab-Cs0YDlMx.js.map +0 -1
- package/dist/_chunks/index-4eNIGyGu.mjs.map +0 -1
- package/dist/_chunks/index-CjR6IZqM.js.map +0 -1
|
@@ -3,7 +3,7 @@ import React__default, { useRef, useState, useEffect, useCallback, useMemo } fro
|
|
|
3
3
|
import { useFetchClient, useNotification } from "@strapi/strapi/admin";
|
|
4
4
|
import { Box, Flex, Typography, Button, Combobox, ComboboxOption, Badge, SingleSelect, SingleSelectOption, TextInput, Checkbox, Alert, Table, Thead, Tr, Th, Tbody, Td, Loader, Textarea, Field } from "@strapi/design-system";
|
|
5
5
|
import { ArrowClockwise, Download, Search, Cog, Upload, ChevronLeft, ChevronRight, Eye, Check, Play } from "@strapi/icons";
|
|
6
|
-
import { u as useBulkUpdaterRBAC, i as isAbortError, V as ValidationRulesTab } from "./ValidationRulesTab-
|
|
6
|
+
import { u as useBulkUpdaterRBAC, i as isAbortError, V as ValidationRulesTab } from "./ValidationRulesTab-BzS4_gcN.mjs";
|
|
7
7
|
function parseCsvRows(csvText) {
|
|
8
8
|
if (!csvText) return [];
|
|
9
9
|
let text = csvText;
|
|
@@ -1467,6 +1467,9 @@ function CsvManagerTab() {
|
|
|
1467
1467
|
const { get, post } = useFetchClient();
|
|
1468
1468
|
const { toggleNotification } = useNotification();
|
|
1469
1469
|
const permissions = useBulkUpdaterRBAC();
|
|
1470
|
+
const canAnyCsvImportExecution = permissions.canCsvSubmitForChecker || permissions.canCsvForceRunNow || permissions.canCsvQueueForOffPeak;
|
|
1471
|
+
const canAnyCsvImportSection = permissions.canCsvImport || canAnyCsvImportExecution || permissions.canCsvPreFlightDryRun;
|
|
1472
|
+
const canAnyCsvAccess = permissions.canCsvExport || canAnyCsvImportSection;
|
|
1470
1473
|
const fileInputRef = useRef(null);
|
|
1471
1474
|
const countAbortControllerRef = useRef(null);
|
|
1472
1475
|
const [collections, setCollections] = useState([]);
|
|
@@ -1572,10 +1575,10 @@ function CsvManagerTab() {
|
|
|
1572
1575
|
const [unreviewedConsent, setUnreviewedConsent] = useState(true);
|
|
1573
1576
|
useEffect(() => {
|
|
1574
1577
|
if (permissions.isLoading) return;
|
|
1575
|
-
if (
|
|
1578
|
+
if (canAnyCsvAccess) {
|
|
1576
1579
|
fetchInitialData();
|
|
1577
1580
|
}
|
|
1578
|
-
}, [permissions.isLoading,
|
|
1581
|
+
}, [permissions.isLoading, canAnyCsvAccess]);
|
|
1579
1582
|
const fetchInitialData = async () => {
|
|
1580
1583
|
try {
|
|
1581
1584
|
setLoadingCollections(true);
|
|
@@ -1931,7 +1934,7 @@ function CsvManagerTab() {
|
|
|
1931
1934
|
downloadCsvFile(csvContent, errFilename);
|
|
1932
1935
|
};
|
|
1933
1936
|
const handleExecuteImport = async () => {
|
|
1934
|
-
if (!selectedUid || allParsedRecords.length === 0) return;
|
|
1937
|
+
if (!permissions.canCsvForceRunNow || !selectedUid || allParsedRecords.length === 0) return;
|
|
1935
1938
|
const runUid = selectedUid;
|
|
1936
1939
|
const runHeaders = originalHeaders;
|
|
1937
1940
|
const originalRecordsSnapshot = allParsedRecords;
|
|
@@ -2146,7 +2149,7 @@ function CsvManagerTab() {
|
|
|
2146
2149
|
}
|
|
2147
2150
|
};
|
|
2148
2151
|
const handleRunPreflight = async () => {
|
|
2149
|
-
if (!selectedUid || allParsedRecords.length === 0) return;
|
|
2152
|
+
if (!permissions.canCsvPreFlightDryRun || !selectedUid || allParsedRecords.length === 0) return;
|
|
2150
2153
|
try {
|
|
2151
2154
|
setPreflightLoading(true);
|
|
2152
2155
|
let currentEntries = collectionEntries;
|
|
@@ -2190,6 +2193,9 @@ function CsvManagerTab() {
|
|
|
2190
2193
|
};
|
|
2191
2194
|
const submitBatchWithMode = async (executionMode, forceImmediate = false) => {
|
|
2192
2195
|
if (!selectedUid || allParsedRecords.length === 0) return;
|
|
2196
|
+
if (executionMode === "maker_checker" && !permissions.canCsvSubmitForChecker) return;
|
|
2197
|
+
if (executionMode === "queue_offpeak" && !permissions.canCsvQueueForOffPeak) return;
|
|
2198
|
+
if (executionMode === "immediate" && !permissions.canCsvForceRunNow) return;
|
|
2193
2199
|
if (executionMode === "immediate") {
|
|
2194
2200
|
setShowConfirmModal(false);
|
|
2195
2201
|
await handleExecuteImport();
|
|
@@ -2277,7 +2283,7 @@ function CsvManagerTab() {
|
|
|
2277
2283
|
variant: "tertiary",
|
|
2278
2284
|
startIcon: /* @__PURE__ */ jsx(Download, {}),
|
|
2279
2285
|
onClick: handleDownloadTemplate,
|
|
2280
|
-
disabled: !selectedUid || downloadingTemplate || !
|
|
2286
|
+
disabled: !selectedUid || downloadingTemplate || !canAnyCsvAccess,
|
|
2281
2287
|
loading: downloadingTemplate,
|
|
2282
2288
|
children: "Download Sample CSV Template"
|
|
2283
2289
|
}
|
|
@@ -2694,7 +2700,7 @@ function CsvManagerTab() {
|
|
|
2694
2700
|
selectedCol && /* @__PURE__ */ jsx(Box, { marginTop: 3, children: /* @__PURE__ */ jsx(Box, { padding: 3, background: selectedDataAttrs.length > 0 ? "primary100" : "neutral100", hasRadius: true, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: selectedDataAttrs.length > 0 ? "primary700" : "neutral700", children: selectedDataAttrs.length > 0 ? `Selective Export: Exports Document ID, Slug, and only the selected columns (${selectedDataAttrs.length} selected). Unselected fields and sibling nested properties remain completely protected during CSV import.` : "Full Collection Export: No specific columns selected. All fields will be exported with complete deep nesting preserved in JSON format." }) }) }),
|
|
2695
2701
|
false
|
|
2696
2702
|
] }),
|
|
2697
|
-
|
|
2703
|
+
canAnyCsvImportSection && /* @__PURE__ */ jsxs(Box, { padding: 5, background: "neutral100", hasRadius: true, children: [
|
|
2698
2704
|
/* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "h3", fontWeight: "bold", marginBottom: 2, children: "2. Import & Batch Override CSV" }),
|
|
2699
2705
|
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", marginBottom: 4, children: "Upload an updated CSV file (supports 10,000+ records via chunked streaming) to bulk update existing records or insert new records." }),
|
|
2700
2706
|
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, wrap: "wrap", gap: 4, children: [
|
|
@@ -2984,7 +2990,7 @@ function CsvManagerTab() {
|
|
|
2984
2990
|
] })
|
|
2985
2991
|
] }),
|
|
2986
2992
|
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", marginTop: 4, wrap: "wrap", gap: 3, children: [
|
|
2987
|
-
/* @__PURE__ */ jsx(
|
|
2993
|
+
permissions.canCsvPreFlightDryRun ? /* @__PURE__ */ jsx(
|
|
2988
2994
|
Button,
|
|
2989
2995
|
{
|
|
2990
2996
|
variant: "secondary",
|
|
@@ -2995,8 +3001,8 @@ function CsvManagerTab() {
|
|
|
2995
3001
|
disabled: importing,
|
|
2996
3002
|
children: "Run Pre-Flight Dry Run"
|
|
2997
3003
|
}
|
|
2998
|
-
),
|
|
2999
|
-
/* @__PURE__ */ jsxs(
|
|
3004
|
+
) : /* @__PURE__ */ jsx(Box, {}),
|
|
3005
|
+
(canAnyCsvImportExecution || permissions.canCsvImport) && /* @__PURE__ */ jsxs(
|
|
3000
3006
|
Button,
|
|
3001
3007
|
{
|
|
3002
3008
|
variant: "default",
|
|
@@ -3468,8 +3474,8 @@ function CsvManagerTab() {
|
|
|
3468
3474
|
},
|
|
3469
3475
|
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", gap: 3, style: { width: "100%" }, children: [
|
|
3470
3476
|
/* @__PURE__ */ jsx(Button, { variant: "tertiary", size: "M", onClick: () => setShowConfirmModal(false), children: "Cancel" }),
|
|
3471
|
-
/* @__PURE__ */
|
|
3472
|
-
/* @__PURE__ */ jsx(
|
|
3477
|
+
/* @__PURE__ */ jsx(Flex, { gap: 2, wrap: "wrap", justifyContent: "flex-end", alignItems: "center", children: !canAnyCsvImportExecution ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "danger700", fontWeight: "bold", children: "You do not have permission to Submit for Checker, Queue for Off-Peak, or Force Run CSV imports." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3478
|
+
permissions.canCsvSubmitForChecker && /* @__PURE__ */ jsx(
|
|
3473
3479
|
Button,
|
|
3474
3480
|
{
|
|
3475
3481
|
variant: executionWindow?.isBusinessHours ? "default" : "secondary",
|
|
@@ -3481,7 +3487,7 @@ function CsvManagerTab() {
|
|
|
3481
3487
|
}
|
|
3482
3488
|
),
|
|
3483
3489
|
executionWindow?.isBusinessHours ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3484
|
-
/* @__PURE__ */ jsxs(
|
|
3490
|
+
permissions.canCsvQueueForOffPeak && /* @__PURE__ */ jsxs(
|
|
3485
3491
|
Button,
|
|
3486
3492
|
{
|
|
3487
3493
|
variant: "secondary",
|
|
@@ -3496,7 +3502,7 @@ function CsvManagerTab() {
|
|
|
3496
3502
|
]
|
|
3497
3503
|
}
|
|
3498
3504
|
),
|
|
3499
|
-
/* @__PURE__ */ jsx(
|
|
3505
|
+
permissions.canCsvForceRunNow && /* @__PURE__ */ jsx(
|
|
3500
3506
|
Button,
|
|
3501
3507
|
{
|
|
3502
3508
|
variant: "danger-light",
|
|
@@ -3507,7 +3513,7 @@ function CsvManagerTab() {
|
|
|
3507
3513
|
children: "Force Run Now"
|
|
3508
3514
|
}
|
|
3509
3515
|
)
|
|
3510
|
-
] }) : /* @__PURE__ */ jsx(
|
|
3516
|
+
] }) : permissions.canCsvForceRunNow && /* @__PURE__ */ jsx(
|
|
3511
3517
|
Button,
|
|
3512
3518
|
{
|
|
3513
3519
|
variant: "default",
|
|
@@ -3518,7 +3524,7 @@ function CsvManagerTab() {
|
|
|
3518
3524
|
children: "Confirm & Execute Now"
|
|
3519
3525
|
}
|
|
3520
3526
|
)
|
|
3521
|
-
] })
|
|
3527
|
+
] }) })
|
|
3522
3528
|
] })
|
|
3523
3529
|
}
|
|
3524
3530
|
);
|
|
@@ -4156,6 +4162,7 @@ const BulkUpdatePreviewModal = ({
|
|
|
4156
4162
|
isOpen,
|
|
4157
4163
|
onClose,
|
|
4158
4164
|
onProceed,
|
|
4165
|
+
canProceed,
|
|
4159
4166
|
loading,
|
|
4160
4167
|
previewData,
|
|
4161
4168
|
attribute,
|
|
@@ -4166,6 +4173,8 @@ const BulkUpdatePreviewModal = ({
|
|
|
4166
4173
|
}) => {
|
|
4167
4174
|
const [filterTab, setFilterTab] = useState("all");
|
|
4168
4175
|
const [searchQuery, setSearchQuery] = useState("");
|
|
4176
|
+
const { canWorkspaceProceedToExecute } = useBulkUpdaterRBAC();
|
|
4177
|
+
const allowProceed = canProceed !== void 0 ? canProceed : canWorkspaceProceedToExecute;
|
|
4169
4178
|
const filteredDiffs = useMemo(() => {
|
|
4170
4179
|
if (!previewData || !previewData.diffs) return [];
|
|
4171
4180
|
let items = previewData.diffs;
|
|
@@ -4512,7 +4521,7 @@ const BulkUpdatePreviewModal = ({
|
|
|
4512
4521
|
},
|
|
4513
4522
|
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", children: [
|
|
4514
4523
|
/* @__PURE__ */ jsx(Button, { variant: "tertiary", size: "M", onClick: onClose, children: "Close Preview" }),
|
|
4515
|
-
/* @__PURE__ */ jsxs(
|
|
4524
|
+
allowProceed && /* @__PURE__ */ jsxs(
|
|
4516
4525
|
Button,
|
|
4517
4526
|
{
|
|
4518
4527
|
variant: "default",
|
|
@@ -6526,6 +6535,8 @@ const BulkUpdater = () => {
|
|
|
6526
6535
|
const { get, post } = useFetchClient();
|
|
6527
6536
|
const { toggleNotification } = useNotification();
|
|
6528
6537
|
const permissions = useBulkUpdaterRBAC();
|
|
6538
|
+
const canAnyUpdateExecution = permissions.canWorkspaceSubmitForChecker || permissions.canWorkspaceForceRunNow || permissions.canWorkspaceQueueForOffPeak;
|
|
6539
|
+
const canAnyCsvAccess = permissions.canCsvExport || permissions.canCsvImport || permissions.canCsvSubmitForChecker || permissions.canCsvForceRunNow || permissions.canCsvQueueForOffPeak || permissions.canCsvPreFlightDryRun;
|
|
6529
6540
|
const getInitialTab = () => {
|
|
6530
6541
|
try {
|
|
6531
6542
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -6535,7 +6546,7 @@ const BulkUpdater = () => {
|
|
|
6535
6546
|
}
|
|
6536
6547
|
if (!permissions.isLoading) {
|
|
6537
6548
|
if (permissions.canWorkspaceView) return "editor";
|
|
6538
|
-
if (
|
|
6549
|
+
if (canAnyCsvAccess) return "csv";
|
|
6539
6550
|
if (permissions.canAuditView || permissions.canApprovalView) return "audit";
|
|
6540
6551
|
if (permissions.canValidationView) return "rules";
|
|
6541
6552
|
}
|
|
@@ -6557,12 +6568,12 @@ const BulkUpdater = () => {
|
|
|
6557
6568
|
if (tab === "editor") return permissions.canWorkspaceView;
|
|
6558
6569
|
if (tab === "audit") return permissions.canAuditView || permissions.canApprovalView;
|
|
6559
6570
|
if (tab === "rules") return permissions.canValidationView;
|
|
6560
|
-
if (tab === "csv") return
|
|
6571
|
+
if (tab === "csv") return canAnyCsvAccess;
|
|
6561
6572
|
return false;
|
|
6562
6573
|
};
|
|
6563
6574
|
if (!isTabAllowed(activeTab)) {
|
|
6564
6575
|
if (permissions.canWorkspaceView) setActiveTab("editor");
|
|
6565
|
-
else if (
|
|
6576
|
+
else if (canAnyCsvAccess) setActiveTab("csv");
|
|
6566
6577
|
else if (permissions.canAuditView || permissions.canApprovalView) setActiveTab("audit");
|
|
6567
6578
|
else if (permissions.canValidationView) setActiveTab("rules");
|
|
6568
6579
|
}
|
|
@@ -6574,6 +6585,7 @@ const BulkUpdater = () => {
|
|
|
6574
6585
|
const [auditEnabled, setAuditEnabled] = useState(false);
|
|
6575
6586
|
const [executionWindow, setExecutionWindow] = useState(null);
|
|
6576
6587
|
const [showConfirmModal, setShowConfirmModal] = useState(false);
|
|
6588
|
+
const [confirmModalSource, setConfirmModalSource] = useState("direct");
|
|
6577
6589
|
const [pendingBatches, setPendingBatches] = useState([]);
|
|
6578
6590
|
const [pendingBatchesLoading, setPendingBatchesLoading] = useState(false);
|
|
6579
6591
|
const [approvingBatchId, setApprovingBatchId] = useState(null);
|
|
@@ -7011,7 +7023,7 @@ const BulkUpdater = () => {
|
|
|
7011
7023
|
};
|
|
7012
7024
|
useEffect(() => {
|
|
7013
7025
|
if (permissions.isLoading) return;
|
|
7014
|
-
if (permissions.canWorkspaceView ||
|
|
7026
|
+
if (permissions.canWorkspaceView || canAnyCsvAccess || permissions.canValidationView) {
|
|
7015
7027
|
fetchModels();
|
|
7016
7028
|
}
|
|
7017
7029
|
if (permissions.canAuditView) {
|
|
@@ -7026,8 +7038,7 @@ const BulkUpdater = () => {
|
|
|
7026
7038
|
}, [
|
|
7027
7039
|
permissions.isLoading,
|
|
7028
7040
|
permissions.canWorkspaceView,
|
|
7029
|
-
|
|
7030
|
-
permissions.canCsvImport,
|
|
7041
|
+
canAnyCsvAccess,
|
|
7031
7042
|
permissions.canValidationView,
|
|
7032
7043
|
permissions.canAuditView,
|
|
7033
7044
|
permissions.canApprovalView
|
|
@@ -7326,13 +7337,13 @@ const BulkUpdater = () => {
|
|
|
7326
7337
|
}, [availableColAttributes, componentDepth, attributesMeta, selectedCol]);
|
|
7327
7338
|
const memoizedComboboxOptions = useMemo(() => {
|
|
7328
7339
|
if (depthFilteredAttributes.length === 0) {
|
|
7329
|
-
return /* @__PURE__ */ jsx(ComboboxOption, { value: "__none__", disabled: true, textValue: "No attributes available", children: /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral600", children: [
|
|
7340
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ComboboxOption, { value: "__none__", disabled: true, textValue: "No attributes available", children: /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral600", children: [
|
|
7330
7341
|
"No attributes available for this collection type (Depth L",
|
|
7331
7342
|
componentDepth,
|
|
7332
7343
|
")"
|
|
7333
|
-
] }) });
|
|
7344
|
+
] }) }) });
|
|
7334
7345
|
}
|
|
7335
|
-
return depthFilteredAttributes.map((attr) => {
|
|
7346
|
+
return /* @__PURE__ */ jsx(Fragment, { children: depthFilteredAttributes.map((attr) => {
|
|
7336
7347
|
const rel = getEffectiveRelMeta(attr);
|
|
7337
7348
|
const depth = getAttrDepth(attr);
|
|
7338
7349
|
const friendlyLabel = formatAttributeHeaderLabel(attr);
|
|
@@ -7352,7 +7363,7 @@ const BulkUpdater = () => {
|
|
|
7352
7363
|
" component"
|
|
7353
7364
|
] }) : null
|
|
7354
7365
|
] }) }, attr);
|
|
7355
|
-
});
|
|
7366
|
+
}) });
|
|
7356
7367
|
}, [depthFilteredAttributes, getEffectiveRelMeta, selectedAttribute, componentDepth, attributesMeta]);
|
|
7357
7368
|
const memoizedSearchComboboxOptions = useMemo(() => {
|
|
7358
7369
|
return /* @__PURE__ */ jsx(Fragment, { children: depthFilteredAttributes.map((attr) => {
|
|
@@ -7671,7 +7682,7 @@ const BulkUpdater = () => {
|
|
|
7671
7682
|
() => gridEditMode ? computeLifecycleStatsForKeys(gridTargetKeys) : selectedLifecycleStats,
|
|
7672
7683
|
[gridEditMode, gridTargetKeys, computeLifecycleStatsForKeys, selectedLifecycleStats]
|
|
7673
7684
|
);
|
|
7674
|
-
const handleOpenConfirmModal = () => {
|
|
7685
|
+
const handleOpenConfirmModal = (source = "direct") => {
|
|
7675
7686
|
if (!selectedAttribute) {
|
|
7676
7687
|
toggleNotification({
|
|
7677
7688
|
type: "warning",
|
|
@@ -7706,6 +7717,7 @@ const BulkUpdater = () => {
|
|
|
7706
7717
|
}
|
|
7707
7718
|
setPublishStrategy("safe");
|
|
7708
7719
|
setUnreviewedConsent(false);
|
|
7720
|
+
setConfirmModalSource(source === "preview" ? "preview" : "direct");
|
|
7709
7721
|
setShowConfirmModal(true);
|
|
7710
7722
|
};
|
|
7711
7723
|
const handleOpenPreviewModal = async () => {
|
|
@@ -7821,8 +7833,10 @@ const BulkUpdater = () => {
|
|
|
7821
7833
|
}
|
|
7822
7834
|
const displaySummaryVal = gridEditMode ? `Grid Editing (${gridSerialized.totalEditCount} edits across ${targets.length} records)` : attributeValue;
|
|
7823
7835
|
try {
|
|
7836
|
+
const isFromPreview = confirmModalSource === "preview";
|
|
7824
7837
|
setUpdating(true);
|
|
7825
7838
|
setShowConfirmModal(false);
|
|
7839
|
+
setConfirmModalSource("direct");
|
|
7826
7840
|
setShowProcessingDashboard(true);
|
|
7827
7841
|
setIsSubmittingBatch(true);
|
|
7828
7842
|
setLastResults(null);
|
|
@@ -7860,7 +7874,8 @@ const BulkUpdater = () => {
|
|
|
7860
7874
|
publishOnApproval,
|
|
7861
7875
|
publishStrategy,
|
|
7862
7876
|
unreviewedConsent,
|
|
7863
|
-
unreviewedCount: selectedLifecycleStats.unreviewedCount
|
|
7877
|
+
unreviewedCount: selectedLifecycleStats.unreviewedCount,
|
|
7878
|
+
...isFromPreview ? { initiatedFromPreview: true } : {}
|
|
7864
7879
|
};
|
|
7865
7880
|
const res = await post("/bulk-updater/batch-update", payload);
|
|
7866
7881
|
setIsSubmittingBatch(false);
|
|
@@ -8500,7 +8515,7 @@ const BulkUpdater = () => {
|
|
|
8500
8515
|
children: "Validation & Quota Rules"
|
|
8501
8516
|
}
|
|
8502
8517
|
),
|
|
8503
|
-
|
|
8518
|
+
canAnyCsvAccess && /* @__PURE__ */ jsx(
|
|
8504
8519
|
Button,
|
|
8505
8520
|
{
|
|
8506
8521
|
variant: activeTab === "csv" ? "default" : "tertiary",
|
|
@@ -8519,7 +8534,7 @@ const BulkUpdater = () => {
|
|
|
8519
8534
|
}
|
|
8520
8535
|
) })
|
|
8521
8536
|
] }),
|
|
8522
|
-
!permissions.canWorkspaceView && !permissions.canAuditView && !permissions.canApprovalView && !permissions.canValidationView && !
|
|
8537
|
+
!permissions.canWorkspaceView && !permissions.canAuditView && !permissions.canApprovalView && !permissions.canValidationView && !canAnyCsvAccess && /* @__PURE__ */ jsx(Box, { padding: 8, background: "neutral0", shadow: "filterShadow", hasRadius: true, marginTop: 4, children: /* @__PURE__ */ jsx(Alert, { variant: "warning", title: "Access Denied", children: "You do not have permission to view any modules in Bulk Attribute Updater. Please contact your administrator to grant the required permissions in Settings → Roles." }) }),
|
|
8523
8538
|
activeTab === "editor" && permissions.canAuditRollback && latestActiveBatch && !updateSummary && /* @__PURE__ */ jsx(
|
|
8524
8539
|
Box,
|
|
8525
8540
|
{
|
|
@@ -9751,10 +9766,10 @@ const BulkUpdater = () => {
|
|
|
9751
9766
|
startIcon: /* @__PURE__ */ jsx(Play, {}),
|
|
9752
9767
|
variant: "default",
|
|
9753
9768
|
size: "L",
|
|
9754
|
-
onClick: handleOpenConfirmModal,
|
|
9769
|
+
onClick: () => handleOpenConfirmModal("direct"),
|
|
9755
9770
|
loading: updating,
|
|
9756
|
-
disabled: !permissions.canWorkspaceExecute || (loading || !selectedAttribute || !selectedAttribute.trim() || (gridEditMode ? gridSerialized.targets.length === 0 || gridSerialized.hasValidationErrors : totalSelectedCount === 0)),
|
|
9757
|
-
title: !permissions.canWorkspaceExecute ? "You do not have permission to execute bulk updates (action: plugin::bulk-updater.workspace.execute)." : void 0,
|
|
9771
|
+
disabled: !(permissions.canWorkspaceExecute || canAnyUpdateExecution) || (loading || !selectedAttribute || !selectedAttribute.trim() || (gridEditMode ? gridSerialized.targets.length === 0 || gridSerialized.hasValidationErrors : totalSelectedCount === 0)),
|
|
9772
|
+
title: !(permissions.canWorkspaceExecute || canAnyUpdateExecution) ? "You do not have permission to execute bulk updates (action: plugin::bulk-updater.workspace.execute)." : void 0,
|
|
9758
9773
|
children: [
|
|
9759
9774
|
"Update Selected (",
|
|
9760
9775
|
gridEditMode ? gridSerialized.targets.length : totalSelectedCount,
|
|
@@ -10330,7 +10345,10 @@ const BulkUpdater = () => {
|
|
|
10330
10345
|
boxSizing: "border-box",
|
|
10331
10346
|
overflowY: "auto"
|
|
10332
10347
|
},
|
|
10333
|
-
onClick: () =>
|
|
10348
|
+
onClick: () => {
|
|
10349
|
+
setShowConfirmModal(false);
|
|
10350
|
+
setConfirmModalSource("direct");
|
|
10351
|
+
},
|
|
10334
10352
|
children: /* @__PURE__ */ jsxs(
|
|
10335
10353
|
Box,
|
|
10336
10354
|
{
|
|
@@ -10674,9 +10692,20 @@ const BulkUpdater = () => {
|
|
|
10674
10692
|
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, style: { width: "100%" }, children: [
|
|
10675
10693
|
publishOnApproval && updateModalLifecycleStats.unreviewedCount > 0 && publishStrategy === "all" && !unreviewedConsent && /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "danger700", fontWeight: "bold", children: "⚠️ Explicit consent is required before publishing records with unreviewed draft revisions." }),
|
|
10676
10694
|
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", gap: 3, style: { width: "100%" }, children: [
|
|
10677
|
-
/* @__PURE__ */ jsx(
|
|
10678
|
-
|
|
10679
|
-
|
|
10695
|
+
/* @__PURE__ */ jsx(
|
|
10696
|
+
Button,
|
|
10697
|
+
{
|
|
10698
|
+
variant: "tertiary",
|
|
10699
|
+
size: "M",
|
|
10700
|
+
onClick: () => {
|
|
10701
|
+
setShowConfirmModal(false);
|
|
10702
|
+
setConfirmModalSource("direct");
|
|
10703
|
+
},
|
|
10704
|
+
children: "Cancel"
|
|
10705
|
+
}
|
|
10706
|
+
),
|
|
10707
|
+
/* @__PURE__ */ jsx(Flex, { gap: 2, wrap: "wrap", justifyContent: "flex-end", alignItems: "center", children: !canAnyUpdateExecution ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "danger700", fontWeight: "bold", children: "You do not have permission to Submit for Checker, Queue for Off-Peak, or Force Run bulk updates." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10708
|
+
permissions.canWorkspaceSubmitForChecker && /* @__PURE__ */ jsx(
|
|
10680
10709
|
Button,
|
|
10681
10710
|
{
|
|
10682
10711
|
variant: executionWindow?.isBusinessHours ? "default" : "secondary",
|
|
@@ -10688,7 +10717,7 @@ const BulkUpdater = () => {
|
|
|
10688
10717
|
}
|
|
10689
10718
|
),
|
|
10690
10719
|
executionWindow?.isBusinessHours ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10691
|
-
/* @__PURE__ */ jsxs(
|
|
10720
|
+
permissions.canWorkspaceQueueForOffPeak && /* @__PURE__ */ jsxs(
|
|
10692
10721
|
Button,
|
|
10693
10722
|
{
|
|
10694
10723
|
variant: "secondary",
|
|
@@ -10703,7 +10732,7 @@ const BulkUpdater = () => {
|
|
|
10703
10732
|
]
|
|
10704
10733
|
}
|
|
10705
10734
|
),
|
|
10706
|
-
/* @__PURE__ */ jsx(
|
|
10735
|
+
permissions.canWorkspaceForceRunNow && /* @__PURE__ */ jsx(
|
|
10707
10736
|
Button,
|
|
10708
10737
|
{
|
|
10709
10738
|
variant: "danger-light",
|
|
@@ -10714,7 +10743,7 @@ const BulkUpdater = () => {
|
|
|
10714
10743
|
children: "Force Run Now"
|
|
10715
10744
|
}
|
|
10716
10745
|
)
|
|
10717
|
-
] }) : /* @__PURE__ */ jsx(
|
|
10746
|
+
] }) : permissions.canWorkspaceForceRunNow && /* @__PURE__ */ jsx(
|
|
10718
10747
|
Button,
|
|
10719
10748
|
{
|
|
10720
10749
|
variant: "default",
|
|
@@ -10725,7 +10754,7 @@ const BulkUpdater = () => {
|
|
|
10725
10754
|
children: "Confirm & Execute Now"
|
|
10726
10755
|
}
|
|
10727
10756
|
)
|
|
10728
|
-
] })
|
|
10757
|
+
] }) })
|
|
10729
10758
|
] })
|
|
10730
10759
|
] })
|
|
10731
10760
|
}
|
|
@@ -11003,9 +11032,11 @@ const BulkUpdater = () => {
|
|
|
11003
11032
|
{
|
|
11004
11033
|
isOpen: showPreviewModal,
|
|
11005
11034
|
onClose: () => setShowPreviewModal(false),
|
|
11035
|
+
canProceed: permissions.canWorkspaceProceedToExecute,
|
|
11006
11036
|
onProceed: () => {
|
|
11037
|
+
if (!permissions.canWorkspaceProceedToExecute) return;
|
|
11007
11038
|
setShowPreviewModal(false);
|
|
11008
|
-
handleOpenConfirmModal();
|
|
11039
|
+
handleOpenConfirmModal("preview");
|
|
11009
11040
|
},
|
|
11010
11041
|
loading: previewLoading,
|
|
11011
11042
|
previewData,
|
|
@@ -11061,4 +11092,4 @@ export {
|
|
|
11061
11092
|
resolveEffectiveRelationMeta,
|
|
11062
11093
|
resolveEntityLabel
|
|
11063
11094
|
};
|
|
11064
|
-
//# sourceMappingURL=BulkUpdater-
|
|
11095
|
+
//# sourceMappingURL=BulkUpdater-BQnhVw0j.mjs.map
|