mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
fixes: query confirmations popup
This commit is contained in:
parent
2dd0160dd4
commit
d61dd120fc
2 changed files with 12 additions and 7 deletions
|
|
@ -1428,6 +1428,15 @@ const EditorComponent = (props) => {
|
|||
|
||||
return (
|
||||
<div className="editor wrapper">
|
||||
<Confirm
|
||||
show={queryConfirmationList?.length > 0}
|
||||
message={`Do you want to run this query - ${queryConfirmationList[0]?.queryName}?`}
|
||||
onConfirm={(queryConfirmationData) => onQueryConfirmOrCancel(editorRef, queryConfirmationData, true)}
|
||||
onCancel={() => onQueryConfirmOrCancel(editorRef, queryConfirmationList[0])}
|
||||
queryConfirmationData={queryConfirmationList[0]}
|
||||
darkMode={props.darkMode}
|
||||
key={queryConfirmationList[0]?.queryName}
|
||||
/>
|
||||
<Confirm
|
||||
show={showPageDeletionConfirmation?.isOpen ?? false}
|
||||
title={'Delete Page'}
|
||||
|
|
|
|||
|
|
@ -337,13 +337,11 @@ export function onComponentClick(_ref, id, component, mode = 'edit') {
|
|||
}
|
||||
|
||||
export function onQueryConfirmOrCancel(_ref, queryConfirmationData, isConfirm = false, mode = 'edit') {
|
||||
const filtertedQueryConfirmation = _ref.state?.queryConfirmationList.filter(
|
||||
const filtertedQueryConfirmation = _ref?.queryConfirmationList.filter(
|
||||
(query) => query.queryId !== queryConfirmationData.queryId
|
||||
);
|
||||
|
||||
_ref.setState({
|
||||
queryConfirmationList: filtertedQueryConfirmation,
|
||||
});
|
||||
_ref.updateQueryConfirmationList(filtertedQueryConfirmation);
|
||||
isConfirm && runQuery(_ref, queryConfirmationData.queryId, queryConfirmationData.queryName, true, mode);
|
||||
}
|
||||
|
||||
|
|
@ -938,9 +936,7 @@ export function runQuery(_ref, queryId, queryName, confirmed = undefined, mode =
|
|||
|
||||
if (confirmed === undefined) {
|
||||
//!check
|
||||
_ref.setState({
|
||||
queryConfirmationList,
|
||||
});
|
||||
_ref.updateQueryConfirmationList(queryConfirmationList);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue