fixes: triggering confirmation box for every query with on load trigger (#7728)

This commit is contained in:
Arpit 2023-10-10 11:38:53 +05:30 committed by GitHub
parent 75cedb49e8
commit 822add77be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View file

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

View file

@ -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 : [];

View file

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