Skip to content

Commit

Permalink
fix: added validation for model names and disabled the NIM models met…
Browse files Browse the repository at this point in the history
…rics hyperlink on the Models tab

Signed-off-by: Olga Lavtar <[email protected]>
  • Loading branch information
olavtar committed Oct 8, 2024
1 parent 25e1a44 commit 2cc9597
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,9 @@ const InferenceServiceTableRow: React.FC<InferenceServiceTableRowProps> = ({
<>
<Td dataLabel="Name">
<ResourceNameTooltip resource={inferenceService}>
{modelMeshMetricsSupported ? (
<Link
data-testid={`metrics-link-${displayName}`}
to={
isGlobal
? `/modelServing/${inferenceService.metadata.namespace}/metrics/${inferenceService.metadata.name}`
: `/projects/${inferenceService.metadata.namespace}/metrics/model/${inferenceService.metadata.name}`
}
>
{displayName}
</Link>
) : kserveMetricsSupported ? (
{isKServeNIMEnabled ? (
displayName

Check warning on line 55 in frontend/src/pages/modelServing/screens/global/InferenceServiceTableRow.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/modelServing/screens/global/InferenceServiceTableRow.tsx#L55

Added line #L55 was not covered by tests
) : modelMeshMetricsSupported || kserveMetricsSupported ? (
<Link
data-testid={`metrics-link-${displayName}`}
to={
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import * as React from 'react';
import { FormGroup, Text } from '@patternfly/react-core';
import { translateDisplayNameForK8sAndReport } from '~/concepts/k8s/utils';

type ProjectSectionType = {
projectName: string;
};

const ProjectSection: React.FC<ProjectSectionType> = ({ projectName }) => (
<FormGroup label="Project">
<Text>{projectName}</Text>
</FormGroup>
);
const ProjectSection: React.FC<ProjectSectionType> = ({ projectName }) => {
const [translatedName] = translateDisplayNameForK8sAndReport(projectName);

return (
<FormGroup label="Project">
<Text>{translatedName}</Text>
</FormGroup>
);
};

export default ProjectSection;

0 comments on commit 2cc9597

Please sign in to comment.