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 3bd704d commit 11f4652
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 { getNotebookDescription, getNotebookDisplayName } from '~/pages/projects/utils';
import NotebookRouteLink from '~/pages/projects/notebook/NotebookRouteLink';
Expand All @@ -22,7 +13,7 @@ import { ProjectDetailsContext } from '~/pages/projects/ProjectDetailsContext';
import { TableRowTitleDescription } from '~/components/table';
import { ProjectObjectType, typedObjectImage } from '~/concepts/design/utils';
import DashboardPopupIconButton from '~/concepts/dashboard/DashboardPopupIconButton';
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 @@ -122,7 +113,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 @@ -141,14 +132,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 @@ -210,7 +194,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 11f4652

Please sign in to comment.