diff --git a/packages/garden/package.json b/packages/garden/package.json index 4216893aa..452fcb372 100644 --- a/packages/garden/package.json +++ b/packages/garden/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/workspace-garden", - "version": "7.0.0", + "version": "7.0.1", "type": "module", "sideEffects": false, "license": "MIT", diff --git a/packages/garden/src/lib/components/Garden.tsx b/packages/garden/src/lib/components/Garden.tsx index 94e12c6e9..d67ba9ada 100644 --- a/packages/garden/src/lib/components/Garden.tsx +++ b/packages/garden/src/lib/components/Garden.tsx @@ -76,7 +76,7 @@ export function Garden, TContext = un }: GardenProps): JSX.Element | null { const client = useRef(new QueryClient()); const [groupingKeys, setGroupingKeys] = useState(initialGrouping); - + const [isLoading, setIsLoading] = useState(true); const [timeInterval, updateTimeInterval] = useState(initialTimeInterval ?? null); const onChangetimeInterval = (timeInterval: string | null) => { updateTimeInterval(timeInterval); @@ -116,12 +116,8 @@ export function Garden, TContext = un customViews={customViews} visuals={visuals} > - - - - { - // Hides ViewSettings sidebar when sidesheet is open - selected ? null : ( + + {selected || isLoading ? null : ( , TContext = un onChangeTimeInterval={onChangetimeInterval} setGroupingKeys={setGroupingKeys} /> - ) - } + )} + diff --git a/packages/garden/src/lib/components/VirtualContainer/VirtualContainer.tsx b/packages/garden/src/lib/components/VirtualContainer/VirtualContainer.tsx index 2df885df2..0c2f0540a 100644 --- a/packages/garden/src/lib/components/VirtualContainer/VirtualContainer.tsx +++ b/packages/garden/src/lib/components/VirtualContainer/VirtualContainer.tsx @@ -1,24 +1,27 @@ +import { Icon } from '@equinor/eds-core-react'; +import { info_circle } from '@equinor/eds-icons'; +import { useEffect } from 'react'; +import styled from 'styled-components'; import { useItemWidths } from '../../hooks'; import { useGarden } from '../../hooks/useGarden'; import { useGardenConfig } from '../../hooks/useGardenConfig'; import { ExpandProvider } from '../ExpandProvider'; import { GardenDataSource } from '../Garden'; import { VirtualGarden } from '../VirtualGarden'; -import { StyledVirtualContainer } from './virtualContainer.styles'; -import { info_circle } from '@equinor/eds-icons'; -import { Icon } from '@equinor/eds-core-react'; -import styled from 'styled-components'; import { SplashScreen } from '../splashScreen/SplashScreen'; +import { StyledVirtualContainer } from './virtualContainer.styles'; Icon.add({ info_circle }); type VirtualContainerProps = { dataSource: GardenDataSource; context: TContext; + setIsLoading: (isLoading: boolean) => void; }; export const VirtualContainer = ({ dataSource, context, + setIsLoading, }: VirtualContainerProps): JSX.Element | null => { const { onClickItem } = useGardenConfig(); const { gardenMetaQuery } = useGarden(); @@ -27,6 +30,10 @@ export const VirtualContainer = ({ return ; } + useEffect(() => { + if (!gardenMetaQuery.isLoading) setIsLoading(false); + }, [gardenMetaQuery.isLoading]); + if (!gardenMetaQuery.data) { // Will never happen when suspense is true throw new Error(); diff --git a/packages/workspace-fusion/package.json b/packages/workspace-fusion/package.json index 776be0c31..5360306d9 100644 --- a/packages/workspace-fusion/package.json +++ b/packages/workspace-fusion/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/workspace-fusion", - "version": "7.0.3", + "version": "7.0.4", "type": "module", "sideEffects": false, "license": "MIT",