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.
Files changed (29) hide show
  1. package/dist/_chunks/{BulkUpdater-CV49TvOV.mjs → BulkUpdater-BQnhVw0j.mjs} +31 -25
  2. package/dist/_chunks/BulkUpdater-BQnhVw0j.mjs.map +1 -0
  3. package/dist/_chunks/{BulkUpdater-Cnzgw4UH.js → BulkUpdater-BrBWtCjS.js} +31 -25
  4. package/dist/_chunks/BulkUpdater-BrBWtCjS.js.map +1 -0
  5. package/dist/_chunks/{SettingsPage-DXRWLRp_.mjs → SettingsPage-DYD6M988.mjs} +2 -2
  6. package/dist/_chunks/{SettingsPage-DXRWLRp_.mjs.map → SettingsPage-DYD6M988.mjs.map} +1 -1
  7. package/dist/_chunks/{SettingsPage-w_Lz-N0V.js → SettingsPage-DsKfbhNd.js} +2 -2
  8. package/dist/_chunks/{SettingsPage-w_Lz-N0V.js.map → SettingsPage-DsKfbhNd.js.map} +1 -1
  9. package/dist/_chunks/{ValidationRulesTab-eN_vH3TB.mjs → ValidationRulesTab-BzS4_gcN.mjs} +23 -3
  10. package/dist/_chunks/ValidationRulesTab-BzS4_gcN.mjs.map +1 -0
  11. package/dist/_chunks/{ValidationRulesTab-of8bIzre.js → ValidationRulesTab-DZw6CujQ.js} +23 -3
  12. package/dist/_chunks/ValidationRulesTab-DZw6CujQ.js.map +1 -0
  13. package/dist/_chunks/{index-C2HoRm23.js → index-BCOsNd1S.js} +12 -4
  14. package/dist/_chunks/index-BCOsNd1S.js.map +1 -0
  15. package/dist/_chunks/{index-2DodYa70.mjs → index-CjbxZZjb.mjs} +12 -4
  16. package/dist/_chunks/index-CjbxZZjb.mjs.map +1 -0
  17. package/dist/admin/index.js +1 -1
  18. package/dist/admin/index.mjs +1 -1
  19. package/dist/server/index.js +332 -227
  20. package/dist/server/index.js.map +1 -1
  21. package/dist/server/index.mjs +332 -227
  22. package/dist/server/index.mjs.map +1 -1
  23. package/package.json +1 -1
  24. package/dist/_chunks/BulkUpdater-CV49TvOV.mjs.map +0 -1
  25. package/dist/_chunks/BulkUpdater-Cnzgw4UH.js.map +0 -1
  26. package/dist/_chunks/ValidationRulesTab-eN_vH3TB.mjs.map +0 -1
  27. package/dist/_chunks/ValidationRulesTab-of8bIzre.js.map +0 -1
  28. package/dist/_chunks/index-2DodYa70.mjs.map +0 -1
  29. package/dist/_chunks/index-C2HoRm23.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-eN_vH3TB.mjs";
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 (permissions.canCsvExport || permissions.canCsvImport) {
1578
+ if (canAnyCsvAccess) {
1576
1579
  fetchInitialData();
1577
1580
  }
1578
- }, [permissions.isLoading, permissions.canCsvExport, permissions.canCsvImport]);
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 || !permissions.canCsvExport && !permissions.canCsvImport,
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
- permissions.canCsvImport && /* @__PURE__ */ jsxs(Box, { padding: 5, background: "neutral100", hasRadius: true, children: [
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__ */ jsxs(Flex, { gap: 2, wrap: "wrap", justifyContent: "flex-end", alignItems: "center", children: [
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
  );
@@ -6530,6 +6536,7 @@ const BulkUpdater = () => {
6530
6536
  const { toggleNotification } = useNotification();
6531
6537
  const permissions = useBulkUpdaterRBAC();
6532
6538
  const canAnyUpdateExecution = permissions.canWorkspaceSubmitForChecker || permissions.canWorkspaceForceRunNow || permissions.canWorkspaceQueueForOffPeak;
6539
+ const canAnyCsvAccess = permissions.canCsvExport || permissions.canCsvImport || permissions.canCsvSubmitForChecker || permissions.canCsvForceRunNow || permissions.canCsvQueueForOffPeak || permissions.canCsvPreFlightDryRun;
6533
6540
  const getInitialTab = () => {
6534
6541
  try {
6535
6542
  const params = new URLSearchParams(window.location.search);
@@ -6539,7 +6546,7 @@ const BulkUpdater = () => {
6539
6546
  }
6540
6547
  if (!permissions.isLoading) {
6541
6548
  if (permissions.canWorkspaceView) return "editor";
6542
- if (permissions.canCsvExport || permissions.canCsvImport) return "csv";
6549
+ if (canAnyCsvAccess) return "csv";
6543
6550
  if (permissions.canAuditView || permissions.canApprovalView) return "audit";
6544
6551
  if (permissions.canValidationView) return "rules";
6545
6552
  }
@@ -6561,12 +6568,12 @@ const BulkUpdater = () => {
6561
6568
  if (tab === "editor") return permissions.canWorkspaceView;
6562
6569
  if (tab === "audit") return permissions.canAuditView || permissions.canApprovalView;
6563
6570
  if (tab === "rules") return permissions.canValidationView;
6564
- if (tab === "csv") return permissions.canCsvExport || permissions.canCsvImport;
6571
+ if (tab === "csv") return canAnyCsvAccess;
6565
6572
  return false;
6566
6573
  };
6567
6574
  if (!isTabAllowed(activeTab)) {
6568
6575
  if (permissions.canWorkspaceView) setActiveTab("editor");
6569
- else if (permissions.canCsvExport || permissions.canCsvImport) setActiveTab("csv");
6576
+ else if (canAnyCsvAccess) setActiveTab("csv");
6570
6577
  else if (permissions.canAuditView || permissions.canApprovalView) setActiveTab("audit");
6571
6578
  else if (permissions.canValidationView) setActiveTab("rules");
6572
6579
  }
@@ -7016,7 +7023,7 @@ const BulkUpdater = () => {
7016
7023
  };
7017
7024
  useEffect(() => {
7018
7025
  if (permissions.isLoading) return;
7019
- if (permissions.canWorkspaceView || permissions.canCsvExport || permissions.canCsvImport || permissions.canValidationView) {
7026
+ if (permissions.canWorkspaceView || canAnyCsvAccess || permissions.canValidationView) {
7020
7027
  fetchModels();
7021
7028
  }
7022
7029
  if (permissions.canAuditView) {
@@ -7031,8 +7038,7 @@ const BulkUpdater = () => {
7031
7038
  }, [
7032
7039
  permissions.isLoading,
7033
7040
  permissions.canWorkspaceView,
7034
- permissions.canCsvExport,
7035
- permissions.canCsvImport,
7041
+ canAnyCsvAccess,
7036
7042
  permissions.canValidationView,
7037
7043
  permissions.canAuditView,
7038
7044
  permissions.canApprovalView
@@ -8509,7 +8515,7 @@ const BulkUpdater = () => {
8509
8515
  children: "Validation & Quota Rules"
8510
8516
  }
8511
8517
  ),
8512
- (permissions.canCsvExport || permissions.canCsvImport) && /* @__PURE__ */ jsx(
8518
+ canAnyCsvAccess && /* @__PURE__ */ jsx(
8513
8519
  Button,
8514
8520
  {
8515
8521
  variant: activeTab === "csv" ? "default" : "tertiary",
@@ -8528,7 +8534,7 @@ const BulkUpdater = () => {
8528
8534
  }
8529
8535
  ) })
8530
8536
  ] }),
8531
- !permissions.canWorkspaceView && !permissions.canAuditView && !permissions.canApprovalView && !permissions.canValidationView && !permissions.canCsvExport && !permissions.canCsvImport && /* @__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." }) }),
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." }) }),
8532
8538
  activeTab === "editor" && permissions.canAuditRollback && latestActiveBatch && !updateSummary && /* @__PURE__ */ jsx(
8533
8539
  Box,
8534
8540
  {
@@ -11086,4 +11092,4 @@ export {
11086
11092
  resolveEffectiveRelationMeta,
11087
11093
  resolveEntityLabel
11088
11094
  };
11089
- //# sourceMappingURL=BulkUpdater-CV49TvOV.mjs.map
11095
+ //# sourceMappingURL=BulkUpdater-BQnhVw0j.mjs.map