Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open log patterns by default (#444) #459

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -41,7 +41,7 @@ const EventPatterns = ({
const dispatch = useDispatch();
const { tabId, pplService, notifications } = useContext<any>(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({
Expand Down Expand Up @@ -99,16 +99,14 @@ const EventPatterns = ({
gutterSize="xs"
>
<EuiFlexItem grow={false}>
{viewLogPatterns && (
<PatternsHeader
patternsData={patternsData}
patternRegexInput={patternRegexInput}
setPatternRegexInput={setPatternRegexInput}
onPatternApply={handlePatternApply}
isPatternConfigPopoverOpen={isPatternConfigPopoverOpen}
setIsPatternConfigPopoverOpen={setIsPatternConfigPopoverOpen}
/>
)}
<PatternsHeader
patternsData={patternsData}
patternRegexInput={patternRegexInput}
setPatternRegexInput={setPatternRegexInput}
onPatternApply={handlePatternApply}
isPatternConfigPopoverOpen={isPatternConfigPopoverOpen}
setIsPatternConfigPopoverOpen={setIsPatternConfigPopoverOpen}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexGroup>
Expand Down