From 902ad0d29977f32b00f3a05d982aa827cea38a1f Mon Sep 17 00:00:00 2001 From: Sachin Chaurasiya Date: Thu, 14 Jul 2022 16:40:33 +0530 Subject: [PATCH] Fix #6079 MlModel UI - Dashboard Undefined (#6083) --- .../MlModelDetail/MlModelDetail.component.tsx | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx index ce51d71819e..7d93c8c899c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx @@ -12,7 +12,7 @@ */ import classNames from 'classnames'; -import { startCase, uniqueId } from 'lodash'; +import { isUndefined, startCase, uniqueId } from 'lodash'; import { observer } from 'mobx-react'; import { EntityTags, @@ -160,15 +160,19 @@ const MlModelDetail: FC = ({ showLabel: true, isLink: true, }, - { - key: 'Dashboard', - value: getDashboardDetailsPath( - mlModelDetail.dashboard?.fullyQualifiedName as string - ), - placeholderText: getEntityName(mlModelDetail.dashboard), - showLabel: true, - isLink: true, - }, + ...(!isUndefined(mlModelDetail.dashboard) + ? [ + { + key: 'Dashboard', + value: getDashboardDetailsPath( + mlModelDetail.dashboard?.fullyQualifiedName as string + ), + placeholderText: getEntityName(mlModelDetail.dashboard), + showLabel: true, + isLink: true, + }, + ] + : []), ]; const hasEditAccess = () => {