Skip to content

Commit

Permalink
expose create acceleration flyout, update docs link
Browse files Browse the repository at this point in the history
Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>
  • Loading branch information
ps48 committed Mar 9, 2024
1 parent ae629be commit c65949c
Show file tree
Hide file tree
Showing 11 changed files with 156 additions and 548 deletions.
2 changes: 1 addition & 1 deletion common/constants/data_connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const OPENSEARCH_S3_DOCUMENTATION_URL =
'https://opensearch.org/docs/latest/dashboards/management/S3-data-source/';

export const OPENSEARCH_ACC_DOCUMENTATION_URL =
'https://opensearch.org/docs/latest/data-acceleration/index';
'https://opensearch.org/docs/latest/dashboards/management/accelerate-external-data/';
export const QUERY_RESTRICTED = 'query-restricted';
export const QUERY_ALL = 'query-all';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Array [
<a
class="euiLink euiLink--primary"
href="https://opensearch.org/docs/latest/data-acceleration/index"
href="https://opensearch.org/docs/latest/dashboards/management/accelerate-external-data/"
rel="noopener noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -144,102 +144,25 @@ Array [
</div>
</div>
<div
class="euiSpacer euiSpacer--s"
class="euiSpacer euiSpacer--m"
/>
<div
class="euiFormRow"
id="random_html_id-row"
<dl
class="euiDescriptionList euiDescriptionList--row"
>
<div
class="euiFormRow__labelWrapper"
<dt
class="euiDescriptionList__title"
>
<label
aria-invalid="false"
class="euiFormLabel euiFormRow__label"
for="random_html_id"
>
Data source
</label>
</div>
<div
class="euiFormRow__fieldWrapper"
Data source
</dt>
<dd
class="euiDescriptionList__description"
>
<div
aria-describedby="random_html_id-help-0"
aria-expanded="false"
aria-haspopup="listbox"
class="euiComboBox"
role="combobox"
>
<div
class="euiFormControlLayout"
>
<div
class="euiFormControlLayout__childrenWrapper"
>
<div
class="euiComboBox__inputWrap euiComboBox__inputWrap--noWrap"
data-test-subj="comboBoxInput"
tabindex="-1"
>
<p
class="euiComboBoxPlaceholder"
>
Select a data source
</p>
<div
class="euiComboBox__input"
style="font-size: 14px; display: inline-block;"
>
<input
aria-controls=""
data-test-subj="comboBoxSearchInput"
id="random_html_id"
role="textbox"
style="box-sizing: content-box; width: 2px;"
value=""
/>
<div
style="position: absolute; top: 0px; left: 0px; visibility: hidden; height: 0px; overflow: scroll; white-space: pre; font-family: -webkit-small-control; letter-spacing: normal; text-transform: none;"
/>
</div>
</div>
<div
class="euiFormControlLayoutIcons euiFormControlLayoutIcons--right"
>
<button
aria-label="Open list of options"
class="euiFormControlLayoutCustomIcon euiFormControlLayoutCustomIcon--clickable"
data-test-subj="comboBoxToggleListButton"
type="button"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
/>
</svg>
</button>
</div>
</div>
</div>
</div>
<div
class="euiFormHelpText euiFormRow__text"
id="random_html_id-help-0"
>
A data source has to be configured and active to be able to select it and index data from.
</div>
</div>
</div>
my_glue
</dd>
</dl>
<div
class="euiSpacer euiSpacer--m"
/>
<div
class="euiFormRow"
id="random_html_id-row"
Expand Down Expand Up @@ -843,7 +766,7 @@ Array [
class="euiFormLabel euiFormControlLayout__prepend"
for="random_html_id"
>
flint_{Datasource Name}_{Database Name}_{Table Name}_
flint_my_glue_{Database Name}_{Table Name}_
</label>
<span
class="euiToolTipAnchor"
Expand Down Expand Up @@ -1241,7 +1164,7 @@ Array [
<a
className="euiLink euiLink--primary"
href="https://opensearch.org/docs/latest/data-acceleration/index"
href="https://opensearch.org/docs/latest/dashboards/management/accelerate-external-data/"
rel="noopener noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -1311,129 +1234,25 @@ Array [
</div>
</div>,
<div
className="euiSpacer euiSpacer--s"
className="euiSpacer euiSpacer--m"
/>,
<div
className="euiFormRow"
id="random_html_id-row"
<dl
className="euiDescriptionList euiDescriptionList--row"
>
<div
className="euiFormRow__labelWrapper"
<dt
className="euiDescriptionList__title"
>
<label
aria-invalid={false}
className="euiFormLabel euiFormRow__label"
htmlFor="random_html_id"
>
Data source
</label>
</div>
<div
className="euiFormRow__fieldWrapper"
Data source
</dt>
<dd
className="euiDescriptionList__description"
>
<div
aria-describedby="random_html_id-help-0"
aria-expanded={false}
aria-haspopup="listbox"
className="euiComboBox"
onKeyDown={[Function]}
role="combobox"
>
<div
className="euiFormControlLayout"
>
<div
className="euiFormControlLayout__childrenWrapper"
>
<div
className="euiComboBox__inputWrap euiComboBox__inputWrap--noWrap"
data-test-subj="comboBoxInput"
onClick={[Function]}
tabIndex={-1}
>
<p
className="euiComboBoxPlaceholder"
>
Select a data source
</p>
<div
className="euiComboBox__input"
style={
Object {
"display": "inline-block",
"fontSize": 14,
}
}
>
<input
aria-controls=""
data-test-subj="comboBoxSearchInput"
id="random_html_id"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
role="textbox"
style={
Object {
"boxSizing": "content-box",
"width": "2px",
}
}
value=""
/>
<div
style={
Object {
"height": 0,
"left": 0,
"overflow": "scroll",
"position": "absolute",
"top": 0,
"visibility": "hidden",
"whiteSpace": "pre",
}
}
/>
</div>
</div>
<div
className="euiFormControlLayoutIcons euiFormControlLayoutIcons--right"
>
<button
aria-label="Open list of options"
className="euiFormControlLayoutCustomIcon euiFormControlLayoutCustomIcon--clickable"
data-test-subj="comboBoxToggleListButton"
onClick={[Function]}
type="button"
>
<svg
aria-hidden={true}
className="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false"
height={16}
role="img"
style={null}
viewBox="0 0 16 16"
width={16}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
/>
</svg>
</button>
</div>
</div>
</div>
</div>
<div
className="euiFormHelpText euiFormRow__text"
id="random_html_id-help-0"
>
A data source has to be configured and active to be able to select it and index data from.
</div>
</div>
</div>,
my_glue
</dd>
</dl>,
<div
className="euiSpacer euiSpacer--m"
/>,
<div
className="euiFormRow"
id="random_html_id-row"
Expand Down Expand Up @@ -2138,7 +1957,7 @@ Array [
className="euiFormLabel euiFormControlLayout__prepend"
htmlFor="random_html_id"
>
flint_{Datasource Name}_{Database Name}_{Table Name}_
flint_my_glue_{Database Name}_{Table Name}_
</label>
<span
className="euiToolTipAnchor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports[`Acceleration header renders acceleration flyout header 1`] = `
<a
className="euiLink euiLink--primary"
href="https://opensearch.org/docs/latest/data-acceleration/index"
href="https://opensearch.org/docs/latest/dashboards/management/accelerate-external-data/"
rel="noopener noreferrer"
target="_blank"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiComboBoxOptionOption } from '@elastic/eui';
import { waitFor } from '@testing-library/dom';
import { configure, mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
Expand All @@ -19,19 +18,12 @@ describe('Create acceleration flyout components', () => {
configure({ adapter: new Adapter() });

it('renders acceleration flyout component with default options', async () => {
const selectedDatasource: EuiComboBoxOptionOption[] = [];
const selectedDatasource = 'my_glue';
const resetFlyout = jest.fn();
const updateQueries = jest.fn();
const client = coreStartMock.http;
client.get = jest.fn().mockResolvedValue(mockDatasourcesQuery);
coreStartMock.http.get = jest.fn().mockResolvedValue(mockDatasourcesQuery);

const wrapper = mount(
<CreateAcceleration
http={client}
selectedDatasource={selectedDatasource}
resetFlyout={resetFlyout}
updateQueries={updateQueries}
/>
<CreateAcceleration selectedDatasource={selectedDatasource} resetFlyout={resetFlyout} />
);
wrapper.update();
await waitFor(() => {
Expand Down
Loading

0 comments on commit c65949c

Please sign in to comment.