Skip to content

Commit

Permalink
Bug fixes for SQL UI buttons (opensearch-project#147)
Browse files Browse the repository at this point in the history
* adding paper cuts

Signed-off-by: Shenoy Pratik <[email protected]>

* update snapshots

Signed-off-by: Shenoy Pratik <[email protected]>

---------

Signed-off-by: Shenoy Pratik <[email protected]>
  • Loading branch information
ps48 authored Oct 5, 2023
1 parent 56a6bce commit c819cd4
Show file tree
Hide file tree
Showing 16 changed files with 455 additions and 704 deletions.
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.
`;

export const SIDEBAR_POLL_INTERVAL_MS = 5000;
275 changes: 7 additions & 268 deletions public/components/Main/__snapshots__/main.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -203,45 +203,7 @@ exports[`<Main /> spec click clear button 1`] = `
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiPopover euiPopover--anchorDownLeft"
>
<div
class="euiPopover__anchor"
>
<button
class="euiButton euiButton--primary"
type="button"
>
<span
class="euiButtonContent euiButtonContent--iconRight euiButton__content"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiButtonContent__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13.069 5.157 8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0Z"
fill-rule="non-zero"
/>
</svg>
<span
class="euiButton__text"
>
Create
</span>
</span>
</button>
</div>
</div>
</div>
/>
<div
class="euiSpacer euiSpacer--l"
/>
Expand Down Expand Up @@ -763,45 +725,7 @@ exports[`<Main /> spec click run button, and response causes an error 1`] = `
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiPopover euiPopover--anchorDownLeft"
>
<div
class="euiPopover__anchor"
>
<button
class="euiButton euiButton--primary"
type="button"
>
<span
class="euiButtonContent euiButtonContent--iconRight euiButton__content"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiButtonContent__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13.069 5.157 8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0Z"
fill-rule="non-zero"
/>
</svg>
<span
class="euiButton__text"
>
Create
</span>
</span>
</button>
</div>
</div>
</div>
/>
<div
class="euiSpacer euiSpacer--l"
/>
Expand Down Expand Up @@ -1323,45 +1247,7 @@ exports[`<Main /> spec click run button, and response is not ok 1`] = `
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiPopover euiPopover--anchorDownLeft"
>
<div
class="euiPopover__anchor"
>
<button
class="euiButton euiButton--primary"
type="button"
>
<span
class="euiButtonContent euiButtonContent--iconRight euiButton__content"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiButtonContent__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13.069 5.157 8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0Z"
fill-rule="non-zero"
/>
</svg>
<span
class="euiButton__text"
>
Create
</span>
</span>
</button>
</div>
</div>
</div>
/>
<div
class="euiSpacer euiSpacer--l"
/>
Expand Down Expand Up @@ -1883,45 +1769,7 @@ exports[`<Main /> spec click run button, and response is ok 1`] = `
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiPopover euiPopover--anchorDownLeft"
>
<div
class="euiPopover__anchor"
>
<button
class="euiButton euiButton--primary"
type="button"
>
<span
class="euiButtonContent euiButtonContent--iconRight euiButton__content"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiButtonContent__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13.069 5.157 8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0Z"
fill-rule="non-zero"
/>
</svg>
<span
class="euiButton__text"
>
Create
</span>
</span>
</button>
</div>
</div>
</div>
/>
<div
class="euiSpacer euiSpacer--l"
/>
Expand Down Expand Up @@ -2531,45 +2379,7 @@ exports[`<Main /> spec click run button, response fills null and missing values
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiPopover euiPopover--anchorDownLeft"
>
<div
class="euiPopover__anchor"
>
<button
class="euiButton euiButton--primary"
type="button"
>
<span
class="euiButtonContent euiButtonContent--iconRight euiButton__content"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiButtonContent__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13.069 5.157 8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0Z"
fill-rule="non-zero"
/>
</svg>
<span
class="euiButton__text"
>
Create
</span>
</span>
</button>
</div>
</div>
</div>
/>
<div
class="euiSpacer euiSpacer--l"
/>
Expand Down Expand Up @@ -3178,45 +2988,7 @@ exports[`<Main /> spec click translation button, and response is ok 1`] = `
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiPopover euiPopover--anchorDownLeft"
>
<div
class="euiPopover__anchor"
>
<button
class="euiButton euiButton--primary"
type="button"
>
<span
class="euiButtonContent euiButtonContent--iconRight euiButton__content"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiButtonContent__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13.069 5.157 8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0Z"
fill-rule="non-zero"
/>
</svg>
<span
class="euiButton__text"
>
Create
</span>
</span>
</button>
</div>
</div>
</div>
/>
<div
class="euiSpacer euiSpacer--l"
/>
Expand Down Expand Up @@ -3729,40 +3501,7 @@ exports[`<Main /> spec renders the component 1`] = `
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiPopover euiPopover--anchorDownLeft"
>
<div
class="euiPopover__anchor"
>
<button
class="euiButton euiButton--primary"
type="button"
>
<span
class="euiButtonContent euiButtonContent--iconRight euiButton__content"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiIcon-isLoading euiButtonContent__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
/>
<span
class="euiButton__text"
>
Create
</span>
</span>
</button>
</div>
</div>
</div>
/>
<div
class="euiSpacer euiSpacer--l"
/>
Expand Down
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
Loading

0 comments on commit c819cd4

Please sign in to comment.