fix copying table with actions

This commit is contained in:
Ruben Fiszel
2023-07-20 00:14:14 +02:00
parent 8f3960c935
commit 761cea4ccd
@@ -264,7 +264,21 @@
}
const newItem = insertNewGridItem(
$app,
(id) => ({ ...item.data, id }),
(id) => {
if (item.data.type === 'tablecomponent') {
return {
...item.data,
id,
actionButtons:
item.data.actionButtons.map((x) => ({
...x,
id: x.id.replace(`${item.id}_`, `${id}_`)
})) ?? []
}
} else {
return { ...item.data, id }
}
},
parentGrid,
Object.fromEntries(gridColumns.map((column) => [column, item[column]]))
)