Skip to content

Commit

Permalink
Tweak UI to point at MR installation
Browse files Browse the repository at this point in the history
Signed-off-by: lucferbux <[email protected]>
  • Loading branch information
lucferbux committed Feb 17, 2025
1 parent 246f41d commit 8ecc119
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Navigate, Outlet, useParams } from 'react-router-dom';
import { Bullseye, Alert, Divider } from '@patternfly/react-core';
import { Bullseye, Alert, Divider, Button } from '@patternfly/react-core';

Check failure on line 3 in clients/ui/frontend/src/app/pages/modelRegistry/ModelRegistryCoreLoader.tsx

View workflow job for this annotation

GitHub Actions / test-and-build

'Button' is defined but never used
import ApplicationsPage from '~/shared/components/ApplicationsPage';
import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext';
import { ProjectObjectType, typedEmptyImage } from '~/shared/components/design/utils';
Expand All @@ -12,6 +12,7 @@ import EmptyModelRegistryState from './screens/components/EmptyModelRegistryStat
import InvalidModelRegistry from './screens/InvalidModelRegistry';
import ModelRegistrySelectorNavigator from './screens/ModelRegistrySelectorNavigator';
import { modelRegistryUrl } from './screens/routeUtils';
import KubeflowDocs from '~/shared/components/KubeflowDocs';

Check failure on line 15 in clients/ui/frontend/src/app/pages/modelRegistry/ModelRegistryCoreLoader.tsx

View workflow job for this annotation

GitHub Actions / test-and-build

`~/shared/components/KubeflowDocs` import should occur before import of `./screens/components/EmptyModelRegistryState`

type ApplicationPageProps = React.ComponentProps<typeof ApplicationsPage>;

Expand Down Expand Up @@ -64,12 +65,16 @@ const ModelRegistryCoreLoader: React.FC<ModelRegistryCoreLoaderProps> = ({
emptyStatePage: (
<EmptyModelRegistryState
testid="empty-model-registries-state"
title="Request access to model registries"
description="To request a new model registry, or to request permission to access an existing model registry, contact your administrator."
title={isMUITheme() ? 'Deploy a model registry' : 'Request access to model registries'}
description={
isMUITheme()
? 'To deploy a new model registry, follow the instructions in the docs below.'
: 'To request a new model registry, or to request permission to access an existing model registry, contact your administrator.'
}
headerIcon={() => (
<img src={typedEmptyImage(ProjectObjectType.registeredModels)} alt="" />
)}
customAction={<WhosMyAdministrator />}
customAction={isMUITheme() ? <KubeflowDocs /> : <WhosMyAdministrator />}
/>
),
headerContent: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelecto
import { ModelRegistry } from '~/app/types';
import SimpleSelect, { SimpleSelectOption } from '~/shared/components/SimpleSelect';
import WhosMyAdministrator from '~/shared/components/WhosMyAdministrator';
import { isMUITheme } from '~/shared/utilities/const';
import KubeflowDocs from '~/shared/components/KubeflowDocs';

const MODEL_REGISTRY_FAVORITE_STORAGE_KEY = 'kubeflow.dashboard.model.registry.favorite';

Expand Down Expand Up @@ -169,14 +171,18 @@ const ModelRegistrySelector: React.FC<ModelRegistrySelectorProps> = ({
</FlexItem>
)}
<FlexItem align={{ default: 'alignRight' }}>
<WhosMyAdministrator
buttonLabel="Need another registry?"
headerContent="Need another registry?"
leadText="To request access to a new or existing model registry, contact your administrator."
contentTestId="model-registry-help-content"
linkTestId="model-registry-help-button"
popoverPosition={PopoverPosition.left}
/>
{isMUITheme() ? (
<KubeflowDocs buttonLabel="Need another registry?" />
) : (
<WhosMyAdministrator
buttonLabel="Need another registry?"
headerContent="Need another registry?"
leadText="To request access to a new or existing model registry, contact your administrator."
contentTestId="model-registry-help-content"
linkTestId="model-registry-help-button"
popoverPosition={PopoverPosition.left}
/>
)}
</FlexItem>
</Flex>
);
Expand Down
31 changes: 31 additions & 0 deletions clients/ui/frontend/src/shared/components/KubeflowDocs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import * as React from 'react';
import { Button } from '@patternfly/react-core';
import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons';

type Props = {
buttonLabel?: string;
dockLinks?: string;
isInline?: boolean;
linkTestId?: string;
};

const KubeflowDocs: React.FC<Props> = ({
buttonLabel = 'Kubeflow Docs',
dockLinks = 'https://www.kubeflow.org/docs/components/model-registry/installation/#installing-model-registry',
isInline,
linkTestId,
}) => (
<Button
isInline={isInline}
variant="link"
icon={<OutlinedQuestionCircleIcon />}
data-testid={linkTestId}
onClick={() => {
window.open(dockLinks);
}}
>
{buttonLabel}
</Button>
);

export default KubeflowDocs;

0 comments on commit 8ecc119

Please sign in to comment.