Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Fix parameters violations (#75074)

Fraser85bf5cfbd806
diff --git a/frontend/lint/module-boundaries.mjs b/frontend/lint/module-boundaries.mjs
index e4efd834d62..3178bd8f148 100644
--- a/frontend/lint/module-boundaries.mjs
+++ b/frontend/lint/module-boundaries.mjs
@@ -99,6 +99,7 @@ const elements = [
createElement({ type: "shared", name: "models" }),
createElement({ type: "shared", name: "new" }),
createElement({ type: "shared", name: "palette" }),
+ createElement({ type: "shared", name: "parameters" }),
createElement({ type: "shared", name: "pulse" }),
createElement({ type: "shared", name: "querying", enforceOutgoing: false }),
createElement({ type: "shared", name: "questions" }),
diff --git a/frontend/src/metabase/dashboard/components/Dashboard/Dashboard.tsx b/frontend/src/metabase/dashboard/components/Dashboard/Dashboard.tsx
index c07e5c648ee..38593377f7e 100644
--- a/frontend/src/metabase/dashboard/components/Dashboard/Dashboard.tsx
+++ b/frontend/src/metabase/dashboard/components/Dashboard/Dashboard.tsx
@@ -9,7 +9,6 @@ import { useDashboardContext } from "metabase/dashboard/context";
import { getIsHeaderVisible } from "metabase/dashboard/selectors";
import EmbedFrameS from "metabase/embedding/theme.module.css";
import { isEmbeddingSdk } from "metabase/embedding-sdk/config";
-import { FilterApplyToast } from "metabase/parameters/components/FilterApplyToast";
import { useSelector } from "metabase/redux";
import { FullWidthContainer } from "metabase/styled-components/layout/FullWidthContainer";
import { Box, Flex, Loader } from "metabase/ui";
@@ -26,6 +25,7 @@ import { DashboardParameterPanel } from "../DashboardParameterPanel";
import { DashboardSidebars } from "../DashboardSidebars";
import { DashboardTabs } from "../DashboardTabs";
import { DashboardTitle } from "../DashboardTitle";
+import { FilterApplyToast } from "../FilterApplyToast";
import { RefreshWidget } from "../RefreshWidget";
import S from "./Dashboard.module.css";
diff --git a/frontend/src/metabase/parameters/components/FilterApplyToast/FilterApplyToast.tsx b/frontend/src/metabase/dashboard/components/FilterApplyToast/FilterApplyToast.tsx
similarity index 100%
rename from frontend/src/metabase/parameters/components/FilterApplyToast/FilterApplyToast.tsx
rename to frontend/src/metabase/dashboard/components/FilterApplyToast/FilterApplyToast.tsx
diff --git a/frontend/src/metabase/parameters/components/FilterApplyToast/index.ts b/frontend/src/metabase/dashboard/components/FilterApplyToast/index.ts
similarity index 100%
rename from frontend/src/metabase/parameters/components/FilterApplyToast/index.ts
rename to frontend/src/metabase/dashboard/components/FilterApplyToast/index.ts
diff --git a/frontend/src/metabase/parameters/components/FilterApplyToast/utils.ts b/frontend/src/metabase/dashboard/components/FilterApplyToast/utils.ts
similarity index 100%
rename from frontend/src/metabase/parameters/components/FilterApplyToast/utils.ts
rename to frontend/src/metabase/dashboard/components/FilterApplyToast/utils.ts
diff --git a/frontend/src/metabase/parameters/components/FilterApplyToast/utils.unit.spec.ts b/frontend/src/metabase/dashboard/components/FilterApplyToast/utils.unit.spec.ts
similarity index 100%
rename from frontend/src/metabase/parameters/components/FilterApplyToast/utils.unit.spec.ts
rename to frontend/src/metabase/dashboard/components/FilterApplyToast/utils.unit.spec.ts
diff --git a/frontend/src/metabase/parameters/components/ParameterWidget/ParameterWidget.tsx b/frontend/src/metabase/parameters/components/ParameterWidget/ParameterWidget.tsx
index 0e75171a504..47722377b19 100644
--- a/frontend/src/metabase/parameters/components/ParameterWidget/ParameterWidget.tsx
+++ b/frontend/src/metabase/parameters/components/ParameterWidget/ParameterWidget.tsx
@@ -11,7 +11,6 @@ import { usePrevious } from "react-use";
import { Sortable } from "metabase/common/components/Sortable";
import CS from "metabase/css/core/index.css";
-import type { DashboardFullscreenControls } from "metabase/dashboard/types";
import { useTranslateContent } from "metabase/i18n/hooks";
import { Box, Flex } from "metabase/ui";
import type { UiParameter } from "metabase-lib/v1/parameters/types";
@@ -29,29 +28,27 @@ import S from "./ParameterWidget.module.css";
export type ParameterWidgetProps = PropsWithChildren<
{
parameter: UiParameter;
- } & Partial<
- {
- setValue: (value: any) => void;
- cardId?: CardId;
- dashboardId?: DashboardId;
+ } & Partial<{
+ setValue: (value: any) => void;
+ cardId?: CardId;
+ dashboardId?: DashboardId;
- editingParameter: Parameter | null;
- commitImmediately: boolean;
- parameters: UiParameter[];
- setParameterValueToDefault: (parameterId: ParameterId) => void;
- enableParameterRequiredBehavior: boolean;
- isSortable: boolean;
- isEditing: boolean;
- className: string;
- isFullscreen: boolean;
- setEditingParameter: (parameterId: ParameterId | null) => void;
- dragHandle: ReactNode;
- withinPortal?: boolean;
- fullWidth?: boolean;
- hasTestId?: boolean;
- popoverPosition: "bottom-start" | "bottom-end";
- } & Pick<DashboardFullscreenControls, "isFullscreen">
- >
+ editingParameter: Parameter | null;
+ commitImmediately: boolean;
+ parameters: UiParameter[];
+ setParameterValueToDefault: (parameterId: ParameterId) => void;
+ enableParameterRequiredBehavior: boolean;
+ isSortable: boolean;
+ isEditing: boolean;
+ className: string;
+ isFullscreen: boolean;
+ setEditingParameter: (parameterId: ParameterId | null) => void;
+ dragHandle: ReactNode;
+ withinPortal?: boolean;
+ fullWidth?: boolean;
+ hasTestId?: boolean;
+ popoverPosition: "bottom-start" | "bottom-end";
+ }>
>;
export const ParameterWidget = ({
diff --git a/frontend/src/metabase/parameters/components/ParametersList/types.ts b/frontend/src/metabase/parameters/components/ParametersList/types.ts
index 10328422141..4652d700fc0 100644
--- a/frontend/src/metabase/parameters/components/ParametersList/types.ts
+++ b/frontend/src/metabase/parameters/components/ParametersList/types.ts
@@ -1,7 +1,3 @@
-import type {
- DashboardFullscreenControls,
- EmbedHideParametersControls,
-} from "metabase/dashboard/types";
import type {
CardId,
DashboardId,
@@ -13,31 +9,29 @@ import type { ParameterWidgetProps } from "../ParameterWidget";
export type ParametersListProps = {
parameters: Parameter[];
-} & Partial<
- {
- className: string;
+} & Partial<{
+ className: string;
+
+ cardId?: CardId;
+ dashboardId?: DashboardId;
+ editingParameter: Parameter | null | undefined;
+ linkedFilterParameters: Parameter[];
- cardId?: CardId;
- dashboardId?: DashboardId;
- editingParameter: Parameter | null | undefined;
- linkedFilterParameters: Parameter[];
+ isEditing: boolean;
+ isSortable?: boolean;
+ vertical: boolean;
+ commitImmediately: boolean;
+ setParameterValue: (parameterId: ParameterId, value: any) => void;
+ setParameterValueToDefault: (parameterId: ParameterId) => void;
+ setParameterIndex: (parameterId: ParameterId, parameterIndex: number) => void;
+ setEditingParameter: (parameterId: ParameterId | null) => void;
+ enableParameterRequiredBehavior: boolean;
+ widgetsWithinPortal?: boolean;
+ widgetsPopoverPosition: ParameterWidgetProps["popoverPosition"];
+ layout?: "horizontal" | "vertical";
+ hasTestIdProps?: boolean;
- isEditing: boolean;
- isSortable?: boolean;
- vertical: boolean;
- commitImmediately: boolean;
- setParameterValue: (parameterId: ParameterId, value: any) => void;
- setParameterValueToDefault: (parameterId: ParameterId) => void;
- setParameterIndex: (
- parameterId: ParameterId,
- parameterIndex: number,
- ) => void;
- setEditingParameter: (parameterId: ParameterId | null) => void;
- enableParameterRequiredBehavior: boolean;
- widgetsWithinPortal?: boolean;
- widgetsPopoverPosition: ParameterWidgetProps["popoverPosition"];
- layout?: "horizontal" | "vertical";
- hasTestIdProps?: boolean;
- } & Pick<DashboardFullscreenControls, "isFullscreen"> &
- Pick<EmbedHideParametersControls, "hideParameters">
->;
+ isFullscreen: boolean;
+ /** Comma-separated list of parameter slugs to hide (embed display option) */
+ hideParameters: string | null;
+}>;
diff --git a/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.tsx b/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.tsx
index a008329cd8f..c57afc8423f 100644
--- a/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.tsx
+++ b/frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.tsx
@@ -9,6 +9,7 @@ import TransitionS from "metabase/css/core/transitions.module.css";
import DashboardS from "metabase/dashboard/components/Dashboard/Dashboard.module.css";
import { FixedWidthContainer } from "metabase/dashboard/components/Dashboard/DashboardComponents";
import { ExportAsPdfButton } from "metabase/dashboard/components/DashboardHeader/buttons/ExportAsPdfButton";
+import { FilterApplyToast } from "metabase/dashboard/components/FilterApplyToast";
import {
DASHBOARD_HEADER_PARAMETERS_PDF_EXPORT_NODE_ID,
DASHBOARD_PDF_EXPORT_ROOT_ID,
@@ -21,7 +22,6 @@ import {
import { EmbeddingFooter } from "metabase/embedding/components/EmbeddingFooter/EmbeddingFooter";
import EmbedThemeS from "metabase/embedding/theme.module.css";
import { isEmbeddingSdk } from "metabase/embedding-sdk/config";
-import { FilterApplyToast } from "metabase/parameters/components/FilterApplyToast";
import { ParametersList } from "metabase/parameters/components/ParametersList";
import { getVisibleParameters } from "metabase/parameters/utils/ui";
import { SyncedParametersList } from "metabase/query_builder/components/SyncedParametersList";