From 753b485d8dc77508c05b1f290c408462adb546ec Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Tue, 9 May 2023 09:49:06 -0700 Subject: [PATCH] Open log patterns by default (#444) Signed-off-by: Joshua Li (cherry picked from commit 72970aa5af30f6ea7c07271375feae67b11d8b6c) --- .../explorer/log_patterns/log_patterns.tsx | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/public/components/event_analytics/explorer/log_patterns/log_patterns.tsx b/public/components/event_analytics/explorer/log_patterns/log_patterns.tsx index 26f34c6323..5a149e0c73 100644 --- a/public/components/event_analytics/explorer/log_patterns/log_patterns.tsx +++ b/public/components/event_analytics/explorer/log_patterns/log_patterns.tsx @@ -3,22 +3,22 @@ * SPDX-License-Identifier: Apache-2.0 */ -import React, { useState, useContext } from 'react'; -import { useDispatch, connect } from 'react-redux'; -import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiText, EuiHorizontalRule } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiLink, EuiText } from '@elastic/eui'; +import React, { useContext, useState } from 'react'; +import { connect, useDispatch } from 'react-redux'; import { FILTERED_PATTERN, PATTERN_REGEX, - RAW_QUERY, PPL_DEFAULT_PATTERN_REGEX_FILETER, + RAW_QUERY, } from '../../../../../common/constants/explorer'; -import { PatternsHeader } from './patterns_header'; -import { PatternsTable } from './patterns_table'; -import { selectPatterns } from '../../redux/slices/patterns_slice'; +import { PatternTableData, Query as IQuery } from '../../../../../common/types/explorer'; import { TabContext, useFetchPatterns } from '../../hooks'; +import { selectPatterns } from '../../redux/slices/patterns_slice'; import { changeQuery, selectQueries } from '../../redux/slices/query_slice'; import { formatError } from '../../utils'; -import { Query as IQuery, PatternTableData } from '../../../../../common/types/explorer'; +import { PatternsHeader } from './patterns_header'; +import { PatternsTable } from './patterns_table'; export interface LogPatternProps { selectedIntervalUnit: { @@ -41,7 +41,7 @@ const EventPatterns = ({ const dispatch = useDispatch(); const { tabId, pplService, notifications } = useContext(TabContext); const patternsData = patterns[tabId]; - const [viewLogPatterns, setViewLogPatterns] = useState(false); + const [viewLogPatterns, setViewLogPatterns] = useState(true); const [isPatternConfigPopoverOpen, setIsPatternConfigPopoverOpen] = useState(false); const [patternRegexInput, setPatternRegexInput] = useState(PPL_DEFAULT_PATTERN_REGEX_FILETER); const { isEventsLoading: isPatternLoading, getPatterns } = useFetchPatterns({ @@ -99,16 +99,14 @@ const EventPatterns = ({ gutterSize="xs" > - {viewLogPatterns && ( - - )} +