Skip to content

Commit

Permalink
Merge pull request #129 from quickwit-oss/ddelemeny/fix-context-varia…
Browse files Browse the repository at this point in the history
…ble-queries

Disable lint filter in context editor
  • Loading branch information
ddelemeny authored May 16, 2024
2 parents 6628ce2 + 9f9a2ff commit e88acdb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/LogContext/components/LogContextUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export interface LogContextUIProps extends LogContextProps {

export function LogContextUI(props: LogContextUIProps ){
const builder = useQueryBuilder();
const {query, parsedQuery, setQuery, setParsedQuery} = builder;
const [canRunQuery, setCanRunQuery] = useState<boolean>(false);
const {query, /*parsedQuery,*/ setQuery, setParsedQuery} = builder;
const [canRunQuery, /*setCanRunQuery*/] = useState<boolean>(true);
const {row, origQuery, updateQuery, runContextQuery } = props;

const fieldsSuggestionTimeRange = useMemo(()=>createContextTimeRange(row.timeEpochMs), [row])
Expand All @@ -60,9 +60,11 @@ export function LogContextUI(props: LogContextUIProps ){
setQuery(origQuery?.query || '')
}, [setQuery, origQuery])

useEffect(()=>{
setCanRunQuery(!parsedQuery.parseError)
}, [parsedQuery, setCanRunQuery])
// FIXME : query parser used for lint is not reliable enough
// to use as a filter for wrong queries. Disabled for now.
// useEffect(()=>{
// <setCanRunQuery(!parsedQuery.parseError)
// }, [parsedQuery, setCanRunQuery])

const runQuery = useCallback(()=>{
if (runContextQuery){
Expand Down

0 comments on commit e88acdb

Please sign in to comment.