fix: fix plug connection for apps with array items
This commit is contained in:
@@ -371,9 +371,16 @@ export function insertNewGridItem(
|
||||
let parent = findGridItemById(app.grid, app.subgrids, key)?.data
|
||||
let subgrids = parent?.numberOfSubgrids
|
||||
if (subgrids === undefined) {
|
||||
throw Error(`Invalid subgrid selected, the parent has no subgrids: ${key}, parent: ${JSON.stringify(parent)}`)
|
||||
throw Error(
|
||||
`Invalid subgrid selected, the parent has no subgrids: ${key}, parent: ${JSON.stringify(
|
||||
parent
|
||||
)}`
|
||||
)
|
||||
}
|
||||
if (focusedGrid?.subGridIndex && (focusedGrid?.subGridIndex < 0 || focusedGrid?.subGridIndex >= subgrids)) {
|
||||
if (
|
||||
focusedGrid?.subGridIndex &&
|
||||
(focusedGrid?.subGridIndex < 0 || focusedGrid?.subGridIndex >= subgrids)
|
||||
) {
|
||||
throw Error(`Invalid subgrid selected: ${key}, max subgrids: ${subgrids}`)
|
||||
}
|
||||
// If ever the subgrid is undefined, we want to make sure it is defined
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
...componentInput,
|
||||
type: 'evalv2',
|
||||
expr: expr,
|
||||
connections: [{ componentId: connection.componentId, id: connection.path.split('.')[0] }]
|
||||
connections: [{ componentId: connection.componentId, id: connection.path.split('.')[0].split('[')[0] }]
|
||||
}
|
||||
evalV2editor?.setCode(expr)
|
||||
$app = $app
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
...componentInput,
|
||||
type: 'evalv2',
|
||||
expr: expr,
|
||||
connections: [{ componentId: connection.componentId, id: connection.path.split('.')[0] }]
|
||||
connections: [{ componentId: connection.componentId, id: connection.path.split('.')[0].split('[')[0] }]
|
||||
}
|
||||
evalV2editor?.setCode(expr)
|
||||
$app = $app
|
||||
|
||||
Reference in New Issue
Block a user