strapi-plugin-bulk-updater 1.5.11 → 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.
@@ -3699,6 +3699,7 @@ const BulkUpdater = () => {
3699
3699
  const [pendingBatchesLoading, setPendingBatchesLoading] = useState(false);
3700
3700
  const [approvingBatchId, setApprovingBatchId] = useState(null);
3701
3701
  const [rejectingBatchId, setRejectingBatchId] = useState(null);
3702
+ const [executingNowBatchId, setExecutingNowBatchId] = useState(null);
3702
3703
  const [inspectingPendingBatch, setInspectingPendingBatch] = useState(null);
3703
3704
  const [exportingPendingBatchId, setExportingPendingBatchId] = useState(null);
3704
3705
  const [makerNotesInput, setMakerNotesInput] = useState("");
@@ -3973,6 +3974,9 @@ const BulkUpdater = () => {
3973
3974
  }
3974
3975
  };
3975
3976
  const loadCollectionPage = async (colUid, targetPage, customPageSize, customSortField, customSortOrder, overrideFilterOp, overrideFilterQuery, overrideEntrySearch, autoSelectReturned = true, overrideSearchAttr) => {
3977
+ if (!colUid || !colUid.trim()) {
3978
+ return;
3979
+ }
3976
3980
  const currentPageState = collectionPages[colUid];
3977
3981
  const size = customPageSize || currentPageState?.pageSize || defaultPageSize;
3978
3982
  const currentSort = collectionSorts[colUid] || { field: "createdAt", order: "desc" };
@@ -4146,18 +4150,29 @@ const BulkUpdater = () => {
4146
4150
  }, [selectedCollectionUid, searchAttribute, filterOperator, filterQuery, entrySearch, useRegex, regexPattern]);
4147
4151
  const KEY_SEP = "@@@";
4148
4152
  const selectedCol = useMemo(() => {
4149
- if (!collections.length) return null;
4150
- return collections.find((c) => c.uid === selectedCollectionUid) || collections[0] || null;
4153
+ if (!collections.length || !selectedCollectionUid) return null;
4154
+ return collections.find((c) => c.uid === selectedCollectionUid) || null;
4151
4155
  }, [collections, selectedCollectionUid]);
4152
4156
  const handleCollectionChange = (newUid) => {
4153
4157
  if (newUid === selectedCollectionUid) return;
4154
4158
  setSelectedCollectionUid(newUid);
4155
4159
  try {
4156
- localStorage.setItem(LAST_COLLECTION_KEY, newUid);
4160
+ if (newUid) {
4161
+ localStorage.setItem(LAST_COLLECTION_KEY, newUid);
4162
+ } else {
4163
+ localStorage.removeItem(LAST_COLLECTION_KEY);
4164
+ }
4157
4165
  } catch {
4158
4166
  }
4159
4167
  setSelectedEntries({});
4160
4168
  setSearchAttribute("");
4169
+ if (!newUid || !newUid.trim()) {
4170
+ setAttributes([]);
4171
+ setSelectedAttribute("");
4172
+ setSelectedRelationDocId("");
4173
+ setAttributeValue("");
4174
+ return;
4175
+ }
4161
4176
  const targetCol = collections.find((c) => c.uid === newUid);
4162
4177
  const colAttrs = targetCol?.attributes || [];
4163
4178
  setAttributes(colAttrs);
@@ -5385,9 +5400,7 @@ const BulkUpdater = () => {
5385
5400
  e.target.select();
5386
5401
  },
5387
5402
  onChange: (val) => {
5388
- if (val && typeof val === "string") {
5389
- handleCollectionChange(val);
5390
- }
5403
+ handleCollectionChange(val ? String(val) : "");
5391
5404
  },
5392
5405
  children: collections.map((col) => /* @__PURE__ */ jsx(ComboboxOption, { value: col.uid, textValue: `${col.displayName} (${col.uid})`, children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", style: { width: "100%" }, children: [
5393
5406
  /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: col.displayName }),
@@ -7655,4 +7668,4 @@ export {
7655
7668
  getSortOptionsForCollection,
7656
7669
  parseDynamicZonePath
7657
7670
  };
7658
- //# sourceMappingURL=BulkUpdater-7rkObCic.mjs.map
7671
+ //# sourceMappingURL=BulkUpdater-GPpE8YW2.mjs.map