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
@@ -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-DUtycMm1.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;
@@ -2157,7 +2160,8 @@ function CsvManagerTab() {
2157
2160
  const res = await post("/bulk-updater/csv/validate-preflight", {
2158
2161
  uid: selectedUid,
2159
2162
  rows: enrichedRecords,
2160
- mode: importMode
2163
+ mode: importMode,
2164
+ ...originalHeaders.length > 0 ? { originalHeaders } : {}
2161
2165
  });
2162
2166
  if (res.data && res.data.success) {
2163
2167
  setPreflightReport(res.data);
@@ -2190,6 +2194,9 @@ function CsvManagerTab() {
2190
2194
  };
2191
2195
  const submitBatchWithMode = async (executionMode, forceImmediate = false) => {
2192
2196
  if (!selectedUid || allParsedRecords.length === 0) return;
2197
+ if (executionMode === "maker_checker" && !permissions.canCsvSubmitForChecker) return;
2198
+ if (executionMode === "queue_offpeak" && !permissions.canCsvQueueForOffPeak) return;
2199
+ if (executionMode === "immediate" && !permissions.canCsvForceRunNow) return;
2193
2200
  if (executionMode === "immediate") {
2194
2201
  setShowConfirmModal(false);
2195
2202
  await handleExecuteImport();
@@ -2277,7 +2284,7 @@ function CsvManagerTab() {
2277
2284
  variant: "tertiary",
2278
2285
  startIcon: /* @__PURE__ */ jsx(Download, {}),
2279
2286
  onClick: handleDownloadTemplate,
2280
- disabled: !selectedUid || downloadingTemplate || !permissions.canCsvExport && !permissions.canCsvImport,
2287
+ disabled: !selectedUid || downloadingTemplate || !canAnyCsvAccess,
2281
2288
  loading: downloadingTemplate,
2282
2289
  children: "Download Sample CSV Template"
2283
2290
  }
@@ -2691,10 +2698,10 @@ function CsvManagerTab() {
2691
2698
  )
2692
2699
  ] })
2693
2700
  ] }),
2694
- 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." }) }) }),
2701
+ 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 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." }) }) }),
2695
2702
  false
2696
2703
  ] }),
2697
- permissions.canCsvImport && /* @__PURE__ */ jsxs(Box, { padding: 5, background: "neutral100", hasRadius: true, children: [
2704
+ canAnyCsvImportSection && /* @__PURE__ */ jsxs(Box, { padding: 5, background: "neutral100", hasRadius: true, children: [
2698
2705
  /* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "h3", fontWeight: "bold", marginBottom: 2, children: "2. Import & Batch Override CSV" }),
2699
2706
  /* @__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
2707
  /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, wrap: "wrap", gap: 4, children: [
@@ -2984,7 +2991,7 @@ function CsvManagerTab() {
2984
2991
  ] })
2985
2992
  ] }),
2986
2993
  /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", marginTop: 4, wrap: "wrap", gap: 3, children: [
2987
- /* @__PURE__ */ jsx(
2994
+ permissions.canCsvPreFlightDryRun ? /* @__PURE__ */ jsx(
2988
2995
  Button,
2989
2996
  {
2990
2997
  variant: "secondary",
@@ -2995,8 +3002,8 @@ function CsvManagerTab() {
2995
3002
  disabled: importing,
2996
3003
  children: "Run Pre-Flight Dry Run"
2997
3004
  }
2998
- ),
2999
- /* @__PURE__ */ jsxs(
3005
+ ) : /* @__PURE__ */ jsx(Box, {}),
3006
+ (canAnyCsvImportExecution || permissions.canCsvImport) && /* @__PURE__ */ jsxs(
3000
3007
  Button,
3001
3008
  {
3002
3009
  variant: "default",
@@ -3468,8 +3475,8 @@ function CsvManagerTab() {
3468
3475
  },
3469
3476
  children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", gap: 3, style: { width: "100%" }, children: [
3470
3477
  /* @__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(
3478
+ /* @__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: [
3479
+ permissions.canCsvSubmitForChecker && /* @__PURE__ */ jsx(
3473
3480
  Button,
3474
3481
  {
3475
3482
  variant: executionWindow?.isBusinessHours ? "default" : "secondary",
@@ -3481,7 +3488,7 @@ function CsvManagerTab() {
3481
3488
  }
3482
3489
  ),
3483
3490
  executionWindow?.isBusinessHours ? /* @__PURE__ */ jsxs(Fragment, { children: [
3484
- /* @__PURE__ */ jsxs(
3491
+ permissions.canCsvQueueForOffPeak && /* @__PURE__ */ jsxs(
3485
3492
  Button,
3486
3493
  {
3487
3494
  variant: "secondary",
@@ -3496,7 +3503,7 @@ function CsvManagerTab() {
3496
3503
  ]
3497
3504
  }
3498
3505
  ),
3499
- /* @__PURE__ */ jsx(
3506
+ permissions.canCsvForceRunNow && /* @__PURE__ */ jsx(
3500
3507
  Button,
3501
3508
  {
3502
3509
  variant: "danger-light",
@@ -3507,7 +3514,7 @@ function CsvManagerTab() {
3507
3514
  children: "Force Run Now"
3508
3515
  }
3509
3516
  )
3510
- ] }) : /* @__PURE__ */ jsx(
3517
+ ] }) : permissions.canCsvForceRunNow && /* @__PURE__ */ jsx(
3511
3518
  Button,
3512
3519
  {
3513
3520
  variant: "default",
@@ -3518,7 +3525,7 @@ function CsvManagerTab() {
3518
3525
  children: "Confirm & Execute Now"
3519
3526
  }
3520
3527
  )
3521
- ] })
3528
+ ] }) })
3522
3529
  ] })
3523
3530
  }
3524
3531
  );
@@ -6530,6 +6537,7 @@ const BulkUpdater = () => {
6530
6537
  const { toggleNotification } = useNotification();
6531
6538
  const permissions = useBulkUpdaterRBAC();
6532
6539
  const canAnyUpdateExecution = permissions.canWorkspaceSubmitForChecker || permissions.canWorkspaceForceRunNow || permissions.canWorkspaceQueueForOffPeak;
6540
+ const canAnyCsvAccess = permissions.canCsvExport || permissions.canCsvImport || permissions.canCsvSubmitForChecker || permissions.canCsvForceRunNow || permissions.canCsvQueueForOffPeak || permissions.canCsvPreFlightDryRun;
6533
6541
  const getInitialTab = () => {
6534
6542
  try {
6535
6543
  const params = new URLSearchParams(window.location.search);
@@ -6539,7 +6547,7 @@ const BulkUpdater = () => {
6539
6547
  }
6540
6548
  if (!permissions.isLoading) {
6541
6549
  if (permissions.canWorkspaceView) return "editor";
6542
- if (permissions.canCsvExport || permissions.canCsvImport) return "csv";
6550
+ if (canAnyCsvAccess) return "csv";
6543
6551
  if (permissions.canAuditView || permissions.canApprovalView) return "audit";
6544
6552
  if (permissions.canValidationView) return "rules";
6545
6553
  }
@@ -6561,12 +6569,12 @@ const BulkUpdater = () => {
6561
6569
  if (tab === "editor") return permissions.canWorkspaceView;
6562
6570
  if (tab === "audit") return permissions.canAuditView || permissions.canApprovalView;
6563
6571
  if (tab === "rules") return permissions.canValidationView;
6564
- if (tab === "csv") return permissions.canCsvExport || permissions.canCsvImport;
6572
+ if (tab === "csv") return canAnyCsvAccess;
6565
6573
  return false;
6566
6574
  };
6567
6575
  if (!isTabAllowed(activeTab)) {
6568
6576
  if (permissions.canWorkspaceView) setActiveTab("editor");
6569
- else if (permissions.canCsvExport || permissions.canCsvImport) setActiveTab("csv");
6577
+ else if (canAnyCsvAccess) setActiveTab("csv");
6570
6578
  else if (permissions.canAuditView || permissions.canApprovalView) setActiveTab("audit");
6571
6579
  else if (permissions.canValidationView) setActiveTab("rules");
6572
6580
  }
@@ -7016,7 +7024,7 @@ const BulkUpdater = () => {
7016
7024
  };
7017
7025
  useEffect(() => {
7018
7026
  if (permissions.isLoading) return;
7019
- if (permissions.canWorkspaceView || permissions.canCsvExport || permissions.canCsvImport || permissions.canValidationView) {
7027
+ if (permissions.canWorkspaceView || canAnyCsvAccess || permissions.canValidationView) {
7020
7028
  fetchModels();
7021
7029
  }
7022
7030
  if (permissions.canAuditView) {
@@ -7031,8 +7039,7 @@ const BulkUpdater = () => {
7031
7039
  }, [
7032
7040
  permissions.isLoading,
7033
7041
  permissions.canWorkspaceView,
7034
- permissions.canCsvExport,
7035
- permissions.canCsvImport,
7042
+ canAnyCsvAccess,
7036
7043
  permissions.canValidationView,
7037
7044
  permissions.canAuditView,
7038
7045
  permissions.canApprovalView
@@ -8344,12 +8351,22 @@ const BulkUpdater = () => {
8344
8351
  }
8345
8352
  };
8346
8353
  const handleRollback = async (batchId) => {
8347
- if (!window.confirm(`Are you sure you want to roll back all changes made in batch "${batchId}"?`)) {
8354
+ const targetRec = auditHistory.find((r) => r.batchId === batchId);
8355
+ const overlap = targetRec?.overlapWarning;
8356
+ const confirmMessage = overlap?.hasOverlap ? `WARNING: Batch "${batchId}" touches ${overlap.affectedEntryCount} entry/entries that were also modified by newer active batch(es): ${overlap.newerActiveBatchIds.join(", ")}.
8357
+
8358
+ Rolling back will restore pre-batch data and previous publishing status from before "${batchId}", overwriting newer changes on those entries.
8359
+
8360
+ Are you sure you want to proceed?` : `Are you sure you want to roll back all changes made in batch "${batchId}"?`;
8361
+ if (!window.confirm(confirmMessage)) {
8348
8362
  return;
8349
8363
  }
8350
8364
  try {
8351
8365
  setRollingBackBatchId(batchId);
8352
- const res = await post(`/bulk-updater/audit/${batchId}/rollback`);
8366
+ const res = await post(
8367
+ `/bulk-updater/audit/${batchId}/rollback`,
8368
+ overlap?.hasOverlap ? { confirmOverwrite: true } : void 0
8369
+ );
8353
8370
  if (res.data && res.data.success) {
8354
8371
  toggleNotification({
8355
8372
  type: "success",
@@ -8364,9 +8381,13 @@ const BulkUpdater = () => {
8364
8381
  });
8365
8382
  }
8366
8383
  } catch (err) {
8384
+ const errMsg = err.response?.data?.error || err.message || "Rollback encountered an error.";
8385
+ if (typeof errMsg === "string" && errMsg.includes("confirmOverwrite")) {
8386
+ await fetchAuditHistory();
8387
+ }
8367
8388
  toggleNotification({
8368
8389
  type: "danger",
8369
- message: err.response?.data?.error || err.message || "Rollback encountered an error."
8390
+ message: errMsg
8370
8391
  });
8371
8392
  } finally {
8372
8393
  setRollingBackBatchId(null);
@@ -8509,7 +8530,7 @@ const BulkUpdater = () => {
8509
8530
  children: "Validation & Quota Rules"
8510
8531
  }
8511
8532
  ),
8512
- (permissions.canCsvExport || permissions.canCsvImport) && /* @__PURE__ */ jsx(
8533
+ canAnyCsvAccess && /* @__PURE__ */ jsx(
8513
8534
  Button,
8514
8535
  {
8515
8536
  variant: activeTab === "csv" ? "default" : "tertiary",
@@ -8528,7 +8549,7 @@ const BulkUpdater = () => {
8528
8549
  }
8529
8550
  ) })
8530
8551
  ] }),
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." }) }),
8552
+ !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
8553
  activeTab === "editor" && permissions.canAuditRollback && latestActiveBatch && !updateSummary && /* @__PURE__ */ jsx(
8533
8554
  Box,
8534
8555
  {
@@ -10137,9 +10158,12 @@ const BulkUpdater = () => {
10137
10158
  /* @__PURE__ */ jsx(Tbody, { children: sortedAuditHistory.map((rec) => {
10138
10159
  const isExpanded = expandedDiffBatchId === rec.batchId;
10139
10160
  const dateStr = new Date(rec.executedAt).toLocaleString();
10140
- const isLatestEligible = Boolean(
10141
- rec.isLatestEligible ?? (latestCompletedBatch && rec.batchId === latestCompletedBatch.batchId && !latestCompletedBatch.isRolledBack)
10161
+ const canRollbackRow = Boolean(
10162
+ rec.isRollbackEligible ?? (!rec.isRolledBack && (!Array.isArray(rec.diffs) || rec.diffs.length === 0 || rec.diffs.some(
10163
+ (d) => d?.status === "updated" && d?.uid && d?.documentId && d?.attribute
10164
+ )))
10142
10165
  );
10166
+ const hasOverlapWarning = Boolean(!rec.isRolledBack && rec.overlapWarning?.hasOverlap);
10143
10167
  return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
10144
10168
  /* @__PURE__ */ jsxs(
10145
10169
  Tr,
@@ -10217,7 +10241,20 @@ const BulkUpdater = () => {
10217
10241
  " by ",
10218
10242
  rec.rolledBackBy || "Admin"
10219
10243
  ] })
10220
- ] }) : /* @__PURE__ */ jsx(Badge, { backgroundColor: "success100", textColor: "success700", children: "ACTIVE (APPLIED)" }) }),
10244
+ ] }) : /* @__PURE__ */ jsxs(Box, { children: [
10245
+ /* @__PURE__ */ jsx(Badge, { backgroundColor: "success100", textColor: "success700", children: "ACTIVE (APPLIED)" }),
10246
+ hasOverlapWarning && /* @__PURE__ */ jsx(
10247
+ Typography,
10248
+ {
10249
+ variant: "pi",
10250
+ textColor: "warning600",
10251
+ display: "block",
10252
+ style: { wordBreak: "break-word", marginTop: 2 },
10253
+ title: `Newer active batch(es) modified overlapping entries: ${rec.overlapWarning?.newerActiveBatchIds.join(", ")}`,
10254
+ children: "Newer edits exist on shared entries"
10255
+ }
10256
+ )
10257
+ ] }) }),
10221
10258
  /* @__PURE__ */ jsx(Td, { style: { minWidth: 160, textAlign: "right", whiteSpace: "nowrap" }, children: /* @__PURE__ */ jsxs(Flex, { gap: 2, justifyContent: "flex-end", children: [
10222
10259
  permissions.canAuditDetails && /* @__PURE__ */ jsx(
10223
10260
  Button,
@@ -10241,19 +10278,26 @@ const BulkUpdater = () => {
10241
10278
  children: isExpanded ? "Hide Diffs" : "View Diffs"
10242
10279
  }
10243
10280
  ),
10244
- !rec.isRolledBack && permissions.canAuditRollback && (isLatestEligible ? /* @__PURE__ */ jsx(
10245
- Button,
10281
+ !rec.isRolledBack && permissions.canAuditRollback && (canRollbackRow ? /* @__PURE__ */ jsx(
10282
+ "span",
10246
10283
  {
10247
- variant: "danger",
10248
- size: "S",
10249
- loading: rollingBackBatchId === rec.batchId,
10250
- onClick: () => handleRollback(rec.batchId),
10251
- children: "Rollback"
10284
+ title: hasOverlapWarning ? `Historical rollback will overwrite newer edits from: ${rec.overlapWarning?.newerActiveBatchIds.join(", ")}` : "Roll back changes made by this batch",
10285
+ style: { display: "inline-flex" },
10286
+ children: /* @__PURE__ */ jsx(
10287
+ Button,
10288
+ {
10289
+ variant: "danger",
10290
+ size: "S",
10291
+ loading: rollingBackBatchId === rec.batchId,
10292
+ onClick: () => handleRollback(rec.batchId),
10293
+ children: "Rollback"
10294
+ }
10295
+ )
10252
10296
  }
10253
10297
  ) : /* @__PURE__ */ jsx(
10254
10298
  "span",
10255
10299
  {
10256
- title: "Only the latest completed update can be rolled back.",
10300
+ title: "This batch has no revertible field updates.",
10257
10301
  style: { display: "inline-flex", cursor: "not-allowed" },
10258
10302
  children: /* @__PURE__ */ jsx(
10259
10303
  Button,
@@ -11086,4 +11130,4 @@ export {
11086
11130
  resolveEffectiveRelationMeta,
11087
11131
  resolveEntityLabel
11088
11132
  };
11089
- //# sourceMappingURL=BulkUpdater-CV49TvOV.mjs.map
11133
+ //# sourceMappingURL=BulkUpdater-KWmfElh6.mjs.map