Skip to content

Commit

Permalink
Fixed bugs in explorer redirection (opensearch-project#1609)
Browse files Browse the repository at this point in the history
* allow for redirection in associated objects skipping indices

Signed-off-by: Paul Sebastian <[email protected]>

* redirection in datasources table implemented

Signed-off-by: Paul Sebastian <[email protected]>

* moderate s3 callout changes

Signed-off-by: Paul Sebastian <[email protected]>

* lint complaint

Signed-off-by: Paul Sebastian <[email protected]>

* update snap

Signed-off-by: Paul Sebastian <[email protected]>

* fix discover to explorer url redirection

Signed-off-by: Paul Sebastian <[email protected]>

* include glue cache s3 callout

Signed-off-by: Paul Sebastian <[email protected]>

* update snapshot

Signed-off-by: Paul Sebastian <[email protected]>

* expand text area max length

Signed-off-by: Paul Sebastian <[email protected]>

* s3 no results page updated implementation

Signed-off-by: Paul Sebastian <[email protected]>

* open up acceleration flyout when direct query visualization

Signed-off-by: Paul Sebastian <[email protected]>

* update snapshots

Signed-off-by: Paul Sebastian <[email protected]>

* update one last snap

Signed-off-by: Paul Sebastian <[email protected]>

* fix lint complaint for a file i didnt even touch

Signed-off-by: Paul Sebastian <[email protected]>

---------

Signed-off-by: Paul Sebastian <[email protected]>
  • Loading branch information
paulstn authored Mar 25, 2024
1 parent 263542b commit faf9c23
Show file tree
Hide file tree
Showing 20 changed files with 435 additions and 269 deletions.
2 changes: 2 additions & 0 deletions common/constants/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import { BaseItem } from '@algolia/autocomplete-core';

export const textAreaMaxLength = 16384;

export const firstCommand = [{ label: 'source' }];

export const pipeCommands = [
Expand Down
5 changes: 4 additions & 1 deletion common/types/data_connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ export interface Acceleration {
}

export interface AssociatedObject {
tableName: string;
datasource: string;
id: string;
name: string;
database: string;
type: AccelerationIndexType | 'table';
type: AssociatedObjectIndexType;
accelerations: CachedAcceleration[];
columns?: CachedColumn[];
}
Expand Down Expand Up @@ -86,6 +87,8 @@ export interface AsyncApiResponse {

export type PollingCallback = (statusObj: AsyncApiResponse) => void;

export type AssociatedObjectIndexType = AccelerationIndexType | 'table';

export type AccelerationIndexType = 'skipping' | 'covering' | 'materialized';

export type LoadCacheType = 'databases' | 'tables' | 'accelerations' | 'tableColumns';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -1561,7 +1561,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -2756,7 +2756,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -3924,7 +3924,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -5151,7 +5151,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -6319,7 +6319,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -7543,7 +7543,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -8672,7 +8672,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -9859,7 +9859,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -10993,7 +10993,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -12186,7 +12186,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -13354,7 +13354,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -14581,7 +14581,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -15749,7 +15749,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -16978,7 +16978,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down Expand Up @@ -18232,7 +18232,7 @@ Object {
data-test-subj="searchAutocompleteTextArea"
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Enter query"
rows="6"
spellcheck="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ exports[`Log Config component renders empty log config 1`] = `
disabled={false}
enterKeyHint="search"
id="autocomplete-textarea"
maxLength={512}
maxLength={16384}
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
Expand Down Expand Up @@ -543,7 +543,7 @@ exports[`Log Config component renders empty log config 1`] = `
disabled={false}
enterKeyHint="search"
id="autocomplete-textarea"
maxLength={512}
maxLength={16384}
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
Expand Down Expand Up @@ -1136,7 +1136,7 @@ exports[`Log Config component renders with query 1`] = `
disabled={false}
enterKeyHint="search"
id="autocomplete-textarea"
maxLength={512}
maxLength={16384}
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
Expand Down Expand Up @@ -1167,7 +1167,7 @@ exports[`Log Config component renders with query 1`] = `
disabled={false}
enterKeyHint="search"
id="autocomplete-textarea"
maxLength={512}
maxLength={16384}
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ exports[`Explorer Search component renders basic component 1`] = `
data-test-subj="searchAutocompleteTextArea"
enterKeyHint="search"
id="autocomplete-textarea"
maxLength={512}
maxLength={16384}
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
Expand Down Expand Up @@ -280,7 +280,7 @@ exports[`Explorer Search component renders basic component 1`] = `
data-test-subj="searchAutocompleteTextArea"
enterKeyHint="search"
id="autocomplete-textarea"
maxLength={512}
maxLength={16384}
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
Expand Down
3 changes: 2 additions & 1 deletion public/components/common/search/autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { EuiFieldText, EuiTextArea } from '@elastic/eui';
import $ from 'jquery';
import DSLService from 'public/services/requests/dsl';
import React, { useEffect, useMemo, useState } from 'react';
import { AutocompleteItem } from '../../../../common/constants/autocomplete';
import { AutocompleteItem, textAreaMaxLength } from '../../../../common/constants/autocomplete';
import { uiSettingsService } from '../../../../common/utils';
import { IQueryBarProps } from './search';
import './search.scss';
Expand Down Expand Up @@ -142,6 +142,7 @@ export const Autocomplete = (props: AutocompleteProps) => {
'data-test-subj': 'searchAutocompleteTextArea',
placeholder,
inputElement: null,
maxLength: textAreaMaxLength,
})}
{...(panelsFilter && { append, fullWidth: true })}
disabled={isDisabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ exports[`Panels View Component render panel view container and refresh panel 1`]
disabled=""
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Use PPL 'where' clauses to add filters on all visualizations [where Carrier = 'OpenSearch-Air']"
spellcheck="false"
style="margin-top: 0px; height: 18px; padding: 8px;"
Expand Down Expand Up @@ -622,7 +622,7 @@ exports[`Panels View Component render panel view so container and reload dashboa
disabled=""
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Use PPL 'where' clauses to add filters on all visualizations [where Carrier = 'OpenSearch-Air']"
spellcheck="false"
style="margin-top: 0px; height: 18px; padding: 8px;"
Expand Down Expand Up @@ -1810,7 +1810,7 @@ exports[`Panels View Component renders panel view container with visualizations
enterKeyHint="search"
fullWidth={true}
id="autocomplete-textarea"
maxLength={512}
maxLength={16384}
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
Expand Down Expand Up @@ -1864,7 +1864,7 @@ exports[`Panels View Component renders panel view container with visualizations
disabled={true}
enterKeyHint="search"
id="autocomplete-textarea"
maxLength={512}
maxLength={16384}
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
Expand Down Expand Up @@ -4043,7 +4043,7 @@ exports[`Panels View Component renders panel view container without visualizatio
enterKeyHint="search"
fullWidth={true}
id="autocomplete-textarea"
maxLength={512}
maxLength={16384}
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
Expand Down Expand Up @@ -4097,7 +4097,7 @@ exports[`Panels View Component renders panel view container without visualizatio
disabled={true}
enterKeyHint="search"
id="autocomplete-textarea"
maxLength={512}
maxLength={16384}
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ exports[`Panels View SO Component render panel view container and refresh panel
disabled=""
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Use PPL 'where' clauses to add filters on all visualizations [where Carrier = 'OpenSearch-Air']"
spellcheck="false"
style="margin-top: 0px; height: 18px; padding: 8px;"
Expand Down Expand Up @@ -622,7 +622,7 @@ exports[`Panels View SO Component render panel view so container and reload dash
disabled=""
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Use PPL 'where' clauses to add filters on all visualizations [where Carrier = 'OpenSearch-Air']"
spellcheck="false"
style="margin-top: 0px; height: 18px; padding: 8px;"
Expand Down Expand Up @@ -1055,7 +1055,7 @@ exports[`Panels View SO Component renders panels view SO container with visualiz
disabled=""
enterkeyhint="search"
id="autocomplete-textarea"
maxlength="512"
maxlength="16384"
placeholder="Use PPL 'where' clauses to add filters on all visualizations [where Carrier = 'OpenSearch-Air']"
spellcheck="false"
style="margin-top: 0px; height: 18px; padding: 8px;"
Expand Down
Loading

0 comments on commit faf9c23

Please sign in to comment.