Skip to content

Commit

Permalink
Fix Unknown container size in workbenches table
Browse files Browse the repository at this point in the history
  • Loading branch information
manaswinidas committed Jun 28, 2024
1 parent e687eb8 commit dbcd95d
Showing 1 changed file with 7 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import * as React from 'react';
import { ActionsColumn, ExpandableRowContent, Tbody, Td, Tr } from '@patternfly/react-table';
import {
Button,
Flex,
FlexItem,
Icon,
Popover,
Split,
SplitItem,
Tooltip,
} from '@patternfly/react-core';
import { Button, Flex, FlexItem, Icon, Popover, Split, SplitItem } from '@patternfly/react-core';
import { useNavigate } from 'react-router-dom';
import { ExclamationCircleIcon, InfoCircleIcon } from '@patternfly/react-icons';
import { InfoCircleIcon } from '@patternfly/react-icons';
import { NotebookState } from '~/pages/projects/notebook/types';
import NotebookRouteLink from '~/pages/projects/notebook/NotebookRouteLink';
import NotebookStatusToggle from '~/pages/projects/notebook/NotebookStatusToggle';
Expand All @@ -22,7 +13,7 @@ import { TableRowTitleDescription } from '~/components/table';
import { ProjectObjectType, typedObjectImage } from '~/concepts/design/utils';
import DashboardPopupIconButton from '~/concepts/dashboard/DashboardPopupIconButton';
import { getDescriptionFromK8sResource, getDisplayNameFromK8sResource } from '~/concepts/k8s/utils';
import useNotebookDeploymentSize from './useNotebookDeploymentSize';
import { usePreferredNotebookSize } from '~/pages/notebookController/screens/server/usePreferredNotebookSize';
import useNotebookImage from './useNotebookImage';
import NotebookSizeDetails from './NotebookSizeDetails';
import NotebookStorageBars from './NotebookStorageBars';
Expand Down Expand Up @@ -51,7 +42,7 @@ const NotebookTableRow: React.FC<NotebookTableRowProps> = ({
const { currentProject } = React.useContext(ProjectDetailsContext);
const navigate = useNavigate();
const [isExpanded, setExpanded] = React.useState(false);
const { size: notebookSize, error: sizeError } = useNotebookDeploymentSize(obj.notebook);
const { selectedSize: notebookSize } = usePreferredNotebookSize();
const [notebookImage, loaded, loadError] = useNotebookImage(obj.notebook);

return (
Expand Down Expand Up @@ -124,7 +115,7 @@ const NotebookTableRow: React.FC<NotebookTableRowProps> = ({
}
>
<DashboardPopupIconButton
aria-label="Notebook image has out of date Elrya version"
aria-label="Notebook image has out of date Elyra version"
data-testid="outdated-elyra-info"
icon={
<Icon status="info">
Expand All @@ -143,14 +134,7 @@ const NotebookTableRow: React.FC<NotebookTableRowProps> = ({
spaceItems={{ default: 'spaceItemsXs' }}
alignItems={{ default: 'alignItemsCenter' }}
>
<FlexItem>{notebookSize?.name ?? 'Unknown'}</FlexItem>
{sizeError && (
<Tooltip content={sizeError}>
<Icon aria-label="error icon" role="button" status="danger" tabIndex={0}>
<ExclamationCircleIcon />
</Icon>
</Tooltip>
)}
<FlexItem>{notebookSize.name}</FlexItem>
</Flex>
</Td>
) : null}
Expand Down Expand Up @@ -212,7 +196,7 @@ const NotebookTableRow: React.FC<NotebookTableRowProps> = ({
</Td>
<Td dataLabel="Limits">
<ExpandableRowContent>
{notebookSize && <NotebookSizeDetails notebookSize={notebookSize} />}
<NotebookSizeDetails notebookSize={notebookSize} />
</ExpandableRowContent>
</Td>
<Td />
Expand Down

0 comments on commit dbcd95d

Please sign in to comment.