From dbcd95d69031c4f3869a2590346bbf6470a9f664 Mon Sep 17 00:00:00 2001 From: manaswinidas Date: Sat, 22 Jun 2024 01:14:48 +0530 Subject: [PATCH] Fix Unknown container size in workbenches table --- .../detail/notebooks/NotebookTableRow.tsx | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/frontend/src/pages/projects/screens/detail/notebooks/NotebookTableRow.tsx b/frontend/src/pages/projects/screens/detail/notebooks/NotebookTableRow.tsx index 69b60601f3..1bdfc0507e 100644 --- a/frontend/src/pages/projects/screens/detail/notebooks/NotebookTableRow.tsx +++ b/frontend/src/pages/projects/screens/detail/notebooks/NotebookTableRow.tsx @@ -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'; @@ -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'; @@ -51,7 +42,7 @@ const NotebookTableRow: React.FC = ({ 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 ( @@ -124,7 +115,7 @@ const NotebookTableRow: React.FC = ({ } > @@ -143,14 +134,7 @@ const NotebookTableRow: React.FC = ({ spaceItems={{ default: 'spaceItemsXs' }} alignItems={{ default: 'alignItemsCenter' }} > - {notebookSize?.name ?? 'Unknown'} - {sizeError && ( - - - - - - )} + {notebookSize.name} ) : null} @@ -212,7 +196,7 @@ const NotebookTableRow: React.FC = ({ - {notebookSize && } +