feat: enable the new where clause for all the log based queries (#6671)

* feat: enable the new where clause for logs dashboards
This commit is contained in:
Vikrant Gupta 2025-01-02 22:55:30 +05:30 committed by GitHub
parent dad72dd295
commit d48cdbfc4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 14 deletions

View File

@ -82,10 +82,6 @@ export const Query = memo(function Query({
entityVersion: version,
});
const isLogsExplorerPage = useMemo(() => pathname === ROUTES.LOGS_EXPLORER, [
pathname,
]);
const handleChangeAggregateEvery = useCallback(
(value: IBuilderQuery['stepInterval']) => {
handleChangeQueryData('stepInterval', value);
@ -457,7 +453,7 @@ export const Query = memo(function Query({
</Col>
)}
<Col flex="1" className="qb-search-container">
{isLogsExplorerPage ? (
{query.dataSource === DataSource.LOGS ? (
<QueryBuilderSearchV2
query={query}
onChange={handleChangeTagFilters}

View File

@ -9,7 +9,6 @@ import {
QUERY_BUILDER_SEARCH_VALUES,
} from 'constants/queryBuilder';
import { DEBOUNCE_DELAY } from 'constants/queryBuilderFilterConfig';
import ROUTES from 'constants/routes';
import { LogsExplorerShortcuts } from 'constants/shortcuts/logsExplorerShortcuts';
import { useKeyboardHotkeys } from 'hooks/hotkeys/useKeyboardHotkeys';
import { WhereClauseConfig } from 'hooks/queryBuilder/useAutoComplete';
@ -40,7 +39,6 @@ import {
useRef,
useState,
} from 'react';
import { useLocation } from 'react-router-dom';
import {
BaseAutocompleteData,
DataTypes,
@ -147,9 +145,8 @@ function QueryBuilderSearchV2(
const [showAllFilters, setShowAllFilters] = useState<boolean>(false);
const { pathname } = useLocation();
const isLogsExplorerPage = useMemo(() => pathname === ROUTES.LOGS_EXPLORER, [
pathname,
const isLogsDataSource = useMemo(() => query.dataSource === DataSource.LOGS, [
query.dataSource,
]);
const memoizedSearchParams = useMemo(
@ -235,7 +232,7 @@ function QueryBuilderSearchV2(
},
{
queryKey: [searchParams],
enabled: isQueryEnabled && !isLogsExplorerPage,
enabled: isQueryEnabled && !isLogsDataSource,
},
);
@ -250,7 +247,7 @@ function QueryBuilderSearchV2(
},
{
queryKey: [suggestionsParams],
enabled: isQueryEnabled && isLogsExplorerPage,
enabled: isQueryEnabled && isLogsDataSource,
},
);
@ -651,7 +648,7 @@ function QueryBuilderSearchV2(
useEffect(() => {
if (currentState === DropdownState.ATTRIBUTE_KEY) {
const { tagKey } = getTagToken(searchValue);
if (isLogsExplorerPage) {
if (isLogsDataSource) {
// add the user typed option in the dropdown to select that and move ahead irrespective of the matches and all
setDropdownOptions([
...(!isEmpty(tagKey) &&
@ -756,7 +753,7 @@ function QueryBuilderSearchV2(
currentFilterItem?.key?.dataType,
currentState,
data?.payload?.attributeKeys,
isLogsExplorerPage,
isLogsDataSource,
searchValue,
suggestionsData?.payload?.attributes,
]);