-
- {appLogEvents && (
-
-
-
- Base Query
-
-
-
- )}
- {!appLogEvents && (
-
-
-
- )}
-
- {
- onQuerySearch(queryLang);
- }}
- dslService={dslService}
- getSuggestions={getSuggestions}
- onItemSelect={onItemSelect}
- tabId={tabId}
- />
- showFlyout()}
- onClickAriaLabel={'pplLinkShowFlyout'}
- >
- PPL
-
-
-
-
- {!isLiveTailOn && (
- handleTimePickerChange(timeRange)}
- handleTimeRangePickerRefresh={() => {
- onQuerySearch(queryLang);
- }}
- />
- )}
-
- {showSaveButton && !showSavePanelOptionsList && (
-
-
-
-
-
- )}
- {isLiveTailOn && (
-
-
-
- )}
- {showSaveButton && searchBarConfigs[selectedSubTabId]?.showSaveButton && (
- <>
-
- setIsSavePanelOpen(false)}
+
+
+
+ {appLogEvents && (
+
+
+
+ Base Query
+
+
+
+ )}
+ {!appLogEvents && (
+ <>
+
+ {
+ handleQueryLanguageChange(lang);
+ setQueryLang(lang);
+ }}
+ />
+
+
+ showFlyout()}
+ color="#159D8D"
+ // onClickAriaLabel={'pplLinkShowFlyout'}
+ />
+
+ {coreRefs.queryAssistEnabled && (
+
+ Index}
+ singleSelection={true}
+ isLoading={loading}
+ options={indicesAndIndexPatterns}
+ selectedOptions={selectedIndex}
+ onChange={(index) => {
+ // clear previous state
+ batch(() => {
+ dispatch(reset({ tabId }));
+ dispatch(resetSummary({ tabId }));
+ });
+ // change the query in the editor to be just source=
+ const indexQuery = `source = ${index[0].label}`;
+ handleQueryChange(indexQuery);
+ // get the fields into the sidebar
+ getAvailableFields(indexQuery);
+ setSelectedIndex(index);
+ }}
+ />
+
+ )}
+ >
+ )}
+ {!showQueryArea && (
+
- {
- return (
- isEqual(curVisId, 'line') &&
- tempQuery &&
- tempQuery.match(PPL_SPAN_REGEX) !== null
+ {
+ onQuerySearch(queryLang);
+ }}
+ dslService={dslService}
+ getSuggestions={getSuggestions}
+ onItemSelect={onItemSelect}
+ tabId={tabId}
+ />
+ showFlyout()}
+ onClickAriaLabel={'pplLinkShowFlyout'}
+ >
+ PPL
+
+
+ )}
+
+
+ {!isLiveTailOn && (
+ {
+ // modifies run button to look like the update button, if there is a time change, disables timepicker setting update if timepicker is disabled
+ setNeedsUpdate(
+ !showQueryArea && // keeps statement false if using query assistant ui, timepicker shouldn't change run button
+ !(tRange[0] === startTime && tRange[1] === endTime) // checks to see if the time given is different from prev
);
+ // keeps the time range change local, to be used when update pressed
+ setTimeRange(tRange);
+ setStartTime(tRange[0]);
+ setEndTime(tRange[1]);
+ }}
+ handleTimeRangePickerRefresh={() => {
+ onQuerySearch(queryLang);
}}
+ isAppAnalytics={isAppAnalytics}
/>
-
-
-
- setIsSavePanelOpen(false)}
- data-test-subj="eventExplorer__querySaveCancel"
- >
- Cancel
-
-
-
- {
- handleSavingObject();
- setIsSavePanelOpen(false);
- }}
- data-test-subj="eventExplorer__querySaveConfirm"
- >
- Save
-
-
-
-
-
+ )}
+
+
+
+ {needsUpdate ? 'Update' : 'Run'}
+
+
+
+ {!showQueryArea && showSaveButton && !showSavePanelOptionsList && (
+
+
+
+
+
+ )}
+ {!showQueryArea && isLiveTailOn && (
+
+
+
+ )}
+ {showSaveButton && searchBarConfigs[selectedSubTabId]?.showSaveButton && (
+ <>
+
+ setIsSavePanelOpen(false)}
+ >
+
+
+
+
+ setIsSavePanelOpen(false)}
+ data-test-subj="eventExplorer__querySaveCancel"
+ >
+ Cancel
+
+
+
+ {
+ handleSavingObject();
+ setIsSavePanelOpen(false);
+ }}
+ data-test-subj="eventExplorer__querySaveConfirm"
+ >
+ Save
+
+
+
+
+
+
+ >
+ )}
+
+
+ {showQueryArea && (
+ <>
+
+
+
+ {(queryAssistantSummarization?.summary?.length > 0 ||
+ queryAssistantSummarization?.summaryLoading) && (
+
+
+
+ )}
>
)}
diff --git a/public/components/common/search/sql_search.tsx b/public/components/common/search/sql_search.tsx
index 69e1f2610..a70746364 100644
--- a/public/components/common/search/sql_search.tsx
+++ b/public/components/common/search/sql_search.tsx
@@ -97,7 +97,7 @@ export const DirectSearch = (props: any) => {
const {
data: pollingResult,
- loading: pollingLoading,
+ loading: _pollingLoading,
error: pollingError,
startPolling,
stopPolling,
@@ -139,7 +139,7 @@ export const DirectSearch = (props: any) => {
);
- const handleQueryLanguageChange = (lang: string) => {
+ const handleQueryLanguageChange = (lang: QUERY_LANGUAGE) => {
if (lang === 'DQL') {
application!.navigateToUrl('../app/data-explorer/discover');
return;
diff --git a/public/components/datasources/icons/query-assistant-logo.svg b/public/components/datasources/icons/query-assistant-logo.svg
new file mode 100644
index 000000000..d21737d82
--- /dev/null
+++ b/public/components/datasources/icons/query-assistant-logo.svg
@@ -0,0 +1,18 @@
+
\ No newline at end of file
diff --git a/public/components/event_analytics/__tests__/__snapshots__/no_results.test.tsx.snap b/public/components/event_analytics/__tests__/__snapshots__/no_results.test.tsx.snap
index 9092d4be2..0fe3612fb 100644
--- a/public/components/event_analytics/__tests__/__snapshots__/no_results.test.tsx.snap
+++ b/public/components/event_analytics/__tests__/__snapshots__/no_results.test.tsx.snap
@@ -1,142 +1,156 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`No result component Renders No result component 1`] = `
-
-
+
-
-
-
-
-
-
- }
+
-
+ }
>
-
-
-
-
-
-
+
+
+
+
+
+
+
+ No results match your search criteria
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- No results match your search criteria
+ Select a data source, expand your time range, or modify the query
-
+
+
+
+
+ After selection, check the time range, query filters, fields, and query
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Select a data source, expand your time range, or modify the query
-
-
-
-
-
-
- After selection, check the time range, query filters, fields, and query
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
`;
diff --git a/public/components/event_analytics/__tests__/no_results.test.tsx b/public/components/event_analytics/__tests__/no_results.test.tsx
index 1bc6c9eb1..7d545ddf4 100644
--- a/public/components/event_analytics/__tests__/no_results.test.tsx
+++ b/public/components/event_analytics/__tests__/no_results.test.tsx
@@ -8,20 +8,28 @@ import Adapter from 'enzyme-adapter-react-16';
import React from 'react';
import { waitFor } from '@testing-library/react';
import { NoResults } from '../explorer/no_results';
+import { initialTabId } from '../../../framework/redux/store/shared_state';
+import { Provider } from 'react-redux';
+import { applyMiddleware, createStore } from '@reduxjs/toolkit';
+import { rootReducer } from '../../../framework/redux/reducers';
+import thunk from 'redux-thunk';
describe('No result component', () => {
configure({ adapter: new Adapter() });
it('Renders No result component', async () => {
-
+ const store = createStore(rootReducer, applyMiddleware(thunk));
+
const wrapper = mount(
-