strapi-plugin-bulk-updater 1.2.0 → 1.2.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/README.md +8 -5
- package/dist/_chunks/{BulkUpdater-BDszahRM.mjs → BulkUpdater-BYtO2SHc.mjs} +55 -41
- package/dist/_chunks/BulkUpdater-BYtO2SHc.mjs.map +1 -0
- package/dist/_chunks/{BulkUpdater-DCrCPKSe.js → BulkUpdater-BdRJhVFh.js} +54 -40
- package/dist/_chunks/BulkUpdater-BdRJhVFh.js.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +205 -25
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +205 -25
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/_chunks/BulkUpdater-BDszahRM.mjs.map +0 -1
- package/dist/_chunks/BulkUpdater-DCrCPKSe.js.map +0 -1
|
@@ -1454,23 +1454,34 @@ const BulkUpdater = () => {
|
|
|
1454
1454
|
children: [
|
|
1455
1455
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", tag: "h2", marginBottom: 4, fontWeight: "semiBold", children: "1. Configure Attribute Update" }),
|
|
1456
1456
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "flex-end", wrap: "wrap", children: [
|
|
1457
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { minWidth:
|
|
1458
|
-
designSystem.
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1457
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { minWidth: 280, flex: 1, maxWidth: 440 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
1458
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Attribute to Update" }),
|
|
1459
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1460
|
+
designSystem.Combobox,
|
|
1461
|
+
{
|
|
1462
|
+
autocomplete: { type: "list", filter: "contains" },
|
|
1463
|
+
placeholder: "Search attribute by name or relation...",
|
|
1464
|
+
value: selectedAttribute,
|
|
1465
|
+
onChange: (val) => {
|
|
1466
|
+
if (val && typeof val === "string") {
|
|
1467
|
+
handleAttributeChange(val);
|
|
1468
|
+
}
|
|
1469
|
+
},
|
|
1470
|
+
children: attributes.map((attr) => {
|
|
1471
|
+
const rel = relationsMeta[attr];
|
|
1472
|
+
const cleanParts = attr.includes(".") ? attr.split(".").join(" ") : "";
|
|
1473
|
+
const labelText = `${attr} ${cleanParts} ${rel ? `relation ${rel.targetDisplayName}` : ""}`.trim();
|
|
1474
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: attr, textValue: labelText, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", width: "100%", gap: 2, children: [
|
|
1475
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: attr === selectedAttribute ? "bold" : "regular", children: attr }),
|
|
1476
|
+
rel ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", size: "S", children: [
|
|
1477
|
+
"relation ➔ ",
|
|
1478
|
+
rel.targetDisplayName
|
|
1479
|
+
] }) : attr.includes(".") ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "neutral150", textColor: "neutral700", size: "S", children: "component" }) : null
|
|
1480
|
+
] }) }, attr);
|
|
1481
|
+
})
|
|
1482
|
+
}
|
|
1483
|
+
)
|
|
1484
|
+
] }) }),
|
|
1474
1485
|
/* @__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: [
|
|
1475
1486
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", wrap: "wrap", children: [
|
|
1476
1487
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral700", children: [
|
|
@@ -1486,28 +1497,31 @@ const BulkUpdater = () => {
|
|
|
1486
1497
|
relationsMeta[selectedAttribute].isMulti && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "primary100", textColor: "primary700", children: "Multi-Relation" })
|
|
1487
1498
|
] }),
|
|
1488
1499
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", style: { width: "100%" }, children: [
|
|
1489
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1, minWidth: 200 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1490
|
-
designSystem.
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1500
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1, minWidth: 200 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
1501
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: `Choose ${relationsMeta[selectedAttribute].targetDisplayName}` }),
|
|
1502
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1503
|
+
designSystem.Combobox,
|
|
1504
|
+
{
|
|
1505
|
+
autocomplete: { type: "list", filter: "contains" },
|
|
1506
|
+
placeholder: relationOptionsLoading ? "Loading entities..." : `Search & pick ${relationsMeta[selectedAttribute].targetDisplayName}...`,
|
|
1507
|
+
value: selectedRelationDocId,
|
|
1508
|
+
onChange: (val) => {
|
|
1509
|
+
const docId = val ? String(val) : "";
|
|
1510
|
+
setSelectedRelationDocId(docId);
|
|
1511
|
+
if (docId === "__clear__") {
|
|
1512
|
+
setAttributeValue(JSON.stringify({ mode: "clear", label: "(clear relation)" }));
|
|
1513
|
+
} else {
|
|
1514
|
+
const opt = relationOptions.find((o) => o.documentId === docId);
|
|
1515
|
+
setAttributeValue(JSON.stringify({ mode: relationMode, documentIds: [docId], label: opt?.label || docId }));
|
|
1516
|
+
}
|
|
1517
|
+
},
|
|
1518
|
+
children: [
|
|
1519
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: "__clear__", textValue: "Clear / Unlink Relation", children: "-- Clear / Unlink Relation --" }),
|
|
1520
|
+
relationOptions.map((opt) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: opt.documentId, textValue: opt.label, children: opt.label }, opt.documentId))
|
|
1521
|
+
]
|
|
1522
|
+
}
|
|
1523
|
+
)
|
|
1524
|
+
] }) }),
|
|
1511
1525
|
relationsMeta[selectedAttribute].isMulti && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 170 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1512
1526
|
designSystem.SingleSelect,
|
|
1513
1527
|
{
|
|
@@ -2769,4 +2783,4 @@ exports.default = BulkUpdater;
|
|
|
2769
2783
|
exports.formatDisplayValue = formatDisplayValue;
|
|
2770
2784
|
exports.getAvailableColumnsForCollection = getAvailableColumnsForCollection;
|
|
2771
2785
|
exports.getNestedValue = getNestedValue;
|
|
2772
|
-
//# sourceMappingURL=BulkUpdater-
|
|
2786
|
+
//# sourceMappingURL=BulkUpdater-BdRJhVFh.js.map
|