strapi-plugin-bulk-updater 1.7.0 → 1.7.2

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-Cnzgw4UH.js → BulkUpdater-BdsfPqoX.js} +85 -41
  2. package/dist/_chunks/BulkUpdater-BdsfPqoX.js.map +1 -0
  3. package/dist/_chunks/{BulkUpdater-CV49TvOV.mjs → BulkUpdater-KWmfElh6.mjs} +85 -41
  4. package/dist/_chunks/BulkUpdater-KWmfElh6.mjs.map +1 -0
  5. package/dist/_chunks/{SettingsPage-DXRWLRp_.mjs → SettingsPage-BdwchEyi.mjs} +2 -2
  6. package/dist/_chunks/{SettingsPage-DXRWLRp_.mjs.map → SettingsPage-BdwchEyi.mjs.map} +1 -1
  7. package/dist/_chunks/{SettingsPage-w_Lz-N0V.js → SettingsPage-DqJ_zBde.js} +2 -2
  8. package/dist/_chunks/{SettingsPage-w_Lz-N0V.js.map → SettingsPage-DqJ_zBde.js.map} +1 -1
  9. package/dist/_chunks/{ValidationRulesTab-eN_vH3TB.mjs → ValidationRulesTab-DUtycMm1.mjs} +23 -3
  10. package/dist/_chunks/ValidationRulesTab-DUtycMm1.mjs.map +1 -0
  11. package/dist/_chunks/{ValidationRulesTab-of8bIzre.js → ValidationRulesTab-DVvVevbW.js} +23 -3
  12. package/dist/_chunks/ValidationRulesTab-DVvVevbW.js.map +1 -0
  13. package/dist/_chunks/{index-C2HoRm23.js → index-BZ5NTSJQ.js} +12 -4
  14. package/dist/_chunks/index-BZ5NTSJQ.js.map +1 -0
  15. package/dist/_chunks/{index-2DodYa70.mjs → index-C9zsPQim.mjs} +12 -4
  16. package/dist/_chunks/index-C9zsPQim.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 +757 -298
  20. package/dist/server/index.js.map +1 -1
  21. package/dist/server/index.mjs +757 -298
  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
@@ -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-of8bIzre.js");
8
+ const ValidationRulesTab = require("./ValidationRulesTab-DVvVevbW.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;
@@ -2161,7 +2164,8 @@ function CsvManagerTab() {
2161
2164
  const res = await post("/bulk-updater/csv/validate-preflight", {
2162
2165
  uid: selectedUid,
2163
2166
  rows: enrichedRecords,
2164
- mode: importMode
2167
+ mode: importMode,
2168
+ ...originalHeaders.length > 0 ? { originalHeaders } : {}
2165
2169
  });
2166
2170
  if (res.data && res.data.success) {
2167
2171
  setPreflightReport(res.data);
@@ -2194,6 +2198,9 @@ function CsvManagerTab() {
2194
2198
  };
2195
2199
  const submitBatchWithMode = async (executionMode, forceImmediate = false) => {
2196
2200
  if (!selectedUid || allParsedRecords.length === 0) return;
2201
+ if (executionMode === "maker_checker" && !permissions.canCsvSubmitForChecker) return;
2202
+ if (executionMode === "queue_offpeak" && !permissions.canCsvQueueForOffPeak) return;
2203
+ if (executionMode === "immediate" && !permissions.canCsvForceRunNow) return;
2197
2204
  if (executionMode === "immediate") {
2198
2205
  setShowConfirmModal(false);
2199
2206
  await handleExecuteImport();
@@ -2281,7 +2288,7 @@ function CsvManagerTab() {
2281
2288
  variant: "tertiary",
2282
2289
  startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Download, {}),
2283
2290
  onClick: handleDownloadTemplate,
2284
- disabled: !selectedUid || downloadingTemplate || !permissions.canCsvExport && !permissions.canCsvImport,
2291
+ disabled: !selectedUid || downloadingTemplate || !canAnyCsvAccess,
2285
2292
  loading: downloadingTemplate,
2286
2293
  children: "Download Sample CSV Template"
2287
2294
  }
@@ -2695,10 +2702,10 @@ function CsvManagerTab() {
2695
2702
  )
2696
2703
  ] })
2697
2704
  ] }),
2698
- 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." }) }) }),
2705
+ 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 paired _before / _target columns for the selected fields (${selectedDataAttrs.length} field${selectedDataAttrs.length > 1 ? "s" : ""}). Edit only _target columns; _before columns, unselected fields, and sibling nested properties remain 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
2706
  false
2700
2707
  ] }),
2701
- permissions.canCsvImport && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 5, background: "neutral100", hasRadius: true, children: [
2708
+ canAnyCsvImportSection && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 5, background: "neutral100", hasRadius: true, children: [
2702
2709
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", tag: "h3", fontWeight: "bold", marginBottom: 2, children: "2. Import & Batch Override CSV" }),
2703
2710
  /* @__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
2711
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, wrap: "wrap", gap: 4, children: [
@@ -2988,7 +2995,7 @@ function CsvManagerTab() {
2988
2995
  ] })
2989
2996
  ] }),
2990
2997
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", marginTop: 4, wrap: "wrap", gap: 3, children: [
2991
- /* @__PURE__ */ jsxRuntime.jsx(
2998
+ permissions.canCsvPreFlightDryRun ? /* @__PURE__ */ jsxRuntime.jsx(
2992
2999
  designSystem.Button,
2993
3000
  {
2994
3001
  variant: "secondary",
@@ -2999,8 +3006,8 @@ function CsvManagerTab() {
2999
3006
  disabled: importing,
3000
3007
  children: "Run Pre-Flight Dry Run"
3001
3008
  }
3002
- ),
3003
- /* @__PURE__ */ jsxRuntime.jsxs(
3009
+ ) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, {}),
3010
+ (canAnyCsvImportExecution || permissions.canCsvImport) && /* @__PURE__ */ jsxRuntime.jsxs(
3004
3011
  designSystem.Button,
3005
3012
  {
3006
3013
  variant: "default",
@@ -3472,8 +3479,8 @@ function CsvManagerTab() {
3472
3479
  },
3473
3480
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", gap: 3, style: { width: "100%" }, children: [
3474
3481
  /* @__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(
3482
+ /* @__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: [
3483
+ permissions.canCsvSubmitForChecker && /* @__PURE__ */ jsxRuntime.jsx(
3477
3484
  designSystem.Button,
3478
3485
  {
3479
3486
  variant: executionWindow?.isBusinessHours ? "default" : "secondary",
@@ -3485,7 +3492,7 @@ function CsvManagerTab() {
3485
3492
  }
3486
3493
  ),
3487
3494
  executionWindow?.isBusinessHours ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3488
- /* @__PURE__ */ jsxRuntime.jsxs(
3495
+ permissions.canCsvQueueForOffPeak && /* @__PURE__ */ jsxRuntime.jsxs(
3489
3496
  designSystem.Button,
3490
3497
  {
3491
3498
  variant: "secondary",
@@ -3500,7 +3507,7 @@ function CsvManagerTab() {
3500
3507
  ]
3501
3508
  }
3502
3509
  ),
3503
- /* @__PURE__ */ jsxRuntime.jsx(
3510
+ permissions.canCsvForceRunNow && /* @__PURE__ */ jsxRuntime.jsx(
3504
3511
  designSystem.Button,
3505
3512
  {
3506
3513
  variant: "danger-light",
@@ -3511,7 +3518,7 @@ function CsvManagerTab() {
3511
3518
  children: "Force Run Now"
3512
3519
  }
3513
3520
  )
3514
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(
3521
+ ] }) : permissions.canCsvForceRunNow && /* @__PURE__ */ jsxRuntime.jsx(
3515
3522
  designSystem.Button,
3516
3523
  {
3517
3524
  variant: "default",
@@ -3522,7 +3529,7 @@ function CsvManagerTab() {
3522
3529
  children: "Confirm & Execute Now"
3523
3530
  }
3524
3531
  )
3525
- ] })
3532
+ ] }) })
3526
3533
  ] })
3527
3534
  }
3528
3535
  );
@@ -6534,6 +6541,7 @@ const BulkUpdater = () => {
6534
6541
  const { toggleNotification } = admin.useNotification();
6535
6542
  const permissions = ValidationRulesTab.useBulkUpdaterRBAC();
6536
6543
  const canAnyUpdateExecution = permissions.canWorkspaceSubmitForChecker || permissions.canWorkspaceForceRunNow || permissions.canWorkspaceQueueForOffPeak;
6544
+ const canAnyCsvAccess = permissions.canCsvExport || permissions.canCsvImport || permissions.canCsvSubmitForChecker || permissions.canCsvForceRunNow || permissions.canCsvQueueForOffPeak || permissions.canCsvPreFlightDryRun;
6537
6545
  const getInitialTab = () => {
6538
6546
  try {
6539
6547
  const params = new URLSearchParams(window.location.search);
@@ -6543,7 +6551,7 @@ const BulkUpdater = () => {
6543
6551
  }
6544
6552
  if (!permissions.isLoading) {
6545
6553
  if (permissions.canWorkspaceView) return "editor";
6546
- if (permissions.canCsvExport || permissions.canCsvImport) return "csv";
6554
+ if (canAnyCsvAccess) return "csv";
6547
6555
  if (permissions.canAuditView || permissions.canApprovalView) return "audit";
6548
6556
  if (permissions.canValidationView) return "rules";
6549
6557
  }
@@ -6565,12 +6573,12 @@ const BulkUpdater = () => {
6565
6573
  if (tab === "editor") return permissions.canWorkspaceView;
6566
6574
  if (tab === "audit") return permissions.canAuditView || permissions.canApprovalView;
6567
6575
  if (tab === "rules") return permissions.canValidationView;
6568
- if (tab === "csv") return permissions.canCsvExport || permissions.canCsvImport;
6576
+ if (tab === "csv") return canAnyCsvAccess;
6569
6577
  return false;
6570
6578
  };
6571
6579
  if (!isTabAllowed(activeTab)) {
6572
6580
  if (permissions.canWorkspaceView) setActiveTab("editor");
6573
- else if (permissions.canCsvExport || permissions.canCsvImport) setActiveTab("csv");
6581
+ else if (canAnyCsvAccess) setActiveTab("csv");
6574
6582
  else if (permissions.canAuditView || permissions.canApprovalView) setActiveTab("audit");
6575
6583
  else if (permissions.canValidationView) setActiveTab("rules");
6576
6584
  }
@@ -7020,7 +7028,7 @@ const BulkUpdater = () => {
7020
7028
  };
7021
7029
  React.useEffect(() => {
7022
7030
  if (permissions.isLoading) return;
7023
- if (permissions.canWorkspaceView || permissions.canCsvExport || permissions.canCsvImport || permissions.canValidationView) {
7031
+ if (permissions.canWorkspaceView || canAnyCsvAccess || permissions.canValidationView) {
7024
7032
  fetchModels();
7025
7033
  }
7026
7034
  if (permissions.canAuditView) {
@@ -7035,8 +7043,7 @@ const BulkUpdater = () => {
7035
7043
  }, [
7036
7044
  permissions.isLoading,
7037
7045
  permissions.canWorkspaceView,
7038
- permissions.canCsvExport,
7039
- permissions.canCsvImport,
7046
+ canAnyCsvAccess,
7040
7047
  permissions.canValidationView,
7041
7048
  permissions.canAuditView,
7042
7049
  permissions.canApprovalView
@@ -8348,12 +8355,22 @@ const BulkUpdater = () => {
8348
8355
  }
8349
8356
  };
8350
8357
  const handleRollback = async (batchId) => {
8351
- if (!window.confirm(`Are you sure you want to roll back all changes made in batch "${batchId}"?`)) {
8358
+ const targetRec = auditHistory.find((r) => r.batchId === batchId);
8359
+ const overlap = targetRec?.overlapWarning;
8360
+ const confirmMessage = overlap?.hasOverlap ? `WARNING: Batch "${batchId}" touches ${overlap.affectedEntryCount} entry/entries that were also modified by newer active batch(es): ${overlap.newerActiveBatchIds.join(", ")}.
8361
+
8362
+ Rolling back will restore pre-batch data and previous publishing status from before "${batchId}", overwriting newer changes on those entries.
8363
+
8364
+ Are you sure you want to proceed?` : `Are you sure you want to roll back all changes made in batch "${batchId}"?`;
8365
+ if (!window.confirm(confirmMessage)) {
8352
8366
  return;
8353
8367
  }
8354
8368
  try {
8355
8369
  setRollingBackBatchId(batchId);
8356
- const res = await post(`/bulk-updater/audit/${batchId}/rollback`);
8370
+ const res = await post(
8371
+ `/bulk-updater/audit/${batchId}/rollback`,
8372
+ overlap?.hasOverlap ? { confirmOverwrite: true } : void 0
8373
+ );
8357
8374
  if (res.data && res.data.success) {
8358
8375
  toggleNotification({
8359
8376
  type: "success",
@@ -8368,9 +8385,13 @@ const BulkUpdater = () => {
8368
8385
  });
8369
8386
  }
8370
8387
  } catch (err) {
8388
+ const errMsg = err.response?.data?.error || err.message || "Rollback encountered an error.";
8389
+ if (typeof errMsg === "string" && errMsg.includes("confirmOverwrite")) {
8390
+ await fetchAuditHistory();
8391
+ }
8371
8392
  toggleNotification({
8372
8393
  type: "danger",
8373
- message: err.response?.data?.error || err.message || "Rollback encountered an error."
8394
+ message: errMsg
8374
8395
  });
8375
8396
  } finally {
8376
8397
  setRollingBackBatchId(null);
@@ -8513,7 +8534,7 @@ const BulkUpdater = () => {
8513
8534
  children: "Validation & Quota Rules"
8514
8535
  }
8515
8536
  ),
8516
- (permissions.canCsvExport || permissions.canCsvImport) && /* @__PURE__ */ jsxRuntime.jsx(
8537
+ canAnyCsvAccess && /* @__PURE__ */ jsxRuntime.jsx(
8517
8538
  designSystem.Button,
8518
8539
  {
8519
8540
  variant: activeTab === "csv" ? "default" : "tertiary",
@@ -8532,7 +8553,7 @@ const BulkUpdater = () => {
8532
8553
  }
8533
8554
  ) })
8534
8555
  ] }),
8535
- !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." }) }),
8556
+ !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
8557
  activeTab === "editor" && permissions.canAuditRollback && latestActiveBatch && !updateSummary && /* @__PURE__ */ jsxRuntime.jsx(
8537
8558
  designSystem.Box,
8538
8559
  {
@@ -10141,9 +10162,12 @@ const BulkUpdater = () => {
10141
10162
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tbody, { children: sortedAuditHistory.map((rec) => {
10142
10163
  const isExpanded = expandedDiffBatchId === rec.batchId;
10143
10164
  const dateStr = new Date(rec.executedAt).toLocaleString();
10144
- const isLatestEligible = Boolean(
10145
- rec.isLatestEligible ?? (latestCompletedBatch && rec.batchId === latestCompletedBatch.batchId && !latestCompletedBatch.isRolledBack)
10165
+ const canRollbackRow = Boolean(
10166
+ rec.isRollbackEligible ?? (!rec.isRolledBack && (!Array.isArray(rec.diffs) || rec.diffs.length === 0 || rec.diffs.some(
10167
+ (d) => d?.status === "updated" && d?.uid && d?.documentId && d?.attribute
10168
+ )))
10146
10169
  );
10170
+ const hasOverlapWarning = Boolean(!rec.isRolledBack && rec.overlapWarning?.hasOverlap);
10147
10171
  return /* @__PURE__ */ jsxRuntime.jsxs(React__default.default.Fragment, { children: [
10148
10172
  /* @__PURE__ */ jsxRuntime.jsxs(
10149
10173
  designSystem.Tr,
@@ -10221,7 +10245,20 @@ const BulkUpdater = () => {
10221
10245
  " by ",
10222
10246
  rec.rolledBackBy || "Admin"
10223
10247
  ] })
10224
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "success100", textColor: "success700", children: "ACTIVE (APPLIED)" }) }),
10248
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
10249
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "success100", textColor: "success700", children: "ACTIVE (APPLIED)" }),
10250
+ hasOverlapWarning && /* @__PURE__ */ jsxRuntime.jsx(
10251
+ designSystem.Typography,
10252
+ {
10253
+ variant: "pi",
10254
+ textColor: "warning600",
10255
+ display: "block",
10256
+ style: { wordBreak: "break-word", marginTop: 2 },
10257
+ title: `Newer active batch(es) modified overlapping entries: ${rec.overlapWarning?.newerActiveBatchIds.join(", ")}`,
10258
+ children: "Newer edits exist on shared entries"
10259
+ }
10260
+ )
10261
+ ] }) }),
10225
10262
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { style: { minWidth: 160, textAlign: "right", whiteSpace: "nowrap" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, justifyContent: "flex-end", children: [
10226
10263
  permissions.canAuditDetails && /* @__PURE__ */ jsxRuntime.jsx(
10227
10264
  designSystem.Button,
@@ -10245,19 +10282,26 @@ const BulkUpdater = () => {
10245
10282
  children: isExpanded ? "Hide Diffs" : "View Diffs"
10246
10283
  }
10247
10284
  ),
10248
- !rec.isRolledBack && permissions.canAuditRollback && (isLatestEligible ? /* @__PURE__ */ jsxRuntime.jsx(
10249
- designSystem.Button,
10285
+ !rec.isRolledBack && permissions.canAuditRollback && (canRollbackRow ? /* @__PURE__ */ jsxRuntime.jsx(
10286
+ "span",
10250
10287
  {
10251
- variant: "danger",
10252
- size: "S",
10253
- loading: rollingBackBatchId === rec.batchId,
10254
- onClick: () => handleRollback(rec.batchId),
10255
- children: "Rollback"
10288
+ title: hasOverlapWarning ? `Historical rollback will overwrite newer edits from: ${rec.overlapWarning?.newerActiveBatchIds.join(", ")}` : "Roll back changes made by this batch",
10289
+ style: { display: "inline-flex" },
10290
+ children: /* @__PURE__ */ jsxRuntime.jsx(
10291
+ designSystem.Button,
10292
+ {
10293
+ variant: "danger",
10294
+ size: "S",
10295
+ loading: rollingBackBatchId === rec.batchId,
10296
+ onClick: () => handleRollback(rec.batchId),
10297
+ children: "Rollback"
10298
+ }
10299
+ )
10256
10300
  }
10257
10301
  ) : /* @__PURE__ */ jsxRuntime.jsx(
10258
10302
  "span",
10259
10303
  {
10260
- title: "Only the latest completed update can be rolled back.",
10304
+ title: "This batch has no revertible field updates.",
10261
10305
  style: { display: "inline-flex", cursor: "not-allowed" },
10262
10306
  children: /* @__PURE__ */ jsxRuntime.jsx(
10263
10307
  designSystem.Button,
@@ -11088,4 +11132,4 @@ exports.parseDynamicZonePath = parseDynamicZonePath;
11088
11132
  exports.registerRelationOptions = registerRelationOptions;
11089
11133
  exports.resolveEffectiveRelationMeta = resolveEffectiveRelationMeta;
11090
11134
  exports.resolveEntityLabel = resolveEntityLabel;
11091
- //# sourceMappingURL=BulkUpdater-Cnzgw4UH.js.map
11135
+ //# sourceMappingURL=BulkUpdater-BdsfPqoX.js.map