Skip to content

Commit

Permalink
Fix misleading label after creating model registry (opendatahub-io#3324)
Browse files Browse the repository at this point in the history
* Fix misleading label after creating model registry

* Add isScrollable to fix RHOAIENG-13051

* Add test to include ContainerCreating use case
  • Loading branch information
manaswinidas authored Oct 15, 2024
1 parent a15a69c commit 3f41512
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const RoleBindingPermissionsNameInput: React.FC<RoleBindingPermissionsNameInputP
}
return (
<TypeaheadSelect
isScrollable
selectOptions={selectOptions}
selected={value}
isCreatable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const ModelRegistrySelector: React.FC<ModelRegistrySelectorProps> = ({

const selector = (
<Select
isScrollable
toggle={(toggleRef) => (
<MenuToggle
ref={toggleRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ export const ModelRegistryTableRowStatus: React.FC<ModelRegistryTableRowStatusPr
: [];

// Unavailable
if (availableCondition?.status === ConditionStatus.False) {
if (
availableCondition?.status === ConditionStatus.False &&
!popoverMessages.some((message) => message.includes('ContainerCreating'))
) {
statusLabel = ModelRegistryStatusLabel.Unavailable;
icon = <ExclamationCircleIcon />;
color = 'red';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,23 @@ describe('ModelRegistryTableRowStatus', () => {
expect(degradingText).toBeInTheDocument();
});

it('renders "Progressing" status when popover message contains "ContainerCreating"', async () => {
render(
<ModelRegistryTableRowStatus
conditions={[
{
status: 'False',
type: 'Unavailable',
message:
'Deployment is unavailable: pod test has unready containers [grpc-container: {waiting: {reason: ContainerCreating, message: }}',
},
]}
/>,
);

expect(screen.getByText('Progressing')).toBeVisible();
});

it('renders "Progressing" status when conditions are empty', () => {
render(<ModelRegistryTableRowStatus conditions={[]} />);
expect(screen.getByText('Progressing')).toBeVisible();
Expand Down

0 comments on commit 3f41512

Please sign in to comment.