strapi-plugin-bulk-updater 1.7.0 → 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-CV49TvOV.mjs → BulkUpdater-BQnhVw0j.mjs} +31 -25
- package/dist/_chunks/BulkUpdater-BQnhVw0j.mjs.map +1 -0
- package/dist/_chunks/{BulkUpdater-Cnzgw4UH.js → BulkUpdater-BrBWtCjS.js} +31 -25
- package/dist/_chunks/BulkUpdater-BrBWtCjS.js.map +1 -0
- package/dist/_chunks/{SettingsPage-DXRWLRp_.mjs → SettingsPage-DYD6M988.mjs} +2 -2
- package/dist/_chunks/{SettingsPage-DXRWLRp_.mjs.map → SettingsPage-DYD6M988.mjs.map} +1 -1
- package/dist/_chunks/{SettingsPage-w_Lz-N0V.js → SettingsPage-DsKfbhNd.js} +2 -2
- package/dist/_chunks/{SettingsPage-w_Lz-N0V.js.map → SettingsPage-DsKfbhNd.js.map} +1 -1
- package/dist/_chunks/{ValidationRulesTab-eN_vH3TB.mjs → ValidationRulesTab-BzS4_gcN.mjs} +23 -3
- package/dist/_chunks/ValidationRulesTab-BzS4_gcN.mjs.map +1 -0
- package/dist/_chunks/{ValidationRulesTab-of8bIzre.js → ValidationRulesTab-DZw6CujQ.js} +23 -3
- package/dist/_chunks/ValidationRulesTab-DZw6CujQ.js.map +1 -0
- package/dist/_chunks/{index-C2HoRm23.js → index-BCOsNd1S.js} +12 -4
- package/dist/_chunks/index-BCOsNd1S.js.map +1 -0
- package/dist/_chunks/{index-2DodYa70.mjs → index-CjbxZZjb.mjs} +12 -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 +332 -227
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +332 -227
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/_chunks/BulkUpdater-CV49TvOV.mjs.map +0 -1
- package/dist/_chunks/BulkUpdater-Cnzgw4UH.js.map +0 -1
- package/dist/_chunks/ValidationRulesTab-eN_vH3TB.mjs.map +0 -1
- package/dist/_chunks/ValidationRulesTab-of8bIzre.js.map +0 -1
- package/dist/_chunks/index-2DodYa70.mjs.map +0 -1
- package/dist/_chunks/index-C2HoRm23.js.map +0 -1
|
@@ -5,7 +5,7 @@ const React = require("react");
|
|
|
5
5
|
const admin = require("@strapi/strapi/admin");
|
|
6
6
|
const designSystem = require("@strapi/design-system");
|
|
7
7
|
const icons = require("@strapi/icons");
|
|
8
|
-
const ValidationRulesTab = require("./ValidationRulesTab-
|
|
8
|
+
const ValidationRulesTab = require("./ValidationRulesTab-DZw6CujQ.js");
|
|
9
9
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
10
10
|
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
11
11
|
function parseCsvRows(csvText) {
|
|
@@ -1471,6 +1471,9 @@ function CsvManagerTab() {
|
|
|
1471
1471
|
const { get, post } = admin.useFetchClient();
|
|
1472
1472
|
const { toggleNotification } = admin.useNotification();
|
|
1473
1473
|
const permissions = ValidationRulesTab.useBulkUpdaterRBAC();
|
|
1474
|
+
const canAnyCsvImportExecution = permissions.canCsvSubmitForChecker || permissions.canCsvForceRunNow || permissions.canCsvQueueForOffPeak;
|
|
1475
|
+
const canAnyCsvImportSection = permissions.canCsvImport || canAnyCsvImportExecution || permissions.canCsvPreFlightDryRun;
|
|
1476
|
+
const canAnyCsvAccess = permissions.canCsvExport || canAnyCsvImportSection;
|
|
1474
1477
|
const fileInputRef = React.useRef(null);
|
|
1475
1478
|
const countAbortControllerRef = React.useRef(null);
|
|
1476
1479
|
const [collections, setCollections] = React.useState([]);
|
|
@@ -1576,10 +1579,10 @@ function CsvManagerTab() {
|
|
|
1576
1579
|
const [unreviewedConsent, setUnreviewedConsent] = React.useState(true);
|
|
1577
1580
|
React.useEffect(() => {
|
|
1578
1581
|
if (permissions.isLoading) return;
|
|
1579
|
-
if (
|
|
1582
|
+
if (canAnyCsvAccess) {
|
|
1580
1583
|
fetchInitialData();
|
|
1581
1584
|
}
|
|
1582
|
-
}, [permissions.isLoading,
|
|
1585
|
+
}, [permissions.isLoading, canAnyCsvAccess]);
|
|
1583
1586
|
const fetchInitialData = async () => {
|
|
1584
1587
|
try {
|
|
1585
1588
|
setLoadingCollections(true);
|
|
@@ -1935,7 +1938,7 @@ function CsvManagerTab() {
|
|
|
1935
1938
|
downloadCsvFile(csvContent, errFilename);
|
|
1936
1939
|
};
|
|
1937
1940
|
const handleExecuteImport = async () => {
|
|
1938
|
-
if (!selectedUid || allParsedRecords.length === 0) return;
|
|
1941
|
+
if (!permissions.canCsvForceRunNow || !selectedUid || allParsedRecords.length === 0) return;
|
|
1939
1942
|
const runUid = selectedUid;
|
|
1940
1943
|
const runHeaders = originalHeaders;
|
|
1941
1944
|
const originalRecordsSnapshot = allParsedRecords;
|
|
@@ -2150,7 +2153,7 @@ function CsvManagerTab() {
|
|
|
2150
2153
|
}
|
|
2151
2154
|
};
|
|
2152
2155
|
const handleRunPreflight = async () => {
|
|
2153
|
-
if (!selectedUid || allParsedRecords.length === 0) return;
|
|
2156
|
+
if (!permissions.canCsvPreFlightDryRun || !selectedUid || allParsedRecords.length === 0) return;
|
|
2154
2157
|
try {
|
|
2155
2158
|
setPreflightLoading(true);
|
|
2156
2159
|
let currentEntries = collectionEntries;
|
|
@@ -2194,6 +2197,9 @@ function CsvManagerTab() {
|
|
|
2194
2197
|
};
|
|
2195
2198
|
const submitBatchWithMode = async (executionMode, forceImmediate = false) => {
|
|
2196
2199
|
if (!selectedUid || allParsedRecords.length === 0) return;
|
|
2200
|
+
if (executionMode === "maker_checker" && !permissions.canCsvSubmitForChecker) return;
|
|
2201
|
+
if (executionMode === "queue_offpeak" && !permissions.canCsvQueueForOffPeak) return;
|
|
2202
|
+
if (executionMode === "immediate" && !permissions.canCsvForceRunNow) return;
|
|
2197
2203
|
if (executionMode === "immediate") {
|
|
2198
2204
|
setShowConfirmModal(false);
|
|
2199
2205
|
await handleExecuteImport();
|
|
@@ -2281,7 +2287,7 @@ function CsvManagerTab() {
|
|
|
2281
2287
|
variant: "tertiary",
|
|
2282
2288
|
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Download, {}),
|
|
2283
2289
|
onClick: handleDownloadTemplate,
|
|
2284
|
-
disabled: !selectedUid || downloadingTemplate || !
|
|
2290
|
+
disabled: !selectedUid || downloadingTemplate || !canAnyCsvAccess,
|
|
2285
2291
|
loading: downloadingTemplate,
|
|
2286
2292
|
children: "Download Sample CSV Template"
|
|
2287
2293
|
}
|
|
@@ -2698,7 +2704,7 @@ function CsvManagerTab() {
|
|
|
2698
2704
|
selectedCol && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 3, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 3, background: selectedDataAttrs.length > 0 ? "primary100" : "neutral100", hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.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." }) }) }),
|
|
2699
2705
|
false
|
|
2700
2706
|
] }),
|
|
2701
|
-
|
|
2707
|
+
canAnyCsvImportSection && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 5, background: "neutral100", hasRadius: true, children: [
|
|
2702
2708
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", tag: "h3", fontWeight: "bold", marginBottom: 2, children: "2. Import & Batch Override CSV" }),
|
|
2703
2709
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.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." }),
|
|
2704
2710
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, wrap: "wrap", gap: 4, children: [
|
|
@@ -2988,7 +2994,7 @@ function CsvManagerTab() {
|
|
|
2988
2994
|
] })
|
|
2989
2995
|
] }),
|
|
2990
2996
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", marginTop: 4, wrap: "wrap", gap: 3, children: [
|
|
2991
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2997
|
+
permissions.canCsvPreFlightDryRun ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2992
2998
|
designSystem.Button,
|
|
2993
2999
|
{
|
|
2994
3000
|
variant: "secondary",
|
|
@@ -2999,8 +3005,8 @@ function CsvManagerTab() {
|
|
|
2999
3005
|
disabled: importing,
|
|
3000
3006
|
children: "Run Pre-Flight Dry Run"
|
|
3001
3007
|
}
|
|
3002
|
-
),
|
|
3003
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3008
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, {}),
|
|
3009
|
+
(canAnyCsvImportExecution || permissions.canCsvImport) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3004
3010
|
designSystem.Button,
|
|
3005
3011
|
{
|
|
3006
3012
|
variant: "default",
|
|
@@ -3472,8 +3478,8 @@ function CsvManagerTab() {
|
|
|
3472
3478
|
},
|
|
3473
3479
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", gap: 3, style: { width: "100%" }, children: [
|
|
3474
3480
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", size: "M", onClick: () => setShowConfirmModal(false), children: "Cancel" }),
|
|
3475
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3476
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3481
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, wrap: "wrap", justifyContent: "flex-end", alignItems: "center", children: !canAnyCsvImportExecution ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.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__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3482
|
+
permissions.canCsvSubmitForChecker && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3477
3483
|
designSystem.Button,
|
|
3478
3484
|
{
|
|
3479
3485
|
variant: executionWindow?.isBusinessHours ? "default" : "secondary",
|
|
@@ -3485,7 +3491,7 @@ function CsvManagerTab() {
|
|
|
3485
3491
|
}
|
|
3486
3492
|
),
|
|
3487
3493
|
executionWindow?.isBusinessHours ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3488
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3494
|
+
permissions.canCsvQueueForOffPeak && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3489
3495
|
designSystem.Button,
|
|
3490
3496
|
{
|
|
3491
3497
|
variant: "secondary",
|
|
@@ -3500,7 +3506,7 @@ function CsvManagerTab() {
|
|
|
3500
3506
|
]
|
|
3501
3507
|
}
|
|
3502
3508
|
),
|
|
3503
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3509
|
+
permissions.canCsvForceRunNow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3504
3510
|
designSystem.Button,
|
|
3505
3511
|
{
|
|
3506
3512
|
variant: "danger-light",
|
|
@@ -3511,7 +3517,7 @@ function CsvManagerTab() {
|
|
|
3511
3517
|
children: "Force Run Now"
|
|
3512
3518
|
}
|
|
3513
3519
|
)
|
|
3514
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3520
|
+
] }) : permissions.canCsvForceRunNow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3515
3521
|
designSystem.Button,
|
|
3516
3522
|
{
|
|
3517
3523
|
variant: "default",
|
|
@@ -3522,7 +3528,7 @@ function CsvManagerTab() {
|
|
|
3522
3528
|
children: "Confirm & Execute Now"
|
|
3523
3529
|
}
|
|
3524
3530
|
)
|
|
3525
|
-
] })
|
|
3531
|
+
] }) })
|
|
3526
3532
|
] })
|
|
3527
3533
|
}
|
|
3528
3534
|
);
|
|
@@ -6534,6 +6540,7 @@ const BulkUpdater = () => {
|
|
|
6534
6540
|
const { toggleNotification } = admin.useNotification();
|
|
6535
6541
|
const permissions = ValidationRulesTab.useBulkUpdaterRBAC();
|
|
6536
6542
|
const canAnyUpdateExecution = permissions.canWorkspaceSubmitForChecker || permissions.canWorkspaceForceRunNow || permissions.canWorkspaceQueueForOffPeak;
|
|
6543
|
+
const canAnyCsvAccess = permissions.canCsvExport || permissions.canCsvImport || permissions.canCsvSubmitForChecker || permissions.canCsvForceRunNow || permissions.canCsvQueueForOffPeak || permissions.canCsvPreFlightDryRun;
|
|
6537
6544
|
const getInitialTab = () => {
|
|
6538
6545
|
try {
|
|
6539
6546
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -6543,7 +6550,7 @@ const BulkUpdater = () => {
|
|
|
6543
6550
|
}
|
|
6544
6551
|
if (!permissions.isLoading) {
|
|
6545
6552
|
if (permissions.canWorkspaceView) return "editor";
|
|
6546
|
-
if (
|
|
6553
|
+
if (canAnyCsvAccess) return "csv";
|
|
6547
6554
|
if (permissions.canAuditView || permissions.canApprovalView) return "audit";
|
|
6548
6555
|
if (permissions.canValidationView) return "rules";
|
|
6549
6556
|
}
|
|
@@ -6565,12 +6572,12 @@ const BulkUpdater = () => {
|
|
|
6565
6572
|
if (tab === "editor") return permissions.canWorkspaceView;
|
|
6566
6573
|
if (tab === "audit") return permissions.canAuditView || permissions.canApprovalView;
|
|
6567
6574
|
if (tab === "rules") return permissions.canValidationView;
|
|
6568
|
-
if (tab === "csv") return
|
|
6575
|
+
if (tab === "csv") return canAnyCsvAccess;
|
|
6569
6576
|
return false;
|
|
6570
6577
|
};
|
|
6571
6578
|
if (!isTabAllowed(activeTab)) {
|
|
6572
6579
|
if (permissions.canWorkspaceView) setActiveTab("editor");
|
|
6573
|
-
else if (
|
|
6580
|
+
else if (canAnyCsvAccess) setActiveTab("csv");
|
|
6574
6581
|
else if (permissions.canAuditView || permissions.canApprovalView) setActiveTab("audit");
|
|
6575
6582
|
else if (permissions.canValidationView) setActiveTab("rules");
|
|
6576
6583
|
}
|
|
@@ -7020,7 +7027,7 @@ const BulkUpdater = () => {
|
|
|
7020
7027
|
};
|
|
7021
7028
|
React.useEffect(() => {
|
|
7022
7029
|
if (permissions.isLoading) return;
|
|
7023
|
-
if (permissions.canWorkspaceView ||
|
|
7030
|
+
if (permissions.canWorkspaceView || canAnyCsvAccess || permissions.canValidationView) {
|
|
7024
7031
|
fetchModels();
|
|
7025
7032
|
}
|
|
7026
7033
|
if (permissions.canAuditView) {
|
|
@@ -7035,8 +7042,7 @@ const BulkUpdater = () => {
|
|
|
7035
7042
|
}, [
|
|
7036
7043
|
permissions.isLoading,
|
|
7037
7044
|
permissions.canWorkspaceView,
|
|
7038
|
-
|
|
7039
|
-
permissions.canCsvImport,
|
|
7045
|
+
canAnyCsvAccess,
|
|
7040
7046
|
permissions.canValidationView,
|
|
7041
7047
|
permissions.canAuditView,
|
|
7042
7048
|
permissions.canApprovalView
|
|
@@ -8513,7 +8519,7 @@ const BulkUpdater = () => {
|
|
|
8513
8519
|
children: "Validation & Quota Rules"
|
|
8514
8520
|
}
|
|
8515
8521
|
),
|
|
8516
|
-
|
|
8522
|
+
canAnyCsvAccess && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8517
8523
|
designSystem.Button,
|
|
8518
8524
|
{
|
|
8519
8525
|
variant: activeTab === "csv" ? "default" : "tertiary",
|
|
@@ -8532,7 +8538,7 @@ const BulkUpdater = () => {
|
|
|
8532
8538
|
}
|
|
8533
8539
|
) })
|
|
8534
8540
|
] }),
|
|
8535
|
-
!permissions.canWorkspaceView && !permissions.canAuditView && !permissions.canApprovalView && !permissions.canValidationView && !
|
|
8541
|
+
!permissions.canWorkspaceView && !permissions.canAuditView && !permissions.canApprovalView && !permissions.canValidationView && !canAnyCsvAccess && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 8, background: "neutral0", shadow: "filterShadow", hasRadius: true, marginTop: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.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." }) }),
|
|
8536
8542
|
activeTab === "editor" && permissions.canAuditRollback && latestActiveBatch && !updateSummary && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8537
8543
|
designSystem.Box,
|
|
8538
8544
|
{
|
|
@@ -11088,4 +11094,4 @@ exports.parseDynamicZonePath = parseDynamicZonePath;
|
|
|
11088
11094
|
exports.registerRelationOptions = registerRelationOptions;
|
|
11089
11095
|
exports.resolveEffectiveRelationMeta = resolveEffectiveRelationMeta;
|
|
11090
11096
|
exports.resolveEntityLabel = resolveEntityLabel;
|
|
11091
|
-
//# sourceMappingURL=BulkUpdater-
|
|
11097
|
+
//# sourceMappingURL=BulkUpdater-BrBWtCjS.js.map
|