From e21f1cfd3fa378d52194425d5106c79a1db6c5dc Mon Sep 17 00:00:00 2001 From: Arpit Date: Wed, 3 Nov 2021 13:33:29 +0530 Subject: [PATCH] Go to app - on success event fixed (#1360) * Goto app handler, when run as the on-success event handler of query, it should not ask for confirmation, in the viewer * Goto app handler, when run as the on-success event handler of query, it should not ask for confirmation, in the viewer --- frontend/src/Editor/Editor.jsx | 2 +- frontend/src/_helpers/appUtils.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index e9d3fbdf76..69c7a79ed5 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -766,7 +766,7 @@ class Editor extends React.Component { selectedComponent={selectedComponent || {}} scaleValue={scaleValue} appLoading={isLoading} - onEvent={(eventName, options) => onEvent(this, eventName, options)} + onEvent={(eventName, options) => onEvent(this, eventName, options, 'edit')} onComponentOptionChanged={(component, optionName, value) => onComponentOptionChanged(this, component, optionName, value) } diff --git a/frontend/src/_helpers/appUtils.js b/frontend/src/_helpers/appUtils.js index e02433d4be..62f7fbd30a 100644 --- a/frontend/src/_helpers/appUtils.js +++ b/frontend/src/_helpers/appUtils.js @@ -134,7 +134,7 @@ function executeAction(_ref, event, mode) { case 'run-query': { const { queryId, queryName } = event; - return runQuery(_ref, queryId, queryName); + return runQuery(_ref, queryId, queryName, true, mode); } case 'open-webpage': { @@ -366,7 +366,7 @@ export function previewQuery(_ref, query) { }); } -export function runQuery(_ref, queryId, queryName, confirmed = undefined) { +export function runQuery(_ref, queryId, queryName, confirmed = undefined, mode) { const query = _ref.state.app.data_queries.find((query) => query.id === queryId); let dataQuery = {}; @@ -515,7 +515,7 @@ export function runQuery(_ref, queryId, queryName, confirmed = undefined) { }, () => { resolve(); - onEvent(_self, 'onDataQuerySuccess', { definition: { events: dataQuery.options.events } }); + onEvent(_self, 'onDataQuerySuccess', { definition: { events: dataQuery.options.events } }, mode); } ); })