strapi-plugin-bulk-updater 1.3.0 → 1.3.3
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.
- package/dist/_chunks/{BulkUpdater-CRvwX326.js → BulkUpdater-C2lw4D0D.js} +367 -404
- package/dist/_chunks/BulkUpdater-C2lw4D0D.js.map +1 -0
- package/dist/_chunks/{BulkUpdater-DowSmA56.mjs → BulkUpdater-CgsqzdyX.mjs} +368 -405
- package/dist/_chunks/BulkUpdater-CgsqzdyX.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +73 -43
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +73 -43
- package/dist/server/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/_chunks/BulkUpdater-CRvwX326.js.map +0 -1
- package/dist/_chunks/BulkUpdater-DowSmA56.mjs.map +0 -1
|
@@ -1689,6 +1689,16 @@ const BulkUpdater = () => {
|
|
|
1689
1689
|
const [bulkExporting, setBulkExporting] = React.useState(false);
|
|
1690
1690
|
const MODELS_CACHE_KEY = "strapi_bulk_updater_models_cache";
|
|
1691
1691
|
const LAST_ATTR_KEY = "strapi_bulk_updater_last_attr";
|
|
1692
|
+
const LAST_COLLECTION_KEY = "strapi_bulk_updater_last_collection";
|
|
1693
|
+
const getInitialCollectionUid = () => {
|
|
1694
|
+
try {
|
|
1695
|
+
const stored = localStorage.getItem(LAST_COLLECTION_KEY);
|
|
1696
|
+
if (stored) return stored;
|
|
1697
|
+
} catch {
|
|
1698
|
+
}
|
|
1699
|
+
return "";
|
|
1700
|
+
};
|
|
1701
|
+
const [selectedCollectionUid, setSelectedCollectionUid] = React.useState(getInitialCollectionUid);
|
|
1692
1702
|
const getInitialAttribute = () => {
|
|
1693
1703
|
try {
|
|
1694
1704
|
const stored = localStorage.getItem(LAST_ATTR_KEY);
|
|
@@ -1747,7 +1757,7 @@ const BulkUpdater = () => {
|
|
|
1747
1757
|
const [filterOperator, setFilterOperator] = React.useState("none");
|
|
1748
1758
|
const [filterQuery, setFilterQuery] = React.useState("");
|
|
1749
1759
|
const [entrySearch, setEntrySearch] = React.useState("");
|
|
1750
|
-
const isFilterActive = Boolean(searchAttribute && searchAttribute !== selectedAttribute) || filterOperator !== "none" && (["empty", "not_empty"].includes(filterOperator) || Boolean(filterQuery.trim())) || Boolean(entrySearch.trim());
|
|
1760
|
+
const isFilterActive = Boolean(searchAttribute && searchAttribute !== selectedAttribute) || filterOperator !== "none" && (["empty", "not_empty"].includes(filterOperator) || Boolean(filterQuery.trim())) || Boolean(entrySearch.trim()) || Boolean(useRegex && regexPattern.trim());
|
|
1751
1761
|
const [lastResults, setLastResults] = React.useState(null);
|
|
1752
1762
|
const [updateSummary, setUpdateSummary] = React.useState(null);
|
|
1753
1763
|
const [collectionPages, setCollectionPages] = React.useState({});
|
|
@@ -1760,6 +1770,7 @@ const BulkUpdater = () => {
|
|
|
1760
1770
|
const [collectionSorts, setCollectionSorts] = React.useState({});
|
|
1761
1771
|
const [collectionColumnVisibility, setCollectionColumnVisibility] = React.useState({});
|
|
1762
1772
|
const [openColumnPickerUid, setOpenColumnPickerUid] = React.useState(null);
|
|
1773
|
+
const [columnSearchTerm, setColumnSearchTerm] = React.useState("");
|
|
1763
1774
|
const toggleColumn = (colUid, colKey, availableCols) => {
|
|
1764
1775
|
setCollectionColumnVisibility((prev) => {
|
|
1765
1776
|
const current = prev[colUid] || availableCols.filter((c) => c.defaultVisible).map((c) => c.key);
|
|
@@ -1830,12 +1841,29 @@ const BulkUpdater = () => {
|
|
|
1830
1841
|
if (data.attributesMeta) {
|
|
1831
1842
|
setAttributesMeta(data.attributesMeta);
|
|
1832
1843
|
}
|
|
1844
|
+
let resolvedColUid = selectedCollectionUid;
|
|
1845
|
+
let storedCol = null;
|
|
1846
|
+
try {
|
|
1847
|
+
storedCol = localStorage.getItem(LAST_COLLECTION_KEY);
|
|
1848
|
+
} catch {
|
|
1849
|
+
}
|
|
1850
|
+
if (!resolvedColUid || !cols.some((c) => c.uid === resolvedColUid)) {
|
|
1851
|
+
resolvedColUid = storedCol && cols.some((c) => c.uid === storedCol) ? storedCol : cols[0]?.uid || "";
|
|
1852
|
+
}
|
|
1853
|
+
setSelectedCollectionUid(resolvedColUid);
|
|
1854
|
+
try {
|
|
1855
|
+
if (resolvedColUid) localStorage.setItem(LAST_COLLECTION_KEY, resolvedColUid);
|
|
1856
|
+
} catch {
|
|
1857
|
+
}
|
|
1858
|
+
const activeCol = cols.find((c) => c.uid === resolvedColUid) || cols[0];
|
|
1859
|
+
const activeAttrs = activeCol?.attributes || [];
|
|
1860
|
+
setAttributes(activeAttrs);
|
|
1833
1861
|
let storedAttr = null;
|
|
1834
1862
|
try {
|
|
1835
1863
|
storedAttr = localStorage.getItem(LAST_ATTR_KEY);
|
|
1836
1864
|
} catch {
|
|
1837
1865
|
}
|
|
1838
|
-
const resolvedAttr = storedAttr &&
|
|
1866
|
+
const resolvedAttr = storedAttr && activeAttrs.includes(storedAttr) ? storedAttr : selectedAttribute && activeAttrs.includes(selectedAttribute) ? selectedAttribute : activeAttrs[0] || "";
|
|
1839
1867
|
setSelectedAttribute(resolvedAttr);
|
|
1840
1868
|
if (resolvedAttr && data.relationsMeta && data.relationsMeta[resolvedAttr]) {
|
|
1841
1869
|
fetchRelationOptions(data.relationsMeta[resolvedAttr].targetUid);
|
|
@@ -2018,36 +2046,60 @@ const BulkUpdater = () => {
|
|
|
2018
2046
|
return;
|
|
2019
2047
|
}
|
|
2020
2048
|
const timer = setTimeout(() => {
|
|
2021
|
-
if (
|
|
2022
|
-
const isFilterActiveNow = Boolean(searchAttribute && searchAttribute !== selectedAttribute) || filterOperator !== "none" && (["empty", "not_empty"].includes(filterOperator) || Boolean(filterQuery.trim())) || Boolean(entrySearch.trim());
|
|
2049
|
+
if (selectedCollectionUid) {
|
|
2050
|
+
const isFilterActiveNow = Boolean(searchAttribute && searchAttribute !== selectedAttribute) || filterOperator !== "none" && (["empty", "not_empty"].includes(filterOperator) || Boolean(filterQuery.trim())) || Boolean(entrySearch.trim()) || Boolean(useRegex && regexPattern.trim());
|
|
2023
2051
|
if (isFilterActiveNow) {
|
|
2024
2052
|
setSelectedEntries({});
|
|
2025
2053
|
}
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
void 0,
|
|
2039
|
-
filterOperator,
|
|
2040
|
-
filterQuery,
|
|
2041
|
-
entrySearch,
|
|
2042
|
-
true,
|
|
2043
|
-
searchAttribute
|
|
2044
|
-
);
|
|
2045
|
-
});
|
|
2054
|
+
loadCollectionPage(
|
|
2055
|
+
selectedCollectionUid,
|
|
2056
|
+
1,
|
|
2057
|
+
void 0,
|
|
2058
|
+
void 0,
|
|
2059
|
+
void 0,
|
|
2060
|
+
filterOperator,
|
|
2061
|
+
filterQuery,
|
|
2062
|
+
entrySearch,
|
|
2063
|
+
true,
|
|
2064
|
+
searchAttribute
|
|
2065
|
+
);
|
|
2046
2066
|
}
|
|
2047
2067
|
}, 350);
|
|
2048
2068
|
return () => clearTimeout(timer);
|
|
2049
|
-
}, [searchAttribute, filterOperator, filterQuery, entrySearch]);
|
|
2069
|
+
}, [selectedCollectionUid, searchAttribute, filterOperator, filterQuery, entrySearch, useRegex, regexPattern]);
|
|
2050
2070
|
const KEY_SEP = "@@@";
|
|
2071
|
+
const selectedCol = React.useMemo(() => {
|
|
2072
|
+
if (!collections.length) return null;
|
|
2073
|
+
return collections.find((c) => c.uid === selectedCollectionUid) || collections[0] || null;
|
|
2074
|
+
}, [collections, selectedCollectionUid]);
|
|
2075
|
+
const handleCollectionChange = (newUid) => {
|
|
2076
|
+
if (newUid === selectedCollectionUid) return;
|
|
2077
|
+
setSelectedCollectionUid(newUid);
|
|
2078
|
+
try {
|
|
2079
|
+
localStorage.setItem(LAST_COLLECTION_KEY, newUid);
|
|
2080
|
+
} catch {
|
|
2081
|
+
}
|
|
2082
|
+
setSelectedEntries({});
|
|
2083
|
+
setSearchAttribute("");
|
|
2084
|
+
setSearchAttributeSearch("");
|
|
2085
|
+
const targetCol = collections.find((c) => c.uid === newUid);
|
|
2086
|
+
const colAttrs = targetCol?.attributes || [];
|
|
2087
|
+
setAttributes(colAttrs);
|
|
2088
|
+
if (!colAttrs.includes(selectedAttribute)) {
|
|
2089
|
+
const newAttr = colAttrs[0] || "";
|
|
2090
|
+
setSelectedAttribute(newAttr);
|
|
2091
|
+
try {
|
|
2092
|
+
localStorage.setItem(LAST_ATTR_KEY, newAttr);
|
|
2093
|
+
} catch {
|
|
2094
|
+
}
|
|
2095
|
+
if (newAttr && relationsMeta[newAttr]) {
|
|
2096
|
+
fetchRelationOptions(relationsMeta[newAttr].targetUid);
|
|
2097
|
+
} else {
|
|
2098
|
+
setSelectedRelationDocId("");
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
loadCollectionPage(newUid, 1, void 0, void 0, void 0, filterOperator, filterQuery, entrySearch, true, "");
|
|
2102
|
+
};
|
|
2051
2103
|
const handleAttributeChange = (newAttr) => {
|
|
2052
2104
|
if (newAttr !== selectedAttribute) {
|
|
2053
2105
|
setSelectedAttribute(newAttr);
|
|
@@ -2070,56 +2122,23 @@ const BulkUpdater = () => {
|
|
|
2070
2122
|
} else {
|
|
2071
2123
|
setRelationOptions([]);
|
|
2072
2124
|
}
|
|
2073
|
-
if (newAttr) {
|
|
2074
|
-
|
|
2075
|
-
(col) => visibleTypeUids[col.uid] !== false && col.attributes.includes(newAttr) && (!collectionPages[col.uid]?.entries || collectionPages[col.uid].entries.length === 0)
|
|
2076
|
-
);
|
|
2077
|
-
collectionsToLoad.forEach((col) => {
|
|
2078
|
-
loadCollectionPage(col.uid, 1);
|
|
2079
|
-
});
|
|
2125
|
+
if (newAttr && selectedCollectionUid) {
|
|
2126
|
+
loadCollectionPage(selectedCollectionUid, 1);
|
|
2080
2127
|
}
|
|
2081
2128
|
}
|
|
2082
2129
|
};
|
|
2083
|
-
const filteredCollections =
|
|
2084
|
-
|
|
2085
|
-
);
|
|
2086
|
-
const supportedCollections = React.useMemo(() => {
|
|
2087
|
-
return collections.filter((c) => c.attributes.includes(selectedAttribute));
|
|
2088
|
-
}, [collections, selectedAttribute]);
|
|
2089
|
-
const unsupportedCollections = React.useMemo(() => {
|
|
2090
|
-
return collections.filter((c) => !c.attributes.includes(selectedAttribute));
|
|
2091
|
-
}, [collections, selectedAttribute]);
|
|
2092
|
-
const handleFocusOnlySupported = () => {
|
|
2093
|
-
const newVis = {};
|
|
2094
|
-
collections.forEach((c) => {
|
|
2095
|
-
newVis[c.uid] = c.attributes.includes(selectedAttribute);
|
|
2096
|
-
});
|
|
2097
|
-
setVisibleTypeUids(newVis);
|
|
2098
|
-
toggleNotification({
|
|
2099
|
-
type: "info",
|
|
2100
|
-
message: `Workspace focused: Showing ${supportedCollections.length} of ${collections.length} collections supporting "${selectedAttribute}".`
|
|
2101
|
-
});
|
|
2102
|
-
};
|
|
2103
|
-
const handleShowAllTypes = () => {
|
|
2104
|
-
const newVis = {};
|
|
2105
|
-
collections.forEach((c) => {
|
|
2106
|
-
newVis[c.uid] = true;
|
|
2107
|
-
});
|
|
2108
|
-
setVisibleTypeUids(newVis);
|
|
2109
|
-
};
|
|
2110
|
-
const handleHideAllTypes = () => {
|
|
2111
|
-
const newVis = {};
|
|
2112
|
-
collections.forEach((c) => {
|
|
2113
|
-
newVis[c.uid] = false;
|
|
2114
|
-
});
|
|
2115
|
-
setVisibleTypeUids(newVis);
|
|
2116
|
-
};
|
|
2130
|
+
const filteredCollections = React.useMemo(() => {
|
|
2131
|
+
return selectedCol ? [selectedCol] : [];
|
|
2132
|
+
}, [selectedCol]);
|
|
2117
2133
|
const [attributeSearch, setAttributeSearch] = React.useState("");
|
|
2118
2134
|
const [searchAttributeSearch, setSearchAttributeSearch] = React.useState("");
|
|
2119
2135
|
const getAttrDepth = (attr) => attributesMeta[attr]?.depth ?? (attr.includes(".") ? attr.split(".").length - 1 : 0);
|
|
2136
|
+
const availableColAttributes = React.useMemo(() => {
|
|
2137
|
+
return selectedCol?.attributes || attributes || [];
|
|
2138
|
+
}, [selectedCol, attributes]);
|
|
2120
2139
|
const depthFilteredAttributes = React.useMemo(() => {
|
|
2121
|
-
return
|
|
2122
|
-
}, [
|
|
2140
|
+
return availableColAttributes.filter((attr) => getAttrDepth(attr) <= componentDepth);
|
|
2141
|
+
}, [availableColAttributes, componentDepth, attributesMeta]);
|
|
2123
2142
|
const filteredAttributes = React.useMemo(() => {
|
|
2124
2143
|
if (!attributeSearch.trim()) {
|
|
2125
2144
|
return depthFilteredAttributes;
|
|
@@ -2228,15 +2247,6 @@ const BulkUpdater = () => {
|
|
|
2228
2247
|
});
|
|
2229
2248
|
}
|
|
2230
2249
|
};
|
|
2231
|
-
const handleGlobalPageSizeChange = (newSize) => {
|
|
2232
|
-
const capped = Math.min(500, Math.max(1, newSize));
|
|
2233
|
-
setDefaultPageSize(capped);
|
|
2234
|
-
collections.forEach((col) => {
|
|
2235
|
-
if (!col.isSingleType) {
|
|
2236
|
-
loadCollectionPage(col.uid, 1, capped);
|
|
2237
|
-
}
|
|
2238
|
-
});
|
|
2239
|
-
};
|
|
2240
2250
|
const handleCollectionPageSizeChange = (colUid, newSize) => {
|
|
2241
2251
|
const capped = Math.min(500, Math.max(1, newSize));
|
|
2242
2252
|
loadCollectionPage(colUid, 1, capped);
|
|
@@ -2261,6 +2271,16 @@ const BulkUpdater = () => {
|
|
|
2261
2271
|
}));
|
|
2262
2272
|
};
|
|
2263
2273
|
const entryMatchesFilter = (entry, attr) => {
|
|
2274
|
+
if (useRegex && regexPattern.trim()) {
|
|
2275
|
+
try {
|
|
2276
|
+
const regex = new RegExp(regexPattern, "i");
|
|
2277
|
+
const targetSearchVal = formatDisplayValue(getNestedValue(entry, attr));
|
|
2278
|
+
if (!regex.test(targetSearchVal)) {
|
|
2279
|
+
return false;
|
|
2280
|
+
}
|
|
2281
|
+
} catch {
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2264
2284
|
if (filterOperator === "none") return true;
|
|
2265
2285
|
const val = getNestedValue(entry, attr);
|
|
2266
2286
|
const displayStr = formatDisplayValue(val);
|
|
@@ -2323,6 +2343,7 @@ const BulkUpdater = () => {
|
|
|
2323
2343
|
setFilterOperator("none");
|
|
2324
2344
|
setFilterQuery("");
|
|
2325
2345
|
setEntrySearch("");
|
|
2346
|
+
setRegexPattern("");
|
|
2326
2347
|
setSelectedEntries({});
|
|
2327
2348
|
collections.forEach((col) => {
|
|
2328
2349
|
loadCollectionPage(col.uid, 1, void 0, void 0, void 0, "none", "", "", false, "");
|
|
@@ -3144,8 +3165,29 @@ const BulkUpdater = () => {
|
|
|
3144
3165
|
))
|
|
3145
3166
|
] })
|
|
3146
3167
|
] }),
|
|
3147
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap:
|
|
3148
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: {
|
|
3168
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "flex-end", wrap: "wrap", children: [
|
|
3169
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 280, minWidth: 230 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3170
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Collection Type" }),
|
|
3171
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3172
|
+
designSystem.Combobox,
|
|
3173
|
+
{
|
|
3174
|
+
autocomplete: "none",
|
|
3175
|
+
placeholder: "Select Collection Type...",
|
|
3176
|
+
value: selectedCollectionUid || void 0,
|
|
3177
|
+
onChange: (val) => {
|
|
3178
|
+
if (val && typeof val === "string") {
|
|
3179
|
+
handleCollectionChange(val);
|
|
3180
|
+
}
|
|
3181
|
+
},
|
|
3182
|
+
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: [
|
|
3183
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: col.displayName }),
|
|
3184
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 1, alignItems: "center", children: col.isSingleType ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", size: "S", children: "Single" }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "neutral150", textColor: "neutral700", size: "S", children: col.totalEntries !== void 0 ? `${col.totalEntries}` : "" }) })
|
|
3185
|
+
] }) }, col.uid))
|
|
3186
|
+
},
|
|
3187
|
+
`update-col-${selectedCollectionUid}`
|
|
3188
|
+
)
|
|
3189
|
+
] }) }),
|
|
3190
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 280, minWidth: 230 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3149
3191
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Attribute to Update" }),
|
|
3150
3192
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3151
3193
|
designSystem.Combobox,
|
|
@@ -3175,7 +3217,8 @@ const BulkUpdater = () => {
|
|
|
3175
3217
|
}
|
|
3176
3218
|
},
|
|
3177
3219
|
children: memoizedComboboxOptions
|
|
3178
|
-
}
|
|
3220
|
+
},
|
|
3221
|
+
`update-attr-${selectedCollectionUid}-${selectedAttribute}`
|
|
3179
3222
|
)
|
|
3180
3223
|
] }) }),
|
|
3181
3224
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1, minWidth: 340 }, children: relationsMeta[selectedAttribute] ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, style: { width: "100%" }, children: [
|
|
@@ -3344,103 +3387,24 @@ const BulkUpdater = () => {
|
|
|
3344
3387
|
] }),
|
|
3345
3388
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: publishOnApproval ? "When enabled, entries will be published live immediately upon batch execution for draft-enabled content types." : "When disabled, entries will be saved as draft versions without publishing to live visitors." })
|
|
3346
3389
|
] }) }),
|
|
3347
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 4, padding:
|
|
3348
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
onCheckedChange: (checked) => setUseRegex(Boolean(checked)),
|
|
3353
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", children: "Enable Regex Find & Replace" })
|
|
3354
|
-
}
|
|
3355
|
-
) }),
|
|
3356
|
-
useRegex && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1, minWidth: 240 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3357
|
-
designSystem.TextInput,
|
|
3358
|
-
{
|
|
3359
|
-
placeholder: "Regex pattern (e.g. \\b(OldName)\\b)...",
|
|
3360
|
-
value: regexPattern,
|
|
3361
|
-
onChange: (e) => setRegexPattern(e.target.value)
|
|
3362
|
-
}
|
|
3363
|
-
) })
|
|
3364
|
-
] }) }),
|
|
3365
|
-
selectedAttribute && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginTop: 4, padding: 4, background: "neutral100", hasRadius: true, style: { border: "1px solid #eaeaef" }, children: [
|
|
3366
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", wrap: "wrap", gap: 3, children: [
|
|
3367
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", wrap: "wrap", children: [
|
|
3368
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: "Attribute Info:" }),
|
|
3369
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", children: [
|
|
3370
|
-
"Targeting attribute ",
|
|
3371
|
-
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: selectedAttribute }) })
|
|
3372
|
-
] }),
|
|
3373
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "success100", textColor: "success700", children: [
|
|
3374
|
-
"✓ Supported in ",
|
|
3375
|
-
supportedCollections.length,
|
|
3376
|
-
" of ",
|
|
3377
|
-
collections.length,
|
|
3378
|
-
" Collections"
|
|
3379
|
-
] }),
|
|
3380
|
-
unsupportedCollections.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "neutral200", textColor: "neutral700", children: [
|
|
3381
|
-
"— Not in schema: ",
|
|
3382
|
-
unsupportedCollections.length
|
|
3383
|
-
] })
|
|
3384
|
-
] }),
|
|
3385
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
|
|
3386
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3387
|
-
designSystem.Button,
|
|
3388
|
-
{
|
|
3389
|
-
variant: "secondary",
|
|
3390
|
-
size: "S",
|
|
3391
|
-
onClick: handleFocusOnlySupported,
|
|
3392
|
-
children: [
|
|
3393
|
-
"Focus Workspace: Show Supported Only (",
|
|
3394
|
-
supportedCollections.length,
|
|
3395
|
-
")"
|
|
3396
|
-
]
|
|
3397
|
-
}
|
|
3398
|
-
),
|
|
3399
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3400
|
-
designSystem.Button,
|
|
3401
|
-
{
|
|
3402
|
-
variant: "tertiary",
|
|
3403
|
-
size: "S",
|
|
3404
|
-
onClick: () => setAttributeInfoExpanded((prev) => !prev),
|
|
3405
|
-
children: attributeInfoExpanded ? "Hide Schema Breakdown ▲" : "Inspect Breakdown ▼"
|
|
3406
|
-
}
|
|
3407
|
-
)
|
|
3408
|
-
] })
|
|
3390
|
+
selectedCol && selectedAttribute && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 4, padding: 3, background: "neutral100", hasRadius: true, style: { border: "1px solid #eaeaef" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", wrap: "wrap", gap: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", wrap: "wrap", children: [
|
|
3391
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: "Target Selection:" }),
|
|
3392
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "primary100", textColor: "primary700", children: [
|
|
3393
|
+
"Collection: ",
|
|
3394
|
+
selectedCol.displayName
|
|
3409
3395
|
] }),
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
] }),
|
|
3423
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { wrap: "wrap", gap: 2, alignItems: "center", style: { maxHeight: 180, overflowY: "auto" }, children: collections.filter(
|
|
3424
|
-
(c) => !attributeInfoSearch.trim() || c.displayName.toLowerCase().includes(attributeInfoSearch.toLowerCase().trim()) || c.uid.toLowerCase().includes(attributeInfoSearch.toLowerCase().trim())
|
|
3425
|
-
).map((c) => {
|
|
3426
|
-
const hasAttr = c.attributes.includes(selectedAttribute);
|
|
3427
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3428
|
-
designSystem.Badge,
|
|
3429
|
-
{
|
|
3430
|
-
backgroundColor: hasAttr ? "success100" : "neutral200",
|
|
3431
|
-
textColor: hasAttr ? "success700" : "neutral600",
|
|
3432
|
-
size: "S",
|
|
3433
|
-
children: [
|
|
3434
|
-
c.displayName,
|
|
3435
|
-
": ",
|
|
3436
|
-
hasAttr ? "✓ Supported" : "— Not in schema"
|
|
3437
|
-
]
|
|
3438
|
-
},
|
|
3439
|
-
c.uid
|
|
3440
|
-
);
|
|
3441
|
-
}) })
|
|
3442
|
-
] })
|
|
3443
|
-
] })
|
|
3396
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", children: [
|
|
3397
|
+
"Attribute: ",
|
|
3398
|
+
selectedAttribute,
|
|
3399
|
+
" ",
|
|
3400
|
+
attributesMeta[selectedAttribute]?.type ? `(${attributesMeta[selectedAttribute].type})` : ""
|
|
3401
|
+
] }),
|
|
3402
|
+
attributesMeta[selectedAttribute]?.depth ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "neutral200", textColor: "neutral700", children: [
|
|
3403
|
+
"Nesting Level: L",
|
|
3404
|
+
attributesMeta[selectedAttribute].depth
|
|
3405
|
+
] }) : null,
|
|
3406
|
+
selectedCol.draftAndPublish ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "success100", textColor: "success700", children: "Draft & Publish Enabled" }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "warning100", textColor: "warning700", children: "Direct Publish Only" })
|
|
3407
|
+
] }) }) })
|
|
3444
3408
|
]
|
|
3445
3409
|
}
|
|
3446
3410
|
),
|
|
@@ -3512,6 +3476,27 @@ const BulkUpdater = () => {
|
|
|
3512
3476
|
] })
|
|
3513
3477
|
] }),
|
|
3514
3478
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "flex-end", wrap: "wrap", children: [
|
|
3479
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 260, minWidth: 200 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3480
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Collection Type" }),
|
|
3481
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3482
|
+
designSystem.Combobox,
|
|
3483
|
+
{
|
|
3484
|
+
autocomplete: "none",
|
|
3485
|
+
placeholder: "Select Collection Type...",
|
|
3486
|
+
value: selectedCollectionUid || void 0,
|
|
3487
|
+
onChange: (val) => {
|
|
3488
|
+
if (val && typeof val === "string") {
|
|
3489
|
+
handleCollectionChange(val);
|
|
3490
|
+
}
|
|
3491
|
+
},
|
|
3492
|
+
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: [
|
|
3493
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: col.displayName }),
|
|
3494
|
+
col.isSingleType ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", size: "S", children: "Single" }) : null
|
|
3495
|
+
] }) }, col.uid))
|
|
3496
|
+
},
|
|
3497
|
+
`search-col-${selectedCollectionUid}`
|
|
3498
|
+
)
|
|
3499
|
+
] }) }),
|
|
3515
3500
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 280, minWidth: 230 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3516
3501
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Search Attribute" }),
|
|
3517
3502
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3540,7 +3525,8 @@ const BulkUpdater = () => {
|
|
|
3540
3525
|
}
|
|
3541
3526
|
},
|
|
3542
3527
|
children: memoizedSearchComboboxOptions
|
|
3543
|
-
}
|
|
3528
|
+
},
|
|
3529
|
+
`search-attr-${selectedCollectionUid}-${searchAttribute}`
|
|
3544
3530
|
)
|
|
3545
3531
|
] }) }),
|
|
3546
3532
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 200, minWidth: 170 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3600,164 +3586,48 @@ const BulkUpdater = () => {
|
|
|
3600
3586
|
)
|
|
3601
3587
|
] })
|
|
3602
3588
|
] }),
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
" visible"
|
|
3589
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginTop: 3, paddingTop: 3, style: { borderTop: "1px solid #dcdce4" }, children: [
|
|
3590
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", wrap: "wrap", gap: 3, children: [
|
|
3591
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
|
|
3592
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3593
|
+
designSystem.Checkbox,
|
|
3594
|
+
{
|
|
3595
|
+
checked: useRegex,
|
|
3596
|
+
onCheckedChange: (checked) => setUseRegex(Boolean(checked)),
|
|
3597
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", children: "Enable Regex Search & Replace" })
|
|
3598
|
+
}
|
|
3599
|
+
),
|
|
3600
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3601
|
+
designSystem.Badge,
|
|
3602
|
+
{
|
|
3603
|
+
backgroundColor: useRegex ? "secondary100" : "neutral200",
|
|
3604
|
+
textColor: useRegex ? "secondary700" : "neutral600",
|
|
3605
|
+
size: "S",
|
|
3606
|
+
children: useRegex ? "REGEX SEARCH ACTIVE" : "REGEX OFF"
|
|
3607
|
+
}
|
|
3608
|
+
)
|
|
3624
3609
|
] }),
|
|
3625
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3626
|
-
supportedCollections.filter((c) => visibleTypeUids[c.uid] !== false).length,
|
|
3627
|
-
" of ",
|
|
3628
|
-
supportedCollections.length,
|
|
3629
|
-
" supported visible"
|
|
3630
|
-
] })
|
|
3631
|
-
] }),
|
|
3632
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", wrap: "wrap", children: [
|
|
3633
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 220 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3610
|
+
useRegex && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1, minWidth: 260 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3634
3611
|
designSystem.TextInput,
|
|
3635
3612
|
{
|
|
3636
|
-
placeholder: "
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
onChange: (e) => setTypeVisibilitySearch(e.target.value)
|
|
3613
|
+
placeholder: `Regex pattern to search in "${effectiveSearchAttribute || "target"}" (e.g. \\b(OldName)\\b)...`,
|
|
3614
|
+
value: regexPattern,
|
|
3615
|
+
onChange: (e) => setRegexPattern(e.target.value)
|
|
3640
3616
|
}
|
|
3641
|
-
) })
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
onClick: handleFocusOnlySupported,
|
|
3648
|
-
children: [
|
|
3649
|
-
"Show Supported Only (",
|
|
3650
|
-
supportedCollections.length,
|
|
3651
|
-
")"
|
|
3652
|
-
]
|
|
3653
|
-
}
|
|
3654
|
-
),
|
|
3655
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3656
|
-
designSystem.Button,
|
|
3657
|
-
{
|
|
3658
|
-
variant: "tertiary",
|
|
3659
|
-
size: "S",
|
|
3660
|
-
onClick: handleShowAllTypes,
|
|
3661
|
-
children: "Show All"
|
|
3662
|
-
}
|
|
3663
|
-
),
|
|
3664
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3665
|
-
designSystem.Button,
|
|
3666
|
-
{
|
|
3667
|
-
variant: "tertiary",
|
|
3668
|
-
size: "S",
|
|
3669
|
-
onClick: handleHideAllTypes,
|
|
3670
|
-
children: "Hide All"
|
|
3671
|
-
}
|
|
3672
|
-
)
|
|
3617
|
+
) })
|
|
3618
|
+
] }),
|
|
3619
|
+
useRegex && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral600", marginTop: 1, children: [
|
|
3620
|
+
"Searches ",
|
|
3621
|
+
effectiveSearchAttribute ? /* @__PURE__ */ jsxRuntime.jsx("strong", { children: effectiveSearchAttribute }) : "target entries",
|
|
3622
|
+
" for text matching this regular expression pattern. Matches will be substituted with the Replacement Value configured in Section 1."
|
|
3673
3623
|
] })
|
|
3674
3624
|
] }),
|
|
3675
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3676
|
-
|
|
3677
|
-
{
|
|
3678
|
-
style: {
|
|
3679
|
-
maxHeight: 220,
|
|
3680
|
-
overflowY: "auto",
|
|
3681
|
-
padding: 8,
|
|
3682
|
-
background: "#ffffff",
|
|
3683
|
-
borderRadius: 4,
|
|
3684
|
-
border: "1px solid #dcdce4",
|
|
3685
|
-
display: "grid",
|
|
3686
|
-
gridTemplateColumns: "repeat(auto-fill, minmax(260px, 1fr))",
|
|
3687
|
-
gap: 8
|
|
3688
|
-
},
|
|
3689
|
-
children: collections.filter(
|
|
3690
|
-
(col) => !typeVisibilitySearch.trim() || col.displayName.toLowerCase().includes(typeVisibilitySearch.toLowerCase().trim()) || col.uid.toLowerCase().includes(typeVisibilitySearch.toLowerCase().trim())
|
|
3691
|
-
).map((col) => {
|
|
3692
|
-
const isVisible = visibleTypeUids[col.uid] !== false;
|
|
3693
|
-
const hasAttr = selectedAttribute ? col.attributes.includes(selectedAttribute) : false;
|
|
3694
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3695
|
-
designSystem.Box,
|
|
3696
|
-
{
|
|
3697
|
-
padding: 2,
|
|
3698
|
-
paddingLeft: 3,
|
|
3699
|
-
paddingRight: 3,
|
|
3700
|
-
background: isVisible ? "#f0f0ff" : "#f6f6f9",
|
|
3701
|
-
hasRadius: true,
|
|
3702
|
-
style: {
|
|
3703
|
-
border: isVisible ? "1px solid #4945ff" : "1px solid #eaeaef",
|
|
3704
|
-
transition: "all 0.15s ease"
|
|
3705
|
-
},
|
|
3706
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", gap: 2, children: [
|
|
3707
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3708
|
-
designSystem.Checkbox,
|
|
3709
|
-
{
|
|
3710
|
-
checked: isVisible,
|
|
3711
|
-
onCheckedChange: (checked) => setVisibleTypeUids((prev) => ({ ...prev, [col.uid]: Boolean(checked) })),
|
|
3712
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: isVisible ? "bold" : "regular", children: col.displayName })
|
|
3713
|
-
}
|
|
3714
|
-
),
|
|
3715
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 1, alignItems: "center", children: [
|
|
3716
|
-
col.isSingleType ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", size: "S", children: "Single" }) : null,
|
|
3717
|
-
hasAttr ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "success100", textColor: "success700", size: "S", children: "✓ Supports" }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "neutral150", textColor: "neutral600", size: "S", children: "—" })
|
|
3718
|
-
] })
|
|
3719
|
-
] })
|
|
3720
|
-
},
|
|
3721
|
-
col.uid
|
|
3722
|
-
);
|
|
3723
|
-
})
|
|
3724
|
-
}
|
|
3725
|
-
)
|
|
3726
|
-
]
|
|
3625
|
+
isFilterActive && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "success100", textColor: "success700", size: "S", children: "✓ Filter active: Showing only matching entries. All returned matching records are pre-selected." }) })
|
|
3626
|
+
] })
|
|
3727
3627
|
}
|
|
3728
3628
|
),
|
|
3729
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3730
|
-
|
|
3731
|
-
designSystem.TextInput,
|
|
3732
|
-
{
|
|
3733
|
-
label: "Search Content Types",
|
|
3734
|
-
placeholder: "Search by name or UID...",
|
|
3735
|
-
value: collectionSearch,
|
|
3736
|
-
onChange: (e) => setCollectionSearch(e.target.value)
|
|
3737
|
-
}
|
|
3738
|
-
) }),
|
|
3739
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", style: { marginLeft: "auto" }, children: [
|
|
3740
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "Default page size (max 500):" }),
|
|
3741
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 130 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3742
|
-
designSystem.SingleSelect,
|
|
3743
|
-
{
|
|
3744
|
-
size: "S",
|
|
3745
|
-
value: String(defaultPageSize),
|
|
3746
|
-
onChange: (val) => handleGlobalPageSizeChange(Number(val)),
|
|
3747
|
-
children: [
|
|
3748
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "5", children: "5 / page" }),
|
|
3749
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "10", children: "10 / page" }),
|
|
3750
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "25", children: "25 / page" }),
|
|
3751
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "50", children: "50 / page" }),
|
|
3752
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "100", children: "100 / page" }),
|
|
3753
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "250", children: "250 / page" }),
|
|
3754
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "500", children: "500 / page" })
|
|
3755
|
-
]
|
|
3756
|
-
}
|
|
3757
|
-
) })
|
|
3758
|
-
] })
|
|
3759
|
-
] }),
|
|
3760
|
-
filteredCollections.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 6, background: "neutral100", hasRadius: true, style: { textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "No content types match the visibility or search filters." }) }) : filteredCollections.map((col) => {
|
|
3629
|
+
!selectedCol ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 6, background: "neutral100", hasRadius: true, style: { textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "Please select a collection type above to display entries." }) }) : (() => {
|
|
3630
|
+
const col = selectedCol;
|
|
3761
3631
|
const pageState = collectionPages[col.uid];
|
|
3762
3632
|
const entries = pageState ? pageState.entries : col.entries || [];
|
|
3763
3633
|
const totalEntries = pageState ? pageState.total : col.totalEntries !== void 0 ? col.totalEntries : entries.length;
|
|
@@ -3846,21 +3716,174 @@ const BulkUpdater = () => {
|
|
|
3846
3716
|
}
|
|
3847
3717
|
) })
|
|
3848
3718
|
] }),
|
|
3849
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3719
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { position: "relative", display: "inline-block" }, children: [
|
|
3720
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3721
|
+
designSystem.Button,
|
|
3722
|
+
{
|
|
3723
|
+
variant: openColumnPickerUid === col.uid ? "secondary" : "tertiary",
|
|
3724
|
+
size: "S",
|
|
3725
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Cog, {}),
|
|
3726
|
+
onClick: () => {
|
|
3727
|
+
setOpenColumnPickerUid(openColumnPickerUid === col.uid ? null : col.uid);
|
|
3728
|
+
setColumnSearchTerm("");
|
|
3729
|
+
},
|
|
3730
|
+
children: [
|
|
3731
|
+
"Columns (",
|
|
3732
|
+
activeColumns.filter((c) => !c.isPermanent).length,
|
|
3733
|
+
"/",
|
|
3734
|
+
availableColumns.filter((c) => !c.isPermanent).length,
|
|
3735
|
+
")"
|
|
3736
|
+
]
|
|
3737
|
+
}
|
|
3738
|
+
),
|
|
3739
|
+
openColumnPickerUid === col.uid && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3740
|
+
designSystem.Box,
|
|
3741
|
+
{
|
|
3742
|
+
style: {
|
|
3743
|
+
position: "absolute",
|
|
3744
|
+
top: "calc(100% + 6px)",
|
|
3745
|
+
right: 0,
|
|
3746
|
+
zIndex: 200,
|
|
3747
|
+
width: 320,
|
|
3748
|
+
maxHeight: 420,
|
|
3749
|
+
background: "#ffffff",
|
|
3750
|
+
borderRadius: 8,
|
|
3751
|
+
boxShadow: "0 10px 25px rgba(33, 33, 52, 0.18)",
|
|
3752
|
+
border: "1px solid #dcdce4",
|
|
3753
|
+
padding: 12,
|
|
3754
|
+
display: "flex",
|
|
3755
|
+
flexDirection: "column",
|
|
3756
|
+
gap: 8
|
|
3757
|
+
},
|
|
3758
|
+
children: [
|
|
3759
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", children: [
|
|
3760
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: "Configure Columns" }),
|
|
3761
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3762
|
+
designSystem.Button,
|
|
3763
|
+
{
|
|
3764
|
+
variant: "ghost",
|
|
3765
|
+
size: "S",
|
|
3766
|
+
onClick: () => setOpenColumnPickerUid(null),
|
|
3767
|
+
style: { padding: "2px 6px", height: "auto", minWidth: "unset" },
|
|
3768
|
+
children: "✕"
|
|
3769
|
+
}
|
|
3770
|
+
)
|
|
3771
|
+
] }),
|
|
3772
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3773
|
+
designSystem.TextInput,
|
|
3774
|
+
{
|
|
3775
|
+
size: "S",
|
|
3776
|
+
placeholder: "Search columns...",
|
|
3777
|
+
value: columnSearchTerm,
|
|
3778
|
+
onChange: (e) => setColumnSearchTerm(e.target.value)
|
|
3779
|
+
}
|
|
3780
|
+
),
|
|
3781
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", style: { borderBottom: "1px solid #f0f0f5", paddingBottom: 6 }, children: [
|
|
3782
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3783
|
+
designSystem.Button,
|
|
3784
|
+
{
|
|
3785
|
+
variant: "ghost",
|
|
3786
|
+
size: "S",
|
|
3787
|
+
onClick: () => showAllColumns(col.uid, availableColumns),
|
|
3788
|
+
style: { fontSize: 11, padding: 0 },
|
|
3789
|
+
children: "Show All"
|
|
3790
|
+
}
|
|
3791
|
+
),
|
|
3792
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3793
|
+
designSystem.Button,
|
|
3794
|
+
{
|
|
3795
|
+
variant: "ghost",
|
|
3796
|
+
size: "S",
|
|
3797
|
+
onClick: () => {
|
|
3798
|
+
setCollectionColumnVisibility((prev) => ({
|
|
3799
|
+
...prev,
|
|
3800
|
+
[col.uid]: []
|
|
3801
|
+
}));
|
|
3802
|
+
},
|
|
3803
|
+
style: { fontSize: 11, padding: 0 },
|
|
3804
|
+
children: "Hide All"
|
|
3805
|
+
}
|
|
3806
|
+
),
|
|
3807
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3808
|
+
designSystem.Button,
|
|
3809
|
+
{
|
|
3810
|
+
variant: "ghost",
|
|
3811
|
+
size: "S",
|
|
3812
|
+
onClick: () => resetDefaultColumns(col.uid, availableColumns),
|
|
3813
|
+
style: { fontSize: 11, padding: 0 },
|
|
3814
|
+
children: "Reset"
|
|
3815
|
+
}
|
|
3816
|
+
)
|
|
3817
|
+
] }),
|
|
3818
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3819
|
+
designSystem.Box,
|
|
3820
|
+
{
|
|
3821
|
+
style: {
|
|
3822
|
+
maxHeight: 250,
|
|
3823
|
+
overflowY: "auto",
|
|
3824
|
+
display: "flex",
|
|
3825
|
+
flexDirection: "column",
|
|
3826
|
+
gap: 4
|
|
3827
|
+
},
|
|
3828
|
+
children: availableColumns.filter((c) => {
|
|
3829
|
+
if (!columnSearchTerm.trim()) return true;
|
|
3830
|
+
const term = columnSearchTerm.toLowerCase().trim();
|
|
3831
|
+
return c.label.toLowerCase().includes(term) || c.key.toLowerCase().includes(term);
|
|
3832
|
+
}).map((c) => {
|
|
3833
|
+
const isChecked = activeColumns.some((ac) => ac.key === c.key);
|
|
3834
|
+
const isNested = c.key.includes(".");
|
|
3835
|
+
const depth = isNested ? c.key.split(".").length - 1 : 0;
|
|
3836
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3837
|
+
designSystem.Flex,
|
|
3838
|
+
{
|
|
3839
|
+
justifyContent: "space-between",
|
|
3840
|
+
alignItems: "center",
|
|
3841
|
+
style: {
|
|
3842
|
+
padding: "4px 6px",
|
|
3843
|
+
borderRadius: 4,
|
|
3844
|
+
background: isChecked ? "#f0f0ff" : "transparent"
|
|
3845
|
+
},
|
|
3846
|
+
children: [
|
|
3847
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { minWidth: 0, flex: 1, overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3848
|
+
designSystem.Checkbox,
|
|
3849
|
+
{
|
|
3850
|
+
checked: isChecked,
|
|
3851
|
+
disabled: c.isPermanent,
|
|
3852
|
+
onCheckedChange: () => {
|
|
3853
|
+
if (!c.isPermanent) {
|
|
3854
|
+
toggleColumn(col.uid, c.key, availableColumns);
|
|
3855
|
+
}
|
|
3856
|
+
},
|
|
3857
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3858
|
+
designSystem.Typography,
|
|
3859
|
+
{
|
|
3860
|
+
variant: "pi",
|
|
3861
|
+
ellipsis: true,
|
|
3862
|
+
style: {
|
|
3863
|
+
color: c.isPermanent ? "#8e8ea9" : "#272833",
|
|
3864
|
+
fontWeight: isChecked ? 600 : 400
|
|
3865
|
+
},
|
|
3866
|
+
title: c.key,
|
|
3867
|
+
children: c.label
|
|
3868
|
+
}
|
|
3869
|
+
)
|
|
3870
|
+
}
|
|
3871
|
+
) }),
|
|
3872
|
+
c.isPermanent ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { size: "S", backgroundColor: "neutral150", textColor: "neutral700", children: "Fixed" }) : depth > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { size: "S", backgroundColor: "secondary100", textColor: "secondary700", children: [
|
|
3873
|
+
"L",
|
|
3874
|
+
depth
|
|
3875
|
+
] }) : null
|
|
3876
|
+
]
|
|
3877
|
+
},
|
|
3878
|
+
c.key
|
|
3879
|
+
);
|
|
3880
|
+
})
|
|
3881
|
+
}
|
|
3882
|
+
)
|
|
3883
|
+
]
|
|
3884
|
+
}
|
|
3885
|
+
)
|
|
3886
|
+
] }),
|
|
3864
3887
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3865
3888
|
designSystem.Button,
|
|
3866
3889
|
{
|
|
@@ -3918,66 +3941,6 @@ const BulkUpdater = () => {
|
|
|
3918
3941
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral500", children: col.isSingleType ? "1 single entry" : isFilterActive ? `${totalEntries} matching entries in DB` : `${totalEntries} entries` })
|
|
3919
3942
|
] })
|
|
3920
3943
|
] }),
|
|
3921
|
-
openColumnPickerUid === col.uid && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3922
|
-
designSystem.Box,
|
|
3923
|
-
{
|
|
3924
|
-
padding: 3,
|
|
3925
|
-
marginBottom: 3,
|
|
3926
|
-
background: "neutral100",
|
|
3927
|
-
hasRadius: true,
|
|
3928
|
-
borderColor: "neutral200",
|
|
3929
|
-
style: { border: "1px solid #dcdce4" },
|
|
3930
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", wrap: "wrap", gap: 3, children: [
|
|
3931
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "center", wrap: "wrap", children: [
|
|
3932
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral700", children: [
|
|
3933
|
-
"Columns for ",
|
|
3934
|
-
col.displayName,
|
|
3935
|
-
":"
|
|
3936
|
-
] }),
|
|
3937
|
-
availableColumns.filter((c) => !c.isPermanent).map((c) => {
|
|
3938
|
-
const isChecked = activeColumns.some((ac) => ac.key === c.key);
|
|
3939
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3940
|
-
designSystem.Checkbox,
|
|
3941
|
-
{
|
|
3942
|
-
checked: isChecked,
|
|
3943
|
-
onCheckedChange: () => toggleColumn(col.uid, c.key, availableColumns),
|
|
3944
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", children: c.label })
|
|
3945
|
-
}
|
|
3946
|
-
) }, c.key);
|
|
3947
|
-
})
|
|
3948
|
-
] }),
|
|
3949
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
3950
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3951
|
-
designSystem.Button,
|
|
3952
|
-
{
|
|
3953
|
-
variant: "tertiary",
|
|
3954
|
-
size: "S",
|
|
3955
|
-
onClick: () => showAllColumns(col.uid, availableColumns),
|
|
3956
|
-
children: "Show All"
|
|
3957
|
-
}
|
|
3958
|
-
),
|
|
3959
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3960
|
-
designSystem.Button,
|
|
3961
|
-
{
|
|
3962
|
-
variant: "tertiary",
|
|
3963
|
-
size: "S",
|
|
3964
|
-
onClick: () => resetDefaultColumns(col.uid, availableColumns),
|
|
3965
|
-
children: "Reset"
|
|
3966
|
-
}
|
|
3967
|
-
),
|
|
3968
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3969
|
-
designSystem.Button,
|
|
3970
|
-
{
|
|
3971
|
-
variant: "ghost",
|
|
3972
|
-
size: "S",
|
|
3973
|
-
onClick: () => setOpenColumnPickerUid(null),
|
|
3974
|
-
children: "Close"
|
|
3975
|
-
}
|
|
3976
|
-
)
|
|
3977
|
-
] })
|
|
3978
|
-
] })
|
|
3979
|
-
}
|
|
3980
|
-
),
|
|
3981
3944
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { className: "bulk-updater-table-container", style: { width: "100%", maxWidth: "100%", minWidth: 0, overflowX: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Table, { colCount: activeColumns.length, rowCount: visibleEntries.length + 1, style: { width: "100%" }, children: [
|
|
3982
3945
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Thead, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tr, { children: activeColumns.map(
|
|
3983
3946
|
(colDef) => renderHeaderCell(colDef, col, currentSort, selectedAttribute, searchAttribute, handleHeaderSortClick)
|
|
@@ -4089,7 +4052,7 @@ const BulkUpdater = () => {
|
|
|
4089
4052
|
},
|
|
4090
4053
|
col.uid
|
|
4091
4054
|
);
|
|
4092
|
-
})
|
|
4055
|
+
})()
|
|
4093
4056
|
]
|
|
4094
4057
|
}
|
|
4095
4058
|
),
|
|
@@ -4972,4 +4935,4 @@ exports.default = BulkUpdater;
|
|
|
4972
4935
|
exports.formatDisplayValue = formatDisplayValue;
|
|
4973
4936
|
exports.getAvailableColumnsForCollection = getAvailableColumnsForCollection;
|
|
4974
4937
|
exports.getNestedValue = getNestedValue;
|
|
4975
|
-
//# sourceMappingURL=BulkUpdater-
|
|
4938
|
+
//# sourceMappingURL=BulkUpdater-C2lw4D0D.js.map
|