Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mr): mr settings scaffolding #2810

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frontend/src/app/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
const CustomServingRuntimeRoutes = React.lazy(
() => import('../pages/modelServing/customServingRuntimes/CustomServingRuntimeRoutes'),
);
const ModelRegistrySettingsPage = React.lazy(
() => import('../pages/modelRegistrySettings/ModelRegistrySettings'),

Check warning on line 57 in frontend/src/app/AppRoutes.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/app/AppRoutes.tsx#L57

Added line #L57 was not covered by tests
);
const GroupSettingsPage = React.lazy(() => import('../pages/groupSettings/GroupSettings'));
const LearningCenterPage = React.lazy(() => import('../pages/learningCenter/LearningCenter'));
const BYONImagesPage = React.lazy(() => import('../pages/BYONImages/BYONImages'));
Expand Down Expand Up @@ -127,6 +130,7 @@
<Route path="/clusterSettings" element={<ClusterSettingsPage />} />
<Route path="/acceleratorProfiles/*" element={<AcceleratorProfileRoutes />} />
<Route path="/servingRuntimes/*" element={<CustomServingRuntimeRoutes />} />
<Route path="/modelRegistrySettings" element={<ModelRegistrySettingsPage />} />
<Route path="/groupSettings" element={<GroupSettingsPage />} />
</>
)}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/concepts/areas/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ export const SupportedAreasStateMap: SupportedAreasState = {
[SupportedArea.MODEL_REGISTRY]: {
featureFlags: ['disableModelRegistry'],
requiredComponents: [StackComponent.MODEL_REGISTRY],
requiredCapabilities: [StackCapability.SERVICE_MESH, StackCapability.SERVICE_MESH_AUTHZ],
lucferbux marked this conversation as resolved.
Show resolved Hide resolved
},
};
50 changes: 50 additions & 0 deletions frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from 'react';
import { useNavigate } from 'react-router-dom';
import {
Button,
EmptyState,
EmptyStateActions,
EmptyStateBody,
EmptyStateFooter,
EmptyStateHeader,
EmptyStateIcon,
EmptyStateVariant,
} from '@patternfly/react-core';
import { PlusCircleIcon } from '@patternfly/react-icons';
import ApplicationsPage from '~/pages/ApplicationsPage';

const ModelRegistrySettings: React.FC = () => {
const navigate = useNavigate();

Check warning on line 17 in frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx#L16-L17

Added lines #L16 - L17 were not covered by tests

return (

Check warning on line 19 in frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx#L19

Added line #L19 was not covered by tests
<ApplicationsPage
title="Model Registry Settings"
description="Manage model registry settings for all users in your organization."
loaded
empty={false}
errorMessage="Unable to load model registry settings."
emptyMessage="No model registry settings found."
provideChildrenPadding
>
<EmptyState variant={EmptyStateVariant.lg}>
<EmptyStateHeader
titleText="No model registries"
icon={<EmptyStateIcon icon={PlusCircleIcon} />}
headingLevel="h5"
/>
<EmptyStateBody>
You can create model registries for specific users or projects.
</EmptyStateBody>
<EmptyStateFooter>
<EmptyStateActions>
<Button variant="primary" onClick={() => navigate('/modelRegistry')}>

Check warning on line 40 in frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx#L40

Added line #L40 was not covered by tests
Create model registry
</Button>
</EmptyStateActions>
</EmptyStateFooter>
</EmptyState>
</ApplicationsPage>
);
};

export default ModelRegistrySettings;
10 changes: 10 additions & 0 deletions frontend/src/utilities/NavData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ const useCustomRuntimesNav = (): NavDataHref[] =>
},
]);

const useModelRegisterySettingsNav = (): NavDataHref[] =>
useAreaCheck<NavDataHref>(SupportedArea.MODEL_REGISTRY, [
{
id: 'settings-model-registry',
label: 'Model registry settings',
href: '/modelRegistrySettings',
},
]);

const useUserManagementNav = (): NavDataHref[] =>
useAreaCheck<NavDataHref>(SupportedArea.USER_MANAGEMENT, [
{
Expand All @@ -174,6 +183,7 @@ const useSettingsNav = (): NavDataGroup[] => {
...useClusterSettingsNav(),
...useAcceleratorProfilesNav(),
...useCustomRuntimesNav(),
...useModelRegisterySettingsNav(),
...useUserManagementNav(),
];

Expand Down
Loading