diff --git a/frontend/src/__tests__/cypress/cypress/tests/mocked/modelServing/servingRuntimeList.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/mocked/modelServing/servingRuntimeList.cy.ts index 7b3b24121d..003a02ae74 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/mocked/modelServing/servingRuntimeList.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/mocked/modelServing/servingRuntimeList.cy.ts @@ -27,6 +27,7 @@ import { createServingRuntimeModal, editServingRuntimeModal, inferenceServiceModal, + inferenceServiceModalEdit, kserveModal, kserveModalEdit, modelServingSection, @@ -471,6 +472,38 @@ describe('Serving Runtime List', () => { }); }); + it('Edit ModelMesh model', () => { + initIntercepts({ + projectEnableModelMesh: true, + disableKServeConfig: false, + disableModelMeshConfig: true, + inferenceServices: [ + mockInferenceServiceK8sResource({ + name: 'ovms-testing', + displayName: 'OVMS ONNX', + isModelMesh: true, + }), + ], + }); + + projectDetails.visitSection('test-project', 'model-server'); + + modelServingSection + .getModelMeshRow('OVMS Model Serving') + .findDeployedModelExpansionButton() + .click(); + modelServingSection.getInferenceServiceRow('OVMS ONNX').findKebabAction('Edit').click(); + inferenceServiceModalEdit.shouldBeOpen(); + inferenceServiceModalEdit + .findServingRuntimeSelect() + .should('have.text', 'OVMS Model Serving') + .should('be.enabled'); + inferenceServiceModalEdit + .findExistingConnectionSelect() + .should('have.text', 'Test Secret') + .should('be.enabled'); + }); + it('ModelMesh ServingRuntime list', () => { initIntercepts({ projectEnableModelMesh: true, diff --git a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/ManageInferenceServiceModal.tsx b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/ManageInferenceServiceModal.tsx index 6cf00b6aa6..0857ea105e 100644 --- a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/ManageInferenceServiceModal.tsx +++ b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/ManageInferenceServiceModal.tsx @@ -63,10 +63,13 @@ const ManageInferenceServiceModal: React.FC = registeredModelDeployInfo, ); + const hasEditInfo = !!editInfo; React.useEffect(() => { - setCreateData('project', currentProjectName); - setCreateData('servingRuntimeName', currentServingRuntimeName); - }, [setCreateData, currentProjectName, currentServingRuntimeName]); + if (!hasEditInfo) { + setCreateData('project', currentProjectName); + setCreateData('servingRuntimeName', currentServingRuntimeName); + } + }, [setCreateData, currentProjectName, currentServingRuntimeName, hasEditInfo]); const storageCanCreate = (): boolean => { if (createData.storage.type === InferenceServiceStorageType.EXISTING_STORAGE) {