Skip to content

Commit

Permalink
Update tooltip to display es|ql
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Sep 1, 2023
1 parent 34a8d0a commit 5a5a20b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ import React, { ReactNode, useCallback, useEffect, useMemo, useRef, useState } f
import deepEqual from 'fast-deep-equal';
import useObservable from 'react-use/lib/useObservable';
import type { Filter, TimeRange, Query, AggregateQuery } from '@kbn/es-query';
import { getAggregateQueryMode, isOfQueryType, isOfAggregateQueryType } from '@kbn/es-query';
import {
getAggregateQueryMode,
isOfQueryType,
isOfAggregateQueryType,
getLanguageDisplayName,
} from '@kbn/es-query';
import { TextBasedLangEditor } from '@kbn/text-based-languages/public';
import { EMPTY } from 'rxjs';
import { map } from 'rxjs/operators';
Expand Down Expand Up @@ -79,13 +84,14 @@ const getWrapperWithTooltip = (
) => {
if (enableTooltip && query && isOfAggregateQueryType(query)) {
const textBasedLanguage = getAggregateQueryMode(query);
const displayName = getLanguageDisplayName(textBasedLanguage);
return (
<EuiToolTip
position="top"
content={i18n.translate('unifiedSearch.query.queryBar.textBasedNonTimestampWarning', {
defaultMessage:
'Date range selection for {language} queries requires the presence of an @timestamp field in the dataset.',
values: { language: textBasedLanguage },
values: { language: displayName },
})}
>
{children}
Expand Down

0 comments on commit 5a5a20b

Please sign in to comment.