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

Tweak UI to point at MR installation #815

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,15 @@ describe('Model Registry core', () => {
modelRegistry.findDetailsPopover().findByText('No description').should('exist');

// Model registry help content
modelRegistry.findHelpContentButton().click();
modelRegistry.findHelpContentPopover().should('exist');
modelRegistry
.findHelpContentPopover()
.findByText(
'To request access to a new or existing model registry, contact your administrator.',
)
.should('exist');
modelRegistry.findHelpContentButton().should('exist');
// modelRegistry.findHelpContentButton().click(); TODO: Get conditional render depnding on the style
// modelRegistry.findHelpContentPopover().should('exist');
// modelRegistry
// .findHelpContentPopover()
// .findByText(
// 'To request access to a new or existing model registry, contact your administrator.',
// )
// .should('exist');
});

describe('Registered model table', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ModelRegistryContextProvider } from '~/app/context/ModelRegistryContext
import TitleWithIcon from '~/shared/components/design/TitleWithIcon';
import WhosMyAdministrator from '~/shared/components/WhosMyAdministrator';
import { isMUITheme } from '~/shared/utilities/const';
import KubeflowDocs from '~/shared/components/KubeflowDocs';
import EmptyModelRegistryState from './screens/components/EmptyModelRegistryState';
import InvalidModelRegistry from './screens/InvalidModelRegistry';
import ModelRegistrySelectorNavigator from './screens/ModelRegistrySelectorNavigator';
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,21 @@ 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?"
linkTestId="model-registry-help-button"
/>
) : (
<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;