refactor: Update expandGroupNode function to handle template proxy values

This commit is contained in:
anovazzi1 2024-05-14 14:47:20 -03:00
commit c464e16d28
2 changed files with 321 additions and 402 deletions

File diff suppressed because it is too large Load diff

View file

@ -1075,6 +1075,7 @@ export function expandGroupNode(
});
//update template values
Object.keys(template).forEach((key) => {
if (template[key].proxy) {
let { field, id } = template[key].proxy!;
let nodeIndex = gNodes.findIndex((n) => n.id === id);
if (nodeIndex !== -1) {
@ -1094,7 +1095,8 @@ export function expandGroupNode(
gNodes[nodeIndex].data.node!.template[field] = template[key];
gNodes[nodeIndex].data.node!.template[field].show = show;
gNodes[nodeIndex].data.node!.template[field].advanced = advanced;
gNodes[nodeIndex].data.node!.template[field].display_name = display_name;
gNodes[nodeIndex].data.node!.template[field].display_name =
display_name;
// keep the nodes selected after ungrouping
// gNodes[nodeIndex].selected = false;
if (proxy) {
@ -1103,6 +1105,7 @@ export function expandGroupNode(
delete gNodes[nodeIndex].data.node!.template[field].proxy;
}
}
}
});
const filteredNodes = [...nodes.filter((n) => n.id !== id), ...gNodes];