Skip to content
Snippets Groups Projects
Unverified Commit 6c8edfa7 authored by Phoomparin Mano's avatar Phoomparin Mano Committed by GitHub
Browse files

feat(sdk): deprecate the ModifyQuestion component (#49747)

parent 8d8ae878
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,6 @@ There are different ways you can embed questions:
- [`StaticQuestion`](#embedding-a-static-question). Embeds a chart. Clicking on the chart doesn't do anything.
- [`InteractiveQuestion`](#embedding-an-interactive-question). Clicking on the chart gives you the drill-through menu.
- [`CreateQuestion`]()
- [`ModifyQuestion`](#embedding-an-editable-question). Embeds the interactive question and the query builder.
## Embedding a static question
......@@ -238,18 +237,18 @@ export default function App() {
## Embedding an editable question
With the `ModifyQuestion` component, you can edit an existing question using the query builder by passing the question's ID.
You can edit an existing question using the query builder by using the `isSaveEnabled` prop on the `InteractiveQuestion` component.
```tsx
import React from "react";
import {MetabaseProvider, ModifyQuestion} from "@metabase/embedding-sdk-react";
import {MetabaseProvider, InteractiveQuestion} from "@metabase/embedding-sdk-react";
const config = {...}
export default function App() {
return (
<MetabaseProvider config={config}>
<ModifyQuestion questionId={1}/>
<InteractiveQuestion questionId={1} isSaveEnabled />
</MetabaseProvider>
);
}
......
......@@ -2,8 +2,7 @@ import { QuestionEditor } from "embedding-sdk/components/private/QuestionEditor"
import type { InteractiveQuestionProps } from "../InteractiveQuestion";
type ModifyQuestionProps = InteractiveQuestionProps;
/** @deprecated Use `InteractiveQuestion` with `isSaveEnabled={true}` instead. */
export const ModifyQuestion = ({
questionId,
plugins,
......@@ -12,7 +11,7 @@ export const ModifyQuestion = ({
entityTypeFilter,
isSaveEnabled,
saveToCollectionId,
}: ModifyQuestionProps = {}) => (
}: InteractiveQuestionProps = {}) => (
<QuestionEditor
questionId={questionId}
plugins={plugins}
......
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