From a9a053591b32daee20862937b007e54f4918f065 Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Fri, 18 Sep 2020 15:46:16 +0200 Subject: [PATCH] Field config: Respect config paths when rendering default value of field config property (#27652) (cherry picked from commit e5b16952c7524da705570377bd002d6dec982a4f) --- .../dashboard/components/PanelEditor/FieldConfigEditor.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/features/dashboard/components/PanelEditor/FieldConfigEditor.tsx b/public/app/features/dashboard/components/PanelEditor/FieldConfigEditor.tsx index 0655d8a8bcb..d96bdc54633 100644 --- a/public/app/features/dashboard/components/PanelEditor/FieldConfigEditor.tsx +++ b/public/app/features/dashboard/components/PanelEditor/FieldConfigEditor.tsx @@ -1,5 +1,5 @@ import React, { ReactNode, useCallback } from 'react'; -import cloneDeep from 'lodash/cloneDeep'; +import { get as lodashGet, cloneDeep } from 'lodash'; import { DataFrame, DocsId, @@ -146,9 +146,9 @@ export const DefaultFieldConfigEditor: React.FC = ({ data, onChange, conf const defaults = config.defaults; const value = item.isCustom ? defaults.custom - ? defaults.custom[item.path] + ? lodashGet(defaults.custom, item.path) : undefined - : (defaults as any)[item.path]; + : lodashGet(defaults, item.path); let label: ReactNode | undefined = (