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