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.
Files changed (29) hide show
  1. package/dist/_chunks/{BulkUpdater-CFStXO-q.mjs → BulkUpdater-BQnhVw0j.mjs} +75 -44
  2. package/dist/_chunks/BulkUpdater-BQnhVw0j.mjs.map +1 -0
  3. package/dist/_chunks/{BulkUpdater-BSlEEUTV.js → BulkUpdater-BrBWtCjS.js} +75 -44
  4. package/dist/_chunks/BulkUpdater-BrBWtCjS.js.map +1 -0
  5. package/dist/_chunks/{SettingsPage-BrfS4_qy.mjs → SettingsPage-DYD6M988.mjs} +2 -2
  6. package/dist/_chunks/{SettingsPage-BrfS4_qy.mjs.map → SettingsPage-DYD6M988.mjs.map} +1 -1
  7. package/dist/_chunks/{SettingsPage-BgEO2BNP.js → SettingsPage-DsKfbhNd.js} +2 -2
  8. package/dist/_chunks/{SettingsPage-BgEO2BNP.js.map → SettingsPage-DsKfbhNd.js.map} +1 -1
  9. package/dist/_chunks/{ValidationRulesTab-BslJyrBj.mjs → ValidationRulesTab-BzS4_gcN.mjs} +43 -3
  10. package/dist/_chunks/ValidationRulesTab-BzS4_gcN.mjs.map +1 -0
  11. package/dist/_chunks/{ValidationRulesTab-Cs0YDlMx.js → ValidationRulesTab-DZw6CujQ.js} +43 -3
  12. package/dist/_chunks/ValidationRulesTab-DZw6CujQ.js.map +1 -0
  13. package/dist/_chunks/{index-CjR6IZqM.js → index-BCOsNd1S.js} +16 -4
  14. package/dist/_chunks/index-BCOsNd1S.js.map +1 -0
  15. package/dist/_chunks/{index-4eNIGyGu.mjs → index-CjbxZZjb.mjs} +16 -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 +475 -282
  20. package/dist/server/index.js.map +1 -1
  21. package/dist/server/index.mjs +475 -282
  22. package/dist/server/index.mjs.map +1 -1
  23. package/package.json +1 -1
  24. package/dist/_chunks/BulkUpdater-BSlEEUTV.js.map +0 -1
  25. package/dist/_chunks/BulkUpdater-CFStXO-q.mjs.map +0 -1
  26. package/dist/_chunks/ValidationRulesTab-BslJyrBj.mjs.map +0 -1
  27. package/dist/_chunks/ValidationRulesTab-Cs0YDlMx.js.map +0 -1
  28. package/dist/_chunks/index-4eNIGyGu.mjs.map +0 -1
  29. package/dist/_chunks/index-CjR6IZqM.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-Cs0YDlMx.js");
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 (permissions.canCsvExport || permissions.canCsvImport) {
1582
+ if (canAnyCsvAccess) {
1580
1583
  fetchInitialData();
1581
1584
  }
1582
- }, [permissions.isLoading, permissions.canCsvExport, permissions.canCsvImport]);
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 || !permissions.canCsvExport && !permissions.canCsvImport,
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
- permissions.canCsvImport && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 5, background: "neutral100", hasRadius: true, children: [
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.jsxs(designSystem.Flex, { gap: 2, wrap: "wrap", justifyContent: "flex-end", alignItems: "center", children: [
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
  );
@@ -4160,6 +4166,7 @@ const BulkUpdatePreviewModal = ({
4160
4166
  isOpen,
4161
4167
  onClose,
4162
4168
  onProceed,
4169
+ canProceed,
4163
4170
  loading,
4164
4171
  previewData,
4165
4172
  attribute,
@@ -4170,6 +4177,8 @@ const BulkUpdatePreviewModal = ({
4170
4177
  }) => {
4171
4178
  const [filterTab, setFilterTab] = React.useState("all");
4172
4179
  const [searchQuery, setSearchQuery] = React.useState("");
4180
+ const { canWorkspaceProceedToExecute } = ValidationRulesTab.useBulkUpdaterRBAC();
4181
+ const allowProceed = canProceed !== void 0 ? canProceed : canWorkspaceProceedToExecute;
4173
4182
  const filteredDiffs = React.useMemo(() => {
4174
4183
  if (!previewData || !previewData.diffs) return [];
4175
4184
  let items = previewData.diffs;
@@ -4516,7 +4525,7 @@ const BulkUpdatePreviewModal = ({
4516
4525
  },
4517
4526
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", children: [
4518
4527
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", size: "M", onClick: onClose, children: "Close Preview" }),
4519
- /* @__PURE__ */ jsxRuntime.jsxs(
4528
+ allowProceed && /* @__PURE__ */ jsxRuntime.jsxs(
4520
4529
  designSystem.Button,
4521
4530
  {
4522
4531
  variant: "default",
@@ -6530,6 +6539,8 @@ const BulkUpdater = () => {
6530
6539
  const { get, post } = admin.useFetchClient();
6531
6540
  const { toggleNotification } = admin.useNotification();
6532
6541
  const permissions = ValidationRulesTab.useBulkUpdaterRBAC();
6542
+ const canAnyUpdateExecution = permissions.canWorkspaceSubmitForChecker || permissions.canWorkspaceForceRunNow || permissions.canWorkspaceQueueForOffPeak;
6543
+ const canAnyCsvAccess = permissions.canCsvExport || permissions.canCsvImport || permissions.canCsvSubmitForChecker || permissions.canCsvForceRunNow || permissions.canCsvQueueForOffPeak || permissions.canCsvPreFlightDryRun;
6533
6544
  const getInitialTab = () => {
6534
6545
  try {
6535
6546
  const params = new URLSearchParams(window.location.search);
@@ -6539,7 +6550,7 @@ const BulkUpdater = () => {
6539
6550
  }
6540
6551
  if (!permissions.isLoading) {
6541
6552
  if (permissions.canWorkspaceView) return "editor";
6542
- if (permissions.canCsvExport || permissions.canCsvImport) return "csv";
6553
+ if (canAnyCsvAccess) return "csv";
6543
6554
  if (permissions.canAuditView || permissions.canApprovalView) return "audit";
6544
6555
  if (permissions.canValidationView) return "rules";
6545
6556
  }
@@ -6561,12 +6572,12 @@ const BulkUpdater = () => {
6561
6572
  if (tab === "editor") return permissions.canWorkspaceView;
6562
6573
  if (tab === "audit") return permissions.canAuditView || permissions.canApprovalView;
6563
6574
  if (tab === "rules") return permissions.canValidationView;
6564
- if (tab === "csv") return permissions.canCsvExport || permissions.canCsvImport;
6575
+ if (tab === "csv") return canAnyCsvAccess;
6565
6576
  return false;
6566
6577
  };
6567
6578
  if (!isTabAllowed(activeTab)) {
6568
6579
  if (permissions.canWorkspaceView) setActiveTab("editor");
6569
- else if (permissions.canCsvExport || permissions.canCsvImport) setActiveTab("csv");
6580
+ else if (canAnyCsvAccess) setActiveTab("csv");
6570
6581
  else if (permissions.canAuditView || permissions.canApprovalView) setActiveTab("audit");
6571
6582
  else if (permissions.canValidationView) setActiveTab("rules");
6572
6583
  }
@@ -6578,6 +6589,7 @@ const BulkUpdater = () => {
6578
6589
  const [auditEnabled, setAuditEnabled] = React.useState(false);
6579
6590
  const [executionWindow, setExecutionWindow] = React.useState(null);
6580
6591
  const [showConfirmModal, setShowConfirmModal] = React.useState(false);
6592
+ const [confirmModalSource, setConfirmModalSource] = React.useState("direct");
6581
6593
  const [pendingBatches, setPendingBatches] = React.useState([]);
6582
6594
  const [pendingBatchesLoading, setPendingBatchesLoading] = React.useState(false);
6583
6595
  const [approvingBatchId, setApprovingBatchId] = React.useState(null);
@@ -7015,7 +7027,7 @@ const BulkUpdater = () => {
7015
7027
  };
7016
7028
  React.useEffect(() => {
7017
7029
  if (permissions.isLoading) return;
7018
- if (permissions.canWorkspaceView || permissions.canCsvExport || permissions.canCsvImport || permissions.canValidationView) {
7030
+ if (permissions.canWorkspaceView || canAnyCsvAccess || permissions.canValidationView) {
7019
7031
  fetchModels();
7020
7032
  }
7021
7033
  if (permissions.canAuditView) {
@@ -7030,8 +7042,7 @@ const BulkUpdater = () => {
7030
7042
  }, [
7031
7043
  permissions.isLoading,
7032
7044
  permissions.canWorkspaceView,
7033
- permissions.canCsvExport,
7034
- permissions.canCsvImport,
7045
+ canAnyCsvAccess,
7035
7046
  permissions.canValidationView,
7036
7047
  permissions.canAuditView,
7037
7048
  permissions.canApprovalView
@@ -7330,13 +7341,13 @@ const BulkUpdater = () => {
7330
7341
  }, [availableColAttributes, componentDepth, attributesMeta, selectedCol]);
7331
7342
  const memoizedComboboxOptions = React.useMemo(() => {
7332
7343
  if (depthFilteredAttributes.length === 0) {
7333
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: "__none__", disabled: true, textValue: "No attributes available", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: [
7344
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: "__none__", disabled: true, textValue: "No attributes available", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: [
7334
7345
  "No attributes available for this collection type (Depth L",
7335
7346
  componentDepth,
7336
7347
  ")"
7337
- ] }) });
7348
+ ] }) }) });
7338
7349
  }
7339
- return depthFilteredAttributes.map((attr) => {
7350
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: depthFilteredAttributes.map((attr) => {
7340
7351
  const rel = getEffectiveRelMeta(attr);
7341
7352
  const depth = getAttrDepth(attr);
7342
7353
  const friendlyLabel = formatAttributeHeaderLabel(attr);
@@ -7356,7 +7367,7 @@ const BulkUpdater = () => {
7356
7367
  " component"
7357
7368
  ] }) : null
7358
7369
  ] }) }, attr);
7359
- });
7370
+ }) });
7360
7371
  }, [depthFilteredAttributes, getEffectiveRelMeta, selectedAttribute, componentDepth, attributesMeta]);
7361
7372
  const memoizedSearchComboboxOptions = React.useMemo(() => {
7362
7373
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: depthFilteredAttributes.map((attr) => {
@@ -7675,7 +7686,7 @@ const BulkUpdater = () => {
7675
7686
  () => gridEditMode ? computeLifecycleStatsForKeys(gridTargetKeys) : selectedLifecycleStats,
7676
7687
  [gridEditMode, gridTargetKeys, computeLifecycleStatsForKeys, selectedLifecycleStats]
7677
7688
  );
7678
- const handleOpenConfirmModal = () => {
7689
+ const handleOpenConfirmModal = (source = "direct") => {
7679
7690
  if (!selectedAttribute) {
7680
7691
  toggleNotification({
7681
7692
  type: "warning",
@@ -7710,6 +7721,7 @@ const BulkUpdater = () => {
7710
7721
  }
7711
7722
  setPublishStrategy("safe");
7712
7723
  setUnreviewedConsent(false);
7724
+ setConfirmModalSource(source === "preview" ? "preview" : "direct");
7713
7725
  setShowConfirmModal(true);
7714
7726
  };
7715
7727
  const handleOpenPreviewModal = async () => {
@@ -7825,8 +7837,10 @@ const BulkUpdater = () => {
7825
7837
  }
7826
7838
  const displaySummaryVal = gridEditMode ? `Grid Editing (${gridSerialized.totalEditCount} edits across ${targets.length} records)` : attributeValue;
7827
7839
  try {
7840
+ const isFromPreview = confirmModalSource === "preview";
7828
7841
  setUpdating(true);
7829
7842
  setShowConfirmModal(false);
7843
+ setConfirmModalSource("direct");
7830
7844
  setShowProcessingDashboard(true);
7831
7845
  setIsSubmittingBatch(true);
7832
7846
  setLastResults(null);
@@ -7864,7 +7878,8 @@ const BulkUpdater = () => {
7864
7878
  publishOnApproval,
7865
7879
  publishStrategy,
7866
7880
  unreviewedConsent,
7867
- unreviewedCount: selectedLifecycleStats.unreviewedCount
7881
+ unreviewedCount: selectedLifecycleStats.unreviewedCount,
7882
+ ...isFromPreview ? { initiatedFromPreview: true } : {}
7868
7883
  };
7869
7884
  const res = await post("/bulk-updater/batch-update", payload);
7870
7885
  setIsSubmittingBatch(false);
@@ -8504,7 +8519,7 @@ const BulkUpdater = () => {
8504
8519
  children: "Validation & Quota Rules"
8505
8520
  }
8506
8521
  ),
8507
- (permissions.canCsvExport || permissions.canCsvImport) && /* @__PURE__ */ jsxRuntime.jsx(
8522
+ canAnyCsvAccess && /* @__PURE__ */ jsxRuntime.jsx(
8508
8523
  designSystem.Button,
8509
8524
  {
8510
8525
  variant: activeTab === "csv" ? "default" : "tertiary",
@@ -8523,7 +8538,7 @@ const BulkUpdater = () => {
8523
8538
  }
8524
8539
  ) })
8525
8540
  ] }),
8526
- !permissions.canWorkspaceView && !permissions.canAuditView && !permissions.canApprovalView && !permissions.canValidationView && !permissions.canCsvExport && !permissions.canCsvImport && /* @__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." }) }),
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." }) }),
8527
8542
  activeTab === "editor" && permissions.canAuditRollback && latestActiveBatch && !updateSummary && /* @__PURE__ */ jsxRuntime.jsx(
8528
8543
  designSystem.Box,
8529
8544
  {
@@ -9755,10 +9770,10 @@ const BulkUpdater = () => {
9755
9770
  startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Play, {}),
9756
9771
  variant: "default",
9757
9772
  size: "L",
9758
- onClick: handleOpenConfirmModal,
9773
+ onClick: () => handleOpenConfirmModal("direct"),
9759
9774
  loading: updating,
9760
- disabled: !permissions.canWorkspaceExecute || (loading || !selectedAttribute || !selectedAttribute.trim() || (gridEditMode ? gridSerialized.targets.length === 0 || gridSerialized.hasValidationErrors : totalSelectedCount === 0)),
9761
- title: !permissions.canWorkspaceExecute ? "You do not have permission to execute bulk updates (action: plugin::bulk-updater.workspace.execute)." : void 0,
9775
+ disabled: !(permissions.canWorkspaceExecute || canAnyUpdateExecution) || (loading || !selectedAttribute || !selectedAttribute.trim() || (gridEditMode ? gridSerialized.targets.length === 0 || gridSerialized.hasValidationErrors : totalSelectedCount === 0)),
9776
+ title: !(permissions.canWorkspaceExecute || canAnyUpdateExecution) ? "You do not have permission to execute bulk updates (action: plugin::bulk-updater.workspace.execute)." : void 0,
9762
9777
  children: [
9763
9778
  "Update Selected (",
9764
9779
  gridEditMode ? gridSerialized.targets.length : totalSelectedCount,
@@ -10334,7 +10349,10 @@ const BulkUpdater = () => {
10334
10349
  boxSizing: "border-box",
10335
10350
  overflowY: "auto"
10336
10351
  },
10337
- onClick: () => setShowConfirmModal(false),
10352
+ onClick: () => {
10353
+ setShowConfirmModal(false);
10354
+ setConfirmModalSource("direct");
10355
+ },
10338
10356
  children: /* @__PURE__ */ jsxRuntime.jsxs(
10339
10357
  designSystem.Box,
10340
10358
  {
@@ -10678,9 +10696,20 @@ const BulkUpdater = () => {
10678
10696
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, style: { width: "100%" }, children: [
10679
10697
  publishOnApproval && updateModalLifecycleStats.unreviewedCount > 0 && publishStrategy === "all" && !unreviewedConsent && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "danger700", fontWeight: "bold", children: "⚠️ Explicit consent is required before publishing records with unreviewed draft revisions." }),
10680
10698
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", gap: 3, style: { width: "100%" }, children: [
10681
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", size: "M", onClick: () => setShowConfirmModal(false), children: "Cancel" }),
10682
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, wrap: "wrap", justifyContent: "flex-end", alignItems: "center", children: [
10683
- /* @__PURE__ */ jsxRuntime.jsx(
10699
+ /* @__PURE__ */ jsxRuntime.jsx(
10700
+ designSystem.Button,
10701
+ {
10702
+ variant: "tertiary",
10703
+ size: "M",
10704
+ onClick: () => {
10705
+ setShowConfirmModal(false);
10706
+ setConfirmModalSource("direct");
10707
+ },
10708
+ children: "Cancel"
10709
+ }
10710
+ ),
10711
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, wrap: "wrap", justifyContent: "flex-end", alignItems: "center", children: !canAnyUpdateExecution ? /* @__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 bulk updates." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10712
+ permissions.canWorkspaceSubmitForChecker && /* @__PURE__ */ jsxRuntime.jsx(
10684
10713
  designSystem.Button,
10685
10714
  {
10686
10715
  variant: executionWindow?.isBusinessHours ? "default" : "secondary",
@@ -10692,7 +10721,7 @@ const BulkUpdater = () => {
10692
10721
  }
10693
10722
  ),
10694
10723
  executionWindow?.isBusinessHours ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10695
- /* @__PURE__ */ jsxRuntime.jsxs(
10724
+ permissions.canWorkspaceQueueForOffPeak && /* @__PURE__ */ jsxRuntime.jsxs(
10696
10725
  designSystem.Button,
10697
10726
  {
10698
10727
  variant: "secondary",
@@ -10707,7 +10736,7 @@ const BulkUpdater = () => {
10707
10736
  ]
10708
10737
  }
10709
10738
  ),
10710
- /* @__PURE__ */ jsxRuntime.jsx(
10739
+ permissions.canWorkspaceForceRunNow && /* @__PURE__ */ jsxRuntime.jsx(
10711
10740
  designSystem.Button,
10712
10741
  {
10713
10742
  variant: "danger-light",
@@ -10718,7 +10747,7 @@ const BulkUpdater = () => {
10718
10747
  children: "Force Run Now"
10719
10748
  }
10720
10749
  )
10721
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(
10750
+ ] }) : permissions.canWorkspaceForceRunNow && /* @__PURE__ */ jsxRuntime.jsx(
10722
10751
  designSystem.Button,
10723
10752
  {
10724
10753
  variant: "default",
@@ -10729,7 +10758,7 @@ const BulkUpdater = () => {
10729
10758
  children: "Confirm & Execute Now"
10730
10759
  }
10731
10760
  )
10732
- ] })
10761
+ ] }) })
10733
10762
  ] })
10734
10763
  ] })
10735
10764
  }
@@ -11007,9 +11036,11 @@ const BulkUpdater = () => {
11007
11036
  {
11008
11037
  isOpen: showPreviewModal,
11009
11038
  onClose: () => setShowPreviewModal(false),
11039
+ canProceed: permissions.canWorkspaceProceedToExecute,
11010
11040
  onProceed: () => {
11041
+ if (!permissions.canWorkspaceProceedToExecute) return;
11011
11042
  setShowPreviewModal(false);
11012
- handleOpenConfirmModal();
11043
+ handleOpenConfirmModal("preview");
11013
11044
  },
11014
11045
  loading: previewLoading,
11015
11046
  previewData,
@@ -11063,4 +11094,4 @@ exports.parseDynamicZonePath = parseDynamicZonePath;
11063
11094
  exports.registerRelationOptions = registerRelationOptions;
11064
11095
  exports.resolveEffectiveRelationMeta = resolveEffectiveRelationMeta;
11065
11096
  exports.resolveEntityLabel = resolveEntityLabel;
11066
- //# sourceMappingURL=BulkUpdater-BSlEEUTV.js.map
11097
+ //# sourceMappingURL=BulkUpdater-BrBWtCjS.js.map