From f3c8a67e6bd98cc4e428ada1c868695feaf7f153 Mon Sep 17 00:00:00 2001 From: Sachin Chaurasiya Date: Mon, 16 May 2022 14:47:48 +0530 Subject: [PATCH] Fix #4963 UI : Lineage Node table with a slash (/) in their name throwing 404 error (#4965) --- .../integration/AddNewService/glue.spec.js | 5 ++++- .../integration/AddNewService/kafka.spec.js | 5 ++++- .../integration/AddNewService/metabase.spec.js | 5 ++++- .../integration/AddNewService/superset.spec.js | 5 ++++- .../EntityInfoDrawer.component.tsx | 16 +++++++++++++--- .../EntityLineage/EntityLineage.component.tsx | 2 +- .../main/resources/ui/src/utils/StringsUtils.ts | 9 +++++++++ 7 files changed, 39 insertions(+), 8 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/glue.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/glue.spec.js index 03db1bbfd3e..44bc20db65e 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/glue.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/glue.spec.js @@ -11,7 +11,10 @@ * limitations under the License. */ -import { goToAddNewServicePage, testServiceCreationAndIngestion } from '../../common/common'; +import { + goToAddNewServicePage, + testServiceCreationAndIngestion, +} from '../../common/common'; describe('Glue Ingestion', () => { it('add and ingest data', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/kafka.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/kafka.spec.js index 7496fb7b137..b154cb7b8b1 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/kafka.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/kafka.spec.js @@ -11,7 +11,10 @@ * limitations under the License. */ -import { goToAddNewServicePage, testServiceCreationAndIngestion } from '../../common/common'; +import { + goToAddNewServicePage, + testServiceCreationAndIngestion, +} from '../../common/common'; describe('Kafka Ingestion', () => { it('add and ingest data', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/metabase.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/metabase.spec.js index cec3953300a..bd8aa4e7e1b 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/metabase.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/metabase.spec.js @@ -11,7 +11,10 @@ * limitations under the License. */ -import { goToAddNewServicePage, testServiceCreationAndIngestion } from '../../common/common'; +import { + goToAddNewServicePage, + testServiceCreationAndIngestion, +} from '../../common/common'; describe('Metabase Ingestion', () => { it('add and ingest data', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/superset.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/superset.spec.js index a71384c6a03..72655d3aa43 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/superset.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/integration/AddNewService/superset.spec.js @@ -11,7 +11,10 @@ * limitations under the License. */ -import { goToAddNewServicePage, testServiceCreationAndIngestion } from '../../common/common'; +import { + goToAddNewServicePage, + testServiceCreationAndIngestion, +} from '../../common/common'; describe('Superset Ingestion', () => { it('add and ingest data', () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/EntityInfoDrawer/EntityInfoDrawer.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/EntityInfoDrawer/EntityInfoDrawer.component.tsx index 42fce83c119..9b1df689c57 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/EntityInfoDrawer/EntityInfoDrawer.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/EntityInfoDrawer/EntityInfoDrawer.component.tsx @@ -26,6 +26,7 @@ import { Table } from '../../generated/entity/data/table'; import { Topic } from '../../generated/entity/data/topic'; import { getHeaderLabel } from '../../utils/EntityLineageUtils'; import { getEntityOverview, getEntityTags } from '../../utils/EntityUtils'; +import { getEncodedFqn } from '../../utils/StringsUtils'; import { getEntityIcon } from '../../utils/TableUtils'; import { showErrorToast } from '../../utils/ToastUtils'; import RichTextEditorPreviewer from '../common/rich-text-editor/RichTextEditorPreviewer'; @@ -57,7 +58,7 @@ const EntityInfoDrawer = ({ switch (selectedNode.type) { case EntityType.TABLE: { setIsLoading(true); - getTableDetailsByFQN(selectedNode.fqn, [ + getTableDetailsByFQN(getEncodedFqn(selectedNode.fqn), [ 'tags', 'owner', 'columns', @@ -74,13 +75,16 @@ const EntityInfoDrawer = ({ err, `Error while getting ${selectedNode.name} details` ); + }) + .finally(() => { + setIsLoading(false); }); break; } case EntityType.PIPELINE: { setIsLoading(true); - getPipelineByFqn(selectedNode.fqn, ['tags', 'owner']) + getPipelineByFqn(getEncodedFqn(selectedNode.fqn), ['tags', 'owner']) .then((res: AxiosResponse) => { getServiceById('pipelineServices', res.data.service?.id) .then((serviceRes: AxiosResponse) => { @@ -100,13 +104,16 @@ const EntityInfoDrawer = ({ err, `Error while getting ${selectedNode.name} details` ); + }) + .finally(() => { + setIsLoading(false); }); break; } case EntityType.DASHBOARD: { setIsLoading(true); - getDashboardByFqn(selectedNode.fqn, ['tags', 'owner']) + getDashboardByFqn(getEncodedFqn(selectedNode.fqn), ['tags', 'owner']) .then((res: AxiosResponse) => { getServiceById('dashboardServices', res.data.service?.id) .then((serviceRes: AxiosResponse) => { @@ -126,6 +133,9 @@ const EntityInfoDrawer = ({ err, `Error while getting ${selectedNode.name} details` ); + }) + .finally(() => { + setIsLoading(false); }); break; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/EntityLineage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/EntityLineage.component.tsx index c994bc4025e..1adb767aae7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/EntityLineage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/EntityLineage.component.tsx @@ -852,7 +852,7 @@ const Entitylineage: FunctionComponent = ({ - {!isEmpty(selectedNode) ? ( + {!isEmpty(selectedNode) && !isEditMode ? ( { + return encodeURIComponent(fqn); +};