Skip to content

Commit

Permalink
ignore shift enter functionality added and sample query 's' removed (o…
Browse files Browse the repository at this point in the history
…pensearch-project#1683)

Signed-off-by: Paul Sebastian <[email protected]>
  • Loading branch information
paulstn authored Apr 11, 2024
1 parent 7163e2e commit 2126a15
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions public/components/common/search/autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interface AutocompleteProps extends IQueryBarProps {
possibleCommands?: Array<{ label: string }>;
append?: any;
isSuggestionDisabled?: boolean;
ignoreShiftEnter?: boolean;
}

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

const [autocompleteState, setAutocompleteState] = useState<AutocompleteState<AutocompleteItem>>({
Expand All @@ -63,6 +65,7 @@ export const Autocomplete = (props: AutocompleteProps) => {
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 @@ -391,6 +391,7 @@ export const DirectSearch = (props: any) => {
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

0 comments on commit 2126a15

Please sign in to comment.