Skip to content

Commit

Permalink
[RHOAIENG-4859] Fix for showing correct models in project overview
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-phillips-18 committed Apr 3, 2024
1 parent 42c0f11 commit 036f063
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
} from '@patternfly/react-core';
import { ExclamationCircleIcon } from '@patternfly/react-icons';
import HeaderIcon from '~/concepts/design/HeaderIcon';
import { ProjectDetailsContext } from '~/pages/projects/ProjectDetailsContext';
import ModelServingContextProvider from '~/pages/modelServing/ModelServingContext';
import { ProjectObjectType } from '~/concepts/design/utils';
import TypeBorderedCard from '~/concepts/design/TypeBorderedCard';
Expand All @@ -30,10 +29,10 @@ enum FilterStates {

interface DeployedModelsCardProps {
isMultiPlatform: boolean;
namespace?: string;
}

const DeployedModelsCard: React.FC<DeployedModelsCardProps> = ({ isMultiPlatform }) => {
const { currentProject } = React.useContext(ProjectDetailsContext);
const DeployedModelsCard: React.FC<DeployedModelsCardProps> = ({ isMultiPlatform, namespace }) => {
const [filteredState, setFilteredState] = React.useState<FilterStates | undefined>();

const renderError = (message?: string): React.ReactElement => (
Expand Down Expand Up @@ -92,10 +91,7 @@ const DeployedModelsCard: React.FC<DeployedModelsCardProps> = ({ isMultiPlatform
</Flex>
</CardHeader>
<CardBody>
<ModelServingContextProvider
namespace={currentProject.metadata.namespace}
getErrorComponent={renderError}
>
<ModelServingContextProvider namespace={namespace} getErrorComponent={renderError}>
<DeployedModelsGallery
showSuccessful={!filteredState || filteredState === FilterStates.success}
showFailed={!filteredState || filteredState === FilterStates.failed}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ const DeployedModelsSection: React.FC<DeployedModelsSectionProps> = ({ isMultiPl
title="Serve models"
data-testid="model-server-section"
>
<DeployedModelsCard isMultiPlatform={isMultiPlatform} />
<DeployedModelsCard
isMultiPlatform={isMultiPlatform}
namespace={currentProject.metadata.name}
/>
</CollapsibleSection>
);
};
Expand Down

0 comments on commit 036f063

Please sign in to comment.