Skip to content
Snippets Groups Projects
Unverified Commit c22144a8 authored by Gustavo Saiani's avatar Gustavo Saiani Committed by GitHub
Browse files

Remove redirectToNewQuestionFlow (#24998)

parent 1cbae6b4
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ import {
import { Card, SavedCard } from "metabase-types/types/Card";
import { getQueryBuilderModeFromLocation } from "../../typed-utils";
import { redirectToNewQuestionFlow, updateUrl } from "../navigation";
import { updateUrl } from "../navigation";
import { cancelQuery, runQuestionQuery } from "../querying";
import { resetQB } from "./core";
......@@ -201,17 +201,6 @@ async function handleQBInit(
const { options, serializedCard } = parseHash(location.hash);
const hasCard = cardId || serializedCard;
if (
!hasCard &&
!options.db &&
!options.table &&
!options.segment &&
!options.metric
) {
dispatch(redirectToNewQuestionFlow());
return;
}
const deserializedCard = serializedCard
? deserializeCard(serializedCard)
: null;
......
......@@ -693,12 +693,6 @@ describe("QB Actions > initializeQB", () => {
};
}
it("redirects to new question flow if missing any options", async () => {
const redirectSpy = jest.spyOn(navigation, "redirectToNewQuestionFlow");
await setupBlank();
expect(redirectSpy).toHaveBeenCalledTimes(1);
});
it("constructs a card based on provided 'db' param", async () => {
const expectedCard = Question.create({
databaseId: SAMPLE_DATABASE?.id,
......
......@@ -112,14 +112,6 @@ export const locationChanged =
}
};
export const REDIRECT_TO_NEW_QUESTION_FLOW =
"metabase/qb/REDIRECT_TO_NEW_QUESTION_FLOW";
export const redirectToNewQuestionFlow = createThunkAction(
REDIRECT_TO_NEW_QUESTION_FLOW,
() => dispatch => dispatch(replace("/question/new")),
);
export const UPDATE_URL = "metabase/qb/UPDATE_URL";
export const updateUrl = createThunkAction(
UPDATE_URL,
......
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