From f63ff51ac570b7726b7584f1ab819cfd922c2571 Mon Sep 17 00:00:00 2001 From: soumya pratik Date: Mon, 18 Nov 2024 19:47:18 +0530 Subject: [PATCH 1/2] feat(client): issue with value setting for dnd variable fixed --- packages/client/src/components/notebook/AddVariablePopover.tsx | 2 +- packages/client/src/stores/state/state.types.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/notebook/AddVariablePopover.tsx b/packages/client/src/components/notebook/AddVariablePopover.tsx index 05966374ac..907e5c7673 100644 --- a/packages/client/src/components/notebook/AddVariablePopover.tsx +++ b/packages/client/src/components/notebook/AddVariablePopover.tsx @@ -606,7 +606,7 @@ export const AddVariablePopover = observer((props: AddVariablePopoverProps) => { setVariableType(variable.type); setIsInput(variable.isInput); setIsOutput(variable.isOutput); - + setVariablePointer(`${variable.to}.${variable.cellId}`); if ( variable.type !== 'query' && variable.type !== 'block' && diff --git a/packages/client/src/stores/state/state.types.ts b/packages/client/src/stores/state/state.types.ts index 2c8639f1bb..624d0b9276 100644 --- a/packages/client/src/stores/state/state.types.ts +++ b/packages/client/src/stores/state/state.types.ts @@ -69,6 +69,7 @@ export type VariableWithId = value?: string; isInput?: boolean; isOutput?: boolean; + cellId?: string; } & { id: string }) | ({ to: string; From e92876c5516baff944f1151c57933e93bf1092f9 Mon Sep 17 00:00:00 2001 From: soumya pratik Date: Thu, 21 Nov 2024 14:29:02 +0530 Subject: [PATCH 2/2] feat(client): code fix --- .../client/src/components/notebook/AddVariablePopover.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/notebook/AddVariablePopover.tsx b/packages/client/src/components/notebook/AddVariablePopover.tsx index 907e5c7673..7a2e8862be 100644 --- a/packages/client/src/components/notebook/AddVariablePopover.tsx +++ b/packages/client/src/components/notebook/AddVariablePopover.tsx @@ -606,7 +606,7 @@ export const AddVariablePopover = observer((props: AddVariablePopoverProps) => { setVariableType(variable.type); setIsInput(variable.isInput); setIsOutput(variable.isOutput); - setVariablePointer(`${variable.to}.${variable.cellId}`); + if ( variable.type !== 'query' && variable.type !== 'block' && @@ -632,6 +632,12 @@ export const AddVariablePopover = observer((props: AddVariablePopoverProps) => { setEngine(variableEngine); } } + } else { + if (variable.type === 'cell') { + setVariablePointer(`${variable.to}.${variable.cellId}`); + } else { + setVariablePointer(variable.to); + } } } }, [variable]);