Commit 2fac8344 by Alex Khomenko Committed by GitHub

Fix dashboard picker's props (#22815)

parent 67fc251f
...@@ -15,6 +15,7 @@ export function MultiSelect<T>(props: MultiSelectCommonProps<T>) { ...@@ -15,6 +15,7 @@ export function MultiSelect<T>(props: MultiSelectCommonProps<T>) {
interface AsyncSelectProps<T> extends Omit<SelectCommonProps<T>, 'options'>, SelectAsyncProps<T> { interface AsyncSelectProps<T> extends Omit<SelectCommonProps<T>, 'options'>, SelectAsyncProps<T> {
// AsyncSelect has options stored internally. We cannot enable plain values as we don't have access to the fetched options // AsyncSelect has options stored internally. We cannot enable plain values as we don't have access to the fetched options
value?: SelectableValue<T>; value?: SelectableValue<T>;
invalid?: boolean;
} }
export function AsyncSelect<T>(props: AsyncSelectProps<T>) { export function AsyncSelect<T>(props: AsyncSelectProps<T>) {
......
...@@ -12,6 +12,8 @@ export interface Props { ...@@ -12,6 +12,8 @@ export interface Props {
currentDashboard?: SelectableValue<number>; currentDashboard?: SelectableValue<number>;
size?: FormInputSize; size?: FormInputSize;
isClearable?: boolean; isClearable?: boolean;
invalid?: boolean;
disabled?: boolean;
} }
const getDashboards = (query = '') => { const getDashboards = (query = '') => {
...@@ -29,7 +31,8 @@ export const DashboardPicker: FC<Props> = ({ ...@@ -29,7 +31,8 @@ export const DashboardPicker: FC<Props> = ({
currentDashboard, currentDashboard,
size = 'md', size = 'md',
isClearable = false, isClearable = false,
...rest invalid,
disabled,
}) => { }) => {
const debouncedSearch = debounce(getDashboards, 300, { const debouncedSearch = debounce(getDashboards, 300, {
leading: true, leading: true,
...@@ -49,7 +52,8 @@ export const DashboardPicker: FC<Props> = ({ ...@@ -49,7 +52,8 @@ export const DashboardPicker: FC<Props> = ({
placeholder="Select dashboard" placeholder="Select dashboard"
noOptionsMessage="No dashboards found" noOptionsMessage="No dashboards found"
value={currentDashboard} value={currentDashboard}
{...rest} invalid={invalid}
disabled={disabled}
/> />
); );
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment