From 55c7dbad72e5c9749b31bf1d412d1e8d40c06dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 23 Aug 2022 17:29:09 +0200 Subject: [PATCH] fix(editor): Fix excess `json` key from pindata in expressions (#3925) * :bug: Return pindata without excess `json` key * :rewind: Restore `json` keys in `RunData` pane --- packages/editor-ui/src/components/RunData.vue | 8 +++++++- packages/editor-ui/src/store.ts | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index e42e2a6f33..2605fbd8b9 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -632,7 +632,13 @@ export default mixins( let inputData = this.rawInputData; if (this.node && this.pinData) { - inputData = this.pinData; + inputData = Array.isArray(this.pinData) + ? this.pinData.map((value) => ({ + json: value, + })) + : [{ + json: this.pinData, + }]; } const offset = this.pageSize * (this.currentPage - 1); diff --git a/packages/editor-ui/src/store.ts b/packages/editor-ui/src/store.ts index 75e9472e5b..4ce086cedc 100644 --- a/packages/editor-ui/src/store.ts +++ b/packages/editor-ui/src/store.ts @@ -895,7 +895,9 @@ export const store = new Vuex.Store({ return state.workflow.pinData; }, pinDataByNodeName: (state) => (nodeName: string) => { - return state.workflow.pinData ? state.workflow.pinData[nodeName] : undefined; + if (!state.workflow.pinData || !state.workflow.pinData[nodeName]) return undefined; + + return state.workflow.pinData[nodeName].map(item => item.json); }, pinDataSize: (state) => { return state.workflow.nodes