diff --git a/ui/dashboard/src/components/dashboards/inputs/ComboInput/index.tsx b/ui/dashboard/src/components/dashboards/inputs/ComboInput/index.tsx index 81439d4a6..ee73c860e 100644 --- a/ui/dashboard/src/components/dashboards/inputs/ComboInput/index.tsx +++ b/ui/dashboard/src/components/dashboards/inputs/ComboInput/index.tsx @@ -2,7 +2,7 @@ import CreatableSelect from "react-select/creatable"; import useSelectInputStyles from "../common/useSelectInputStyles"; import useSelectInputValues from "../common/useSelectInputValues"; import { DashboardActions, DashboardDataModeLive } from "../../../../types"; -import { InputProps } from "../types"; +import { InputProps, SelectOption } from "../types"; import { MultiValueLabelWithTags, OptionWithTags, @@ -11,11 +11,6 @@ import { import { useDashboard } from "../../../../hooks/useDashboard"; import { useEffect, useState } from "react"; -export type SelectOption = { - label: string; - value: string; -}; - type SelectInputProps = InputProps & { multi?: boolean; name: string; diff --git a/ui/dashboard/src/components/dashboards/inputs/SelectInput/index.tsx b/ui/dashboard/src/components/dashboards/inputs/SelectInput/index.tsx index d50c95f83..0c63fe201 100644 --- a/ui/dashboard/src/components/dashboards/inputs/SelectInput/index.tsx +++ b/ui/dashboard/src/components/dashboards/inputs/SelectInput/index.tsx @@ -2,7 +2,7 @@ import Select from "react-select"; import useSelectInputStyles from "../common/useSelectInputStyles"; import useSelectInputValues from "../common/useSelectInputValues"; import { DashboardActions, DashboardDataModeLive } from "../../../../types"; -import { InputProps } from "../types"; +import { InputProps, SelectOption } from "../types"; import { MultiValueLabelWithTags, OptionWithTags, @@ -11,12 +11,6 @@ import { import { useDashboard } from "../../../../hooks/useDashboard"; import { useEffect, useState } from "react"; -export type SelectOption = { - label: string; - value: string | null; - tags?: object; -}; - type SelectInputProps = InputProps & { multi?: boolean; name: string; diff --git a/ui/dashboard/src/components/dashboards/inputs/common/useSelectInputValues.test.ts b/ui/dashboard/src/components/dashboards/inputs/common/useSelectInputValues.test.ts index aff904747..ebf823f70 100644 --- a/ui/dashboard/src/components/dashboards/inputs/common/useSelectInputValues.test.ts +++ b/ui/dashboard/src/components/dashboards/inputs/common/useSelectInputValues.test.ts @@ -2,8 +2,7 @@ import useSelectInputValues from "./useSelectInputValues"; import { DashboardRunState } from "../../../../types"; import { LeafNodeData } from "../../common"; import { renderHook } from "@testing-library/react"; -import { SelectInputOption } from "../types"; -import { SelectOption } from "../SelectInput"; +import { SelectInputOption, SelectOption } from "../types"; const options = [ { diff --git a/ui/dashboard/src/components/dashboards/inputs/common/useSelectInputValues.ts b/ui/dashboard/src/components/dashboards/inputs/common/useSelectInputValues.ts index 0b3ddb8ef..3dd4e5aff 100644 --- a/ui/dashboard/src/components/dashboards/inputs/common/useSelectInputValues.ts +++ b/ui/dashboard/src/components/dashboards/inputs/common/useSelectInputValues.ts @@ -1,8 +1,7 @@ import { DashboardRunState } from "../../../../types"; import { getColumn } from "../../../../utils/data"; import { LeafNodeData } from "../../common"; -import { SelectInputOption } from "../types"; -import { SelectOption } from "../SelectInput"; +import { SelectInputOption, SelectOption } from "../types"; import { useMemo } from "react"; const useSelectInputValues = ( diff --git a/ui/dashboard/src/components/dashboards/inputs/types.ts b/ui/dashboard/src/components/dashboards/inputs/types.ts index 2b34a14d1..8b7cedf07 100644 --- a/ui/dashboard/src/components/dashboards/inputs/types.ts +++ b/ui/dashboard/src/components/dashboards/inputs/types.ts @@ -6,6 +6,12 @@ export type BaseInputProps = PanelDefinition & BasePrimitiveProps & ExecutablePrimitiveProps; +export type SelectOption = { + label: string; + value: string | null; + tags?: object; +}; + export type SelectInputOption = { name: string; label?: string;