Skip to content

Commit

Permalink
Move location of default query setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry350 committed Oct 20, 2022
1 parent 94b86c9 commit fd193dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface ILogFilterState {
validationError: Error | null;
}

const DEFAULT_QUERY = {
export const DEFAULT_QUERY = {
language: 'kuery',
query: '',
};
Expand Down Expand Up @@ -64,11 +64,6 @@ export const useLogFilterState = ({ indexPattern }: { indexPattern?: DataViewBas
const kibanaQuerySettings = useKibanaQuerySettings();

const [logFilterState, setLogFilterState] = useState<ILogFilterState>(() => {
// NOTE: Set a default on the queryString manager so we don't pull in values from other solutions.
queryString.setQuery({
language: 'kuery',
query: '',
});
return INITIAL_LOG_FILTER_STATE;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as rt from 'io-ts';
import React from 'react';
import { Query } from '@kbn/es-query';
import { replaceStateKeyInQueryString, UrlStateContainer } from '../../../utils/url_state';
import { useLogFilterStateContext } from './log_filter_state';
import { useLogFilterStateContext, DEFAULT_QUERY } from './log_filter_state';
import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';

export const WithLogFilterUrlState: React.FC = () => {
Expand Down

0 comments on commit fd193dd

Please sign in to comment.