Skip to content

fix small issues within explorer search bar and sample query #1683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions public/components/common/search/autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
dslService: DSLService,
possibleCommands: Array<{ label: string }>
) => Promise<AutocompleteItem[]>;
onItemSelect: any;

Check warning on line 24 in public/components/common/search/autocomplete.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
isDisabled?: boolean;
baseQuery: string;
tabId: string;
placeholder?: string;
possibleCommands?: Array<{ label: string }>;
append?: any;

Check warning on line 30 in public/components/common/search/autocomplete.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
isSuggestionDisabled?: boolean;
ignoreShiftEnter?: boolean;
}

export const Autocomplete = (props: AutocompleteProps) => {
Expand All @@ -47,6 +48,7 @@
possibleCommands,
append,
isSuggestionDisabled = false,
ignoreShiftEnter = false,
} = props;

const [autocompleteState, setAutocompleteState] = useState<AutocompleteState<AutocompleteItem>>({
Expand All @@ -63,6 +65,7 @@
const panelsFilter = tabId === 'panels-filter';

useEffect(() => {
if (ignoreShiftEnter) return;
const searchBar = document.getElementById('autocomplete-textarea');

searchBar?.addEventListener('keydown', (e) => {
Expand Down
1 change: 1 addition & 0 deletions public/components/common/search/direct_search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
tempQuery: string;
handleQueryChange: (query: string) => void;
handleQuerySearch: () => void;
dslService: any;

Check warning on line 67 in public/components/common/search/direct_search.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
}

export interface IDatePickerProps {
Expand All @@ -74,11 +74,11 @@
setEndTime: () => void;
setTimeRange: () => void;
setIsOutputStale: () => void;
handleTimePickerChange: (timeRange: string[]) => any;

Check warning on line 77 in public/components/common/search/direct_search.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
handleTimeRangePickerRefresh: () => any;

Check warning on line 78 in public/components/common/search/direct_search.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
}

export const DirectSearch = (props: any) => {

Check warning on line 81 in public/components/common/search/direct_search.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const {
query,
tempQuery,
Expand Down Expand Up @@ -119,7 +119,7 @@
error: pollingError,
startPolling,
stopPolling,
} = usePolling<any, any>((params) => {

Check warning on line 122 in public/components/common/search/direct_search.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type

Check warning on line 122 in public/components/common/search/direct_search.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
return sqlService.fetchWithJobId(params);
}, ASYNC_POLLING_INTERVAL);

Expand Down Expand Up @@ -334,13 +334,13 @@
})
);
}
}, [pollingResult, pollingError]);

Check warning on line 337 in public/components/common/search/direct_search.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has missing dependencies: 'dispatch', 'dispatchOnGettingHis', 'stopPollingWithStatus', and 'tabId'. Either include them or remove the dependency array

useEffect(() => {
return () => {
stopPolling();
};
}, []);

Check warning on line 343 in public/components/common/search/direct_search.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'stopPolling'. Either include it or remove the dependency array

useEffect(() => {
if (!explorerSearchMetadata.isPolling) {
Expand Down Expand Up @@ -391,6 +391,7 @@
tabId={tabId}
isSuggestionDisabled={true}
isDisabled={explorerSearchMetadata.isPolling}
ignoreShiftEnter={true}
/>
{queryLang === QUERY_LANGUAGE.PPL && (
<EuiBadge
Expand Down
4 changes: 1 addition & 3 deletions public/components/common/search/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,7 @@ export const Search = (props: any) => {
tempQuery={tempQuery}
baseQuery={baseQuery}
handleQueryChange={handleQueryChange}
handleQuerySearch={() => {
onQuerySearch(queryLang);
}}
handleQuerySearch={runChanges}
dslService={dslService}
getSuggestions={getSuggestions}
onItemSelect={onItemSelect}
Expand Down
2 changes: 1 addition & 1 deletion public/components/event_analytics/explorer/no_results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const NoResults = ({ tabId }: any) => {
<p>Show a list of tables within a database</p>
<EuiSpacer size="s" />
<CreatedCodeBlock
code={`SHOW TABLES EXTENDED IN ${datasourceName}.<database> LIKE '*'`}
code={`SHOW TABLE EXTENDED IN ${datasourceName}.<database> LIKE '*'`}
/>
</EuiFlexItem>
<EuiFlexItem>
Expand Down
Loading