Skip to content
Snippets Groups Projects
Commit f9ef010a authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Fix clicking of legends inside query builder

parent 22dbf928
No related branches found
No related tags found
No related merge requests found
......@@ -524,6 +524,7 @@ export const navigateToNewCardFromDashboard = createThunkAction(
dashcard && dashcard.parameter_mappings
);
dispatch(push(url));
}
);
......
......@@ -534,8 +534,15 @@ export const setCardAndRun = createThunkAction(SET_CARD_AND_RUN, (nextCard, shou
*/
export const NAVIGATE_TO_NEW_CARD = "metabase/qb/NAVIGATE_TO_NEW_CARD";
export const navigateToNewCardInsideQB = createThunkAction(NAVIGATE_TO_NEW_CARD, (nextCard, previousCard) => {
return (dispatch, getState) => {
dispatch(setCardAndRun(getCardAfterVisualizationClick(nextCard, previousCard)));
return async (dispatch, getState) => {
const nextCardIsClean = !nextCard.dataset_query;
if (nextCardIsClean) {
// This is mainly a fallback for scenarios where a visualization legend is clicked inside QB
dispatch(setCardAndRun(await loadCard(nextCard.id)));
} else {
dispatch(setCardAndRun(getCardAfterVisualizationClick(nextCard, previousCard)));
}
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment