From ec475bce03f44dccc11751af51d9bfdb95a30fd2 Mon Sep 17 00:00:00 2001
From: Harsh Vador <58542468+harsh-vador@users.noreply.github.com>
Date: Sat, 2 Mar 2024 22:20:30 +0530
Subject: [PATCH] ui: display source of lineage (#15391)
* ui: display lineage source
* added locale files
* rename dbt source name
* test: added unit test case
---
.../EdgeInfoDrawer.component.tsx | 11 ++
.../EntityInfoDrawer/EdgeInfoDrawer.test.tsx | 163 ++++++++++++++++++
.../ui/src/constants/Lineage.constants.ts | 11 ++
.../ui/src/locale/languages/de-de.json | 1 +
.../ui/src/locale/languages/en-us.json | 1 +
.../ui/src/locale/languages/es-es.json | 7 +-
.../ui/src/locale/languages/fr-fr.json | 1 +
.../ui/src/locale/languages/he-he.json | 1 +
.../ui/src/locale/languages/ja-jp.json | 1 +
.../ui/src/locale/languages/nl-nl.json | 1 +
.../ui/src/locale/languages/pt-br.json | 1 +
.../ui/src/locale/languages/ru-ru.json | 1 +
.../ui/src/locale/languages/zh-cn.json | 1 +
13 files changed, 198 insertions(+), 3 deletions(-)
create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/EdgeInfoDrawer.test.tsx
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/EdgeInfoDrawer.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/EdgeInfoDrawer.component.tsx
index 97d63d956cb..ec56f9c4032 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/EdgeInfoDrawer.component.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/EdgeInfoDrawer.component.tsx
@@ -21,8 +21,10 @@ import { Node } from 'reactflow';
import { ReactComponent as EditIcon } from '../../../assets/svg/edit-new.svg';
import DescriptionV1 from '../../../components/common/EntityDescription/DescriptionV1';
import { DE_ACTIVE_COLOR } from '../../../constants/constants';
+import { LINEAGE_SOURCE } from '../../../constants/Lineage.constants';
import { CSMode } from '../../../enums/codemirror.enum';
import { EntityType } from '../../../enums/entity.enum';
+import { Source } from '../../../generated/type/entityLineage';
import { getNameFromFQN } from '../../../utils/CommonUtils';
import { getLineageDetailsObject } from '../../../utils/EntityLineageUtils';
import entityUtilClassBase from '../../../utils/EntityUtilClassBase';
@@ -266,6 +268,15 @@ const EdgeInfoDrawer = ({
)}
+
+
+
+ {`${t('label.lineage-source')}`}
+
+
+ {LINEAGE_SOURCE[edgeEntity.source as keyof typeof Source]}
+
+
)}
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/EdgeInfoDrawer.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/EdgeInfoDrawer.test.tsx
new file mode 100644
index 00000000000..7904fd2bbd9
--- /dev/null
+++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/EdgeInfoDrawer.test.tsx
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2024 Collate.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { act, fireEvent, render, screen } from '@testing-library/react';
+import React from 'react';
+import { Edge } from 'reactflow';
+import { MOCK_NODES_AND_EDGES } from '../../../mocks/Lineage.mock';
+import EdgeInfoDrawer from './EdgeInfoDrawer.component';
+
+jest.mock('../../../components/common/EntityDescription/DescriptionV1', () =>
+ jest.fn().mockImplementation(({ onDescriptionUpdate }) => (
+