strapi-plugin-bulk-updater 1.3.3 → 1.3.8
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-C2lw4D0D.js → BulkUpdater-BosdSbGF.js} +182 -143
- package/dist/_chunks/BulkUpdater-BosdSbGF.js.map +1 -0
- package/dist/_chunks/{BulkUpdater-CgsqzdyX.mjs → BulkUpdater-DUrmamj-.mjs} +183 -144
- package/dist/_chunks/BulkUpdater-DUrmamj-.mjs.map +1 -0
- package/dist/_chunks/{ScopedQuotaSelectInput-ChWrQIBV.mjs → ScopedQuotaSelectInput-Cy3eEj9-.mjs} +50 -23
- package/dist/_chunks/ScopedQuotaSelectInput-Cy3eEj9-.mjs.map +1 -0
- package/dist/_chunks/{ScopedQuotaSelectInput-s4oUMLgK.js → ScopedQuotaSelectInput-CyGlYa9x.js} +50 -23
- package/dist/_chunks/ScopedQuotaSelectInput-CyGlYa9x.js.map +1 -0
- package/dist/_chunks/{SettingsPage-BAvuOb7V.js → SettingsPage-B6Ia7SVS.js} +2 -2
- package/dist/_chunks/{SettingsPage-BAvuOb7V.js.map → SettingsPage-B6Ia7SVS.js.map} +1 -1
- package/dist/_chunks/{SettingsPage-BWo4l6Gd.mjs → SettingsPage-Bdse5MP4.mjs} +2 -2
- package/dist/_chunks/{SettingsPage-BWo4l6Gd.mjs.map → SettingsPage-Bdse5MP4.mjs.map} +1 -1
- package/dist/_chunks/{ValidationRulesTab-BLZWPGrZ.js → ValidationRulesTab-BqGz1VLo.js} +83 -16
- package/dist/_chunks/ValidationRulesTab-BqGz1VLo.js.map +1 -0
- package/dist/_chunks/{ValidationRulesTab-Dt53h-Ke.mjs → ValidationRulesTab-Dqkson67.mjs} +84 -17
- package/dist/_chunks/ValidationRulesTab-Dqkson67.mjs.map +1 -0
- package/dist/admin/index.js +45 -3
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +44 -4
- package/dist/admin/index.mjs.map +1 -1
- package/dist/server/index.js +607 -128
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +607 -128
- package/dist/server/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/_chunks/BulkUpdater-C2lw4D0D.js.map +0 -1
- package/dist/_chunks/BulkUpdater-CgsqzdyX.mjs.map +0 -1
- package/dist/_chunks/ScopedQuotaSelectInput-ChWrQIBV.mjs.map +0 -1
- package/dist/_chunks/ScopedQuotaSelectInput-s4oUMLgK.js.map +0 -1
- package/dist/_chunks/ValidationRulesTab-BLZWPGrZ.js.map +0 -1
- package/dist/_chunks/ValidationRulesTab-Dt53h-Ke.mjs.map +0 -1
|
@@ -5,9 +5,96 @@ const React = require("react");
|
|
|
5
5
|
const admin = require("@strapi/strapi/admin");
|
|
6
6
|
const designSystem = require("@strapi/design-system");
|
|
7
7
|
const icons = require("@strapi/icons");
|
|
8
|
-
const ValidationRulesTab = require("./ValidationRulesTab-
|
|
8
|
+
const ValidationRulesTab = require("./ValidationRulesTab-BqGz1VLo.js");
|
|
9
9
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
10
10
|
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
11
|
+
function parseCsvRows(csvText) {
|
|
12
|
+
if (!csvText) return [];
|
|
13
|
+
let text = csvText;
|
|
14
|
+
if (text.charCodeAt(0) === 65279) {
|
|
15
|
+
text = text.slice(1);
|
|
16
|
+
}
|
|
17
|
+
const rows = [];
|
|
18
|
+
let currentRow = [];
|
|
19
|
+
let currentCell = "";
|
|
20
|
+
let inQuotes = false;
|
|
21
|
+
let cellIsQuoted = false;
|
|
22
|
+
for (let i = 0; i < text.length; i++) {
|
|
23
|
+
const char = text[i];
|
|
24
|
+
const nextChar = text[i + 1];
|
|
25
|
+
if (inQuotes) {
|
|
26
|
+
if (char === '"') {
|
|
27
|
+
if (nextChar === '"') {
|
|
28
|
+
currentCell += '"';
|
|
29
|
+
i++;
|
|
30
|
+
} else {
|
|
31
|
+
inQuotes = false;
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
currentCell += char;
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
if (char === '"' && !cellIsQuoted && currentCell.trim() === "") {
|
|
38
|
+
inQuotes = true;
|
|
39
|
+
cellIsQuoted = true;
|
|
40
|
+
currentCell = "";
|
|
41
|
+
} else if (char === ",") {
|
|
42
|
+
currentRow.push(cellIsQuoted ? currentCell : currentCell.trim());
|
|
43
|
+
currentCell = "";
|
|
44
|
+
cellIsQuoted = false;
|
|
45
|
+
} else if (char === "\r") {
|
|
46
|
+
if (nextChar === "\n") {
|
|
47
|
+
i++;
|
|
48
|
+
}
|
|
49
|
+
currentRow.push(cellIsQuoted ? currentCell : currentCell.trim());
|
|
50
|
+
if (currentRow.length > 1 || currentRow.length === 1 && currentRow[0] !== "") {
|
|
51
|
+
rows.push(currentRow);
|
|
52
|
+
}
|
|
53
|
+
currentRow = [];
|
|
54
|
+
currentCell = "";
|
|
55
|
+
cellIsQuoted = false;
|
|
56
|
+
} else if (char === "\n") {
|
|
57
|
+
currentRow.push(cellIsQuoted ? currentCell : currentCell.trim());
|
|
58
|
+
if (currentRow.length > 1 || currentRow.length === 1 && currentRow[0] !== "") {
|
|
59
|
+
rows.push(currentRow);
|
|
60
|
+
}
|
|
61
|
+
currentRow = [];
|
|
62
|
+
currentCell = "";
|
|
63
|
+
cellIsQuoted = false;
|
|
64
|
+
} else {
|
|
65
|
+
if (!(cellIsQuoted && !inQuotes && (char === " " || char === " "))) {
|
|
66
|
+
currentCell += char;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (currentCell !== "" || cellIsQuoted || currentRow.length > 0) {
|
|
72
|
+
currentRow.push(cellIsQuoted ? currentCell : currentCell.trim());
|
|
73
|
+
if (currentRow.length > 1 || currentRow.length === 1 && currentRow[0] !== "") {
|
|
74
|
+
rows.push(currentRow);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return rows;
|
|
78
|
+
}
|
|
79
|
+
function parseCsv(csvText) {
|
|
80
|
+
const rows = parseCsvRows(csvText);
|
|
81
|
+
if (rows.length < 2) return [];
|
|
82
|
+
const headers = rows[0].map((h) => h.trim());
|
|
83
|
+
const records = [];
|
|
84
|
+
for (let i = 1; i < rows.length; i++) {
|
|
85
|
+
const row = rows[i];
|
|
86
|
+
const record = {};
|
|
87
|
+
headers.forEach((h, idx) => {
|
|
88
|
+
let val = row[idx] !== void 0 ? row[idx] : "";
|
|
89
|
+
if (typeof val === "string" && /^'[=+@-]/.test(val)) {
|
|
90
|
+
val = val.substring(1);
|
|
91
|
+
}
|
|
92
|
+
record[h] = val;
|
|
93
|
+
});
|
|
94
|
+
records.push(record);
|
|
95
|
+
}
|
|
96
|
+
return records;
|
|
97
|
+
}
|
|
11
98
|
function CsvManagerTab() {
|
|
12
99
|
const { get, post } = admin.useFetchClient();
|
|
13
100
|
const { toggleNotification } = admin.useNotification();
|
|
@@ -139,20 +226,8 @@ function CsvManagerTab() {
|
|
|
139
226
|
const text = event.target?.result;
|
|
140
227
|
setCsvRawText(text);
|
|
141
228
|
try {
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
const headers = lines[0].split(",").map((h) => h.replace(/^"|"$/g, "").trim());
|
|
145
|
-
const previewRows = [];
|
|
146
|
-
for (let i = 1; i < Math.min(lines.length, 6); i++) {
|
|
147
|
-
const vals = lines[i].split(",").map((v) => v.replace(/^"|"$/g, "").trim());
|
|
148
|
-
const row = {};
|
|
149
|
-
headers.forEach((h, idx) => {
|
|
150
|
-
row[h] = vals[idx] || "";
|
|
151
|
-
});
|
|
152
|
-
previewRows.push(row);
|
|
153
|
-
}
|
|
154
|
-
setParsedPreview(previewRows);
|
|
155
|
-
}
|
|
229
|
+
const records = parseCsv(text);
|
|
230
|
+
setParsedPreview(records.slice(0, 10));
|
|
156
231
|
} catch (err) {
|
|
157
232
|
setParsedPreview([]);
|
|
158
233
|
}
|
|
@@ -282,53 +357,20 @@ function CsvManagerTab() {
|
|
|
282
357
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 5, background: "neutral100", hasRadius: true, children: [
|
|
283
358
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", tag: "h3", fontWeight: "bold", marginBottom: 2, children: "2. Import & Batch Override CSV" }),
|
|
284
359
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", marginBottom: 4, children: "Upload an updated CSV file to bulk update existing records or insert new records." }),
|
|
285
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, {
|
|
360
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, wrap: "wrap", gap: 4, children: [
|
|
286
361
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
287
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", marginBottom:
|
|
288
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap:
|
|
289
|
-
/* @__PURE__ */ jsxRuntime.
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
name: "importMode",
|
|
295
|
-
value: "auto",
|
|
296
|
-
checked: importMode === "auto",
|
|
297
|
-
onChange: () => setImportMode("auto")
|
|
298
|
-
}
|
|
299
|
-
),
|
|
300
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: importMode === "auto" ? "bold" : "normal", children: "Smart Auto-Detect (Auto-updates matching documentId, creates new if missing)" })
|
|
301
|
-
] }),
|
|
302
|
-
/* @__PURE__ */ jsxRuntime.jsxs("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
|
|
303
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
304
|
-
"input",
|
|
305
|
-
{
|
|
306
|
-
type: "radio",
|
|
307
|
-
name: "importMode",
|
|
308
|
-
value: "update",
|
|
309
|
-
checked: importMode === "update",
|
|
310
|
-
onChange: () => setImportMode("update")
|
|
311
|
-
}
|
|
312
|
-
),
|
|
313
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: importMode === "update" ? "bold" : "normal", children: "Update Existing Only (Requires documentId)" })
|
|
314
|
-
] }),
|
|
315
|
-
/* @__PURE__ */ jsxRuntime.jsxs("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
|
|
316
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
317
|
-
"input",
|
|
318
|
-
{
|
|
319
|
-
type: "radio",
|
|
320
|
-
name: "importMode",
|
|
321
|
-
value: "create_or_override",
|
|
322
|
-
checked: importMode === "create_or_override",
|
|
323
|
-
onChange: () => setImportMode("create_or_override")
|
|
324
|
-
}
|
|
325
|
-
),
|
|
326
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: importMode === "create_or_override" ? "bold" : "normal", children: "Add / Override (Inserts new or replaces existing)" })
|
|
362
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", marginBottom: 1, display: "block", children: "Operation Mode" }),
|
|
363
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", wrap: "wrap", children: [
|
|
364
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "primary100", textColor: "primary700", children: "⚡ Smart Auto-Detect" }),
|
|
365
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: [
|
|
366
|
+
"Automatically updates matching records by ",
|
|
367
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "documentId" }),
|
|
368
|
+
" and creates new entries when ID is omitted."
|
|
327
369
|
] })
|
|
328
370
|
] })
|
|
329
371
|
] }),
|
|
330
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, {
|
|
331
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", marginBottom:
|
|
372
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
373
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", marginBottom: 1, display: "block", children: "Publish Options" }),
|
|
332
374
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
333
375
|
designSystem.Checkbox,
|
|
334
376
|
{
|
|
@@ -396,8 +438,8 @@ function CsvManagerTab() {
|
|
|
396
438
|
missingDocIdCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginBottom: 3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
397
439
|
designSystem.Alert,
|
|
398
440
|
{
|
|
399
|
-
variant:
|
|
400
|
-
title:
|
|
441
|
+
variant: "default",
|
|
442
|
+
title: "Smart Auto-Detect Active",
|
|
401
443
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "omega", children: [
|
|
402
444
|
missingDocIdCount,
|
|
403
445
|
" row",
|
|
@@ -406,23 +448,40 @@ function CsvManagerTab() {
|
|
|
406
448
|
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "documentId" }),
|
|
407
449
|
".",
|
|
408
450
|
" ",
|
|
409
|
-
|
|
451
|
+
"Because no documentId is provided, the engine will automatically treat them as new entries and generate new database IDs for them."
|
|
410
452
|
] })
|
|
411
453
|
}
|
|
412
454
|
) }),
|
|
413
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Table, { colCount: headers.length + 1, rowCount: parsedPreview.length + 1, children: [
|
|
455
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { overflowX: "auto", maxWidth: "100%", border: "1px solid #e0e0e0", borderRadius: 4 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Table, { colCount: headers.length + 1, rowCount: parsedPreview.length + 1, children: [
|
|
414
456
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Thead, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
415
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { style: { width:
|
|
416
|
-
headers.map((h) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: h }) }, h))
|
|
457
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { style: { width: 150, minWidth: 150 }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: "Detected Action" }) }),
|
|
458
|
+
headers.map((h) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { style: { minWidth: 160 }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: h }) }, h))
|
|
417
459
|
] }) }),
|
|
418
460
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tbody, { children: parsedPreview.map((row, rIdx) => {
|
|
419
461
|
const hasDocId = !!(row.documentId || row.id || "").trim();
|
|
420
462
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
421
463
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: hasDocId ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "primary100", textColor: "primary700", children: "🔄 Match / Update" }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "warning100", textColor: "warning700", children: "➕ New Entry" }) }),
|
|
422
|
-
headers.map((h) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: (h === "documentId" || h === "id") && !row[h]?.trim() ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "warning700", fontWeight: "bold", children: "(Auto-generate ID)" }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
464
|
+
headers.map((h) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { style: { verticalAlign: "top", maxWidth: 300 }, children: (h === "documentId" || h === "id") && !row[h]?.trim() ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "warning700", fontWeight: "bold", children: "(Auto-generate ID)" }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
465
|
+
designSystem.Typography,
|
|
466
|
+
{
|
|
467
|
+
variant: "omega",
|
|
468
|
+
style: {
|
|
469
|
+
display: "-webkit-box",
|
|
470
|
+
WebkitLineClamp: 3,
|
|
471
|
+
WebkitBoxOrient: "vertical",
|
|
472
|
+
overflow: "hidden",
|
|
473
|
+
textOverflow: "ellipsis",
|
|
474
|
+
whiteSpace: "pre-wrap",
|
|
475
|
+
wordBreak: "break-word",
|
|
476
|
+
maxHeight: 65
|
|
477
|
+
},
|
|
478
|
+
title: row[h] || "",
|
|
479
|
+
children: row[h] || "-"
|
|
480
|
+
}
|
|
481
|
+
) }, h))
|
|
423
482
|
] }, rIdx);
|
|
424
483
|
}) })
|
|
425
|
-
] }),
|
|
484
|
+
] }) }),
|
|
426
485
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", marginTop: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
427
486
|
designSystem.Button,
|
|
428
487
|
{
|
|
@@ -431,7 +490,7 @@ function CsvManagerTab() {
|
|
|
431
490
|
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
|
|
432
491
|
onClick: handleExecuteImport,
|
|
433
492
|
loading: importing,
|
|
434
|
-
children:
|
|
493
|
+
children: "Execute Smart Import (Auto-Detect)"
|
|
435
494
|
}
|
|
436
495
|
) })
|
|
437
496
|
] });
|
|
@@ -3132,42 +3191,19 @@ const BulkUpdater = () => {
|
|
|
3132
3191
|
] })
|
|
3133
3192
|
}
|
|
3134
3193
|
) : activeTab === "editor" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3135
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3194
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3136
3195
|
designSystem.Box,
|
|
3137
3196
|
{
|
|
3138
|
-
padding:
|
|
3197
|
+
padding: 4,
|
|
3139
3198
|
background: "neutral0",
|
|
3140
3199
|
shadow: "filterShadow",
|
|
3141
3200
|
hasRadius: true,
|
|
3142
|
-
marginBottom:
|
|
3201
|
+
marginBottom: 5,
|
|
3143
3202
|
style: { width: "100%", maxWidth: "100%", minWidth: 0, boxSizing: "border-box" },
|
|
3144
|
-
children: [
|
|
3145
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, {
|
|
3146
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3147
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
|
3148
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "Select the target attribute to update across collections." })
|
|
3149
|
-
] }),
|
|
3150
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", wrap: "wrap", children: [
|
|
3151
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral700", fontWeight: "bold", children: "Component Nesting Depth:" }),
|
|
3152
|
-
[1, 2, 3, 4, 5].map((lvl) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3153
|
-
designSystem.Button,
|
|
3154
|
-
{
|
|
3155
|
-
variant: componentDepth === lvl ? "default" : "tertiary",
|
|
3156
|
-
size: "S",
|
|
3157
|
-
onClick: () => handleComponentDepthChange(lvl),
|
|
3158
|
-
title: `Discover nested component attributes up to Level ${lvl}`,
|
|
3159
|
-
children: [
|
|
3160
|
-
"Level ",
|
|
3161
|
-
lvl
|
|
3162
|
-
]
|
|
3163
|
-
},
|
|
3164
|
-
`depth_cfg_${lvl}`
|
|
3165
|
-
))
|
|
3166
|
-
] })
|
|
3167
|
-
] }),
|
|
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" }),
|
|
3203
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", wrap: "wrap", gap: 3, children: [
|
|
3204
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "center", wrap: "wrap", style: { flex: 1, minWidth: 280 }, children: [
|
|
3205
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 340, minWidth: 260 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3206
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Target Collection Type" }),
|
|
3171
3207
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3172
3208
|
designSystem.Combobox,
|
|
3173
3209
|
{
|
|
@@ -3181,12 +3217,52 @@ const BulkUpdater = () => {
|
|
|
3181
3217
|
},
|
|
3182
3218
|
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
3219
|
/* @__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}` : "" }) })
|
|
3220
|
+
/* @__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} entries` : "" }) })
|
|
3185
3221
|
] }) }, col.uid))
|
|
3186
3222
|
},
|
|
3187
|
-
`
|
|
3223
|
+
`top-col-${selectedCollectionUid}`
|
|
3188
3224
|
)
|
|
3189
3225
|
] }) }),
|
|
3226
|
+
selectedCol && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", wrap: "wrap", style: { paddingTop: 20 }, children: [
|
|
3227
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "primary100", textColor: "primary700", children: selectedCol.isSingleType ? "SINGLE TYPE" : "COLLECTION" }),
|
|
3228
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "neutral150", textColor: "neutral700", children: selectedCol.isSingleType ? "1 single entry" : `${collectionPages[selectedCol.uid]?.total ?? selectedCol.totalEntries ?? selectedCol.entries?.length ?? 0} records` })
|
|
3229
|
+
] })
|
|
3230
|
+
] }),
|
|
3231
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", wrap: "wrap", children: [
|
|
3232
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral700", fontWeight: "bold", children: "Component Nesting Depth:" }),
|
|
3233
|
+
[1, 2, 3, 4, 5].map((lvl) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3234
|
+
designSystem.Button,
|
|
3235
|
+
{
|
|
3236
|
+
variant: componentDepth === lvl ? "default" : "tertiary",
|
|
3237
|
+
size: "S",
|
|
3238
|
+
onClick: () => handleComponentDepthChange(lvl),
|
|
3239
|
+
title: `Discover nested component attributes up to Level ${lvl}`,
|
|
3240
|
+
children: [
|
|
3241
|
+
"Level ",
|
|
3242
|
+
lvl
|
|
3243
|
+
]
|
|
3244
|
+
},
|
|
3245
|
+
`depth_cfg_${lvl}`
|
|
3246
|
+
))
|
|
3247
|
+
] })
|
|
3248
|
+
] })
|
|
3249
|
+
}
|
|
3250
|
+
),
|
|
3251
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3252
|
+
designSystem.Box,
|
|
3253
|
+
{
|
|
3254
|
+
padding: 6,
|
|
3255
|
+
background: "neutral0",
|
|
3256
|
+
shadow: "filterShadow",
|
|
3257
|
+
hasRadius: true,
|
|
3258
|
+
marginBottom: 6,
|
|
3259
|
+
style: { width: "100%", maxWidth: "100%", minWidth: 0, boxSizing: "border-box" },
|
|
3260
|
+
children: [
|
|
3261
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, wrap: "wrap", gap: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
3262
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", tag: "h2", fontWeight: "semiBold", children: "1. Configure Attribute Update" }),
|
|
3263
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "Select the target attribute to update and configure the replacement value." })
|
|
3264
|
+
] }) }),
|
|
3265
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "flex-end", wrap: "wrap", children: [
|
|
3190
3266
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 280, minWidth: 230 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3191
3267
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Attribute to Update" }),
|
|
3192
3268
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3421,7 +3497,11 @@ const BulkUpdater = () => {
|
|
|
3421
3497
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, wrap: "wrap", gap: 3, children: [
|
|
3422
3498
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
3423
3499
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", tag: "h2", fontWeight: "semiBold", children: "2. Select Targets" }),
|
|
3424
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3500
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: [
|
|
3501
|
+
"Search and select entries to apply the update to within ",
|
|
3502
|
+
selectedCol ? selectedCol.displayName : "the selected collection",
|
|
3503
|
+
"."
|
|
3504
|
+
] })
|
|
3425
3505
|
] }),
|
|
3426
3506
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
3427
3507
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", size: "S", onClick: selectAll, children: "Select All" }),
|
|
@@ -3453,50 +3533,9 @@ const BulkUpdater = () => {
|
|
|
3453
3533
|
selectedAttribute
|
|
3454
3534
|
] })
|
|
3455
3535
|
] }),
|
|
3456
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3457
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 1, alignItems: "center", children: [
|
|
3458
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "Depth:" }),
|
|
3459
|
-
[1, 2, 3, 4, 5].map((lvl) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3460
|
-
designSystem.Button,
|
|
3461
|
-
{
|
|
3462
|
-
variant: componentDepth === lvl ? "default" : "tertiary",
|
|
3463
|
-
size: "S",
|
|
3464
|
-
onClick: () => handleComponentDepthChange(lvl),
|
|
3465
|
-
title: `Show component attributes up to Level ${lvl}`,
|
|
3466
|
-
style: { minWidth: 26, padding: "2px 6px" },
|
|
3467
|
-
children: [
|
|
3468
|
-
"L",
|
|
3469
|
-
lvl
|
|
3470
|
-
]
|
|
3471
|
-
},
|
|
3472
|
-
`s2_depth_${lvl}`
|
|
3473
|
-
))
|
|
3474
|
-
] }),
|
|
3475
|
-
isFilterActive && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "ghost", size: "S", onClick: clearFilter, children: "Clear Search & Filter" })
|
|
3476
|
-
] })
|
|
3536
|
+
isFilterActive && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "ghost", size: "S", onClick: clearFilter, children: "Clear Search & Filter" })
|
|
3477
3537
|
] }),
|
|
3478
3538
|
/* @__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
|
-
] }) }),
|
|
3500
3539
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 280, minWidth: 230 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3501
3540
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Search Attribute" }),
|
|
3502
3541
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4935,4 +4974,4 @@ exports.default = BulkUpdater;
|
|
|
4935
4974
|
exports.formatDisplayValue = formatDisplayValue;
|
|
4936
4975
|
exports.getAvailableColumnsForCollection = getAvailableColumnsForCollection;
|
|
4937
4976
|
exports.getNestedValue = getNestedValue;
|
|
4938
|
-
//# sourceMappingURL=BulkUpdater-
|
|
4977
|
+
//# sourceMappingURL=BulkUpdater-BosdSbGF.js.map
|