Skip to content
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

Bug fixes for SQL UI buttons #147

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const SKIPPING_INDEX_ACCELERATION_METHODS = [
];

export const ACCELERATION_ADD_FIELDS_TEXT = '(add fields here)';
export const ACCELERATION_INDEX_NAME_REGEX = /^[a-z][a-z_\-]*$/;
export const ACCELERATION_INDEX_NAME_REGEX = /^[a-z][a-z_]*$/;
export const ACCELERATION_S3_URL_REGEX = /^(s3|s3a):\/\/[a-zA-Z0-9.\-]+\/.*/;
export const ACCELERATION_DEFUALT_SKIPPING_INDEX_NAME = 'skipping';

Expand All @@ -78,7 +78,7 @@ export const ACCELERATION_INDEX_NAME_INFO = `All OpenSearch acceleration indices
- 'Materialized View' indices also enable users to define their index name, but they do not have a suffix.
- An example of a 'Materialized View' index name might look like: \`flint_mydatasource_mydb_mytable_myindexname\`.
##### Note:
- All user given index names must be in lowercase letters. Cannot begin with underscores or hyphens. Spaces, commas, and characters :, ", *, +, /, \, |, ?, #, >, or < are not allowed.
- All user given index names must be in lowercase letters. Index name cannot begin with underscores. Spaces, commas, and characters -, :, ", *, +, /, \, |, ?, #, >, or < are not allowed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think i asked this somewhere else but if

All user given index names must be in lowercase letters

and -, :, ", *, +, /, \, |, ?, #, >, or < are obviously not lowercase letters, why does it mention those characters are not allowed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is taken from here: https://docs.aws.amazon.com/opensearch-service/latest/developerguide/indexing.html
Docs team didn't get time for a review.

`;

export const SIDEBAR_POLL_INTERVAL_MS = 5000;
7 changes: 6 additions & 1 deletion public/components/Main/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ export class Main extends React.Component<MainProps, MainState> {
asyncLoading={this.state.asyncLoading}
asyncLoadingStatus={this.state.asyncLoadingStatus}
cancelAsyncQuery={this.cancelAsyncQuery}
selectedDatasource={this.state.selectedDatasource}
/>
</div>
);
Expand Down Expand Up @@ -919,7 +920,10 @@ export class Main extends React.Component<MainProps, MainState> {
<EuiFlexGroup direction="column">
<EuiFlexItem>
<EuiFlexItem grow={false}>
<CreateButton updateSQLQueries={this.updateSQLQueries} />
<CreateButton
updateSQLQueries={this.updateSQLQueries}
selectedDatasource={this.state.selectedDatasource}
/>
</EuiFlexItem>
<EuiSpacer />
<TableView
Expand Down Expand Up @@ -979,6 +983,7 @@ export class Main extends React.Component<MainProps, MainState> {
asyncLoading={this.state.asyncLoading}
asyncLoadingStatus={this.state.asyncLoadingStatus}
cancelAsyncQuery={this.cancelAsyncQuery}
selectedDatasource={this.state.selectedDatasource}
/>
</div>
</EuiPageContentBody>
Expand Down
53 changes: 28 additions & 25 deletions public/components/QueryResults/QueryResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,45 @@ import React from 'react';
import { SortableProperties, SortableProperty } from '@elastic/eui/lib/services';
// @ts-ignore
import {
EuiPanel,
EuiFlexGroup,
EuiFlexItem,
EuiTab,
EuiTabs,
EuiPopover,
Comparators,
EuiButton,
EuiButtonIcon,
EuiComboBoxOptionOption,
EuiContextMenuItem,
EuiContextMenuPanel,
EuiFlexGroup,
EuiFlexItem,
EuiHorizontalRule,
EuiSearchBar,
Pager,
EuiIcon,
EuiText,
EuiPanel,
EuiPopover,
EuiSearchBar,
EuiSpacer,
EuiTab,
EuiTabs,
EuiText,
EuiTextAlign,
EuiButton,
EuiButtonIcon,
Comparators,
Pager,
} from '@elastic/eui';
import {
QueryResult,
QueryMessage,
Tab,
ResponseDetail,
ItemIdToExpandedRowMap,
DataRow,
} from '../Main/main';
import QueryResultsBody from './QueryResultsBody';
import { getQueryIndex, needsScrolling, getSelectedResults } from '../../utils/utils';
import _ from 'lodash';
import { AsyncQueryLoadingStatus } from '../../../common/types';
import { PanelWrapper } from '../../utils/PanelWrapper';
import {
DEFAULT_NUM_RECORDS_PER_PAGE,
MESSAGE_TAB_LABEL,
TAB_CONTAINER_ID,
} from '../../utils/constants';
import { PanelWrapper } from '../../utils/PanelWrapper';
import _ from 'lodash';
import { getQueryIndex, getSelectedResults, needsScrolling } from '../../utils/utils';
import {
DataRow,
ItemIdToExpandedRowMap,
QueryMessage,
QueryResult,
ResponseDetail,
Tab,
} from '../Main/main';
import { AsyncQueryBody } from './AsyncQueryBody';
import { AsyncQueryLoadingStatus } from '../../../common/types';
import QueryResultsBody from './QueryResultsBody';

interface QueryResultsProps {
language: string;
Expand Down Expand Up @@ -73,6 +74,7 @@ interface QueryResultsProps {
asyncLoading: boolean;
asyncLoadingStatus: AsyncQueryLoadingStatus;
cancelAsyncQuery: () => void;
selectedDatasource: EuiComboBoxOptionOption[];
}

interface QueryResultsState {
Expand Down Expand Up @@ -429,6 +431,7 @@ class QueryResults extends React.Component<QueryResultsProps, QueryResultsState>
getCsv={this.props.getCsv}
getText={this.props.getText}
onSort={this.onSort}
selectedDatasource={this.props.selectedDatasource}
/>
</PanelWrapper>
</>
Expand Down
Loading
Loading