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

Delete datasource and Connection Configuration Tab #1024

Merged
merged 6 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`Data Connection Page test Renders data connection page with data 1`] =
<div
class="euiText euiText--medium overview-title"
>
Access control
Authentication method
</div>
<div
class="euiText euiText--small overview-content"
Expand All @@ -84,26 +84,48 @@ exports[`Data Connection Page test Renders data connection page with data 1`] =
<div
class="euiText euiText--medium overview-title"
>
Connection description
Data source description
</div>
<div
class="euiText euiText--small overview-content"
>
my_spark3
-
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiText euiText--medium overview-title"
>
Query permissions
</div>
<div
class="euiText euiText--small overview-content"
>
Everyone
</div>
</div>
</div>
</div>
<div
class="euiFlexItem"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionColumn euiFlexGroup--responsive"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiText euiText--medium overview-title"
>
Connection status
Spark data location
</div>
<div
class="euiText euiText--small overview-content"
>
j-3UNQLT1MPBGLG
-
</div>
</div>
</div>
Expand Down Expand Up @@ -268,20 +290,6 @@ exports[`Data Connection Page test Renders data connection page with data 1`] =
aria-controls="random_html_id"
aria-selected="true"
class="euiTab euiTab-isSelected"
id="data"
role="tab"
type="button"
>
<span
class="euiTab__content"
>
Data
</span>
</button>
<button
aria-controls="random_html_id"
aria-selected="false"
class="euiTab"
id="access_control"
role="tab"
type="button"
Expand All @@ -308,10 +316,125 @@ exports[`Data Connection Page test Renders data connection page with data 1`] =
</button>
</div>
<div
aria-labelledby="data"
aria-labelledby="access_control"
id="random_html_id"
role="tabpanel"
/>
>
<div
class="euiSpacer euiSpacer--l"
/>
<div
class="euiCallOut euiCallOut--primary"
>
<div
class="euiCallOutHeader"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiIcon-isLoading euiCallOutHeader__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
/>
<span
class="euiCallOutHeader__title"
>
Configurations may be managed elsewhere.
</span>
</div>
<div
class="euiText euiText--small"
>
<div
class="euiTextColor euiTextColor--default"
>
Access to data can be managed in other systems outside of OpenSearch. Check with your administrator for additional configurations.
</div>
</div>
</div>
<div
class="euiSpacer euiSpacer--l"
/>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
>
<div
class="euiFlexItem"
>
<div
class="euiText euiText--medium"
>
<h2
class="panel-title"
>
Access Control
</h2>
Control which OpenSearch users have access to this data source.
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<button
class="euiButton euiButton--primary euiButton--fill"
data-test-subj="createButton"
type="button"
>
<span
class="euiButtonContent euiButton__content"
>
<span
class="euiButton__text"
>
Edit
</span>
</span>
</button>
</div>
</div>
<hr
class="euiHorizontalRule euiHorizontalRule--full euiHorizontalRule--marginLarge"
/>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
>
<div
class="euiFlexItem"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionColumn euiFlexGroup--responsive"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiText euiText--medium overview-title"
>
Query access
</div>
<div
class="euiText euiText--small overview-content"
>
-
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="euiSpacer euiSpacer--l"
/>
<div
class="euiSpacer euiSpacer--l"
/>
</div>
</div>
<div
class="euiSpacer euiSpacer--l"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,24 +225,7 @@ exports[`Manage Data Connections Table test Renders manage data connections tabl
</th>
<th
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_connectionStatus_1"
role="columnheader"
scope="col"
>
<span
class="euiTableCellContent"
>
<span
class="euiTableCellContent__text"
title="Connection Status"
>
Connection Status
</span>
</span>
</th>
<th
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_actions_2"
data-test-subj="tableHeaderCell_actions_1"
role="columnheader"
scope="col"
>
Expand Down Expand Up @@ -295,23 +278,6 @@ exports[`Manage Data Connections Table test Renders manage data connections tabl
</div>
</div>
</td>
<td
class="euiTableRowCell"
>
<div
class="euiTableRowCell__mobileHeader euiTableRowCell--hideForDesktop"
>
Connection Status
</div>
<div
class="euiTableCellContent euiTableCellContent--truncateText euiTableCellContent--overflowingContent"
>
<div
class="euiText euiText--medium"
data-test-subj="undefinedDataConnectionHealth"
/>
</div>
</td>
<td
class="euiTableRowCell"
>
Expand Down Expand Up @@ -371,23 +337,6 @@ exports[`Manage Data Connections Table test Renders manage data connections tabl
</div>
</div>
</td>
<td
class="euiTableRowCell"
>
<div
class="euiTableRowCell__mobileHeader euiTableRowCell--hideForDesktop"
>
Connection Status
</div>
<div
class="euiTableCellContent euiTableCellContent--truncateText euiTableCellContent--overflowingContent"
>
<div
class="euiText euiText--medium"
data-test-subj="undefinedDataConnectionHealth"
/>
</div>
</td>
<td
class="euiTableRowCell"
>
Expand Down Expand Up @@ -447,23 +396,6 @@ exports[`Manage Data Connections Table test Renders manage data connections tabl
</div>
</div>
</td>
<td
class="euiTableRowCell"
>
<div
class="euiTableRowCell__mobileHeader euiTableRowCell--hideForDesktop"
>
Connection Status
</div>
<div
class="euiTableCellContent euiTableCellContent--truncateText euiTableCellContent--overflowingContent"
>
<div
class="euiText euiText--medium"
data-test-subj="undefinedDataConnectionHealth"
/>
</div>
</td>
<td
class="euiTableRowCell"
>
Expand Down Expand Up @@ -523,23 +455,6 @@ exports[`Manage Data Connections Table test Renders manage data connections tabl
</div>
</div>
</td>
<td
class="euiTableRowCell"
>
<div
class="euiTableRowCell__mobileHeader euiTableRowCell--hideForDesktop"
>
Connection Status
</div>
<div
class="euiTableCellContent euiTableCellContent--truncateText euiTableCellContent--overflowingContent"
>
<div
class="euiText euiText--medium"
data-test-subj="undefinedDataConnectionHealth"
/>
</div>
</td>
<td
class="euiTableRowCell"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { configure, mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { act, waitFor } from '@testing-library/react';
import React from 'react';
import { describeDataConnection } from './testing_constants';
import { describeDataConnection, mockRoleData } from './testing_constants';
import { DataConnection } from '../data_connection';
import ReactDOM from 'react-dom';

Expand All @@ -17,7 +17,7 @@ jest.mock('../../../../../public/framework/core_refs', () => ({
setBreadcrumbs: jest.fn(),
},
http: {
get: jest.fn().mockResolvedValue(describeDataConnection),
get: jest.fn().mockResolvedValueOnce(mockRoleData).mockResolvedValue(describeDataConnection),
},
},
}));
Expand All @@ -29,7 +29,6 @@ describe('Data Connection Page test', () => {
const pplService = {
fetch: jest.fn(),
};
const wrapper = mount(<DataConnection pplService={pplService} />);
const container = document.createElement('div');
await act(() => {
ReactDOM.render(<DataConnection pplService={pplService} />, container);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@ import React from 'react';
import { ManageDataConnectionsTable } from '../manage_data_connections_table';
import { showDataConnectionsData } from './testing_constants';
import ReactDOM from 'react-dom';
import { coreRefs } from '../../../../../public/framework/core_refs';

jest.mock('../../../../../public/framework/core_refs', () => ({
coreRefs: {
chrome: {
setBreadcrumbs: jest.fn(),
},
http: {
get: jest.fn().mockResolvedValue(showDataConnectionsData),
},
},
}));

describe('Manage Data Connections Table test', () => {
configure({ adapter: new Adapter() });
Expand Down
Loading