mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
Fix dashboard picker's props (#22815)
This commit is contained in:
parent
67fc251fef
commit
2fac834413
@ -15,6 +15,7 @@ export function MultiSelect<T>(props: MultiSelectCommonProps<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
|
||||
value?: SelectableValue<T>;
|
||||
invalid?: boolean;
|
||||
}
|
||||
|
||||
export function AsyncSelect<T>(props: AsyncSelectProps<T>) {
|
||||
|
@ -12,6 +12,8 @@ export interface Props {
|
||||
currentDashboard?: SelectableValue<number>;
|
||||
size?: FormInputSize;
|
||||
isClearable?: boolean;
|
||||
invalid?: boolean;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
const getDashboards = (query = '') => {
|
||||
@ -29,7 +31,8 @@ export const DashboardPicker: FC<Props> = ({
|
||||
currentDashboard,
|
||||
size = 'md',
|
||||
isClearable = false,
|
||||
...rest
|
||||
invalid,
|
||||
disabled,
|
||||
}) => {
|
||||
const debouncedSearch = debounce(getDashboards, 300, {
|
||||
leading: true,
|
||||
@ -49,7 +52,8 @@ export const DashboardPicker: FC<Props> = ({
|
||||
placeholder="Select dashboard"
|
||||
noOptionsMessage="No dashboards found"
|
||||
value={currentDashboard}
|
||||
{...rest}
|
||||
invalid={invalid}
|
||||
disabled={disabled}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user