mirror of
https://github.com/turbot/steampipe.git
synced 2026-04-11 07:00:06 -04:00
Move dashboard UI select option types to input types and re-use for combo select option #3244.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = [
|
||||
{
|
||||
|
||||
@@ -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 = (
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user