Skip to content

Commit

Permalink
Remove connectionTypes SupportedArea
Browse files Browse the repository at this point in the history
  • Loading branch information
ashley-o0o committed Jan 24, 2025
1 parent 881757a commit 7f7ea8e
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 97 deletions.
5 changes: 1 addition & 4 deletions frontend/src/app/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const AppRoutes: React.FC = () => {
const { isAdmin, isAllowed } = useUser();
const isJupyterEnabled = useCheckJupyterEnabled();
const isHomeAvailable = useIsAreaAvailable(SupportedArea.HOME).status;
const isConnectionTypesAvailable = useIsAreaAvailable(SupportedArea.CONNECTION_TYPES).status;

if (!isAllowed) {
return (
Expand Down Expand Up @@ -140,9 +139,7 @@ const AppRoutes: React.FC = () => {
<Route path="/acceleratorProfiles/*" element={<AcceleratorProfileRoutes />} />
<Route path="/hardwareProfiles/*" element={<HardwareProfileRoutes />} />
<Route path="/servingRuntimes/*" element={<CustomServingRuntimeRoutes />} />
{isConnectionTypesAvailable ? (
<Route path="/connectionTypes/*" element={<ConnectionTypeRoutes />} />
) : null}
<Route path="/connectionTypes/*" element={<ConnectionTypeRoutes />} />
<Route path="/storageClasses/*" element={<StorageClassesPage />} />
<Route path="/modelRegistrySettings/*" element={<ModelRegistrySettingsRoutes />} />
<Route path="/groupSettings" element={<GroupSettingsPage />} />
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/concepts/areas/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ export const SupportedAreasStateMap: SupportedAreasState = {
featureFlags: ['disableCustomServingRuntimes'],
reliantAreas: [SupportedArea.MODEL_SERVING],
},
[SupportedArea.CONNECTION_TYPES]: {
featureFlags: [], // TODO: We want to disable, no flag exists today,
},
[SupportedArea.STORAGE_CLASSES]: {
featureFlags: ['disableStorageClasses'],
},
Expand Down
1 change: 0 additions & 1 deletion frontend/src/concepts/areas/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export enum SupportedArea {
USER_MANAGEMENT = 'user-management',
ACCELERATOR_PROFILES = 'accelerator-profiles',
HARDWARE_PROFILES = 'hardware-profiles',
CONNECTION_TYPES = 'connections-types',
STORAGE_CLASSES = 'storage-classes',

/* DS Projects specific areas */
Expand Down

This file was deleted.

51 changes: 16 additions & 35 deletions frontend/src/pages/home/aiFlows/ProjectsGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import InfoGalleryItem from '~/concepts/design/InfoGalleryItem';
import { SupportedArea } from '~/concepts/areas';
import useIsAreaAvailable from '~/concepts/areas/useIsAreaAvailable';
import useServingPlatformStatuses from '~/pages/modelServing/useServingPlatformStatuses';
import useConnectionTypesEnabled from '~/concepts/connectionTypes/useConnectionTypesEnabled';
import InfoGallery from './InfoGallery';

const ProjectsGallery: React.FC<{ onClose: () => void }> = ({ onClose }) => {
const { status: pipelinesAvailable } = useIsAreaAvailable(SupportedArea.DS_PIPELINES);
const { status: modelServingAvailable } = useIsAreaAvailable(SupportedArea.MODEL_SERVING);
const servingPlatformStatuses = useServingPlatformStatuses();
const modelMeshEnabled = servingPlatformStatuses.modelMesh.enabled;
const connectionTypesEnabled = useConnectionTypesEnabled();

const getProjectDescriptionAdditionalText = () => {
if (pipelinesAvailable && modelServingAvailable) {
Expand Down Expand Up @@ -68,39 +66,22 @@ const ProjectsGallery: React.FC<{ onClose: () => void }> = ({ onClose }) => {
}
isOpen
/>,
connectionTypesEnabled ? (
<InfoGalleryItem
key="connections"
data-testid="ai-flows-connections-info"
title="Connections"
resourceType={ProjectObjectType.dataConnection}
sectionType={SectionType.organize}
description={
<Content component="small">
Connections enable you to store and retrieve information that typically should not be
stored in code. For example, you can store details (including credentials) for object
storage, databases, and more. You can then attach the connections to artifacts in your
project, such as workbenches and model servers.
</Content>
}
isOpen
/>
) : (
<InfoGalleryItem
key="data-connections"
data-testid="ai-flows-connections-info"
title="Data connections"
resourceType={ProjectObjectType.dataConnection}
sectionType={SectionType.organize}
description={
<Content component="small">
You can add data connections to link your project and its workbenches to data sources,
and to object storage buckets which save data and models that you want to deploy.
</Content>
}
isOpen
/>
),
<InfoGalleryItem
key="connections"
data-testid="ai-flows-connections-info"
title="Connections"
resourceType={ProjectObjectType.dataConnection}
sectionType={SectionType.organize}
description={
<Content component="small">
Connections enable you to store and retrieve information that typically should not be
stored in code. For example, you can store details (including credentials) for object
storage, databases, and more. You can then attach the connections to artifacts in your
project, such as workbenches and model servers.
</Content>
}
isOpen
/>,
<InfoGalleryItem
key="storage"
data-testid="ai-flows-storage-info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
getCreateInferenceServiceLabels,
getSubmitInferenceServiceResourceFn,
getSubmitServingRuntimeResourcesFn,
isConnectionPathValid,
useCreateInferenceServiceObject,
useCreateServingRuntimeObject,
} from '~/pages/modelServing/screens/projects/utils';
Expand Down Expand Up @@ -35,8 +34,6 @@ import ServingRuntimeSizeSection from '~/pages/modelServing/screens/projects/Ser
import ServingRuntimeTemplateSection from '~/pages/modelServing/screens/projects/ServingRuntimeModal/ServingRuntimeTemplateSection';
import ProjectSection from '~/pages/modelServing/screens/projects/InferenceServiceModal/ProjectSection';
import { DataConnection, NamespaceApplicationCase } from '~/pages/projects/types';
import { AwsKeys } from '~/pages/projects/dataConnections/const';
import { isAWSValid } from '~/pages/projects/screens/spawner/spawnerUtils';
import InferenceServiceFrameworkSection from '~/pages/modelServing/screens/projects/InferenceServiceModal/InferenceServiceFrameworkSection';
import { getDisplayNameFromK8sResource } from '~/concepts/k8s/utils';
import AuthServingRuntimeSection from '~/pages/modelServing/screens/projects/ServingRuntimeModal/AuthServingRuntimeSection';
Expand All @@ -48,7 +45,6 @@ import {
FormTrackingEventProperties,
TrackingOutcome,
} from '~/concepts/analyticsTracking/trackingProperties';
import useConnectionTypesEnabled from '~/concepts/connectionTypes/useConnectionTypesEnabled';
import { Connection } from '~/concepts/connectionTypes/types';
import { ConnectionSection } from '~/pages/modelServing/screens/projects/InferenceServiceModal/ConnectionSection';
import K8sNameDescriptionField, {
Expand Down Expand Up @@ -109,7 +105,6 @@ const ManageKServeModal: React.FC<ManageKServeModalProps> = ({
initialData: editInfo?.inferenceServiceEditInfo,
});

const isConnectionTypesEnabled = useConnectionTypesEnabled();
const [connection, setConnection] = React.useState<Connection>();
const [isConnectionValid, setIsConnectionValid] = React.useState(false);

Expand Down Expand Up @@ -171,23 +166,7 @@ const ManageKServeModal: React.FC<ManageKServeModalProps> = ({
if (createDataInferenceService.storage.type === InferenceServiceStorageType.EXISTING_URI) {
return !!createDataInferenceService.storage.uri;
}
if (createDataInferenceService.storage.type === InferenceServiceStorageType.EXISTING_STORAGE) {
if (isConnectionTypesEnabled) {
return isConnectionValid;
}
return (
createDataInferenceService.storage.dataConnection !== '' &&
isConnectionPathValid(createDataInferenceService.storage.path)
);
}
// NEW_STORAGE
if (isConnectionTypesEnabled) {
return isConnectionValid;
}
return (
isAWSValid(createDataInferenceService.storage.awsData, [AwsKeys.AWS_S3_BUCKET]) &&
isConnectionPathValid(createDataInferenceService.storage.path)
);
return isConnectionValid;
};

const baseInputValueValid =
Expand Down
23 changes: 5 additions & 18 deletions frontend/src/pages/projects/screens/detail/ProjectDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ import { ProjectSectionID } from '~/pages/projects/screens/detail/types';
import { AccessReviewResourceAttributes } from '~/k8sTypes';
import { useAccessReview } from '~/api';
import { getDescriptionFromK8sResource, getDisplayNameFromK8sResource } from '~/concepts/k8s/utils';
import useConnectionTypesEnabled from '~/concepts/connectionTypes/useConnectionTypesEnabled';
import ResourceNameTooltip from '~/components/ResourceNameTooltip';
import HeaderIcon from '~/concepts/design/HeaderIcon';
import useCheckLogoutParams from './useCheckLogoutParams';
import ProjectOverview from './overview/ProjectOverview';
import NotebookList from './notebooks/NotebookList';
import StorageList from './storage/StorageList';
import DataConnectionsList from './data-connections/DataConnectionsList';
import ConnectionsList from './connections/ConnectionsList';
import PipelinesSection from './pipelines/PipelinesSection';
import ProjectActions from './ProjectActions';
Expand All @@ -43,7 +41,6 @@ const ProjectDetails: React.FC = () => {
const projectSharingEnabled = useIsAreaAvailable(SupportedArea.DS_PROJECTS_PERMISSIONS).status;
const pipelinesEnabled = useIsAreaAvailable(SupportedArea.DS_PIPELINES).status;
const modelServingEnabled = useModelServingEnabled();
const connectionTypesEnabled = useConnectionTypesEnabled();
const queryParams = useQueryParams();
const state = queryParams.get('section');
const [allowCreate, rbacLoaded] = useAccessReview({
Expand Down Expand Up @@ -113,21 +110,11 @@ const ProjectDetails: React.FC = () => {
title: 'Cluster storage',
component: <StorageList />,
},
...(connectionTypesEnabled
? [
{
id: ProjectSectionID.CONNECTIONS,
title: 'Connections',
component: <ConnectionsList />,
},
]
: [
{
id: ProjectSectionID.DATA_CONNECTIONS,
title: 'Data connections',
component: <DataConnectionsList />,
},
]),
{
id: ProjectSectionID.CONNECTIONS,
title: 'Connections',
component: <ConnectionsList />,
},
...(projectSharingEnabled && allowCreate
? [
{
Expand Down
15 changes: 7 additions & 8 deletions frontend/src/utilities/NavData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,13 @@ const useCustomRuntimesNav = (): NavDataHref[] =>
},
]);

const useConnectionTypesNav = (): NavDataHref[] =>
useAreaCheck<NavDataHref>(SupportedArea.CONNECTION_TYPES, [
{
id: 'settings-connection-types',
label: 'Connection types',
href: '/connectionTypes',
},
]);
const useConnectionTypesNav = (): NavDataHref[] => [
{
id: 'settings-connection-types',
label: 'Connection types',
href: '/connectionTypes',
},
];

const useStorageClassesNav = (): NavDataHref[] =>
useAreaCheck<NavDataHref>(SupportedArea.STORAGE_CLASSES, [
Expand Down

0 comments on commit 7f7ea8e

Please sign in to comment.