strapi-plugin-bulk-updater 1.5.10 → 1.5.12

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.
@@ -3703,6 +3703,7 @@ const BulkUpdater = () => {
3703
3703
  const [pendingBatchesLoading, setPendingBatchesLoading] = React.useState(false);
3704
3704
  const [approvingBatchId, setApprovingBatchId] = React.useState(null);
3705
3705
  const [rejectingBatchId, setRejectingBatchId] = React.useState(null);
3706
+ const [executingNowBatchId, setExecutingNowBatchId] = React.useState(null);
3706
3707
  const [inspectingPendingBatch, setInspectingPendingBatch] = React.useState(null);
3707
3708
  const [exportingPendingBatchId, setExportingPendingBatchId] = React.useState(null);
3708
3709
  const [makerNotesInput, setMakerNotesInput] = React.useState("");
@@ -3977,6 +3978,9 @@ const BulkUpdater = () => {
3977
3978
  }
3978
3979
  };
3979
3980
  const loadCollectionPage = async (colUid, targetPage, customPageSize, customSortField, customSortOrder, overrideFilterOp, overrideFilterQuery, overrideEntrySearch, autoSelectReturned = true, overrideSearchAttr) => {
3981
+ if (!colUid || !colUid.trim()) {
3982
+ return;
3983
+ }
3980
3984
  const currentPageState = collectionPages[colUid];
3981
3985
  const size = customPageSize || currentPageState?.pageSize || defaultPageSize;
3982
3986
  const currentSort = collectionSorts[colUid] || { field: "createdAt", order: "desc" };
@@ -4150,18 +4154,29 @@ const BulkUpdater = () => {
4150
4154
  }, [selectedCollectionUid, searchAttribute, filterOperator, filterQuery, entrySearch, useRegex, regexPattern]);
4151
4155
  const KEY_SEP = "@@@";
4152
4156
  const selectedCol = React.useMemo(() => {
4153
- if (!collections.length) return null;
4154
- return collections.find((c) => c.uid === selectedCollectionUid) || collections[0] || null;
4157
+ if (!collections.length || !selectedCollectionUid) return null;
4158
+ return collections.find((c) => c.uid === selectedCollectionUid) || null;
4155
4159
  }, [collections, selectedCollectionUid]);
4156
4160
  const handleCollectionChange = (newUid) => {
4157
4161
  if (newUid === selectedCollectionUid) return;
4158
4162
  setSelectedCollectionUid(newUid);
4159
4163
  try {
4160
- localStorage.setItem(LAST_COLLECTION_KEY, newUid);
4164
+ if (newUid) {
4165
+ localStorage.setItem(LAST_COLLECTION_KEY, newUid);
4166
+ } else {
4167
+ localStorage.removeItem(LAST_COLLECTION_KEY);
4168
+ }
4161
4169
  } catch {
4162
4170
  }
4163
4171
  setSelectedEntries({});
4164
4172
  setSearchAttribute("");
4173
+ if (!newUid || !newUid.trim()) {
4174
+ setAttributes([]);
4175
+ setSelectedAttribute("");
4176
+ setSelectedRelationDocId("");
4177
+ setAttributeValue("");
4178
+ return;
4179
+ }
4165
4180
  const targetCol = collections.find((c) => c.uid === newUid);
4166
4181
  const colAttrs = targetCol?.attributes || [];
4167
4182
  setAttributes(colAttrs);
@@ -5389,9 +5404,7 @@ const BulkUpdater = () => {
5389
5404
  e.target.select();
5390
5405
  },
5391
5406
  onChange: (val) => {
5392
- if (val && typeof val === "string") {
5393
- handleCollectionChange(val);
5394
- }
5407
+ handleCollectionChange(val ? String(val) : "");
5395
5408
  },
5396
5409
  children: collections.map((col) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: col.uid, textValue: `${col.displayName} (${col.uid})`, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", style: { width: "100%" }, children: [
5397
5410
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: col.displayName }),
@@ -7657,4 +7670,4 @@ exports.getNestedValue = getNestedValue;
7657
7670
  exports.getPropertyValue = getPropertyValue;
7658
7671
  exports.getSortOptionsForCollection = getSortOptionsForCollection;
7659
7672
  exports.parseDynamicZonePath = parseDynamicZonePath;
7660
- //# sourceMappingURL=BulkUpdater-BlSPmNFG.js.map
7673
+ //# sourceMappingURL=BulkUpdater-VwNHxQId.js.map