From 434ab7ed9b9dcc80ae34645c7680f476d871971e Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Mon, 30 Aug 2021 17:14:04 +0900 Subject: [PATCH 1/2] fix frame > add column > apply --- src/common/vpFrameEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/vpFrameEditor.js b/src/common/vpFrameEditor.js index af860fe2..96661f8e 100644 --- a/src/common/vpFrameEditor.js +++ b/src/common/vpFrameEditor.js @@ -563,7 +563,7 @@ define([ var suggestInput = new vpSuggestInputText.vpSuggestInputText(); suggestInput.setComponentID('vp_popupAddApply'); suggestInput.addClass('vp-input vp-popup-apply-lambda'); - suggestInput.setSuggestList(function() { return ['x', 'min(x)', 'max(x)', 'sum(x)', 'mean(x)']; }); + suggestInput.setSuggestList(function() { return ['x']; }); suggestInput.setValue('x'); suggestInput.setNormalFilter(false); content.appendFormatLine('{0}', suggestInput.toTagString()); From 1c34e3b5ecca7a810467913c5b220d14f1776163 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Mon, 30 Aug 2021 17:27:28 +0900 Subject: [PATCH 2/2] fix snippets run operation --- src/api_block/init.js | 24 ++++++++++++++++-------- src/file_io/udf.js | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/api_block/init.js b/src/api_block/init.js index 2fbf3053..283c01f4 100644 --- a/src/api_block/init.js +++ b/src/api_block/init.js @@ -303,14 +303,22 @@ define([ var createdBlock = blockContainer.getSelectBlock(); if (createdBlock) { - // apply to original block - createdBlock.setState({ - apps: { - menu: blockContainer.apps, - code: code, - state: state - } - }); + if (title === 'Snippets') { + // set code + createdBlock.setState({ + [STATE_codeLine]: code + }); + } else if (title === 'Import' || title === 'Variables' || title === 'File' + || title === 'Instance' || title === 'Chart') { + // apply to original block + createdBlock.setState({ + apps: { + menu: blockContainer.apps, + code: code, + state: state + } + }); + } createdBlock.saveState(); } else { if (title === 'Snippets') { diff --git a/src/file_io/udf.js b/src/file_io/udf.js index b2881a9f..ff3597a1 100644 --- a/src/file_io/udf.js +++ b/src/file_io/udf.js @@ -220,7 +220,7 @@ define([ ' return 0.0', ' else:', ' try:', - ' result = float(x)', + ' result = float(x)', ' return result', ' except ValueError:', ' return 0.0'