diff --git a/public/app/features/dashboard/components/PanelEditor/getPanelFrameOptions.tsx b/public/app/features/dashboard/components/PanelEditor/getPanelFrameOptions.tsx index b651492c215..56fd78ca84d 100644 --- a/public/app/features/dashboard/components/PanelEditor/getPanelFrameOptions.tsx +++ b/public/app/features/dashboard/components/PanelEditor/getPanelFrameOptions.tsx @@ -125,7 +125,7 @@ export function getPanelFrameCategory(props: OptionPaneRenderProps): OptionsPane { + onChange={(value?: string) => { onPanelConfigChange('repeat', value); }} /> diff --git a/public/app/features/dashboard/components/PanelEditor/types.ts b/public/app/features/dashboard/components/PanelEditor/types.ts index 59c917bf4d7..e95d7b1cc5f 100644 --- a/public/app/features/dashboard/components/PanelEditor/types.ts +++ b/public/app/features/dashboard/components/PanelEditor/types.ts @@ -56,7 +56,7 @@ export interface OptionPaneRenderProps { data?: PanelData; dashboard: DashboardModel; instanceState: unknown; - onPanelConfigChange: (configKey: keyof PanelModel, value: unknown) => void; + onPanelConfigChange: (configKey: T, value: PanelModel[T]) => void; onPanelOptionsChanged: (options: PanelModel['options']) => void; onFieldConfigsChange: (config: FieldConfigSource) => void; } diff --git a/public/app/features/dashboard/components/RepeatRowSelect/RepeatRowSelect.tsx b/public/app/features/dashboard/components/RepeatRowSelect/RepeatRowSelect.tsx index 1e79885c8a5..8c7d0de5afd 100644 --- a/public/app/features/dashboard/components/RepeatRowSelect/RepeatRowSelect.tsx +++ b/public/app/features/dashboard/components/RepeatRowSelect/RepeatRowSelect.tsx @@ -8,8 +8,8 @@ import { getLastKey, getVariablesByKey } from '../../../variables/state/selector export interface Props { id?: string; - repeat?: string | null; - onChange: (name: string | null) => void; + repeat?: string; + onChange: (name?: string) => void; } export const RepeatRowSelect = ({ repeat, onChange, id }: Props) => { diff --git a/public/app/features/dashboard/components/RowOptions/RowOptionsButton.tsx b/public/app/features/dashboard/components/RowOptions/RowOptionsButton.tsx index 3cae211487e..f4d820a652b 100644 --- a/public/app/features/dashboard/components/RowOptions/RowOptionsButton.tsx +++ b/public/app/features/dashboard/components/RowOptions/RowOptionsButton.tsx @@ -7,7 +7,7 @@ import { RowOptionsModal } from './RowOptionsModal'; export interface RowOptionsButtonProps { title: string; - repeat?: string | null; + repeat?: string; onUpdate: OnRowOptionsUpdate; warning?: React.ReactNode; } diff --git a/public/app/features/dashboard/components/RowOptions/RowOptionsForm.tsx b/public/app/features/dashboard/components/RowOptions/RowOptionsForm.tsx index 1558225ee4e..b486aabf5b8 100644 --- a/public/app/features/dashboard/components/RowOptions/RowOptionsForm.tsx +++ b/public/app/features/dashboard/components/RowOptions/RowOptionsForm.tsx @@ -9,15 +9,15 @@ export type OnRowOptionsUpdate = (title: string, repeat?: string | null) => void export interface Props { title: string; - repeat?: string | null; + repeat?: string; onUpdate: OnRowOptionsUpdate; onCancel: () => void; warning?: React.ReactNode; } export const RowOptionsForm = ({ repeat, title, warning, onUpdate, onCancel }: Props) => { - const [newRepeat, setNewRepeat] = useState(repeat); - const onChangeRepeat = useCallback((name?: string | null) => setNewRepeat(name), [setNewRepeat]); + const [newRepeat, setNewRepeat] = useState(repeat); + const onChangeRepeat = useCallback((name?: string) => setNewRepeat(name), [setNewRepeat]); return (
void; onUpdate: OnRowOptionsUpdate;