Skip to content

Commit

Permalink
Tooltip render fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ashley-o0o committed Nov 12, 2024
1 parent e725e25 commit 67f4f81
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import {
Button,
CardBody,
CardFooter,
CardHeader,
Expand All @@ -13,7 +14,7 @@ import {
TextListVariants,
Truncate,
} from '@patternfly/react-core';
import { Link } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
import { ProjectObjectType } from '~/concepts/design/utils';
import { InferenceServiceKind, ServingRuntimeKind } from '~/k8sTypes';
import InferenceServiceStatus from '~/pages/modelServing/screens/global/InferenceServiceStatus';
Expand All @@ -37,6 +38,7 @@ const DeployedModelCard: React.FC<DeployedModelCardProps> = ({
servingRuntime,
}) => {
const [modelMetricsEnabled] = useModelMetricsEnabled();
const navigate = useNavigate();
const kserveMetricsEnabled = useIsAreaAvailable(SupportedArea.K_SERVE_METRICS).status;
const modelMesh = isModelMesh(inferenceService);
const { currentProject } = React.useContext(ProjectDetailsContext);
Expand All @@ -62,11 +64,18 @@ const DeployedModelCard: React.FC<DeployedModelCardProps> = ({
<FlexItem>
<ResourceNameTooltip resource={inferenceService}>
{modelMetricsSupported ? (
<Link
to={`/projects/${inferenceService.metadata.namespace}/metrics/model/${inferenceService.metadata.name}`}
<Button
variant="link"
isInline
onClick={() => {
navigate(

Check warning on line 71 in frontend/src/pages/projects/screens/detail/overview/serverModels/deployedModels/DeployedModelCard.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/projects/screens/detail/overview/serverModels/deployedModels/DeployedModelCard.tsx#L70-L71

Added lines #L70 - L71 were not covered by tests
`/projects/${inferenceService.metadata.namespace}/metrics/model/${inferenceService.metadata.name}`,
);
}}
style={{ fontSize: 'var(--pf-v5-global--FontSize--md)' }}
>
<Truncate content={inferenceServiceDisplayName} />
</Link>
</Button>
) : (
inferenceServiceDisplayName
)}
Expand Down

0 comments on commit 67f4f81

Please sign in to comment.