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
This commit is contained in:
Arpit 2021-11-03 13:33:29 +05:30 committed by GitHub
parent 44f3b9d8d0
commit e21f1cfd3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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)
}

View file

@ -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);
}
);
})