From 6a55019cb651d6e00b0c2c9af575f8df94211915 Mon Sep 17 00:00:00 2001 From: Khristinin Nikita Date: Thu, 21 Jul 2022 10:14:33 +0200 Subject: [PATCH] Show dataViewLabel --- .../detections/components/rules/step_define_rule/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx index 8cb92ab36d51c..2318f59f6af01 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx @@ -183,6 +183,7 @@ const StepDefineRuleComponent: FC = ({ const [openTimelineSearch, setOpenTimelineSearch] = useState(false); const [indexModified, setIndexModified] = useState(false); const [threatIndexModified, setThreatIndexModified] = useState(false); + const [dataViewTitle, setDataViewTitle] = useState(); const [indicesConfig] = useUiSetting$(DEFAULT_INDEX_KEY); const [threatIndicesConfig] = useUiSetting$(DEFAULT_THREAT_INDEX_KEY); @@ -272,6 +273,7 @@ const StepDefineRuleComponent: FC = ({ const fetchDataView = async () => { if (dataView != null) { const dv = await data.dataViews.get(dataView); + setDataViewTitle(dv.title); setIndexPattern(dv); } }; @@ -650,12 +652,13 @@ const StepDefineRuleComponent: FC = ({ [indexPattern] ); - let dataForDescription: Partial = initialState; + let dataForDescription: Partial = { ...initialState }; if (dataSourceType === DataSourceType.IndexPatterns) { dataForDescription = omit(initialState, ['dataSourceType', 'dataViewId']); } else if (dataSourceType === DataSourceType.DataView) { dataForDescription = omit(initialState, ['dataSourceType', 'index']); + dataForDescription.dataViewTitle = dataViewTitle; } return isReadOnlyView ? (