Skip to content

Commit

Permalink
Feat #10757: Data observability UI changes (#14749)
Browse files Browse the repository at this point in the history
* Centralize EventType

* Format better for readability

* Add Handling for Thread as Change Event

* Centralize logic for Entity Message Creation

* Add Thread Parent Message in Conversation

* Add Task and Announcement

* Support for multiple destinations

* Delete existing alerts for schema changes

* Delete all tables data for event subscription

* Centralize logic for Notifications and Observability

* Change Field Name and Remove redundant code

* Test Fixes

* Add more fields

* Add Optional

* Logical Test Case Addition Chnage Event

* Add Filter By Owner

* Fix Email Entity Url

* added data observability settings page

* localization changes for other languages

* Handler closure and cleanup

* complete create observibility flow

* fix searchIndex method error

---------

Co-authored-by: mohitdeuex <mohit.y@deuexsolutions.com>
Co-authored-by: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com>
Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com>
  • Loading branch information
4 people authored Jan 19, 2024
1 parent 72fc0cf commit f3f73a3
Show file tree
Hide file tree
Showing 33 changed files with 1,991 additions and 746 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
* limitations under the License.
*/

import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons';
import Icon from '@ant-design/icons/lib/components/Icon';
import { Button, Card, Col, Divider, Row, Space, Tag, Typography } from 'antd';
import { Button, Card, Col, Divider, Row, Space, Typography } from 'antd';
import { isArray } from 'lodash';
import React, { Fragment } from 'react';
import { useTranslation } from 'react-i18next';
Expand All @@ -23,16 +22,12 @@ import { ReactComponent as IconDelete } from '../../../assets/svg/ic-delete.svg'
import {
Effect,
EventSubscription,
SubscriptionType,
} from '../../../generated/events/eventSubscription';
import {
EDIT_LINK_PATH,
getAlertActionTypeDisplayName,
getAlertsActionTypeIcon,
getDisplayNameForEntities,
getFunctionDisplayName,
} from '../../../utils/Alerts/AlertsUtil';
import { getHostNameFromURL } from '../../../utils/CommonUtils';
import TitleBreadcrumb from '../../common/TitleBreadcrumb/TitleBreadcrumb.component';
import { TitleBreadcrumbProps } from '../../common/TitleBreadcrumb/TitleBreadcrumb.interface';
import PageHeader from '../../PageHeader/PageHeader.component';
Expand Down Expand Up @@ -122,108 +117,7 @@ export const AlertDetailsComponent = ({
<Typography.Title level={5}>
{t('label.destination')}
</Typography.Title>
<Row gutter={[16, 16]}>
<Col key={alerts.name} span={8}>
{alerts.subscriptionType === SubscriptionType.ActivityFeed ? (
<Space size={16}>
{getAlertsActionTypeIcon(alerts.subscriptionType)}

{getAlertActionTypeDisplayName(
alerts.subscriptionType ?? SubscriptionType.GenericWebhook
)}
</Space>
) : (
<Card
className="h-full"
title={
<Space size={16}>
{getAlertsActionTypeIcon(alerts.subscriptionType)}

{getAlertActionTypeDisplayName(
alerts.subscriptionType ??
SubscriptionType.GenericWebhook
)}
</Space>
}>
<Space direction="vertical" size={8}>
{alerts.subscriptionType === SubscriptionType.Email && (
<>
<Typography.Text>
{t('label.send-to')}:{' '}
<div>
{alerts.subscriptionConfig?.receivers?.map(
(rec) => (
<Tag key={rec}>{rec}</Tag>
)
)}
</div>
</Typography.Text>
<Typography.Text>
<Space size={16}>
<span>
{alerts?.subscriptionConfig?.sendToAdmins ? (
<CheckCircleOutlined />
) : (
<CloseCircleOutlined />
)}{' '}
{t('label.admin-plural')}
</span>
<span>
{alerts?.subscriptionConfig?.sendToOwners ? (
<CheckCircleOutlined />
) : (
<CloseCircleOutlined />
)}{' '}
{t('label.owner-plural')}
</span>
<span>
{alerts?.subscriptionConfig?.sendToFollowers ? (
<CheckCircleOutlined />
) : (
<CloseCircleOutlined />
)}{' '}
{t('label.follower-plural')}
</span>
</Space>
</Typography.Text>
</>
)}
{alerts.subscriptionType !== SubscriptionType.Email && (
<>
<Typography.Text>
<Typography.Text type="secondary">
{t('label.webhook')}:{' '}
</Typography.Text>
{getHostNameFromURL(
alerts.subscriptionConfig?.endpoint ?? '-'
)}
</Typography.Text>
<Typography.Text>
<Typography.Text type="secondary">
{t('label.batch-size')}:{' '}
</Typography.Text>
{alerts.batchSize}
</Typography.Text>
<Typography.Text>
<Typography.Text type="secondary">
{t('message.field-timeout-description')}:{' '}
</Typography.Text>
{alerts.timeout}
</Typography.Text>
<Typography.Text>
<Typography.Text type="secondary">
{t('label.secret-key')}:{' '}
</Typography.Text>

{alerts.subscriptionConfig?.secretKey ? '****' : '-'}
</Typography.Text>
</>
)}
</Space>
</Card>
)}
</Col>
</Row>
<Row gutter={[16, 16]} />
</Card>
</Col>
</Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ const AddAlertPage = withSuspenseFallback(
React.lazy(() => import('../../pages/AddAlertPage/AddAlertPage'))
);

const AddObservabilityPage = withSuspenseFallback(
React.lazy(
() => import('../../pages/AddObservabilityPage/AddObservabilityPage')
)
);

const ImportTeamsPage = withSuspenseFallback(
React.lazy(
() => import('../../pages/TeamsPage/ImportTeamsPage/ImportTeamsPage')
Expand All @@ -51,19 +57,15 @@ const AlertsActivityFeedPage = withSuspenseFallback(
() => import('../../pages/AlertsActivityFeedPage/AlertsActivityFeedPage')
)
);
const AlertDataInsightReportPage = withSuspenseFallback(
React.lazy(
() =>
import(
'../../pages/AlertDataInsightReportPage/AlertDataInsightReportPage'
)
)
);

const AlertsPage = withSuspenseFallback(
React.lazy(() => import('../../pages/AlertsPage/AlertsPage'))
);

const ObservabilityPage = withSuspenseFallback(
React.lazy(() => import('../../pages/ObservabilityPage/ObservabilityPage'))
);

const TeamsPage = withSuspenseFallback(
React.lazy(() => import('../../pages/TeamsPage/TeamsPage'))
);
Expand Down Expand Up @@ -315,6 +317,16 @@ const GlobalSettingRouter = () => {
)}
/>

<AdminProtectedRoute
exact
component={ObservabilityPage}
hasPermission={false}
path={getSettingPath(
GlobalSettingsMenuCategory.NOTIFICATIONS,
GlobalSettingOptions.OBSERVABILITY
)}
/>

<AdminProtectedRoute
exact
component={AddAlertPage}
Expand All @@ -334,35 +346,34 @@ const GlobalSettingRouter = () => {
GlobalSettingOptions.ADD_ALERTS
)}
/>

<AdminProtectedRoute
exact
component={AlertDetailsPage}
component={AddObservabilityPage}
hasPermission={false}
path={getSettingPath(
GlobalSettingsMenuCategory.NOTIFICATIONS,
GlobalSettingOptions.ALERT,
true
GlobalSettingOptions.ADD_OBSERVABILITY
)}
/>

<AdminProtectedRoute
exact
component={AlertsActivityFeedPage}
component={AlertDetailsPage}
hasPermission={false}
path={getSettingPath(
GlobalSettingsMenuCategory.NOTIFICATIONS,
GlobalSettingOptions.ACTIVITY_FEED
GlobalSettingOptions.ALERT,
true
)}
/>

<AdminProtectedRoute
exact
component={AlertDataInsightReportPage}
component={AlertsActivityFeedPage}
hasPermission={false}
path={getSettingPath(
GlobalSettingsMenuCategory.NOTIFICATIONS,
GlobalSettingOptions.DATA_INSIGHT_REPORT_ALERT
GlobalSettingOptions.ACTIVITY_FEED
)}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ export enum GlobalSettingOptions {
EMAIL = 'email',
ALERTS = 'alerts',
ALERT = 'alert',
OBSERVABILITY = 'observability',
GLOSSARY_TERM = 'glossaryTerm',
ADD_ALERTS = 'add-alerts',
EDIT_ALERTS = 'edit-alert',
ADD_OBSERVABILITY = 'add-observability',
STORAGES = 'storages',
DATA_INSIGHT_REPORT_ALERT = 'dataInsightReport',
ADD_DATA_INSIGHT_REPORT_ALERT = 'add-data-insight-report',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export enum SearchIndex {
CONTAINER = 'container_search_index',
QUERY = 'query_search_index',
TEST_CASE = 'test_case_search_index',
TEST_SUITE = 'test_suite_search_index',
DATABASE_SCHEMA = 'database_schema_search_index',
DATABASE = 'database_search_index',
DATABASE_SERVICE = 'database_service_search_index',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export interface TestCaseSearchSource
Exclude<TestCase, 'testSuite'> {
testSuites: TestSuite[];
} // extends EntityInterface
export interface TestSuiteSearchSource extends SearchSourceBase, TestSuite {}

export interface DatabaseServiceSearchSource
extends SearchSourceBase,
Expand Down Expand Up @@ -201,6 +202,7 @@ export type SearchIndexSearchSourceMapping = {
[SearchIndex.STORED_PROCEDURE]: StoredProcedureSearchSource;
[SearchIndex.DASHBOARD_DATA_MODEL]: DashboardDataModelSearchSource;
[SearchIndex.DATA_PRODUCT]: DataProductSearchSource;
[SearchIndex.TEST_SUITE]: TestSuiteSearchSource;
};

export type SearchRequest<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"account-email": "Konto-E-Mail",
"account-name": "Kontoname",
"acknowledged": "Acknowledged",
"action": "Action",
"action-plural": "Aktionen",
"active": "Aktiv",
"active-user": "Aktiver Benutzer",
Expand Down Expand Up @@ -706,6 +707,7 @@
"number-of-retries": "Anzahl der Wiederholungen",
"number-of-rows": "Anzahl der Zeilen",
"object-plural": "Objekte",
"observability": "Observability",
"october": "Oktober",
"of-lowercase": "von",
"ok": "Ok",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"account-email": "Account email",
"account-name": "Account Name",
"acknowledged": "Acknowledged",
"action": "Action",
"action-plural": "Actions",
"active": "Active",
"active-user": "Active User",
Expand Down Expand Up @@ -706,6 +707,7 @@
"number-of-retries": "Number of Retries",
"number-of-rows": "Number of rows",
"object-plural": "Objects",
"observability": "Observability",
"october": "October",
"of-lowercase": "of",
"ok": "Ok",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"account-email": "Correo electrónico de la cuenta",
"account-name": "Account Name",
"acknowledged": "Acknowledged",
"action": "Action",
"action-plural": "Acciones",
"active": "Activo",
"active-user": "Usuario activo",
Expand Down Expand Up @@ -706,6 +707,7 @@
"number-of-retries": "Number of Retries",
"number-of-rows": "Número de filas",
"object-plural": "Objects",
"observability": "Observability",
"october": "Octubre",
"of-lowercase": "de",
"ok": "Ok",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"account-email": "Compte email",
"account-name": "Nom du Compte",
"acknowledged": "Acknowledged",
"action": "Action",
"action-plural": "Actions",
"active": "Actif",
"active-user": "Utilisateur Actif",
Expand Down Expand Up @@ -706,6 +707,7 @@
"number-of-retries": "Nombre de Tentatives",
"number-of-rows": "Nombre de lignes",
"object-plural": "Objets",
"observability": "Observability",
"october": "Octobre",
"of-lowercase": "de",
"ok": "Ok",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"account-email": "אימייל חשבון",
"account-name": "שם החשבון",
"acknowledged": "Acknowledged",
"action": "Action",
"action-plural": "פעולות",
"active": "פעיל",
"active-user": "משתמש פעיל",
Expand Down Expand Up @@ -706,6 +707,7 @@
"number-of-retries": "מספר ניסיונות מחדש",
"number-of-rows": "מספר השורות",
"object-plural": "אובייקטים",
"observability": "Observability",
"october": "אוקטובר",
"of-lowercase": "של",
"ok": "אישור",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"account-email": "アカウントのEmail",
"account-name": "Account Name",
"acknowledged": "Acknowledged",
"action": "Action",
"action-plural": "アクション",
"active": "アクティブ",
"active-user": "アクティブなユーザ",
Expand Down Expand Up @@ -706,6 +707,7 @@
"number-of-retries": "Number of Retries",
"number-of-rows": "行数",
"object-plural": "Objects",
"observability": "Observability",
"october": "10月",
"of-lowercase": "",
"ok": "Ok",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"account-email": "Account e-mail",
"account-name": "Accountnaam",
"acknowledged": "Acknowledged",
"action": "Action",
"action-plural": "Acties",
"active": "Actief",
"active-user": "Actieve gebruiker",
Expand Down Expand Up @@ -706,6 +707,7 @@
"number-of-retries": "Aantal herhalingen",
"number-of-rows": "Aantal rijen",
"object-plural": "Objecten",
"observability": "Observability",
"october": "Oktober",
"of-lowercase": "van",
"ok": "Oké",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"account-email": "E-mail da conta",
"account-name": "Nome da Conta",
"acknowledged": "Acknowledged",
"action": "Action",
"action-plural": "Ações",
"active": "Ativo",
"active-user": "Usuário Ativo",
Expand Down Expand Up @@ -706,6 +707,7 @@
"number-of-retries": "Número de Tentativas",
"number-of-rows": "Número de linhas",
"object-plural": "Objetos",
"observability": "Observability",
"october": "Outubro",
"of-lowercase": "de",
"ok": "Ok",
Expand Down
Loading

0 comments on commit f3f73a3

Please sign in to comment.