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

Adding datasource status and filter for hive tables #1549

Merged
merged 2 commits into from
Mar 16, 2024
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
Prev Previous commit
update tests and replace dataConnection variable
Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>
  • Loading branch information
ps48 committed Mar 16, 2024
commit 5a52d4d599a755221235a398cc95b6dd844948d9
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@
import { AccessControlTab } from './access_control_tab';
import { AssociatedObjectsTab } from './associated_objects/associated_objects_tab';
import { InactiveDataConnectionCallout } from './inactive_data_connection';
import { InstalledIntegrationsTable } from './integrations/installed_integrations_table';

const renderCreateAccelerationFlyout = getRenderCreateAccelerationFlyout();

export const DataConnection = (props: any) => {

Check warning on line 51 in public/components/datasources/components/manage/data_connection.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const { dataSource } = props;
const [datasourceDetails, setDatasourceDetails] = useState<DatasourceDetails>({
allowedRoles: [],
Expand Down Expand Up @@ -234,7 +235,7 @@
},
]);
fetchSelectedDatasource();
}, [chrome, http]);

Check warning on line 238 in public/components/datasources/components/manage/data_connection.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has missing dependencies: 'dataSource' and 'fetchSelectedDatasource'. Either include them or remove the dependency array

const tabs = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
);
})
.catch((err) => {
console.error(err);

Check warning on line 65 in public/components/datasources/components/manage/manage_data_connections_table.tsx

View check run for this annotation

Codecov / codecov/patch

public/components/datasources/components/manage/manage_data_connections_table.tsx#L65

Added line #L65 was not covered by tests
setToast(`Data connection $${connectionName} not deleted. See output for more details.`);
});
};
Expand All @@ -70,11 +70,15 @@
const fetchDataSources = () => {
http!
.get(`${DATACONNECTIONS_BASE}`)
.then((res: any) => {

Check warning on line 73 in public/components/datasources/components/manage/manage_data_connections_table.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const dataConnections = res.map((x: any) => {
return { name: x.name, connectionType: x.connector, dsStatus: x.status };
const dataConnections = res.map((dataConnection: any) => {

Check warning on line 74 in public/components/datasources/components/manage/manage_data_connections_table.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
return {

Check warning on line 75 in public/components/datasources/components/manage/manage_data_connections_table.tsx

View check run for this annotation

Codecov / codecov/patch

public/components/datasources/components/manage/manage_data_connections_table.tsx#L75

Added line #L75 was not covered by tests
name: dataConnection.name,
connectionType: dataConnection.connector,
dsStatus: dataConnection.status,
};
});
setData(dataConnections);

Check warning on line 81 in public/components/datasources/components/manage/manage_data_connections_table.tsx

View check run for this annotation

Codecov / codecov/patch

public/components/datasources/components/manage/manage_data_connections_table.tsx#L81

Added line #L81 was not covered by tests
})
.catch((err) => {
console.error(err);
Expand All @@ -90,7 +94,7 @@
},
]);
fetchDataSources();
}, [chrome]);

Check warning on line 97 in public/components/datasources/components/manage/manage_data_connections_table.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'fetchDataSources'. Either include it or remove the dependency array

const displayDeleteModal = (connectionName: string) => {
setModalLayout(
Expand Down Expand Up @@ -207,9 +211,9 @@
truncateText: true,
render: (value, record: DataConnection) =>
record.dsStatus === 'ACTIVE' ? (
<EuiHealth color="success">Active</EuiHealth>

Check warning on line 214 in public/components/datasources/components/manage/manage_data_connections_table.tsx

View check run for this annotation

Codecov / codecov/patch

public/components/datasources/components/manage/manage_data_connections_table.tsx#L214

Added line #L214 was not covered by tests
) : (
<EuiHealth color="subdued">Inactive</EuiHealth>

Check warning on line 216 in public/components/datasources/components/manage/manage_data_connections_table.tsx

View check run for this annotation

Codecov / codecov/patch

public/components/datasources/components/manage/manage_data_connections_table.tsx#L216

Added line #L216 was not covered by tests
),
},
{
Expand All @@ -217,7 +221,7 @@
name: 'Actions',
actions,
},
] as Array<EuiTableFieldDataColumnType<any>>;

Check warning on line 224 in public/components/datasources/components/manage/manage_data_connections_table.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type

const search = {
box: {
Expand All @@ -228,8 +232,8 @@
const entries = data.map((dataconnection: DataConnection) => {
const name = dataconnection.name;
const connectionType = dataconnection.connectionType;
const dsStatus = dataconnection.dsStatus;
return { connectionType, name, dsStatus, data: { name, connectionType } };

Check warning on line 236 in public/components/datasources/components/manage/manage_data_connections_table.tsx

View check run for this annotation

Codecov / codecov/patch

public/components/datasources/components/manage/manage_data_connections_table.tsx#L235-L236

Added lines #L235 - L236 were not covered by tests
});

return (
Expand Down
4 changes: 2 additions & 2 deletions public/framework/catalog_cache/cache_loader.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { CatalogCacheManager } from './cache_manager';

interface LooseObject {
[key: string]: any;

Check warning on line 23 in public/framework/catalog_cache/cache_loader.test.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
}

// Mock localStorage
Expand Down Expand Up @@ -305,7 +305,7 @@
const loadCacheType = 'tables';
const dataSourceName = 'example';
const databaseName = 'test';
const expectedQuery = 'SHOW TABLES IN `example`.`test`';
const expectedQuery = "SHOW TABLE EXTENDED IN `example`.`test` LIKE '*'";
expect(createLoadQuery(loadCacheType, dataSourceName, databaseName)).toEqual(expectedQuery);
});

Expand All @@ -326,7 +326,7 @@
const loadCacheType = 'tables';
const dataSourceName = 'example';
const databaseName = '`sample`';
const expectedQuery = 'SHOW TABLES IN `example`.`sample`';
const expectedQuery = "SHOW TABLE EXTENDED IN `example`.`sample` LIKE '*'";
expect(createLoadQuery(loadCacheType, dataSourceName, databaseName)).toEqual(expectedQuery);
});
});
Expand Down
Loading