From ee634dd4bd667b4618b6e41e3784213c0bc90c6a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 11 Jun 2024 17:20:12 +0000 Subject: [PATCH] fixed rule object to yaml conversion for timeframe (#1020) Signed-off-by: Amardeepsingh Siglani (cherry picked from commit 2b1c6f1d815cf4f64d232866a6aae377c5c7eb23) Signed-off-by: github-actions[bot] --- .../Rules/components/RuleEditor/DetectionVisualEditor.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/pages/Rules/components/RuleEditor/DetectionVisualEditor.tsx b/public/pages/Rules/components/RuleEditor/DetectionVisualEditor.tsx index c5c309475..05e8082c5 100644 --- a/public/pages/Rules/components/RuleEditor/DetectionVisualEditor.tsx +++ b/public/pages/Rules/components/RuleEditor/DetectionVisualEditor.tsx @@ -253,7 +253,9 @@ export class DetectionVisualEditor extends React.Component< let selectionMaps: any = {}; selection.data.forEach((datum) => { - if (datum.field) { + if (selection.name === 'timeframe') { + selectionMaps = datum.values[0] || ''; + } else if (datum.field) { const key = `${datum.field}${datum.modifier ? `|${datum.modifier}` : ''}`; selectionMaps[key] = datum.values; } else {