mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
fixes: triggering confirmation box for every query with on load trigger (#7728)
This commit is contained in:
parent
75cedb49e8
commit
822add77be
3 changed files with 6 additions and 4 deletions
|
|
@ -134,7 +134,7 @@ class ViewerComponent extends React.Component {
|
|||
|
||||
if (dataQueries.length > 0) {
|
||||
dataQueries.forEach((query) => {
|
||||
if (query?.options && query?.options?.runOnPageLoad) {
|
||||
if (query?.options && query?.options?.requestConfirmation && query?.options?.runOnPageLoad) {
|
||||
queryConfirmationList.push({ queryId: query.id, queryName: query.name });
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -341,7 +341,9 @@ export function onQueryConfirmOrCancel(_ref, queryConfirmationData, isConfirm =
|
|||
(query) => query.queryId !== queryConfirmationData.queryId
|
||||
);
|
||||
|
||||
_ref.updateQueryConfirmationList(filtertedQueryConfirmation);
|
||||
// console.log('---arpit:: dq', { filtertedQueryConfirmation });
|
||||
|
||||
_ref.updateQueryConfirmationList(filtertedQueryConfirmation, 'check');
|
||||
isConfirm && runQuery(_ref, queryConfirmationData.queryId, queryConfirmationData.queryName, true, mode);
|
||||
}
|
||||
|
||||
|
|
@ -927,7 +929,7 @@ export function runQuery(_ref, queryId, queryName, confirmed = undefined, mode =
|
|||
|
||||
const options = getQueryVariables(dataQuery.options, getCurrentState());
|
||||
|
||||
if (dataQuery.options.requestConfirmation) {
|
||||
if (dataQuery.options?.requestConfirmation) {
|
||||
const runOnPageLoad = dataQuery.options?.runOnPageLoad ?? false;
|
||||
const queryConfirmationList = runOnPageLoad ? _ref.queryConfirmationList : [];
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export const useDataQueriesStore = create(
|
|||
if (data.data_queries.length !== 0) {
|
||||
const queryConfirmationList = [];
|
||||
data.data_queries.forEach(({ id, name, options }) => {
|
||||
if (options && options?.runOnPageLoad) {
|
||||
if (options && options?.requestConfirmation && options?.runOnPageLoad) {
|
||||
queryConfirmationList.push({ queryId: id, queryName: name });
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue