diff --git a/frontend/src/metabase/dashboard/components/DashCard.jsx b/frontend/src/metabase/dashboard/components/DashCard.jsx index a154b2b08c10abe28ed66fdf7da282e7ba891d4e..e2b1d81c811a5fd84a17cf7e99b3882e1ca47221 100644 --- a/frontend/src/metabase/dashboard/components/DashCard.jsx +++ b/frontend/src/metabase/dashboard/components/DashCard.jsx @@ -27,8 +27,6 @@ import DashCardParameterMapper from "./DashCardParameterMapper"; import { IS_EMBED_PREVIEW } from "metabase/lib/embed"; import { getClickBehaviorDescription } from "metabase/lib/click-behavior"; -import ActionsLinkingControl from "metabase/writeback/components/ActionsLinkingControl"; - import cx from "classnames"; import _ from "underscore"; import { getIn } from "icepick"; @@ -213,9 +211,6 @@ export default class DashCard extends Component { hasError={!!errorMessage} onRemove={onRemove} onAddSeries={onAddSeries} - onUpdateVisualizationSettings={ - this.props.onUpdateVisualizationSettings - } onReplaceAllVisualizationSettings={ this.props.onReplaceAllVisualizationSettings } @@ -225,7 +220,6 @@ export default class DashCard extends Component { isPreviewing={this.state.isPreviewingCard} onPreviewToggle={this.handlePreviewToggle} dashboard={dashboard} - metadata={metadata} /> </DashboardCardActionsPanel> ) : null} @@ -355,13 +349,11 @@ const DashCardActionButtons = ({ hasError, onRemove, onAddSeries, - onUpdateVisualizationSettings, onReplaceAllVisualizationSettings, showClickBehaviorSidebar, onPreviewToggle, isPreviewing, dashboard, - metadata, }) => { const buttons = []; @@ -415,18 +407,6 @@ const DashCardActionButtons = ({ } } - if (card.display === "actions") { - buttons.push( - <ActionsLinkingControl - key="connect-actions" - card={card} - dashboard={dashboard} - metadata={metadata} - onUpdateVisualizationSettings={onUpdateVisualizationSettings} - />, - ); - } - return ( <span className="flex align-center text-medium" style={{ lineHeight: 1 }}> {buttons} diff --git a/frontend/src/metabase/writeback/components/ActionsLinkingControl.tsx b/frontend/src/metabase/writeback/components/ActionsLinkingControl.tsx deleted file mode 100644 index e72a760110678215a2b9b50edab142aad420b59b..0000000000000000000000000000000000000000 --- a/frontend/src/metabase/writeback/components/ActionsLinkingControl.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import React from "react"; -import { t } from "ttag"; - -import Icon from "metabase/components/Icon"; -import PopoverWithTrigger from "metabase/components/PopoverWithTrigger"; -import Tooltip from "metabase/components/Tooltip"; -import SelectList from "metabase/components/SelectList"; - -import * as Q_DEPRECATED from "metabase/lib/query"; - -import { SavedCard, StructuredDatasetQuery } from "metabase-types/types/Card"; -import { DashboardWithCards, DashCard } from "metabase-types/types/Dashboard"; - -type StructuredQuerySavedCard = SavedCard<StructuredDatasetQuery>; -type StructuredQueryDashCard = DashCard<StructuredQuerySavedCard>; - -interface Props { - card: DashCard; - dashboard: DashboardWithCards; - onUpdateVisualizationSettings: (settings: Record<string, unknown>) => void; -} - -function ActionsLinkingControl({ - card, - dashboard, - onUpdateVisualizationSettings, -}: Props) { - const connectedDashCardId = - card.visualization_settings["actions.linked_card"]; - - const suitableDashCards = dashboard.ordered_cards.filter( - dashCard => - Q_DEPRECATED.isStructured(dashCard.card.dataset_query) && - !dashCard.isAdded, // only show dash cards that have a stable ID already - ) as StructuredQueryDashCard[]; - - return ( - <PopoverWithTrigger - triggerElement={ - <Tooltip tooltip={t`Connect table`}> - <Icon name="bolt" size={16} /> - </Tooltip> - } - > - <SelectList> - {suitableDashCards.map(dashCard => ( - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - <SelectList.Item - key={dashCard.id} - name={dashCard.card.name} - icon="table" - isSelected={dashCard.id === connectedDashCardId} - onSelect={() => - onUpdateVisualizationSettings({ - "actions.linked_card": dashCard.id, - }) - } - /> - ))} - </SelectList> - </PopoverWithTrigger> - ); -} - -export default ActionsLinkingControl;