Skip to content

Commit

Permalink
Adding datasource status and filter for hive tables (#1549)
Browse files Browse the repository at this point in the history
* adding datasource status and filter for hive tables

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

* update tests and replace dataConnection variable

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

---------

Signed-off-by: Shenoy Pratik <[email protected]>
  • Loading branch information
ps48 authored Mar 16, 2024
1 parent f095910 commit 0e7c2bf
Show file tree
Hide file tree
Showing 15 changed files with 374 additions and 743 deletions.
1 change: 1 addition & 0 deletions common/constants/data_sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const ACCELERATION_TIME_INTERVAL = [
export const ACCELERATION_ADD_FIELDS_TEXT = '(add fields here)';
export const ACCELERATION_INDEX_NAME_REGEX = /^[a-z][a-z_]*$/;
export const ACCELERATION_S3_URL_REGEX = /^(s3|s3a):\/\/[a-zA-Z0-9.\-]+/;
export const SPARK_HIVE_TABLE_REGEX = /Provider:\s*hive/;
export const TIMESTAMP_DATATYPE = 'timestamp';

export const ACCELERATION_INDEX_TYPES = [
Expand Down
1 change: 1 addition & 0 deletions common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const INTEGRATIONS_BASE = '/api/integrations';
export const JOBS_BASE = '/query/jobs';
export const DATACONNECTIONS_BASE = '/api/dataconnections';
export const EDIT = '/edit';
export const DATACONNECTIONS_UPDATE_STATUS = '/status';
export const SECURITY_ROLES = '/api/v1/configuration/roles';
export const EVENT_ANALYTICS = '/event_analytics';
export const SAVED_OBJECTS = '/saved_objects';
Expand Down
3 changes: 3 additions & 0 deletions common/types/data_connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@ export interface PrometheusProperties {
'prometheus.uri': string;
}

export type DatasourceStatus = 'ACTIVE' | 'DISABLED';

export interface DatasourceDetails {
allowedRoles: string[];
name: string;
connector: DatasourceType;
description: string;
properties: S3GlueProperties | PrometheusProperties;
status: DatasourceStatus;
}

interface AsyncApiDataResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,24 +156,16 @@ exports[`Data Connection Page test Renders S3 data connection page with data 1`]
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--xxLarge euiCard__icon"
class="euiIcon euiIcon--xxLarge euiIcon-isLoading euiCard__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 12 12"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
clip-rule="evenodd"
d="M5.095 2.903a.525.525 0 0 1 .472-.278l1.05.016a.525.525 0 0 1 .462.292l.42.844.742-.063a.525.525 0 0 1 .486.239l.53.822a.525.525 0 0 1-.015.59l-.39.546.415.548c.129.17.142.402.032.586l-.5.838a.525.525 0 0 1-.482.255l-.785-.048-.483.989a.525.525 0 0 1-.472.294H5.495a.525.525 0 0 1-.471-.294L4.57 8.15l-.84.076a.525.525 0 0 1-.493-.246l-.531-.855a.525.525 0 0 1 .03-.597l.48-.625-.386-.539a.525.525 0 0 1-.014-.59l.53-.822a.525.525 0 0 1 .485-.239l.797.068.467-.879Zm.598.474-.472.888a.525.525 0 0 1-.508.277l-.81-.069-.374.58.394.55a.525.525 0 0 1-.01.625l-.488.634.376.606.856-.078a.525.525 0 0 1 .52.292l.459.941h.8l.488-.997a.525.525 0 0 1 .503-.293l.798.048.352-.59-.424-.56a.525.525 0 0 1-.008-.622l.399-.556-.374-.58-.76.064a.525.525 0 0 1-.515-.29l-.427-.858-.775-.012Z"
fill-rule="evenodd"
/>
<path
d="M10.282 7.4a4.5 4.5 0 0 1-8.666-.376l.851-.168L.847 5.18l-.848 2.167.897-.176a5.25 5.25 0 0 0 10.125.461l-.739-.233zm.836-2.54A5.25 5.25 0 0 0 .993 4.4l.713.232a4.5 4.5 0 0 1 8.666.375l-.851.169 1.62 1.672.858-2.164-.88.177z"
/>
<path
clip-rule="evenodd"
d="M6 5.625a.375.375 0 1 0 0 .75.375.375 0 0 0 0-.75zM4.875 6a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0z"
fill-rule="evenodd"
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>
</div>
Expand Down Expand Up @@ -230,7 +222,7 @@ exports[`Data Connection Page test Renders S3 data connection page with data 1`]
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--xxLarge euiCard__icon"
class="euiIcon euiIcon--xxLarge euiIcon-isLoading euiCard__icon"
focusable="false"
height="16"
role="img"
Expand All @@ -239,7 +231,7 @@ exports[`Data Connection Page test Renders S3 data connection page with data 1`]
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.04 13.274a.5.5 0 1 0 .892.453l3.014-5.931a.5.5 0 0 0-.445-.727H5.316L8.03 1.727a.5.5 0 1 0-.892-.453L4.055 7.343a.5.5 0 0 0 .446.726h5.185L7.04 13.274Z"
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>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Data Connection Inactive Page test Renders inactive data connection callout 1`] = `
<div>
<div
class="euiCallOut euiCallOut--warning"
>
<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"
>
<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>
<span
class="euiCallOutHeader__title"
>
This data source connection is inactive
</span>
</div>
<div
class="euiText euiText--small"
>
<div
class="euiTextColor euiTextColor--default"
>
<p>
Associated objects and accelerations are not available while this connection is inactive.
</p>
<button
class="euiButton euiButton--warning"
type="button"
>
<span
class="euiButtonContent euiButton__content"
>
<span
class="euiButton__text"
>
Enable connection
</span>
</span>
</button>
</div>
</div>
</div>
</div>
`;
Loading

0 comments on commit 0e7c2bf

Please sign in to comment.