From 36232857dfb74171d8ccc8cbcc67eaa382854baf Mon Sep 17 00:00:00 2001 From: Alex Khomenko Date: Tue, 17 Mar 2020 12:07:40 +0200 Subject: [PATCH] Fix dashboard picker's props (#22815) (cherry picked from commit 2fac83441364902908ce18980415f3029c603110) --- .../grafana-ui/src/components/Forms/Select/Select.tsx | 1 + public/app/core/components/Select/DashboardPicker.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/Forms/Select/Select.tsx b/packages/grafana-ui/src/components/Forms/Select/Select.tsx index d2e2e62106d..f082d2e443f 100644 --- a/packages/grafana-ui/src/components/Forms/Select/Select.tsx +++ b/packages/grafana-ui/src/components/Forms/Select/Select.tsx @@ -15,6 +15,7 @@ export function MultiSelect(props: MultiSelectCommonProps) { interface AsyncSelectProps extends Omit, 'options'>, SelectAsyncProps { // AsyncSelect has options stored internally. We cannot enable plain values as we don't have access to the fetched options value?: SelectableValue; + invalid?: boolean; } export function AsyncSelect(props: AsyncSelectProps) { diff --git a/public/app/core/components/Select/DashboardPicker.tsx b/public/app/core/components/Select/DashboardPicker.tsx index a70f60490fc..bbcd57ce319 100644 --- a/public/app/core/components/Select/DashboardPicker.tsx +++ b/public/app/core/components/Select/DashboardPicker.tsx @@ -12,6 +12,8 @@ export interface Props { currentDashboard?: SelectableValue; size?: FormInputSize; isClearable?: boolean; + invalid?: boolean; + disabled?: boolean; } const getDashboards = (query = '') => { @@ -29,7 +31,8 @@ export const DashboardPicker: FC = ({ currentDashboard, size = 'md', isClearable = false, - ...rest + invalid, + disabled, }) => { const debouncedSearch = debounce(getDashboards, 300, { leading: true, @@ -49,7 +52,8 @@ export const DashboardPicker: FC = ({ placeholder="Select dashboard" noOptionsMessage="No dashboards found" value={currentDashboard} - {...rest} + invalid={invalid} + disabled={disabled} /> ); };