diff --git a/frontend/src/metabase-lib/.eslintrc b/frontend/src/metabase-lib/.eslintrc index 1c472cb17cb9fddddbf454a075c084d241469dd1..166b1454e03993f6aa3996ef31be7a78eb1ba6b2 100644 --- a/frontend/src/metabase-lib/.eslintrc +++ b/frontend/src/metabase-lib/.eslintrc @@ -9,9 +9,7 @@ "metabase/*", "!metabase/env", "!metabase/lib", - "!metabase/services", - "!metabase/parameters", - "!metabase/writeback" + "!metabase/services" ] }, { diff --git a/frontend/src/metabase-lib/lib/Question.ts b/frontend/src/metabase-lib/lib/Question.ts index d0f0253a4ae11647480f44296c90f769f0820b22..3fe0924c115cf73a520ea4312dbf28e4ce83c8b9 100644 --- a/frontend/src/metabase-lib/lib/Question.ts +++ b/frontend/src/metabase-lib/lib/Question.ts @@ -27,7 +27,7 @@ import { memoizeClass, sortObject } from "metabase-lib/lib/utils"; // TODO: remove these dependencies import * as Urls from "metabase/lib/urls"; -import { getCardUiParameters } from "metabase/parameters/utils/cards"; +import { getCardUiParameters } from "metabase-lib/lib/parameters/utils/cards"; import { DashboardApi, CardApi, diff --git a/frontend/src/metabase/parameters/utils/cards.ts b/frontend/src/metabase-lib/lib/parameters/utils/cards.ts similarity index 98% rename from frontend/src/metabase/parameters/utils/cards.ts rename to frontend/src/metabase-lib/lib/parameters/utils/cards.ts index 7e2cef04bd416ae5d2c969771d030d4d67c03087..82af7b3f107efe4825370f7c7eba51b74bdeddcf 100644 --- a/frontend/src/metabase/parameters/utils/cards.ts +++ b/frontend/src/metabase-lib/lib/parameters/utils/cards.ts @@ -1,5 +1,3 @@ -import _ from "underscore"; - import { Parameter, ParameterTarget } from "metabase-types/types/Parameter"; import { Card } from "metabase-types/types/Card"; import { diff --git a/frontend/src/metabase/public/containers/PublicQuestion.jsx b/frontend/src/metabase/public/containers/PublicQuestion.jsx index 0f73575156e67cf6c2810e084ba2f4c8e525324e..2c2434609754f0708320f05d2b9c91be06f24d91 100644 --- a/frontend/src/metabase/public/containers/PublicQuestion.jsx +++ b/frontend/src/metabase/public/containers/PublicQuestion.jsx @@ -12,8 +12,6 @@ import title from "metabase/hoc/Title"; import { getParameterValuesByIdFromQueryParams } from "metabase/parameters/utils/parameter-values"; -import { getCardUiParameters } from "metabase/parameters/utils/cards"; - import { PublicApi, EmbedApi, @@ -27,6 +25,7 @@ import { addParamValues, addFields } from "metabase/redux/metadata"; import { getMetadata } from "metabase/selectors/metadata"; import PublicMode from "metabase/modes/components/modes/PublicMode"; +import { getCardUiParameters } from "metabase-lib/lib/parameters/utils/cards"; import { getParameterValuesBySlug } from "metabase-lib/lib/parameters/utils/parameter-values"; import { getParametersFromCard } from "metabase-lib/lib/parameters/utils/template-tags"; import { applyParameters } from "metabase-lib/lib/queries/utils/card"; diff --git a/frontend/src/metabase/query_builder/actions/core/parameterUtils.ts b/frontend/src/metabase/query_builder/actions/core/parameterUtils.ts index 7d65a5a83cb7ab8ba8b34cb20b14ef8496a7698a..d8f7e6edaf90f48720e1c64c129332a72fd1079e 100644 --- a/frontend/src/metabase/query_builder/actions/core/parameterUtils.ts +++ b/frontend/src/metabase/query_builder/actions/core/parameterUtils.ts @@ -5,7 +5,6 @@ import { DashboardApi } from "metabase/services"; import { setErrorPage } from "metabase/redux/app"; import { getMetadata } from "metabase/selectors/metadata"; -import { getCardUiParameters } from "metabase/parameters/utils/cards"; import { hasMatchingParameters } from "metabase/parameters/utils/dashboards"; import { getParameterValuesByIdFromQueryParams } from "metabase/parameters/utils/parameter-values"; @@ -13,6 +12,7 @@ import { Dispatch, GetState } from "metabase-types/store"; import { Card, SavedCard } from "metabase-types/types/Card"; import { Parameter } from "metabase-types/types/Parameter"; +import { getCardUiParameters } from "metabase-lib/lib/parameters/utils/cards"; import { cardIsEquivalent, cardParametersAreEquivalent, diff --git a/frontend/src/metabase/query_builder/containers/QuestionEmbedWidget.jsx b/frontend/src/metabase/query_builder/containers/QuestionEmbedWidget.jsx index 4bffa93bd15c6ea5e1110f0ac68ad5cc4cf6f0bc..c2076f0b1173bfa009e84380f210fb15f3d36c20 100644 --- a/frontend/src/metabase/query_builder/containers/QuestionEmbedWidget.jsx +++ b/frontend/src/metabase/query_builder/containers/QuestionEmbedWidget.jsx @@ -11,8 +11,8 @@ import EmbedModalContent from "metabase/public/components/widgets/EmbedModalCont import * as Urls from "metabase/lib/urls"; import MetabaseSettings from "metabase/lib/settings"; import * as MetabaseAnalytics from "metabase/lib/analytics"; -import { getCardUiParameters } from "metabase/parameters/utils/cards"; import { getMetadata } from "metabase/selectors/metadata"; +import { getCardUiParameters } from "metabase-lib/lib/parameters/utils/cards"; import { createPublicLink, diff --git a/frontend/src/metabase/query_builder/selectors.js b/frontend/src/metabase/query_builder/selectors.js index 1e2a04a5597e02df091419fec62b3b620693a993..c733b20ff666a06968e5f51c8b8ca15b825f5b1f 100644 --- a/frontend/src/metabase/query_builder/selectors.js +++ b/frontend/src/metabase/query_builder/selectors.js @@ -14,7 +14,6 @@ import { } from "metabase/visualizations"; import { MetabaseApi } from "metabase/services"; import { getComputedSettingsForSeries } from "metabase/visualizations/lib/settings/visualization"; -import { getCardUiParameters } from "metabase/parameters/utils/cards"; import Databases from "metabase/entities/databases"; import Timelines from "metabase/entities/timelines"; @@ -33,6 +32,7 @@ import { import ObjectMode from "metabase/modes/components/modes/ObjectMode"; import { LOAD_COMPLETE_FAVICON } from "metabase/hoc/Favicon"; +import { getCardUiParameters } from "metabase-lib/lib/parameters/utils/cards"; import { normalizeParameterValue } from "metabase-lib/lib/parameters/utils/parameter-values"; import { isPK } from "metabase-lib/lib/types/utils/isa"; import Mode from "metabase-lib/lib/Mode";