Skip to content

Commit

Permalink
Fix name overflow on deployed model card (#3465)
Browse files Browse the repository at this point in the history
* Fix name overflow on deployed model card

* Tooltip render fix
  • Loading branch information
ashley-o0o authored Nov 13, 2024
1 parent a0e16f5 commit 037ecd0
Showing 1 changed file with 15 additions and 5 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 @@ -11,8 +12,9 @@ import {
TextListItem,
TextListItemVariants,
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 @@ -36,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 @@ -61,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(
`/projects/${inferenceService.metadata.namespace}/metrics/model/${inferenceService.metadata.name}`,
);
}}
style={{ fontSize: 'var(--pf-v5-global--FontSize--md)' }}
>
{inferenceServiceDisplayName}
</Link>
<Truncate content={inferenceServiceDisplayName} />
</Button>
) : (
inferenceServiceDisplayName
)}
Expand Down

0 comments on commit 037ecd0

Please sign in to comment.